From a3a0e4844708024715295f13288b26dd543d8913 Mon Sep 17 00:00:00 2001 From: Nathan Brake Date: Sat, 1 Aug 2026 00:11:04 +0000 Subject: [PATCH 1/9] feat(dashboard): make the activity log browsable, not just watchable Activity answers "is traffic flowing and is anything failing", but it does not answer "find me this request". Three of the cheap, UI-side reasons why, from issue #427: Rows are near-identical because the Tokens column shows one total, which on a cached agent workload is ~98% cache read. The column now draws that total's composition as a thin stacked bar (fresh input, cache read, cache write, output), so a scan compares shapes instead of similar large numbers. The split comes from `billing_meters` when the row has it, because providers disagree on whether cache tokens sit inside `prompt_tokens` and the row does not record which convention it followed; the raw columns are the clamped fallback. Imported agent traffic could not be separated from gateway traffic while browsing, even though `/v1/usage` already takes a `source` filter and the page already had friendly labels for known sources. There is now a Source select, its options drawn from the provenance breakdown of the log itself, with the source filter omitted from that query so switching sources needs no clearing first. Refresh threw away your position. It re-anchored the rolling window, which recomputed "now", which changed the filter set, which reset the page: pressing refresh on page 12 landed you on page 1. Refresh now means "same view, newer rows" and refetches without moving the window; re-picking the active preset is the explicit re-anchor gesture. The same mechanism fired on mount, so a shared or bookmarked `?page=3` URL always opened on page 1; both re-anchor effects now skip their first run, since the state initializers have already snapshotted the window. Left for follow-ups: sessions as the entry point, sortable columns, keyset pagination, searchable `source_event_id`, and error grouping all need server work. Fixes #427 Co-Authored-By: Claude Opus 5 (1M context) --- .../dashboard/assets/ActivityPage-C5gSmqNJ.js | 1 - .../dashboard/assets/ActivityPage-CGtQFYkj.js | 1 + ...ge-D7ZKXX3I.js => AliasesPage-BW4Ki1y6.js} | 2 +- ...ge-DanpEezo.js => BudgetsPage-B98xbp9L.js} | 2 +- ...-ChuHp-Qm.js => ConfirmDialog-P_P4TNFr.js} | 2 +- ...sPage-DkHyFdGF.js => DocsPage-CQXolIdY.js} | 2 +- ...ps-Dqy1SR3R.js => FilterChips-CxOVvh-O.js} | 2 +- ...sPage-D4g9XrFY.js => KeysPage-BBEXGo7q.js} | 2 +- ...Vzk1f.js => ModelScopeControl-Bmks7cWc.js} | 2 +- ...age-r0TNjwml.js => ModelsPage-XwbqKUgz.js} | 2 +- ...e-WmIAewmo.js => OverviewPage-XfWqfHJ2.js} | 2 +- ...-BRQCYCYu.js => ProvidersPage-HN_Zodtk.js} | 2 +- ...e-DjaTcy-f.js => SettingsPage-Csgj1pAU.js} | 2 +- ...CBn4us4.js => TablePagination-BHTN5PVb.js} | 2 +- ..._ke.js => ToolsGuardrailsPage-DPdRTl_b.js} | 2 +- ...Page-CGU7s9AT.js => UsagePage-BAefkQlH.js} | 2 +- ...Page-CUF9BhT-.js => UsersPage-Lrd1SvIH.js} | 2 +- ...{index-w6diat9F.css => index-BqdGY8GQ.css} | 2 +- .../{index-Bi2hajrg.js => index-MlRogoGm.js} | 4 +- src/gateway/static/dashboard/index.html | 4 +- web/src/api/types.ts | 3 + web/src/pages/ActivityPage.test.tsx | 157 +++++++++++++++ web/src/pages/ActivityPage.tsx | 186 ++++++++++++++++-- web/src/styles/globals.css | 4 + 24 files changed, 359 insertions(+), 33 deletions(-) delete mode 100644 src/gateway/static/dashboard/assets/ActivityPage-C5gSmqNJ.js create mode 100644 src/gateway/static/dashboard/assets/ActivityPage-CGtQFYkj.js rename src/gateway/static/dashboard/assets/{AliasesPage-D7ZKXX3I.js => AliasesPage-BW4Ki1y6.js} (98%) rename src/gateway/static/dashboard/assets/{BudgetsPage-DanpEezo.js => BudgetsPage-B98xbp9L.js} (99%) rename src/gateway/static/dashboard/assets/{ConfirmDialog-ChuHp-Qm.js => ConfirmDialog-P_P4TNFr.js} (92%) rename src/gateway/static/dashboard/assets/{DocsPage-DkHyFdGF.js => DocsPage-CQXolIdY.js} (99%) rename src/gateway/static/dashboard/assets/{FilterChips-Dqy1SR3R.js => FilterChips-CxOVvh-O.js} (99%) rename src/gateway/static/dashboard/assets/{KeysPage-D4g9XrFY.js => KeysPage-BBEXGo7q.js} (98%) rename src/gateway/static/dashboard/assets/{ModelScopeControl-DNcVzk1f.js => ModelScopeControl-Bmks7cWc.js} (98%) rename src/gateway/static/dashboard/assets/{ModelsPage-r0TNjwml.js => ModelsPage-XwbqKUgz.js} (99%) rename src/gateway/static/dashboard/assets/{OverviewPage-WmIAewmo.js => OverviewPage-XfWqfHJ2.js} (99%) rename src/gateway/static/dashboard/assets/{ProvidersPage-BRQCYCYu.js => ProvidersPage-HN_Zodtk.js} (99%) rename src/gateway/static/dashboard/assets/{SettingsPage-DjaTcy-f.js => SettingsPage-Csgj1pAU.js} (99%) rename src/gateway/static/dashboard/assets/{TablePagination-8CBn4us4.js => TablePagination-BHTN5PVb.js} (98%) rename src/gateway/static/dashboard/assets/{ToolsGuardrailsPage-B4MIR_ke.js => ToolsGuardrailsPage-DPdRTl_b.js} (99%) rename src/gateway/static/dashboard/assets/{UsagePage-CGU7s9AT.js => UsagePage-BAefkQlH.js} (98%) rename src/gateway/static/dashboard/assets/{UsersPage-CUF9BhT-.js => UsersPage-Lrd1SvIH.js} (98%) rename src/gateway/static/dashboard/assets/{index-w6diat9F.css => index-BqdGY8GQ.css} (93%) rename src/gateway/static/dashboard/assets/{index-Bi2hajrg.js => index-MlRogoGm.js} (96%) diff --git a/src/gateway/static/dashboard/assets/ActivityPage-C5gSmqNJ.js b/src/gateway/static/dashboard/assets/ActivityPage-C5gSmqNJ.js deleted file mode 100644 index 03b61aa53..000000000 --- a/src/gateway/static/dashboard/assets/ActivityPage-C5gSmqNJ.js +++ /dev/null @@ -1 +0,0 @@ -import{j as s}from"./tanstack-query-1t81HyiD.js";import{u as Ve,r as i}from"./react-dgEcD0HR.js";import{u as Ze,a as Je,b as Qe,c as fe,d as _e,f as w,e as Xe,A as L,g as et,h as tt,P as st,E as at,C as ye,i as j,R as rt,F as ve,j as H,k as je,Y as lt}from"./index-Bi2hajrg.js";import{A as nt,F as ot}from"./FilterChips-Dqy1SR3R.js";import{u as it,r as ct,B as dt}from"./tableSelection-9hV37uhu.js";import{C as ut}from"./ConfirmDialog-ChuHp-Qm.js";import{D as mt}from"./DataTable-Bmn_eYSV.js";import{T as pt,S as gt,P as ht}from"./TablePagination-8CBn4us4.js";import{B as V}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function xt(t){const[l,n]=Ve(),a=i.useCallback(g=>l.get(g)??t[g],[l,t]),o=i.useCallback(g=>{const u=Number.parseInt(l.get(g)??"",10);if(!Number.isNaN(u))return u;const c=Number.parseInt(t[g],10);return Number.isNaN(c)?0:c},[l,t]),k=i.useCallback(g=>{n(u=>{const c=new URLSearchParams(u);for(const[p,x]of Object.entries(g)){const f=String(x);f===""||f===t[p]?c.delete(p):c.set(p,f)}return c},{replace:!0})},[n,t]);return{get:a,getNumber:o,patch:k}}const bt=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function O(t){return t===null?"—":bt.format(t)}function v(t){return t===null?"—":t.toLocaleString()}function we(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function ft(t){const l=new Date(t);return Number.isNaN(l.getTime())?t:l.toLocaleString()}function _t(t){const l=new Date(t).getTime();if(Number.isNaN(l))return t;const n=Math.max(0,Math.round((Date.now()-l)/1e3));if(n<60)return`${n}s ago`;const a=Math.round(n/60);if(a<60)return`${a}m ago`;const o=Math.round(a/60);return o<24?`${o}h ago`:`${Math.round(o/24)}d ago`}const vt=t=>t.id,kt=t=>t.status==="error"?"bg-red-50":void 0,ke=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],Se=[{label:"All",value:""},{label:"Priced",value:"true"},{label:"Unpriced",value:"false"}],St=50,yt={range:L,start_date:"",end_date:"",status:"",model:"",user_id:"",api_key_id:"",priced:"",source:"",page:"0",size:String(St)};function U(t,l,n){if(l||n)return{start:l||void 0,end:n||void 0};if(t===ye)return{};const a=w(j,t)??w(j,L),o=(a==null?void 0:a.seconds)??null;return{start:o==null?void 0:je(o),end:void 0}}function Z(t){const l=U(t,"","");if(l.start)return l;const n=w(j,t);return(n==null?void 0:n.seconds)==null?{start:je(lt)}:l}function jt({status:t}){const l=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return s.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${l}`,children:t})}const wt={gateway:"Gateway",claude_code:"Claude Code",codex:"Codex"};function Ce(t){return wt[t]??t}function d({label:t,children:l}){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),s.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:l})]})}function Ct({entry:t}){var l;return s.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"}),s.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"This request failed. Inspect gateway logs for details."})]}):null,s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(d,{label:"Provider",children:t.provider??"—"}),s.jsx(d,{label:"Endpoint",children:t.endpoint}),s.jsx(d,{label:"Source",children:Ce(t.source)}),t.source_label?s.jsx(d,{label:"Session",children:t.source_label}):null,s.jsx(d,{label:"User",children:t.user_id??"—"}),s.jsx(d,{label:"API key",children:t.api_key_id??"—"}),s.jsx(d,{label:"Prompt tokens",children:v(t.prompt_tokens)}),s.jsx(d,{label:"Completion tokens",children:v(t.completion_tokens)}),s.jsx(d,{label:"Total tokens",children:v(t.total_tokens)}),s.jsx(d,{label:"Cost",children:O(t.cost)}),s.jsx(d,{label:"Cache read tokens",children:v(t.cache_read_tokens)}),s.jsx(d,{label:"Cache write tokens",children:v(t.cache_write_tokens)}),s.jsx(d,{label:"1h cache writes",children:v(t.cache_write_1h_tokens??null)}),s.jsx(d,{label:"Total time",children:we(t.latency_ms)}),s.jsx(d,{label:"Request ID",children:t.id})]}),(l=t.pricing_breakdown)!=null&&l.length?s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(n=>s.jsxs(d,{label:n.meter.replaceAll("_"," "),children:[v(n.units)," at ",O(n.rate_per_million)," / 1M, ",O(n.cost)]},n.meter))})]}):null]})}function Rt(){var me,pe,ge,he,xe;const t=Ze(),l=Je(),n=i.useMemo(()=>{const e=new Map;for(const r of l.data??[])e.set(r.id,r.key_name??`${r.id.slice(0,8)}…`);return e},[l.data]),a=xt(yt),o=a.get("range"),k=a.get("start_date"),g=a.get("end_date"),u=a.get("status"),c=a.get("model"),p=a.get("user_id"),x=a.get("api_key_id"),f=a.get("priced"),_=a.get("source"),J=Math.max(0,a.getNumber("page")),Q=a.getNumber("size"),R=ht.reduce((e,r)=>Math.abs(r-Q)U(o,k,g));i.useEffect(()=>{X(U(o,k,g))},[o,k,g]);const[E,ee]=i.useState(()=>Z(o));i.useEffect(()=>{ee(Z(o))},[o]);const F=f==="true"?!0:f==="false"?!1:void 0,b=i.useMemo(()=>({start_date:m.start,end_date:m.end,status:u||void 0,model:c.trim()||void 0,user_id:p||void 0,api_key_id:x||void 0,source:_||void 0,priced:F}),[m,u,c,p,x,_,F]),h=it(),M=JSON.stringify(b),te=i.useRef(M);i.useEffect(()=>{te.current!==M&&(te.current=M,a.patch({page:0}),h.clear())},[M,a,h]);const S=Qe(b,J,R),C=fe(b),Pe=i.useMemo(()=>({start_date:m.start,end_date:m.end,status:u||void 0,user_id:p||void 0,api_key_id:x||void 0,source:_||void 0}),[m,u,p,x,_]),se=_e(Pe,"day"),K=((pe=(me=se.data)==null?void 0:me.by_model)==null?void 0:pe.filter(e=>!e.is_other&&e.key!==null).map(e=>e.key))??[],ae=(l.data??[]).map(e=>({value:e.id,label:e.key_name??`${e.id.slice(0,8)}…`})),P=w(j,o)??w(j,L),N=!!(m.start&&E.start&&new Date(m.start).getTime()({start_date:N?m.start:E.start,end_date:N?m.end:void 0,status:u||void 0,model:c.trim()||void 0,user_id:p||void 0,api_key_id:x||void 0,source:_||void 0,priced:F}),[N,m,E,u,c,p,x,_,F]),B=_e(Ae,re),Ee=(((ge=B.data)==null?void 0:ge.series)??[]).map(e=>({bucketStart:e.bucket_start,requests:e.requests})),y=S.data??[],Fe=C.isSuccess&&!C.isPlaceholderData?((he=C.data)==null?void 0:he.total)??0:null,$=w(j,o),Me=!!(k||g)||o!==L&&($==null?void 0:$.seconds)!=null,Te=!!(u||c.trim()||p||x||f||_||Me),T=(e,r)=>{var be;return((be=e.find(He=>He.value===r))==null?void 0:be.label)??r},le=(t.data??[]).map(e=>({value:e.user_id,label:e.alias?`${e.alias} (${e.user_id})`:e.user_id})),De=()=>a.patch({status:"",priced:"",model:"",user_id:"",api_key_id:"",source:""}),Ie=[...u?[{key:"status",label:"Status",value:T(ke,u),onClear:()=>a.patch({status:""})}]:[],...f?[{key:"priced",label:"Priced",value:T(Se,f),onClear:()=>a.patch({priced:""})}]:[],...p?[{key:"user",label:"User",value:T(le,p),onClear:()=>a.patch({user_id:""})}]:[],...c.trim()?[{key:"model",label:"Model",value:c.trim(),onClear:()=>a.patch({model:""})}]:[],...x?[{key:"key",label:"API key",value:T(ae,x),onClear:()=>a.patch({api_key_id:""})}]:[],..._?[{key:"source",label:"Source",value:Ce(_),onClear:()=>a.patch({source:""})}]:[]],q=i.useMemo(()=>y.filter(e=>!e.counts_toward_budget).map(e=>e.id),[y]),Oe=i.useMemo(()=>y.filter(e=>e.counts_toward_budget).map(e=>e.id),[y]),ne=ct(h.selectedKeys,q),A=ne.length,oe=h.allMatching||A>0,Ue=i.useMemo(()=>({...b,counts_toward_budget:!1}),[b]),ie=fe(Ue,oe),D=ie.isSuccess?((xe=ie.data)==null?void 0:xe.total)??null:null,Le=q.length>0&&A===q.length&&D!=null&&D>A,I=h.allMatching?D??A:A,z=et(),W=tt(),[Re,Y]=i.useState(!1),[Ke,G]=i.useState(!1),[Be,ce]=i.useState(null),$e=i.useCallback(e=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[s.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Request detail"}),s.jsx(V,{size:"sm",variant:"ghost",onPress:()=>ce(null),children:"Close"})]}),s.jsx(Ct,{entry:e})]}),[]),de=()=>h.allMatching?{by_filter:!0,model:b.model,user_id:b.user_id,api_key_id:b.api_key_id,status:b.status,start_date:b.start_date,end_date:b.end_date,priced:b.priced}:{ids:ne},qe=()=>{z.mutate(de(),{onSuccess:()=>{Y(!1),h.clear()}})},ze=e=>{W.mutate({...de(),...e},{onSuccess:()=>{G(!1),h.clear()}})},We=()=>{X(U(o,k,g)),ee(Z(o)),S.refetch(),C.refetch(),B.refetch(),se.refetch()},ue=e=>a.patch({range:e.key,start_date:"",end_date:""}),Ye=(e,r)=>a.patch({start_date:e,end_date:r}),Ge=i.useMemo(()=>{const e=r=>r===null?"—":n.get(r)??`${r.slice(0,8)}…`;return[{id:"time",header:"Time",cell:r=>s.jsx("span",{title:ft(r.timestamp),className:"text-[var(--otari-muted)]",children:_t(r.timestamp)})},{id:"user",header:"User",cell:r=>r.user_id??"—"},{id:"model",header:"Model",isRowHeader:!0,cell:r=>r.model},{id:"api_key",header:"API key",cell:r=>s.jsx("span",{className:"text-[var(--otari-muted)]",children:e(r.api_key_id)})},{id:"tokens",header:"Tokens",align:"end",cell:r=>v(r.total_tokens)},{id:"cost",header:"Cost",align:"end",cell:r=>O(r.cost)},{id:"latency",header:"Total time",align:"end",cell:r=>we(r.latency_ms)},{id:"status",header:"Status",cell:r=>s.jsx(jt,{status:r.status})}]},[n]);return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(st,{title:"Activity",description:"A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored."}),s.jsx(at,{error:S.error??C.error}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(nt,{presets:j,extentKey:Ne,onPreset:ue,onSelectRange:Ye,onSelectFull:()=>P?ue(P):void 0,series:Ee,bucket:re,windowStart:m.start,windowEnd:m.end,loading:B.isLoading,ariaLabel:"Activity request volume over the selected window",action:s.jsx(rt,{onRefresh:We,isFetching:S.isFetching,updatedAt:S.dataUpdatedAt})}),s.jsxs(ot,{chips:Ie,onClearAll:De,children:[s.jsx(ve,{id:"filter-status",label:"Status",value:u,onChange:e=>a.patch({status:e}),children:ke.map(e=>s.jsx("option",{value:e.value,children:e.label},e.value))}),s.jsx(ve,{id:"filter-priced",label:"Priced?",value:f,onChange:e=>a.patch({priced:e}),children:Se.map(e=>s.jsx("option",{value:e.value,children:e.label},e.value))}),s.jsx(H,{label:"API key",value:x,onChange:e=>a.patch({api_key_id:e}),placeholder:"All keys",options:ae}),s.jsx(H,{label:"User",value:p,onChange:e=>a.patch({user_id:e}),placeholder:"All users",options:le}),s.jsx(H,{label:"Model",value:c,onChange:e=>a.patch({model:e}),allowsCustom:!0,placeholder:"Any model",options:(c&&!K.includes(c)?[c,...K]:K).map(e=>({value:e,label:e}))})]})]}),oe?s.jsxs(dt,{selectedCount:I,allMatching:h.allMatching,matchingTotal:D,canSelectAllMatching:Le,onSelectAllMatching:h.enableAllMatching,onClear:h.clear,children:[s.jsx(V,{size:"sm",variant:"primary",onPress:()=>G(!0),children:"Set price"}),s.jsx(V,{size:"sm",variant:"danger",onPress:()=>Y(!0),children:"Delete"})]}):null,s.jsx(mt,{ariaLabel:"Activity log",columns:Ge,rows:y,getRowKey:vt,isLoading:S.isLoading,emptyContent:Te?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:h.selectedKeys,onSelectionChange:h.onSelectionChange,disabledKeys:Oe,onRowAction:e=>ce(r=>r===e?null:e),rowClassName:kt,detailKey:Be,renderDetail:$e}),s.jsx(pt,{page:J,pageSize:R,total:Fe,rowsOnPage:y.length,onPageChange:e=>a.patch({page:e}),onPageSizeChange:e=>a.patch({size:e,page:0}),isFetching:S.isFetching,hasNextFallback:y.length===R}),s.jsx(ut,{isOpen:Re,onOpenChange:Y,heading:"Delete usage rows",body:`Delete ${I.toLocaleString()} imported ${I===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:z.isPending,error:z.error,onConfirm:qe}),s.jsx(gt,{isOpen:Ke,onOpenChange:G,targetCount:I,isPending:W.isPending,error:W.error,onSubmit:ze})]})}export{Rt as ActivityPage}; diff --git a/src/gateway/static/dashboard/assets/ActivityPage-CGtQFYkj.js b/src/gateway/static/dashboard/assets/ActivityPage-CGtQFYkj.js new file mode 100644 index 000000000..2717ad6a9 --- /dev/null +++ b/src/gateway/static/dashboard/assets/ActivityPage-CGtQFYkj.js @@ -0,0 +1 @@ +import{j as s}from"./tanstack-query-1t81HyiD.js";import{u as st,r as c}from"./react-dgEcD0HR.js";import{u as at,a as rt,b as nt,c as Ce,d as Q,f as N,e as lt,A as K,g as ot,h as it,P as ct,E as dt,C as Ae,i as C,R as ut,F as X,j as ee,k as Ee,Y as mt}from"./index-MlRogoGm.js";import{A as pt,F as ht}from"./FilterChips-CxOVvh-O.js";import{u as gt,r as ft,B as xt}from"./tableSelection-9hV37uhu.js";import{C as _t}from"./ConfirmDialog-P_P4TNFr.js";import{D as bt}from"./DataTable-Bmn_eYSV.js";import{T as vt,S as kt,P as yt}from"./TablePagination-BHTN5PVb.js";import{B as te}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function St(t){const[r,i]=st(),a=c.useCallback(l=>r.get(l)??t[l],[r,t]),o=c.useCallback(l=>{const d=Number.parseInt(r.get(l)??"",10);if(!Number.isNaN(d))return d;const u=Number.parseInt(t[l],10);return Number.isNaN(u)?0:u},[r,t]),x=c.useCallback(l=>{i(d=>{const u=new URLSearchParams(d);for(const[p,g]of Object.entries(l)){const v=String(g);v===""||v===t[p]?u.delete(p):u.set(p,v)}return u},{replace:!0})},[i,t]);return{get:a,getNumber:o,patch:x}}const jt=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return t===null?"—":jt.format(t)}function y(t){return t===null?"—":t.toLocaleString()}function Fe(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function wt(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleString()}function Ct(t){const r=new Date(t).getTime();if(Number.isNaN(r))return t;const i=Math.max(0,Math.round((Date.now()-r)/1e3));if(i<60)return`${i}s ago`;const a=Math.round(i/60);if(a<60)return`${a}m ago`;const o=Math.round(a/60);return o<24?`${o}h ago`:`${Math.round(o/24)}d ago`}const Nt=t=>t.id,Pt=t=>t.status==="error"?"bg-red-50":void 0,Ne=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],Pe=[{label:"All",value:""},{label:"Priced",value:"true"},{label:"Unpriced",value:"false"}],At=50,Et={range:K,start_date:"",end_date:"",status:"",model:"",user_id:"",api_key_id:"",priced:"",source:"",page:"0",size:String(At)};function $(t,r,i){if(r||i)return{start:r||void 0,end:i||void 0};if(t===Ae)return{};const a=N(C,t)??N(C,K),o=(a==null?void 0:a.seconds)??null;return{start:o==null?void 0:Ee(o),end:void 0}}function se(t){const r=$(t,"","");if(r.start)return r;const i=N(C,t);return(i==null?void 0:i.seconds)==null?{start:Ee(mt)}:r}function Ft({status:t}){const r=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return s.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r}`,children:t})}const Mt={gateway:"Gateway",claude_code:"Claude Code",codex:"Codex"};function ae(t){return Mt[t]??t}function k(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function Tt(t){const r=t.billing_meters??null,i=k(r?r.total_input_tokens:t.prompt_tokens),a=k(r?r.cache_read_tokens:t.cache_read_tokens),o=k(r?r.cache_write_tokens:t.cache_write_tokens),x=k(r?r.completion_tokens:t.completion_tokens),l=Math.max(0,i-a-o),d=l+a+o+x;return d>0?{fresh:l,cacheRead:a,cacheWrite:o,output:x,total:d}:null}const Dt=[{key:"fresh",label:"Fresh input",fill:"var(--otari-brand)"},{key:"cacheRead",label:"Cache read",fill:"var(--otari-line)"},{key:"cacheWrite",label:"Cache write",fill:"var(--otari-brand-soft)"},{key:"output",label:"Output",fill:"var(--otari-brand-dark)"}];function Ot({entry:t}){const r=Tt(t);if(r===null)return s.jsx("span",{className:"tabular-nums",children:y(t.total_tokens)});const i=Dt.map(l=>({...l,value:r[l.key]})),a=i.filter(l=>l.value>0).map(l=>`${l.label} ${l.value.toLocaleString()}`).join(", ");let o=0;const x=i.map(l=>{const d=l.value/r.total*100,u={...l,x:o,width:d};return o+=d,u});return s.jsxs("span",{className:"inline-flex flex-col items-end gap-1",title:a,children:[s.jsx("span",{className:"tabular-nums",children:r.total.toLocaleString()}),s.jsx("svg",{viewBox:"0 0 100 4",preserveAspectRatio:"none",role:"img","aria-label":`Token composition: ${a}`,className:"h-1 w-16 overflow-hidden rounded-full bg-[var(--otari-bg)]",children:x.filter(l=>l.width>0).map(l=>s.jsx("rect",{x:l.x,y:0,width:l.width,height:4,fill:l.fill},l.key))})]})}function h({label:t,children:r}){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),s.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:r})]})}function It({entry:t}){var r;return s.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"}),s.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"This request failed. Inspect gateway logs for details."})]}):null,s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(h,{label:"Provider",children:t.provider??"—"}),s.jsx(h,{label:"Endpoint",children:t.endpoint}),s.jsx(h,{label:"Source",children:ae(t.source)}),t.source_label?s.jsx(h,{label:"Session",children:t.source_label}):null,s.jsx(h,{label:"User",children:t.user_id??"—"}),s.jsx(h,{label:"API key",children:t.api_key_id??"—"}),s.jsx(h,{label:"Prompt tokens",children:y(t.prompt_tokens)}),s.jsx(h,{label:"Completion tokens",children:y(t.completion_tokens)}),s.jsx(h,{label:"Total tokens",children:y(t.total_tokens)}),s.jsx(h,{label:"Cost",children:U(t.cost)}),s.jsx(h,{label:"Cache read tokens",children:y(t.cache_read_tokens)}),s.jsx(h,{label:"Cache write tokens",children:y(t.cache_write_tokens)}),s.jsx(h,{label:"1h cache writes",children:y(t.cache_write_1h_tokens??null)}),s.jsx(h,{label:"Total time",children:Fe(t.latency_ms)}),s.jsx(h,{label:"Request ID",children:t.id})]}),(r=t.pricing_breakdown)!=null&&r.length?s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(i=>s.jsxs(h,{label:i.meter.replaceAll("_"," "),children:[y(i.units)," at ",U(i.rate_per_million)," / 1M, ",U(i.cost)]},i.meter))})]}):null]})}function Vt(){var ke,ye,Se,je,we;const t=at(),r=rt(),i=c.useMemo(()=>{const e=new Map;for(const n of r.data??[])e.set(n.id,n.key_name??`${n.id.slice(0,8)}…`);return e},[r.data]),a=St(Et),o=a.get("range"),x=a.get("start_date"),l=a.get("end_date"),d=a.get("status"),u=a.get("model"),p=a.get("user_id"),g=a.get("api_key_id"),v=a.get("priced"),f=a.get("source"),re=Math.max(0,a.getNumber("page")),ne=a.getNumber("size"),B=yt.reduce((e,n)=>Math.abs(n-ne)$(o,x,l)),oe=c.useRef(M);c.useEffect(()=>{oe.current!==M&&(oe.current=M,le($(o,x,l)))},[M,o,x,l]);const[T,ie]=c.useState(()=>se(o)),ce=c.useRef(o);c.useEffect(()=>{ce.current!==o&&(ce.current=o,ie(se(o)))},[o]);const D=v==="true"?!0:v==="false"?!1:void 0,b=c.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,model:u.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0,source:f||void 0,priced:D}),[m,d,u,p,g,f,D]),_=gt(),O=JSON.stringify(b),de=c.useRef(O);c.useEffect(()=>{de.current!==O&&(de.current=O,a.patch({page:0}),_.clear())},[O,a,_]);const S=nt(b,re,B),P=Ce(b),Me=c.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,user_id:p||void 0,api_key_id:g||void 0,source:f||void 0}),[m,d,p,g,f]),ue=Q(Me,"day"),q=((ye=(ke=ue.data)==null?void 0:ke.by_model)==null?void 0:ye.filter(e=>!e.is_other&&e.key!==null).map(e=>e.key))??[],me=(r.data??[]).map(e=>({value:e.id,label:e.key_name??`${e.id.slice(0,8)}…`})),Te=c.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,model:u.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0}),[m,d,u,p,g]),z=Q(Te,"day"),De=c.useMemo(()=>{var n;const e=(((n=z.data)==null?void 0:n.by_source)??[]).filter(w=>!w.is_other&&w.key!==null).map(w=>w.key);return f&&!e.includes(f)?[f,...e]:e},[z.data,f]),A=N(C,o)??N(C,K),E=!!(m.start&&T.start&&new Date(m.start).getTime()({start_date:E?m.start:T.start,end_date:E?m.end:void 0,status:d||void 0,model:u.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0,source:f||void 0,priced:D}),[E,m,T,d,u,p,g,f,D]),W=Q(Ie,pe),Re=(((Se=W.data)==null?void 0:Se.series)??[]).map(e=>({bucketStart:e.bucket_start,requests:e.requests})),j=S.data??[],Le=P.isSuccess&&!P.isPlaceholderData?((je=P.data)==null?void 0:je.total)??0:null,Y=N(C,o),Ue=!!(x||l)||o!==K&&(Y==null?void 0:Y.seconds)!=null,$e=!!(d||u.trim()||p||g||v||f||Ue),I=(e,n)=>{var w;return((w=e.find(tt=>tt.value===n))==null?void 0:w.label)??n},he=(t.data??[]).map(e=>({value:e.user_id,label:e.alias?`${e.alias} (${e.user_id})`:e.user_id})),Ke=()=>a.patch({status:"",priced:"",model:"",user_id:"",api_key_id:"",source:""}),Be=[...d?[{key:"status",label:"Status",value:I(Ne,d),onClear:()=>a.patch({status:""})}]:[],...v?[{key:"priced",label:"Priced",value:I(Pe,v),onClear:()=>a.patch({priced:""})}]:[],...p?[{key:"user",label:"User",value:I(he,p),onClear:()=>a.patch({user_id:""})}]:[],...u.trim()?[{key:"model",label:"Model",value:u.trim(),onClear:()=>a.patch({model:""})}]:[],...g?[{key:"key",label:"API key",value:I(me,g),onClear:()=>a.patch({api_key_id:""})}]:[],...f?[{key:"source",label:"Source",value:ae(f),onClear:()=>a.patch({source:""})}]:[]],G=c.useMemo(()=>j.filter(e=>!e.counts_toward_budget).map(e=>e.id),[j]),qe=c.useMemo(()=>j.filter(e=>e.counts_toward_budget).map(e=>e.id),[j]),ge=ft(_.selectedKeys,G),F=ge.length,fe=_.allMatching||F>0,ze=c.useMemo(()=>({...b,counts_toward_budget:!1}),[b]),xe=Ce(ze,fe),R=xe.isSuccess?((we=xe.data)==null?void 0:we.total)??null:null,We=G.length>0&&F===G.length&&R!=null&&R>F,L=_.allMatching?R??F:F,H=ot(),V=it(),[Ye,Z]=c.useState(!1),[Ge,J]=c.useState(!1),[He,_e]=c.useState(null),Ve=c.useCallback(e=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[s.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Request detail"}),s.jsx(te,{size:"sm",variant:"ghost",onPress:()=>_e(null),children:"Close"})]}),s.jsx(It,{entry:e})]}),[]),be=()=>_.allMatching?{by_filter:!0,model:b.model,user_id:b.user_id,api_key_id:b.api_key_id,status:b.status,start_date:b.start_date,end_date:b.end_date,priced:b.priced}:{ids:ge},Ze=()=>{H.mutate(be(),{onSuccess:()=>{Z(!1),_.clear()}})},Je=e=>{V.mutate({...be(),...e},{onSuccess:()=>{J(!1),_.clear()}})},Qe=()=>{S.refetch(),P.refetch(),W.refetch(),ue.refetch(),z.refetch()},ve=e=>{if(e.key===o&&!x&&!l){le($(e.key,"","")),ie(se(e.key));return}a.patch({range:e.key,start_date:"",end_date:""})},Xe=(e,n)=>a.patch({start_date:e,end_date:n}),et=c.useMemo(()=>{const e=n=>n===null?"—":i.get(n)??`${n.slice(0,8)}…`;return[{id:"time",header:"Time",cell:n=>s.jsx("span",{title:wt(n.timestamp),className:"text-[var(--otari-muted)]",children:Ct(n.timestamp)})},{id:"user",header:"User",cell:n=>n.user_id??"—"},{id:"model",header:"Model",isRowHeader:!0,cell:n=>n.model},{id:"api_key",header:"API key",cell:n=>s.jsx("span",{className:"text-[var(--otari-muted)]",children:e(n.api_key_id)})},{id:"tokens",header:"Tokens",align:"end",cell:n=>s.jsx(Ot,{entry:n})},{id:"cost",header:"Cost",align:"end",cell:n=>U(n.cost)},{id:"latency",header:"Total time",align:"end",cell:n=>Fe(n.latency_ms)},{id:"status",header:"Status",cell:n=>s.jsx(Ft,{status:n.status})}]},[i]);return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(ct,{title:"Activity",description:"A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored."}),s.jsx(dt,{error:S.error??P.error}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(pt,{presets:C,extentKey:Oe,onPreset:ve,onSelectRange:Xe,onSelectFull:()=>A?ve(A):void 0,series:Re,bucket:pe,windowStart:m.start,windowEnd:m.end,loading:W.isLoading,ariaLabel:"Activity request volume over the selected window",action:s.jsx(ut,{onRefresh:Qe,isFetching:S.isFetching,updatedAt:S.dataUpdatedAt})}),s.jsxs(ht,{chips:Be,onClearAll:Ke,children:[s.jsx(X,{id:"filter-status",label:"Status",value:d,onChange:e=>a.patch({status:e}),children:Ne.map(e=>s.jsx("option",{value:e.value,children:e.label},e.value))}),s.jsx(X,{id:"filter-priced",label:"Priced?",value:v,onChange:e=>a.patch({priced:e}),children:Pe.map(e=>s.jsx("option",{value:e.value,children:e.label},e.value))}),s.jsxs(X,{id:"filter-source",label:"Source",value:f,onChange:e=>a.patch({source:e}),children:[s.jsx("option",{value:"",children:"All"}),De.map(e=>s.jsx("option",{value:e,children:ae(e)},e))]}),s.jsx(ee,{label:"API key",value:g,onChange:e=>a.patch({api_key_id:e}),placeholder:"All keys",options:me}),s.jsx(ee,{label:"User",value:p,onChange:e=>a.patch({user_id:e}),placeholder:"All users",options:he}),s.jsx(ee,{label:"Model",value:u,onChange:e=>a.patch({model:e}),allowsCustom:!0,placeholder:"Any model",options:(u&&!q.includes(u)?[u,...q]:q).map(e=>({value:e,label:e}))})]})]}),fe?s.jsxs(xt,{selectedCount:L,allMatching:_.allMatching,matchingTotal:R,canSelectAllMatching:We,onSelectAllMatching:_.enableAllMatching,onClear:_.clear,children:[s.jsx(te,{size:"sm",variant:"primary",onPress:()=>J(!0),children:"Set price"}),s.jsx(te,{size:"sm",variant:"danger",onPress:()=>Z(!0),children:"Delete"})]}):null,s.jsx(bt,{ariaLabel:"Activity log",columns:et,rows:j,getRowKey:Nt,isLoading:S.isLoading,emptyContent:$e?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:_.selectedKeys,onSelectionChange:_.onSelectionChange,disabledKeys:qe,onRowAction:e=>_e(n=>n===e?null:e),rowClassName:Pt,detailKey:He,renderDetail:Ve}),s.jsx(vt,{page:re,pageSize:B,total:Le,rowsOnPage:j.length,onPageChange:e=>a.patch({page:e}),onPageSizeChange:e=>a.patch({size:e,page:0}),isFetching:S.isFetching,hasNextFallback:j.length===B}),s.jsx(_t,{isOpen:Ye,onOpenChange:Z,heading:"Delete usage rows",body:`Delete ${L.toLocaleString()} imported ${L===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:H.isPending,error:H.error,onConfirm:Ze}),s.jsx(kt,{isOpen:Ge,onOpenChange:J,targetCount:L,isPending:V.isPending,error:V.error,onSubmit:Je})]})}export{Vt as ActivityPage}; diff --git a/src/gateway/static/dashboard/assets/AliasesPage-D7ZKXX3I.js b/src/gateway/static/dashboard/assets/AliasesPage-BW4Ki1y6.js similarity index 98% rename from src/gateway/static/dashboard/assets/AliasesPage-D7ZKXX3I.js rename to src/gateway/static/dashboard/assets/AliasesPage-BW4Ki1y6.js index 860365f50..ac62569fc 100644 --- a/src/gateway/static/dashboard/assets/AliasesPage-D7ZKXX3I.js +++ b/src/gateway/static/dashboard/assets/AliasesPage-BW4Ki1y6.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as L}from"./react-dgEcD0HR.js";import{l as T,m as I,n as M,o as R,P as K,E as w,p as P,u as F}from"./index-Bi2hajrg.js";import{u as O,r as $,B as U}from"./tableSelection-9hV37uhu.js";import{C as q}from"./ConfirmDialog-ChuHp-Qm.js";import{D as H}from"./DataTable-Bmn_eYSV.js";import{F as V}from"./Field-Dwp6u3t8.js";import{C as k,L as z,I as G,a as J,b as W,f as X,B as j,d as A}from"./heroui-BI50yK5B.js";import{U as Q}from"./UserComboBox-a9wxf8eF.js";const Y=50;function B({label:t,value:a,onChange:n,description:r,placeholder:c="provider:model",autoFocus:l,isRequired:d}){const o=T(),{visible:m,total:h,failed:x}=u.useMemo(()=>{var N;const i=a.trim().toLowerCase(),v=((N=o.data)==null?void 0:N.providers)??[],C=v.flatMap(f=>f.models),p=i?C.filter(f=>f.key.toLowerCase().includes(i)):C;return{visible:p.slice(0,Y),total:p.length,failed:v.filter(f=>!f.ok)}},[o.data,a]),g=o.isLoading?"Loading models from your providers…":x.length>0?`Could not list models for ${x.map(v=>v.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:h>m.length?`Showing ${m.length} of ${h} matches. Keep typing to narrow them.`:r;return e.jsxs(k.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:a,onInputChange:n,onSelectionChange:i=>{i!=null&&n(String(i))},isRequired:d,className:"flex max-w-md flex-col gap-1",children:[e.jsx(z,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(k.InputGroup,{children:[e.jsx(G,{placeholder:c,autoFocus:l}),e.jsx(k.Trigger,{})]}),e.jsx(k.Popover,{children:e.jsx(J,{items:m,className:"max-h-72 overflow-auto",children:i=>e.jsx(W,{id:i.key,textValue:i.key,children:i.key})})}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:g}):null]})}const S=t=>JSON.stringify([t.user_id,t.name]);function Z({userId:t,onChange:a}){const n=F(),r=t!==null,c=(l,d)=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>a(l?"":null),className:r===l?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:d});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Applies to"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"A global alias resolves for every caller. A user-scoped one resolves only for that user, and takes precedence over a global alias of the same name."})]}),e.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[c(!1,"Every caller"),c(!0,"One user")]}),r?e.jsx(Q,{label:"User",value:t??"",onChange:a,users:n.data??[],placeholder:"Pick a user…",description:"Only this user resolves the alias.",unknownHint:e.jsx("span",{className:"text-red-700",children:"No such user. Pick an existing one."})}):null]})}function ee({alias:t,onClose:a}){const n=P(),[r,c]=u.useState(t.target),l=r.trim()!==""&&r.trim()!==t.target,d=()=>{l&&n.mutate({name:t.name,target:r.trim(),user_id:t.user_id},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name}),t.user_id?e.jsxs(e.Fragment,{children:[" for user ",e.jsx("code",{children:t.user_id})]}):null]}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["The alias name and who it applies to (",t.user_id?e.jsx("code",{children:t.user_id}):"every caller",") are the key and cannot be changed here. Delete and recreate to change either."]})]}),e.jsx(B,{label:"Target",value:r,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!l||n.isPending,onPress:d,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function se({onClose:t,initialTarget:a=""}){const n=P(),[r,c]=u.useState(""),[l,d]=u.useState(a),[o,m]=u.useState(null),h=/[:/]/.test(r),x=o===null||o.trim()!=="",g=r.trim()!==""&&l.trim()!==""&&!h&&x,i=()=>{g&&n.mutate({name:r.trim(),target:l.trim(),user_id:o===null?null:o.trim()},{onSuccess:t})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(V,{label:"Alias name",value:r,onChange:c,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:h?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(B,{label:"Target",value:l,onChange:d,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsx(Z,{userId:o,onChange:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!g||n.isPending,onPress:i,children:n.isPending?"Creating…":"Create alias"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function me(){const t=I(),a=M(),[n]=L(),r=n.get("target")??"",[c,l]=u.useState(r!==""),[d,o]=u.useState(null),m=O(),[h,x]=u.useState(!1),[g,i]=u.useState(void 0),[v,C]=u.useState(!1),p=[...t.data??[]].sort((s,b)=>s.name.localeCompare(b.name)||(s.user_id??"").localeCompare(b.user_id??"")),N=p.filter(s=>s.source==="stored").map(S),f=p.filter(s=>s.source!=="stored").map(S),y=$(m.selectedKeys,N),D=new Map(p.map(s=>[S(s),s])),_=async()=>{C(!0),i(void 0);try{for(const s of y){const b=D.get(s);b!==void 0&&await a.mutateAsync({name:b.name,userId:b.user_id})}m.clear(),x(!1)}catch(s){i(s)}finally{C(!1)}},E=u.useMemo(()=>[{id:"alias",header:"Alias",isRowHeader:!0,cell:s=>e.jsx("span",{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name})},{id:"target",header:"Target",cell:s=>e.jsx("span",{className:"break-all text-[var(--otari-muted)]",children:s.target})},{id:"scope",header:"Applies to",cell:s=>s.user_id?e.jsx("code",{className:"break-all text-xs text-[var(--otari-ink)]",children:s.user_id}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Every caller"})},{id:"source",header:"Source",cell:s=>e.jsx(X,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})},{id:"actions",header:"Actions",align:"end",cell:s=>s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{l(!1),o(s)},children:"Edit"}),e.jsx(R,{confirmLabel:"Delete",isPending:a.isPending,onConfirm:()=>a.mutate({name:s.name,userId:s.user_id}),children:"Delete"})]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})}],[a.isPending,a.mutate]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(K,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:c||d?null:e.jsx(j,{variant:"primary",onPress:()=>{o(null),l(!0)},children:"New alias"})}),e.jsx(w,{error:t.error}),c?e.jsx(se,{initialTarget:r,onClose:()=>l(!1)}):null,d?e.jsx(ee,{alias:d,onClose:()=>o(null)}):null,a.error?e.jsx(w,{error:a.error}):null,y.length>0?e.jsx(U,{selectedCount:y.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:m.clear,children:e.jsx(j,{size:"sm",variant:"danger",onPress:()=>x(!0),children:"Delete"})}):null,e.jsx(H,{ariaLabel:"Aliases",columns:E,rows:p,getRowKey:S,isLoading:t.isLoading,emptyContent:"No aliases yet. Create one to give a model a friendly name.",selectionMode:"multiple",selectedKeys:m.selectedKeys,onSelectionChange:m.onSelectionChange,disabledKeys:f}),e.jsx(q,{isOpen:h,onOpenChange:x,heading:"Delete aliases",body:`Delete ${y.length} stored ${y.length===1?"alias":"aliases"}? Callers using ${y.length===1?"it":"them"} will get a model-not-found error.`,confirmLabel:"Delete",isPending:v,error:g,onConfirm:_})]})}export{me as AliasesPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as L}from"./react-dgEcD0HR.js";import{l as T,m as I,n as M,o as R,P as K,E as w,p as P,u as F}from"./index-MlRogoGm.js";import{u as O,r as $,B as U}from"./tableSelection-9hV37uhu.js";import{C as q}from"./ConfirmDialog-P_P4TNFr.js";import{D as H}from"./DataTable-Bmn_eYSV.js";import{F as V}from"./Field-Dwp6u3t8.js";import{C as k,L as z,I as G,a as J,b as W,f as X,B as j,d as A}from"./heroui-BI50yK5B.js";import{U as Q}from"./UserComboBox-a9wxf8eF.js";const Y=50;function B({label:t,value:a,onChange:n,description:r,placeholder:c="provider:model",autoFocus:l,isRequired:d}){const o=T(),{visible:m,total:h,failed:x}=u.useMemo(()=>{var N;const i=a.trim().toLowerCase(),v=((N=o.data)==null?void 0:N.providers)??[],C=v.flatMap(f=>f.models),p=i?C.filter(f=>f.key.toLowerCase().includes(i)):C;return{visible:p.slice(0,Y),total:p.length,failed:v.filter(f=>!f.ok)}},[o.data,a]),g=o.isLoading?"Loading models from your providers…":x.length>0?`Could not list models for ${x.map(v=>v.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:h>m.length?`Showing ${m.length} of ${h} matches. Keep typing to narrow them.`:r;return e.jsxs(k.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:a,onInputChange:n,onSelectionChange:i=>{i!=null&&n(String(i))},isRequired:d,className:"flex max-w-md flex-col gap-1",children:[e.jsx(z,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(k.InputGroup,{children:[e.jsx(G,{placeholder:c,autoFocus:l}),e.jsx(k.Trigger,{})]}),e.jsx(k.Popover,{children:e.jsx(J,{items:m,className:"max-h-72 overflow-auto",children:i=>e.jsx(W,{id:i.key,textValue:i.key,children:i.key})})}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:g}):null]})}const S=t=>JSON.stringify([t.user_id,t.name]);function Z({userId:t,onChange:a}){const n=F(),r=t!==null,c=(l,d)=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>a(l?"":null),className:r===l?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:d});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Applies to"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"A global alias resolves for every caller. A user-scoped one resolves only for that user, and takes precedence over a global alias of the same name."})]}),e.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[c(!1,"Every caller"),c(!0,"One user")]}),r?e.jsx(Q,{label:"User",value:t??"",onChange:a,users:n.data??[],placeholder:"Pick a user…",description:"Only this user resolves the alias.",unknownHint:e.jsx("span",{className:"text-red-700",children:"No such user. Pick an existing one."})}):null]})}function ee({alias:t,onClose:a}){const n=P(),[r,c]=u.useState(t.target),l=r.trim()!==""&&r.trim()!==t.target,d=()=>{l&&n.mutate({name:t.name,target:r.trim(),user_id:t.user_id},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name}),t.user_id?e.jsxs(e.Fragment,{children:[" for user ",e.jsx("code",{children:t.user_id})]}):null]}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["The alias name and who it applies to (",t.user_id?e.jsx("code",{children:t.user_id}):"every caller",") are the key and cannot be changed here. Delete and recreate to change either."]})]}),e.jsx(B,{label:"Target",value:r,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!l||n.isPending,onPress:d,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function se({onClose:t,initialTarget:a=""}){const n=P(),[r,c]=u.useState(""),[l,d]=u.useState(a),[o,m]=u.useState(null),h=/[:/]/.test(r),x=o===null||o.trim()!=="",g=r.trim()!==""&&l.trim()!==""&&!h&&x,i=()=>{g&&n.mutate({name:r.trim(),target:l.trim(),user_id:o===null?null:o.trim()},{onSuccess:t})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(V,{label:"Alias name",value:r,onChange:c,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:h?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(B,{label:"Target",value:l,onChange:d,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsx(Z,{userId:o,onChange:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!g||n.isPending,onPress:i,children:n.isPending?"Creating…":"Create alias"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function me(){const t=I(),a=M(),[n]=L(),r=n.get("target")??"",[c,l]=u.useState(r!==""),[d,o]=u.useState(null),m=O(),[h,x]=u.useState(!1),[g,i]=u.useState(void 0),[v,C]=u.useState(!1),p=[...t.data??[]].sort((s,b)=>s.name.localeCompare(b.name)||(s.user_id??"").localeCompare(b.user_id??"")),N=p.filter(s=>s.source==="stored").map(S),f=p.filter(s=>s.source!=="stored").map(S),y=$(m.selectedKeys,N),D=new Map(p.map(s=>[S(s),s])),_=async()=>{C(!0),i(void 0);try{for(const s of y){const b=D.get(s);b!==void 0&&await a.mutateAsync({name:b.name,userId:b.user_id})}m.clear(),x(!1)}catch(s){i(s)}finally{C(!1)}},E=u.useMemo(()=>[{id:"alias",header:"Alias",isRowHeader:!0,cell:s=>e.jsx("span",{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name})},{id:"target",header:"Target",cell:s=>e.jsx("span",{className:"break-all text-[var(--otari-muted)]",children:s.target})},{id:"scope",header:"Applies to",cell:s=>s.user_id?e.jsx("code",{className:"break-all text-xs text-[var(--otari-ink)]",children:s.user_id}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Every caller"})},{id:"source",header:"Source",cell:s=>e.jsx(X,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})},{id:"actions",header:"Actions",align:"end",cell:s=>s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{l(!1),o(s)},children:"Edit"}),e.jsx(R,{confirmLabel:"Delete",isPending:a.isPending,onConfirm:()=>a.mutate({name:s.name,userId:s.user_id}),children:"Delete"})]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})}],[a.isPending,a.mutate]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(K,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:c||d?null:e.jsx(j,{variant:"primary",onPress:()=>{o(null),l(!0)},children:"New alias"})}),e.jsx(w,{error:t.error}),c?e.jsx(se,{initialTarget:r,onClose:()=>l(!1)}):null,d?e.jsx(ee,{alias:d,onClose:()=>o(null)}):null,a.error?e.jsx(w,{error:a.error}):null,y.length>0?e.jsx(U,{selectedCount:y.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:m.clear,children:e.jsx(j,{size:"sm",variant:"danger",onPress:()=>x(!0),children:"Delete"})}):null,e.jsx(H,{ariaLabel:"Aliases",columns:E,rows:p,getRowKey:S,isLoading:t.isLoading,emptyContent:"No aliases yet. Create one to give a model a friendly name.",selectionMode:"multiple",selectedKeys:m.selectedKeys,onSelectionChange:m.onSelectionChange,disabledKeys:f}),e.jsx(q,{isOpen:h,onOpenChange:x,heading:"Delete aliases",body:`Delete ${y.length} stored ${y.length===1?"alias":"aliases"}? Callers using ${y.length===1?"it":"them"} will get a model-not-found error.`,confirmLabel:"Delete",isPending:v,error:g,onConfirm:_})]})}export{me as AliasesPage}; diff --git a/src/gateway/static/dashboard/assets/BudgetsPage-DanpEezo.js b/src/gateway/static/dashboard/assets/BudgetsPage-B98xbp9L.js similarity index 99% rename from src/gateway/static/dashboard/assets/BudgetsPage-DanpEezo.js rename to src/gateway/static/dashboard/assets/BudgetsPage-B98xbp9L.js index ab70b6119..0e18e98b1 100644 --- a/src/gateway/static/dashboard/assets/BudgetsPage-DanpEezo.js +++ b/src/gateway/static/dashboard/assets/BudgetsPage-B98xbp9L.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{q as ae,u as re,r as le,s as ie,t as oe,v as de,P as ue,E as T,I as ce,w as me,x as xe}from"./index-Bi2hajrg.js";import{u as ge,r as he,B as pe}from"./tableSelection-9hV37uhu.js";import{C as fe}from"./ConfirmDialog-ChuHp-Qm.js";import{D as be}from"./DataTable-Bmn_eYSV.js";import{F as z}from"./Field-Dwp6u3t8.js";import{C as E,I as je,a as ve,b as ye,B as x,d as k,S as Ne}from"./heroui-BI50yK5B.js";const Se=50;function _e({value:t,onChange:r,users:a,label:o,description:l}){const[g,h]=i.useState(""),d=i.useMemo(()=>a.filter(s=>!s.user_id.startsWith("apikey-")).map(s=>({id:s.user_id,label:s.alias?`${s.user_id} (${s.alias})`:s.user_id})),[a]),p=i.useMemo(()=>{const s=g.trim().toLowerCase();return d.filter(u=>!t.includes(u.id)).filter(u=>!s||u.id.toLowerCase().includes(s)||u.label.toLowerCase().includes(s)).slice(0,Se)},[d,t,g]),c=s=>{t.includes(s)||r([...t,s]),h("")},m=s=>r(t.filter(u=>u!==s));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:o}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[s,e.jsx("button",{type:"button","aria-label":`Remove ${s}`,onClick:()=>m(s),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},s))}):null,d.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:h,selectedKey:null,onSelectionChange:s=>{s!=null&&c(String(s))},className:"flex flex-col gap-1",children:[e.jsxs(E.InputGroup,{children:[e.jsx(je,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(ve,{items:p,className:"max-h-72 overflow-auto",children:s=>e.jsx(ye,{id:s.id,textValue:s.label,children:s.label})})})]})]})}const Ce=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function D(t){return Ce.format(t)}const j=86400,q=3600,O=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function we(t){if(t===null)return"No reset";const r=O.find(a=>a.seconds===t);return r?r.label:t%j===0?`Every ${t/j} days`:t%q===0?`Every ${t/q} hours`:`Every ${t}s`}function W(t){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function De(t){const r=t.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function Y(t){return t!==null&&t%j===0?String(t/j):""}function Be({value:t,onChange:r,onInvalidChange:a}){const o=O.some(s=>s.seconds===t),[l,g]=i.useState(!o),[h,d]=i.useState(()=>Y(t)),p=h.trim(),c=Number(p),m=p!==""&&(!Number.isSafeInteger(c)||c<=0);return i.useEffect(()=>{a==null||a(m)},[m,a]),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.map(s=>e.jsx(x,{size:"sm",variant:!l&&t===s.seconds?"primary":"outline",onPress:()=>{g(!1),d(Y(s.seconds)),r(s.seconds)},children:s.label},s.label)),e.jsx(x,{size:"sm",variant:l?"primary":"outline",onPress:()=>g(!0),children:"Custom"})]}),l?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(z,{label:"Every N days",value:h,onChange:s=>{d(s);const u=Number(s.trim());r(s.trim()===""||!Number.isSafeInteger(u)||u<=0?null:u*j)},placeholder:"14",description:m?e.jsx("span",{className:"text-red-700",children:"Enter a whole number of days."}):"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function G({title:t,submitLabel:r,initial:a,error:o,isPending:l,onSubmit:g,onClose:h,assignUsers:d}){const[p,c]=i.useState(a.name??""),[m,s]=i.useState(a.max_budget===null?"":String(a.max_budget)),[u,b]=i.useState(a.budget_duration_sec),[S,v]=i.useState(!1),[B,P]=i.useState([]),f=De(m),A=!l&&f.valid&&!S,C=()=>{A&&g({name:p.trim()||null,max_budget:f.value,budget_duration_sec:u},B)};return e.jsx(k,{children:e.jsxs(k.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(T,{error:o}),e.jsx(z,{label:"Name (optional)",value:p,onChange:c,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(z,{label:"Spending limit (USD)",value:m,onChange:s,placeholder:"100.00",description:f.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(Be,{value:u,onChange:b,onInvalidChange:v}),d?e.jsx(_e,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:B,onChange:P,users:d}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:!A,onPress:C,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:h,children:"Cancel"})]})]})})}function Pe({budget:t}){if(t.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=t.total_spend;if(t.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[D(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=t.max_budget*t.user_count,o=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:D(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",D(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(o,l?100:2)}%`}})})]})}function Ae({budgetId:t}){const r=xe(t);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(Ne,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:o.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:D(o.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:W(o.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:W(o.next_reset_at)})]},o.id))})]})})}function Ee({label:t,isPending:r,onConfirm:a}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:t}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}const ke=t=>t.budget_id;function Q(t){return t.split("-")[0]}function $(t){return t.name??Q(t.budget_id)}function Te(){const t=ae(),r=re(),a=le(),o=ie(),l=oe(),g=de(),[h,d]=i.useState(!1),[p,c]=i.useState(null),[m,s]=i.useState(null),[u,b]=i.useState(null),[S,v]=i.useState(null),[B,P]=i.useState(!1),f=ge(),[A,C]=i.useState(!1),[X,F]=i.useState(void 0),[J,H]=i.useState(!1),w=t.data??[],K=t.isLoading,y=w.find(n=>n.budget_id===p)??null,U=w.find(n=>n.budget_id===m)??null,L=!K&&w.length===0&&!h,Z=w.map(n=>n.budget_id),_=he(f.selectedKeys,Z),ee=async()=>{H(!0),F(void 0);try{for(const n of _)await l.mutateAsync(n);f.clear(),C(!1)}catch(n){F(n)}finally{H(!1)}},te=i.useMemo(()=>[{id:"budget",header:"Budget",isRowHeader:!0,cell:n=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:Q(n.budget_id)})]})},{id:"limit",header:"Limit (per user)",cell:n=>n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):D(n.max_budget)},{id:"reset",header:"Reset",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:we(n.budget_duration_sec)})},{id:"users",header:"Users",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:n.user_count})},{id:"usage",header:"Usage",cell:n=>e.jsx(Pe,{budget:n})},{id:"actions",header:"Actions",align:"end",cell:n=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(N=>N===n.budget_id?null:n.budget_id),children:m===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{d(!1),c(n.budget_id)},children:"Edit"}),e.jsx(Ee,{label:$(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})}],[m,l.isPending,l.mutate]),V=async(n,N)=>{P(!0),b(null);const I=await Promise.allSettled(N.map(M=>g.mutateAsync({id:M,body:{budget_id:n}})));P(!1);const R=I.flatMap((M,ne)=>M.status==="rejected"?[N[ne]]:[]);if(R.length>0){v({budgetId:n,userIds:R}),b(new Error(`Budget created, but could not assign it to: ${R.join(", ")}. Retry to try again.`));return}v(null),d(!1)},se=(n,N)=>{if(S){V(S.budgetId,S.userIds);return}b(null),a.mutate(n,{onSuccess:async I=>{if(N.length>0){await V(I.budget_id,N);return}d(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ue,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:h||L?null:e.jsx(x,{variant:"primary",onPress:()=>{c(null),b(null),v(null),d(!0)},children:"Create budget"})}),e.jsx(T,{error:t.error??a.error??o.error??l.error??g.error}),e.jsx(ce,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),L?e.jsx(me,{title:"No budgets yet",description:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit.",actionLabel:"Create your first budget",onAction:()=>{c(null),b(null),v(null),d(!0)}}):null,h?e.jsx(G,{title:"Create budget",submitLabel:S?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??u,isPending:a.isPending||B,assignUsers:r.data??[],onSubmit:se,onClose:()=>{b(null),v(null),d(!1)}}):null,y?e.jsx(G,{title:`Edit budget ${$(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:o.error,isPending:o.isPending,onSubmit:n=>o.mutate({id:y.budget_id,body:n},{onSuccess:()=>c(null)}),onClose:()=>c(null)},y.budget_id):null,_.length>0?e.jsx(pe,{selectedCount:_.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:f.clear,children:e.jsx(x,{size:"sm",variant:"danger",onPress:()=>C(!0),children:"Delete"})}):null,L?null:e.jsx(be,{ariaLabel:"Budgets",columns:te,rows:w,getRowKey:ke,isLoading:K,emptyContent:"No budgets yet. Create one to cap spending.",selectionMode:"multiple",selectedKeys:f.selectedKeys,onSelectionChange:f.onSelectionChange}),U?e.jsx(k,{children:e.jsxs(k.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsxs("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:["Reset history — ",$(U)]}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(null),children:"Close"})]}),e.jsx(Ae,{budgetId:U.budget_id})]})}):null,e.jsx(fe,{isOpen:A,onOpenChange:C,heading:"Delete budgets",body:`Delete ${_.length} ${_.length===1?"budget":"budgets"}? Users on ${_.length===1?"it":"them"} will no longer be capped.`,confirmLabel:"Delete",isPending:J,error:X,onConfirm:ee})]})}export{Te as BudgetsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{q as ae,u as re,r as le,s as ie,t as oe,v as de,P as ue,E as T,I as ce,w as me,x as xe}from"./index-MlRogoGm.js";import{u as ge,r as he,B as pe}from"./tableSelection-9hV37uhu.js";import{C as fe}from"./ConfirmDialog-P_P4TNFr.js";import{D as be}from"./DataTable-Bmn_eYSV.js";import{F as z}from"./Field-Dwp6u3t8.js";import{C as E,I as je,a as ve,b as ye,B as x,d as k,S as Ne}from"./heroui-BI50yK5B.js";const Se=50;function _e({value:t,onChange:r,users:a,label:o,description:l}){const[g,h]=i.useState(""),d=i.useMemo(()=>a.filter(s=>!s.user_id.startsWith("apikey-")).map(s=>({id:s.user_id,label:s.alias?`${s.user_id} (${s.alias})`:s.user_id})),[a]),p=i.useMemo(()=>{const s=g.trim().toLowerCase();return d.filter(u=>!t.includes(u.id)).filter(u=>!s||u.id.toLowerCase().includes(s)||u.label.toLowerCase().includes(s)).slice(0,Se)},[d,t,g]),c=s=>{t.includes(s)||r([...t,s]),h("")},m=s=>r(t.filter(u=>u!==s));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:o}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[s,e.jsx("button",{type:"button","aria-label":`Remove ${s}`,onClick:()=>m(s),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},s))}):null,d.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:h,selectedKey:null,onSelectionChange:s=>{s!=null&&c(String(s))},className:"flex flex-col gap-1",children:[e.jsxs(E.InputGroup,{children:[e.jsx(je,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(ve,{items:p,className:"max-h-72 overflow-auto",children:s=>e.jsx(ye,{id:s.id,textValue:s.label,children:s.label})})})]})]})}const Ce=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function D(t){return Ce.format(t)}const j=86400,q=3600,O=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function we(t){if(t===null)return"No reset";const r=O.find(a=>a.seconds===t);return r?r.label:t%j===0?`Every ${t/j} days`:t%q===0?`Every ${t/q} hours`:`Every ${t}s`}function W(t){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function De(t){const r=t.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function Y(t){return t!==null&&t%j===0?String(t/j):""}function Be({value:t,onChange:r,onInvalidChange:a}){const o=O.some(s=>s.seconds===t),[l,g]=i.useState(!o),[h,d]=i.useState(()=>Y(t)),p=h.trim(),c=Number(p),m=p!==""&&(!Number.isSafeInteger(c)||c<=0);return i.useEffect(()=>{a==null||a(m)},[m,a]),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.map(s=>e.jsx(x,{size:"sm",variant:!l&&t===s.seconds?"primary":"outline",onPress:()=>{g(!1),d(Y(s.seconds)),r(s.seconds)},children:s.label},s.label)),e.jsx(x,{size:"sm",variant:l?"primary":"outline",onPress:()=>g(!0),children:"Custom"})]}),l?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(z,{label:"Every N days",value:h,onChange:s=>{d(s);const u=Number(s.trim());r(s.trim()===""||!Number.isSafeInteger(u)||u<=0?null:u*j)},placeholder:"14",description:m?e.jsx("span",{className:"text-red-700",children:"Enter a whole number of days."}):"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function G({title:t,submitLabel:r,initial:a,error:o,isPending:l,onSubmit:g,onClose:h,assignUsers:d}){const[p,c]=i.useState(a.name??""),[m,s]=i.useState(a.max_budget===null?"":String(a.max_budget)),[u,b]=i.useState(a.budget_duration_sec),[S,v]=i.useState(!1),[B,P]=i.useState([]),f=De(m),A=!l&&f.valid&&!S,C=()=>{A&&g({name:p.trim()||null,max_budget:f.value,budget_duration_sec:u},B)};return e.jsx(k,{children:e.jsxs(k.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(T,{error:o}),e.jsx(z,{label:"Name (optional)",value:p,onChange:c,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(z,{label:"Spending limit (USD)",value:m,onChange:s,placeholder:"100.00",description:f.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(Be,{value:u,onChange:b,onInvalidChange:v}),d?e.jsx(_e,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:B,onChange:P,users:d}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:!A,onPress:C,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:h,children:"Cancel"})]})]})})}function Pe({budget:t}){if(t.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=t.total_spend;if(t.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[D(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=t.max_budget*t.user_count,o=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:D(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",D(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(o,l?100:2)}%`}})})]})}function Ae({budgetId:t}){const r=xe(t);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(Ne,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:o.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:D(o.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:W(o.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:W(o.next_reset_at)})]},o.id))})]})})}function Ee({label:t,isPending:r,onConfirm:a}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:t}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}const ke=t=>t.budget_id;function Q(t){return t.split("-")[0]}function $(t){return t.name??Q(t.budget_id)}function Te(){const t=ae(),r=re(),a=le(),o=ie(),l=oe(),g=de(),[h,d]=i.useState(!1),[p,c]=i.useState(null),[m,s]=i.useState(null),[u,b]=i.useState(null),[S,v]=i.useState(null),[B,P]=i.useState(!1),f=ge(),[A,C]=i.useState(!1),[X,F]=i.useState(void 0),[J,H]=i.useState(!1),w=t.data??[],K=t.isLoading,y=w.find(n=>n.budget_id===p)??null,U=w.find(n=>n.budget_id===m)??null,L=!K&&w.length===0&&!h,Z=w.map(n=>n.budget_id),_=he(f.selectedKeys,Z),ee=async()=>{H(!0),F(void 0);try{for(const n of _)await l.mutateAsync(n);f.clear(),C(!1)}catch(n){F(n)}finally{H(!1)}},te=i.useMemo(()=>[{id:"budget",header:"Budget",isRowHeader:!0,cell:n=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:Q(n.budget_id)})]})},{id:"limit",header:"Limit (per user)",cell:n=>n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):D(n.max_budget)},{id:"reset",header:"Reset",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:we(n.budget_duration_sec)})},{id:"users",header:"Users",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:n.user_count})},{id:"usage",header:"Usage",cell:n=>e.jsx(Pe,{budget:n})},{id:"actions",header:"Actions",align:"end",cell:n=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(N=>N===n.budget_id?null:n.budget_id),children:m===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{d(!1),c(n.budget_id)},children:"Edit"}),e.jsx(Ee,{label:$(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})}],[m,l.isPending,l.mutate]),V=async(n,N)=>{P(!0),b(null);const I=await Promise.allSettled(N.map(M=>g.mutateAsync({id:M,body:{budget_id:n}})));P(!1);const R=I.flatMap((M,ne)=>M.status==="rejected"?[N[ne]]:[]);if(R.length>0){v({budgetId:n,userIds:R}),b(new Error(`Budget created, but could not assign it to: ${R.join(", ")}. Retry to try again.`));return}v(null),d(!1)},se=(n,N)=>{if(S){V(S.budgetId,S.userIds);return}b(null),a.mutate(n,{onSuccess:async I=>{if(N.length>0){await V(I.budget_id,N);return}d(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ue,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:h||L?null:e.jsx(x,{variant:"primary",onPress:()=>{c(null),b(null),v(null),d(!0)},children:"Create budget"})}),e.jsx(T,{error:t.error??a.error??o.error??l.error??g.error}),e.jsx(ce,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),L?e.jsx(me,{title:"No budgets yet",description:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit.",actionLabel:"Create your first budget",onAction:()=>{c(null),b(null),v(null),d(!0)}}):null,h?e.jsx(G,{title:"Create budget",submitLabel:S?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??u,isPending:a.isPending||B,assignUsers:r.data??[],onSubmit:se,onClose:()=>{b(null),v(null),d(!1)}}):null,y?e.jsx(G,{title:`Edit budget ${$(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:o.error,isPending:o.isPending,onSubmit:n=>o.mutate({id:y.budget_id,body:n},{onSuccess:()=>c(null)}),onClose:()=>c(null)},y.budget_id):null,_.length>0?e.jsx(pe,{selectedCount:_.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:f.clear,children:e.jsx(x,{size:"sm",variant:"danger",onPress:()=>C(!0),children:"Delete"})}):null,L?null:e.jsx(be,{ariaLabel:"Budgets",columns:te,rows:w,getRowKey:ke,isLoading:K,emptyContent:"No budgets yet. Create one to cap spending.",selectionMode:"multiple",selectedKeys:f.selectedKeys,onSelectionChange:f.onSelectionChange}),U?e.jsx(k,{children:e.jsxs(k.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsxs("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:["Reset history — ",$(U)]}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(null),children:"Close"})]}),e.jsx(Ae,{budgetId:U.budget_id})]})}):null,e.jsx(fe,{isOpen:A,onOpenChange:C,heading:"Delete budgets",body:`Delete ${_.length} ${_.length===1?"budget":"budgets"}? Users on ${_.length===1?"it":"them"} will no longer be capped.`,confirmLabel:"Delete",isPending:J,error:X,onConfirm:ee})]})}export{Te as BudgetsPage}; diff --git a/src/gateway/static/dashboard/assets/ConfirmDialog-ChuHp-Qm.js b/src/gateway/static/dashboard/assets/ConfirmDialog-P_P4TNFr.js similarity index 92% rename from src/gateway/static/dashboard/assets/ConfirmDialog-ChuHp-Qm.js rename to src/gateway/static/dashboard/assets/ConfirmDialog-P_P4TNFr.js index f9f9b935b..81d367bd9 100644 --- a/src/gateway/static/dashboard/assets/ConfirmDialog-ChuHp-Qm.js +++ b/src/gateway/static/dashboard/assets/ConfirmDialog-P_P4TNFr.js @@ -1 +1 @@ -import{j as r}from"./tanstack-query-1t81HyiD.js";import{E as j}from"./index-Bi2hajrg.js";import{A as e,B as l}from"./heroui-BI50yK5B.js";function p({isOpen:s,onOpenChange:a,heading:n,body:o,confirmLabel:t,confirmVariant:c="danger",isPending:i,error:d,onConfirm:x}){return r.jsx(e,{isOpen:s,onOpenChange:a,children:s?r.jsx(e.Backdrop,{children:r.jsx(e.Container,{placement:"center",size:"md",children:r.jsxs(e.Dialog,{children:[r.jsx(e.Header,{children:r.jsx(e.Heading,{children:n})}),r.jsxs(e.Body,{className:"flex flex-col gap-4",children:[r.jsx("div",{className:"text-sm text-[var(--otari-muted)]",children:o}),r.jsx(j,{error:d})]}),r.jsxs(e.Footer,{children:[r.jsx(l,{variant:"ghost",isDisabled:i,onPress:()=>a(!1),children:"Cancel"}),r.jsx(l,{variant:c,isPending:i,onPress:x,children:t})]})]})})}):null})}export{p as C}; +import{j as r}from"./tanstack-query-1t81HyiD.js";import{E as j}from"./index-MlRogoGm.js";import{A as e,B as l}from"./heroui-BI50yK5B.js";function p({isOpen:s,onOpenChange:a,heading:n,body:o,confirmLabel:t,confirmVariant:c="danger",isPending:i,error:d,onConfirm:x}){return r.jsx(e,{isOpen:s,onOpenChange:a,children:s?r.jsx(e.Backdrop,{children:r.jsx(e.Container,{placement:"center",size:"md",children:r.jsxs(e.Dialog,{children:[r.jsx(e.Header,{children:r.jsx(e.Heading,{children:n})}),r.jsxs(e.Body,{className:"flex flex-col gap-4",children:[r.jsx("div",{className:"text-sm text-[var(--otari-muted)]",children:o}),r.jsx(j,{error:d})]}),r.jsxs(e.Footer,{children:[r.jsx(l,{variant:"ghost",isDisabled:i,onPress:()=>a(!1),children:"Cancel"}),r.jsx(l,{variant:c,isPending:i,onPress:x,children:t})]})]})})}):null})}export{p as C}; diff --git a/src/gateway/static/dashboard/assets/DocsPage-DkHyFdGF.js b/src/gateway/static/dashboard/assets/DocsPage-CQXolIdY.js similarity index 99% rename from src/gateway/static/dashboard/assets/DocsPage-DkHyFdGF.js rename to src/gateway/static/dashboard/assets/DocsPage-CQXolIdY.js index 984c81691..6dea971e4 100644 --- a/src/gateway/static/dashboard/assets/DocsPage-DkHyFdGF.js +++ b/src/gateway/static/dashboard/assets/DocsPage-CQXolIdY.js @@ -1,4 +1,4 @@ -import{j as re}from"./tanstack-query-1t81HyiD.js";import{P as gi}from"./index-Bi2hajrg.js";import{d as ct}from"./heroui-BI50yK5B.js";import{g as nr}from"./react-dgEcD0HR.js";function yi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi={};function ht(e,t){return(bi.jsx?xi:ki).test(e)}const wi=/[ \t\n\f\r]/g;function Si(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(wi,"")===""}class Ke{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function tr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ke(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ci=0;const L=Te(),Y=Te(),Dn=Te(),E=Te(),$=Te(),Ie=Te(),te=Te();function Te(){return 2**++Ci}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:Ie,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ai.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Di);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Ti,zi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function zi(e){return"-"+e.toLowerCase()}function Di(e){return e.charAt(1).toUpperCase()}const Li=tr([rr,Ei,or,ar,sr],"html"),qn=tr([rr,Ii,or,ar,sr],"svg");function _i(e){return e.join(" ").trim()}var De={},mn,dt;function Ri(){if(dt)return mn;dt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=` +import{j as re}from"./tanstack-query-1t81HyiD.js";import{P as gi}from"./index-MlRogoGm.js";import{d as ct}from"./heroui-BI50yK5B.js";import{g as nr}from"./react-dgEcD0HR.js";function yi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi={};function ht(e,t){return(bi.jsx?xi:ki).test(e)}const wi=/[ \t\n\f\r]/g;function Si(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(wi,"")===""}class Ke{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function tr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ke(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ci=0;const L=Te(),Y=Te(),Dn=Te(),E=Te(),$=Te(),Ie=Te(),te=Te();function Te(){return 2**++Ci}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:Ie,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ai.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Di);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Ti,zi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function zi(e){return"-"+e.toLowerCase()}function Di(e){return e.charAt(1).toUpperCase()}const Li=tr([rr,Ei,or,ar,sr],"html"),qn=tr([rr,Ii,or,ar,sr],"svg");function _i(e){return e.join(" ").trim()}var De={},mn,dt;function Ri(){if(dt)return mn;dt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=` `,u="/",h="*",c="",p="comment",f="declaration";function g(S,y){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];y=y||{};var I=1,C=1;function R(D){var T=D.match(t);T&&(I+=T.length);var U=D.lastIndexOf(s);C=~U?D.length-U:C+D.length}function F(){var D={line:I,column:C};return function(T){return T.position=new b(D),j(),T}}function b(D){this.start=D,this.end={line:I,column:C},this.source=y.source}b.prototype.content=S;function M(D){var T=new Error(y.source+":"+I+":"+C+": "+D);if(T.reason=D,T.filename=y.source,T.line=I,T.column=C,T.source=S,!y.silent)throw T}function H(D){var T=D.exec(S);if(T){var U=T[0];return R(U),S=S.slice(U.length),T}}function j(){H(n)}function k(D){var T;for(D=D||[];T=A();)T!==!1&&D.push(T);return D}function A(){var D=F();if(!(u!=S.charAt(0)||h!=S.charAt(1))){for(var T=2;c!=S.charAt(T)&&(h!=S.charAt(T)||u!=S.charAt(T+1));)++T;if(T+=2,c===S.charAt(T-1))return M("End of comment missing");var U=S.slice(2,T-2);return C+=2,R(U),S=S.slice(T),C+=2,D({type:p,comment:U})}}function P(){var D=F(),T=H(r);if(T){if(A(),!H(i))return M("property missing ':'");var U=H(o),K=D({type:f,property:w(T[0].replace(e,c)),value:U?w(U[0].replace(e,c)):c});return H(l),K}}function q(){var D=[];k(D);for(var T;T=P();)T!==!1&&(D.push(T),k(D));return D}return j(),q()}function w(S){return S?S.replace(a,c):c}return mn=g,mn}var gt;function Fi(){if(gt)return De;gt=1;var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(De,"__esModule",{value:!0}),De.default=n;const t=e(Ri());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),a=typeof i=="function";return l.forEach(s=>{if(s.type!=="declaration")return;const{property:u,value:h}=s;a?i(u,h,s):h&&(o=o||{},o[u]=h)}),o}return De}var Be={},yt;function Oi(){if(yt)return Be;yt=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(u){return!u||n.test(u)||e.test(u)},l=function(u,h){return h.toUpperCase()},a=function(u,h){return"".concat(h,"-")},s=function(u,h){return h===void 0&&(h={}),o(u)?u:(u=u.toLowerCase(),h.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(t,l))};return Be.camelCase=s,Be}var je,kt;function Mi(){if(kt)return je;kt=1;var e=je&&je.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Fi()),n=Oi();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(a,s){a&&s&&(l[(0,n.camelCase)(a,o)]=s)}),l}return r.default=r,je=r,je}var Ni=Mi();const Bi=nr(Ni),ur=cr("end"),Un=cr("start");function cr(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ji(e){const t=Un(e),n=ur(e);if(t&&n)return{start:t,end:n}}function Ue(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xt(e.position):"start"in e||"end"in e?xt(e):"line"in e||"column"in e?_n(e):""}function _n(e){return bt(e&&e.line)+":"+bt(e&&e.column)}function xt(e){return _n(e&&e.start)+"-"+_n(e&&e.end)}function bt(e){return e&&typeof e=="number"?e:1}class G extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?o.ruleId=r:(o.source=r.slice(0,s),o.ruleId=r.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){const s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ue(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}G.prototype.file="";G.prototype.name="";G.prototype.reason="";G.prototype.message="";G.prototype.stack="";G.prototype.column=void 0;G.prototype.line=void 0;G.prototype.ancestors=void 0;G.prototype.cause=void 0;G.prototype.fatal=void 0;G.prototype.place=void 0;G.prototype.ruleId=void 0;G.prototype.source=void 0;const Vn={}.hasOwnProperty,Hi=new Map,qi=/[A-Z]/g,Ui=new Set(["table","tbody","thead","tfoot","tr"]),Vi=new Set(["td","th"]),hr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $i(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Zi(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ji(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qn:Li,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=fr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function fr(e,t,n){if(t.type==="element")return Wi(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Yi(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Qi(e,t,n);if(t.type==="mdxjsEsm")return Ki(e,t);if(t.type==="root")return Xi(e,t,n);if(t.type==="text")return Gi(e,t)}function Wi(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=qn,e.schema=i),e.ancestors.push(t);const o=mr(e,t.tagName,!1),l=el(e,t);let a=Wn(e,t);return Ui.has(t.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!Si(s):!0})),pr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Yi(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}We(e,t.position)}function Ki(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);We(e,t.position)}function Qi(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=qn,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:mr(e,t.name,!0),l=nl(e,t),a=Wn(e,t);return pr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Xi(e,t,n){const r={};return $n(r,Wn(e,t)),e.create(t,e.Fragment,r,n)}function Gi(e,t){return t.value}function pr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $n(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ji(e,t,n){return r;function r(i,o,l,a){const u=Array.isArray(l.children)?n:t;return a?u(o,l,a):u(o,l)}}function Zi(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),s=Un(r);return t(i,o,l,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function el(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Vn.call(t.properties,i)){const o=tl(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&Vi.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function nl(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else We(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else We(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Wn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Hi;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(ie(e,e.length,0,t),e):t}const Ct={}.hasOwnProperty;function gr(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ce(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const J=be(/[A-Za-z]/),X=be(/[\dA-Za-z]/),hl=be(/[#-'*+\--9=?A-Z^-~]/);function rn(e){return e!==null&&(e<32||e===127)}const Rn=be(/\d/),fl=be(/[\dA-Fa-f]/),pl=be(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function W(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}const sn=be(new RegExp("\\p{P}|\\p{S}","u")),ve=be(/\s/);function be(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fe(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function B(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(s){return O(s)?(e.enter(n),a(s)):t(s)}function a(s){return O(s)&&o++l))return;const M=t.events.length;let H=M,j,k;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(j){k=t.events[H][1].end;break}j=!0}for(y(r),b=M;bC;){const F=n[R];t.containerState=F[1],F[0].exit.call(t,e)}n.length=C}function I(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function kl(e,t,n){return B(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _e(e){if(e===null||W(e)||ve(e))return 1;if(sn(e))return 2}function un(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};It(c,-s),It(p,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:s>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=le(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=le(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=le(u,un(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=le(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,u=le(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,ie(e,r-1,n-r+3,u),n=r+u.length-h-2;break}}for(n=-1;++n0&&O(b)?B(e,I,"linePrefix",o+1)(b):I(b)}function I(b){return b===null||z(b)?e.check(vt,w,R)(b):(e.enter("codeFlowValue"),C(b))}function C(b){return b===null||z(b)?(e.exit("codeFlowValue"),I(b)):(e.consume(b),C)}function R(b){return e.exit("codeFenced"),t(b)}function F(b,M,H){let j=0;return k;function k(T){return b.enter("lineEnding"),b.consume(T),b.exit("lineEnding"),A}function A(T){return b.enter("codeFencedFence"),O(T)?B(b,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):P(T)}function P(T){return T===a?(b.enter("codeFencedFenceSequence"),q(T)):H(T)}function q(T){return T===a?(j++,b.consume(T),q):j>=l?(b.exit("codeFencedFenceSequence"),O(T)?B(b,D,"whitespace")(T):D(T)):H(T)}function D(T){return T===null||z(T)?(b.exit("codeFencedFence"),M(T)):H(T)}}}function zl(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const gn={name:"codeIndented",tokenize:Ll},Dl={partial:!0,tokenize:_l};function Ll(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),B(e,o,"linePrefix",5)(u)}function o(u){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?s(u):z(u)?e.attempt(Dl,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||z(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),t(u)}}function _l(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):B(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):z(l)?i(l):n(l)}}const Rl={name:"codeText",previous:Ol,resolve:Fl,tokenize:Ml};function Fl(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&He(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),He(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),He(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Sr(e,t,n,r,i,o,l,a,s){const u=s||Number.POSITIVE_INFINITY;let h=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||rn(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||z(y)?n(y):(e.consume(y),y===92?g:f)}function g(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function w(y){return!h&&(y===null||y===41||W(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):h999||f===null||f===91||f===93&&!s||f===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===null||f===91||f===93||z(f)||a++>999?(e.exit("chunkString"),h(f)):(e.consume(f),s||(s=!O(f)),f===92?p:c)}function p(f){return f===91||f===92||f===93?(e.consume(f),a++,c):c(f)}}function Er(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,s):n(p)}function s(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),s(l)):p===null?n(p):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),B(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===l||p===null||z(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:h)}function c(p){return p===l||p===92?(e.consume(p),h):h(p)}}function Ve(e,t){let n;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):O(i)?B(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const $l={name:"definition",tokenize:Yl},Wl={partial:!0,tokenize:Kl};function Yl(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),l(f)}function l(f){return Cr.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=ce(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),s):n(f)}function s(f){return W(f)?Ve(e,u)(f):u(f)}function u(f){return Sr(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function h(f){return e.attempt(Wl,c,c)(f)}function c(f){return O(f)?B(e,p,"whitespace")(f):p(f)}function p(f){return f===null||z(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function Kl(e,t,n){return r;function r(a){return W(a)?Ve(e,i)(a):n(a)}function i(a){return Er(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return O(a)?B(e,l,"whitespace")(a):l(a)}function l(a){return a===null||z(a)?t(a):n(a)}}const Ql={name:"hardBreakEscape",tokenize:Xl};function Xl(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return z(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Gl={name:"headingAtx",resolve:Jl,tokenize:Zl};function Jl(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ie(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Zl(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),o(h)}function o(h){return e.enter("atxHeadingSequence"),l(h)}function l(h){return h===35&&r++<6?(e.consume(h),l):h===null||W(h)?(e.exit("atxHeadingSequence"),a(h)):n(h)}function a(h){return h===35?(e.enter("atxHeadingSequence"),s(h)):h===null||z(h)?(e.exit("atxHeading"),t(h)):O(h)?B(e,a,"whitespace")(h):(e.enter("atxHeadingText"),u(h))}function s(h){return h===35?(e.consume(h),s):(e.exit("atxHeadingSequence"),a(h))}function u(h){return h===null||h===35||W(h)?(e.exit("atxHeadingText"),a(h)):(e.consume(h),u)}}const eo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],At=["pre","script","style","textarea"],no={concrete:!0,name:"htmlFlow",resolveTo:io,tokenize:lo},to={partial:!0,tokenize:ao},ro={partial:!0,tokenize:oo};function io(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function lo(e,t,n){const r=this;let i,o,l,a,s;return u;function u(d){return h(d)}function h(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,w):d===63?(e.consume(d),i=3,r.interrupt?t:m):J(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function p(d){return d===45?(e.consume(d),i=2,f):d===91?(e.consume(d),i=5,a=0,g):J(d)?(e.consume(d),i=4,r.interrupt?t:m):n(d)}function f(d){return d===45?(e.consume(d),r.interrupt?t:m):n(d)}function g(d){const se="CDATA[";return d===se.charCodeAt(a++)?(e.consume(d),a===se.length?r.interrupt?t:P:g):n(d)}function w(d){return J(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function S(d){if(d===null||d===47||d===62||W(d)){const se=d===47,we=l.toLowerCase();return!se&&!o&&At.includes(we)?(i=1,r.interrupt?t(d):P(d)):eo.includes(l.toLowerCase())?(i=6,se?(e.consume(d),y):r.interrupt?t(d):P(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(d):o?I(d):C(d))}return d===45||X(d)?(e.consume(d),l+=String.fromCharCode(d),S):n(d)}function y(d){return d===62?(e.consume(d),r.interrupt?t:P):n(d)}function I(d){return O(d)?(e.consume(d),I):k(d)}function C(d){return d===47?(e.consume(d),k):d===58||d===95||J(d)?(e.consume(d),R):O(d)?(e.consume(d),C):k(d)}function R(d){return d===45||d===46||d===58||d===95||X(d)?(e.consume(d),R):F(d)}function F(d){return d===61?(e.consume(d),b):O(d)?(e.consume(d),F):C(d)}function b(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),s=d,M):O(d)?(e.consume(d),b):H(d)}function M(d){return d===s?(e.consume(d),s=null,j):d===null||z(d)?n(d):(e.consume(d),M)}function H(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||W(d)?F(d):(e.consume(d),H)}function j(d){return d===47||d===62||O(d)?C(d):n(d)}function k(d){return d===62?(e.consume(d),A):n(d)}function A(d){return d===null||z(d)?P(d):O(d)?(e.consume(d),A):n(d)}function P(d){return d===45&&i===2?(e.consume(d),U):d===60&&i===1?(e.consume(d),K):d===62&&i===4?(e.consume(d),ae):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),pe):z(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(to,me,q)(d)):d===null||z(d)?(e.exit("htmlFlowData"),q(d)):(e.consume(d),P)}function q(d){return e.check(ro,D,me)(d)}function D(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),T}function T(d){return d===null||z(d)?q(d):(e.enter("htmlFlowData"),P(d))}function U(d){return d===45?(e.consume(d),m):P(d)}function K(d){return d===47?(e.consume(d),l="",oe):P(d)}function oe(d){if(d===62){const se=l.toLowerCase();return At.includes(se)?(e.consume(d),ae):P(d)}return J(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),oe):P(d)}function pe(d){return d===93?(e.consume(d),m):P(d)}function m(d){return d===62?(e.consume(d),ae):d===45&&i===2?(e.consume(d),m):P(d)}function ae(d){return d===null||z(d)?(e.exit("htmlFlowData"),me(d)):(e.consume(d),ae)}function me(d){return e.exit("htmlFlow"),t(d)}}function oo(e,t,n){const r=this;return i;function i(l){return z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ao(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Qe,t,n)}}const so={name:"htmlText",tokenize:uo};function uo(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),s}function s(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),F):m===63?(e.consume(m),C):J(m)?(e.consume(m),H):n(m)}function u(m){return m===45?(e.consume(m),h):m===91?(e.consume(m),o=0,g):J(m)?(e.consume(m),I):n(m)}function h(m){return m===45?(e.consume(m),f):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):z(m)?(l=c,K(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),f):c(m)}function f(m){return m===62?U(m):m===45?p(m):c(m)}function g(m){const ae="CDATA[";return m===ae.charCodeAt(o++)?(e.consume(m),o===ae.length?w:g):n(m)}function w(m){return m===null?n(m):m===93?(e.consume(m),S):z(m)?(l=w,K(m)):(e.consume(m),w)}function S(m){return m===93?(e.consume(m),y):w(m)}function y(m){return m===62?U(m):m===93?(e.consume(m),y):w(m)}function I(m){return m===null||m===62?U(m):z(m)?(l=I,K(m)):(e.consume(m),I)}function C(m){return m===null?n(m):m===63?(e.consume(m),R):z(m)?(l=C,K(m)):(e.consume(m),C)}function R(m){return m===62?U(m):C(m)}function F(m){return J(m)?(e.consume(m),b):n(m)}function b(m){return m===45||X(m)?(e.consume(m),b):M(m)}function M(m){return z(m)?(l=M,K(m)):O(m)?(e.consume(m),M):U(m)}function H(m){return m===45||X(m)?(e.consume(m),H):m===47||m===62||W(m)?j(m):n(m)}function j(m){return m===47?(e.consume(m),U):m===58||m===95||J(m)?(e.consume(m),k):z(m)?(l=j,K(m)):O(m)?(e.consume(m),j):U(m)}function k(m){return m===45||m===46||m===58||m===95||X(m)?(e.consume(m),k):A(m)}function A(m){return m===61?(e.consume(m),P):z(m)?(l=A,K(m)):O(m)?(e.consume(m),A):j(m)}function P(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,q):z(m)?(l=P,K(m)):O(m)?(e.consume(m),P):(e.consume(m),D)}function q(m){return m===i?(e.consume(m),i=void 0,T):m===null?n(m):z(m)?(l=q,K(m)):(e.consume(m),q)}function D(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||W(m)?j(m):(e.consume(m),D)}function T(m){return m===47||m===62||W(m)?j(m):n(m)}function U(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function K(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),oe}function oe(m){return O(m)?B(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):pe(m)}function pe(m){return e.enter("htmlTextData"),l(m)}}const Qn={name:"labelEnd",resolveAll:po,resolveTo:mo,tokenize:go},co={tokenize:yo},ho={tokenize:ko},fo={tokenize:xo};function po(e){let t=-1;const n=[];for(;++t=3&&(u===null||z(u))?(e.exit("thematicBreak"),t(u)):n(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),O(u)?B(e,a,"whitespace")(u):a(u))}}const Z={continuation:{tokenize:Po},exit:Do,name:"list",tokenize:Ao},vo={partial:!0,tokenize:Lo},To={partial:!0,tokenize:zo};function Ao(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(f){const g=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Rn(f)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(tn,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(f)}return n(f)}function s(f){return Rn(f)&&++l<10?(e.consume(f),s):(!r.interrupt||l<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Qe,r.interrupt?n:h,e.attempt(vo,p,c))}function h(f){return r.containerState.initialBlankLine=!0,o++,p(f)}function c(f){return O(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Po(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Qe,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,B(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!O(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(To,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,B(e,e.attempt(Z,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function zo(e,t,n){const r=this;return B(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function Do(e){e.exit(this.containerState.type)}function Lo(e,t,n){const r=this;return B(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!O(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Pt={name:"setextUnderline",resolveTo:_o,tokenize:Ro};function _o(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Ro(e,t,n){const r=this;let i;return o;function o(u){let h=r.events.length,c;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){c=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),O(u)?B(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||z(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Fo={tokenize:Oo};function Oo(e){const t=this,n=e.attempt(Qe,r,e.attempt(this.parser.constructs.flowInitial,i,B(e,e.attempt(this.parser.constructs.flow,i,e.attempt(jl,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Mo={resolveAll:vr()},No=Ir("string"),Bo=Ir("text");function Ir(e){return{resolveAll:vr(e==="text"?jo:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(h){return u(h)?o(h):a(h)}function a(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),s}function s(h){return u(h)?(n.exit("data"),o(h)):(n.consume(h),s)}function u(h){if(h===null)return!0;const c=i[h];let p=-1;if(c)for(;++p-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Zo(e,t){let n=-1;const r=[];let i;for(;++n0){const ue=_.tokenStack[_.tokenStack.length-1];(ue[1]||Dt).call(_,void 0,ue[0])}for(v.position={start:xe(x.length>0?x[0][1].start:{line:1,column:1,offset:0}),end:xe(x.length>0?x[x.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++Ve.bucketStart),X=x.map(e=>({x:e.bucketStart,requests:e.requests})),r=x.length,H=oe(C,S),z=()=>{if(r===0)return[0,1];const{startIndex:e,endIndex:s}=ce(w,C,S);return[e,s+1]},[T,Z]=p.useState(z),y=p.useRef(T),v=e=>{y.current=e,Z(e)},N=p.useRef(!1);p.useEffect(()=>{N.current||v(z())},[C,S,r,w[0],w[r-1]]);const b=([e,s])=>{if(N.current=!1,r===0)return;const i=Math.max(0,Math.min(r-1,Math.floor(e+1e-6))),a=Math.max(i,Math.min(r-1,Math.ceil(s-1e-6)-1));if(i===0&&a===r-1){j(),v([0,r]);return}const n=de(w,i,a,l);n&&g(n.startIso,n.endIso)},k=o.findIndex(e=>e.key===m),B=k>=0?o[k].seconds:r*le(l)/1e3,A=k>=0?o[k+1]:o.find(e=>e.seconds===null||B!==null&&e.seconds>B),[d,u]=T,P=d<=.01&&u>=r-.01,L=e=>{const s=Math.max(1,Math.min(r,e)),i=(d+u)/2;let a=i-s/2,n=i+s/2;a<0&&(n-=a,a=0),n>r&&(a-=n-r,n=r);const f=[Math.max(0,a),Math.min(r,n)];v(f),b(f)},V=()=>{if(P){A&&c(A);return}L((u-d)*2)},G=()=>L((u-d)/2),J=(e,s)=>{const[i,a]=y.current,n=e===0?[Math.max(0,Math.min(a-1,Math.round(i)+s)),a]:[i,Math.min(r,Math.max(i+1,Math.round(a)+s))];v(n),b(n)},Q=e=>{var n,f;const s=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:0;if(s===0)return;const i=(f=(n=e.target).getAttribute)==null?void 0:f.call(n,"aria-label"),a=F.indexOf(i);a<0||(e.preventDefault(),e.stopPropagation(),J(a,s))},R=p.useRef(null),h=p.useRef(null),Y=e=>{if(!h.current||!R.current)return;const s=R.current.getBoundingClientRect().width;if(s<=0)return;const i=(e.clientX-h.current.x)/s*r,a=h.current.sel[1]-h.current.sel[0],n=Math.max(0,Math.min(r-a,h.current.sel[0]+i));v([n,n+a])},ee=e=>{const[s,i]=y.current,a=i-s,n=Math.max(0,Math.min(r-a,Math.round(s)+e)),f=[n,n+a];v(f),b(f)},te=e=>{if(P)return;const[s,i]=y.current,a=Math.max(1,Math.round(i-s)),n=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:e.key==="PageUp"?a:e.key==="PageDown"?-a:e.key==="Home"?-r:e.key==="End"?r:0;n!==0&&(e.preventDefault(),ee(n))},I=r?Math.min(d,u)/r*100:0,E=r?Math.max(d,u)/r*100:100,D=!P,re=Math.max(1,Math.round(u-d)),U=Math.max(0,r-re),q=Math.min(Math.max(0,Math.round(Math.min(d,u))),U);return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.map(e=>t.jsx(M,{size:"sm",variant:m===e.key?"primary":"outline",onPress:()=>c(e),children:e.label},e.key)),t.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[t.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",H," · UTC"]}),O]})]}),t.jsxs("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-2",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[t.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:["Requests / ",l==="hour"?"hour":"day"]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"hidden text-[11px] text-[var(--otari-muted)] sm:inline",children:"drag the edges to zoom · the bottom strip to pan"}),t.jsx(M,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom in",isDisabled:r===0,onPress:G,children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:t.jsx("path",{d:"M12 5v14M5 12h14",strokeLinecap:"round"})})}),t.jsx(M,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom out",isDisabled:r===0||P&&!A,onPress:V,children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:t.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})})}),D?t.jsx(M,{size:"sm",variant:"ghost",onPress:()=>b([0,r]),children:"Reset"}):null]})]}),K&&r===0?t.jsx("div",{className:"flex h-[90px] items-center justify-center",children:t.jsx(ae,{size:"sm"})}):r===0?t.jsx("div",{className:"flex h-[90px] items-center justify-center text-xs text-[var(--otari-muted)]",children:"No activity in this range."}):t.jsxs("div",{ref:R,className:"relative w-full",children:[t.jsx("div",{role:"img","aria-label":_,className:"w-full touch-pan-y select-none",children:t.jsx(ue,{width:"100%",height:90,children:t.jsxs(me,{data:X,margin:{top:4,right:0,left:0,bottom:0},children:[t.jsx(xe,{dataKey:"x",tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:40,tickFormatter:e=>$(e,l),tick:{fontSize:10,fill:"var(--otari-muted)"}}),t.jsx(he,{cursor:{fill:"var(--otari-line)",opacity:.35},content:t.jsx(be,{bucket:l})}),t.jsx(fe,{dataKey:"requests",fill:pe,radius:[2,2,0,0],isAnimationActive:!1})]})})}),D?t.jsxs(t.Fragment,{children:[t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-0 bg-[var(--otari-bg)] opacity-70",style:{width:`${I}%`}}),t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 right-0 bg-[var(--otari-bg)] opacity-70",style:{width:`${100-E}%`}})]}):null,t.jsx("div",{role:"slider","aria-label":"Pan the selected window","aria-valuemin":0,"aria-valuemax":U,"aria-valuenow":q,"aria-valuetext":`Window starting at ${$(w[Math.min(q,r-1)]??w[0],l)}`,"aria-disabled":!D,tabIndex:0,className:"absolute bottom-0 z-[1] cursor-grab touch-none rounded bg-[var(--otari-brand)]/10 outline-none hover:bg-[var(--otari-brand)]/20 focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)] active:cursor-grabbing",style:{left:`${I}%`,width:`${Math.max(0,E-I)}%`,height:ve},onKeyDown:te,onPointerDown:e=>{e.stopPropagation(),e.preventDefault(),N.current=!0,h.current={x:e.clientX,sel:[Math.min(d,u),Math.max(d,u)]},e.currentTarget.setPointerCapture(e.pointerId)},onPointerMove:Y,onPointerUp:e=>{e.currentTarget.releasePointerCapture(e.pointerId),h.current=null,b(y.current)},onPointerCancel:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),h.current=null,b(y.current)}}),t.jsx("div",{className:"pointer-events-none absolute inset-0 z-[2]",onKeyDownCapture:Q,children:t.jsx(ne,{"aria-label":"Selected time range",minValue:0,maxValue:r,step:1/ge,value:T,onChange:e=>{N.current=!0,Array.isArray(e)&&e.length===2&&v([e[0],e[1]])},onChangeEnd:e=>{Array.isArray(e)&&e.length===2&&b([e[0],e[1]])},className:"pointer-events-none h-full w-full",children:t.jsxs(se,{className:"pointer-events-none relative h-full w-full",children:[t.jsx(W,{index:0}),t.jsx(W,{index:1})]})})})]})]})]})}function Ce({chips:o,children:m,onClearAll:c}){const[g,j]=p.useState(!1),x=p.useId();return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(M,{size:"sm",variant:"outline",onPress:()=>j(l=>!l),"aria-expanded":g,"aria-controls":x,children:g?"Done":"Add filter"}),o.map(l=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] py-0.5 pl-2.5 pr-1 text-xs text-[var(--otari-brand-dark)]",children:[t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[l.label,":"]}),t.jsx("span",{className:"font-medium",children:l.value}),t.jsx("button",{type:"button",onClick:l.onClear,"aria-label":`Remove ${l.label} filter`,className:"ml-0.5 inline-flex h-4 w-4 items-center justify-center rounded-full text-[var(--otari-muted)] outline-none hover:bg-[var(--otari-line)] hover:text-[var(--otari-ink)] focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)]",children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"h-3 w-3","aria-hidden":"true",children:t.jsx("path",{d:"M6 6l12 12M18 6L6 18",strokeLinecap:"round"})})})]},l.key)),o.length>0&&c?t.jsx(M,{size:"sm",variant:"ghost",onPress:c,children:"Clear all"}):null]}),t.jsx("div",{id:x,className:g?"flex flex-wrap items-end gap-3":"hidden",children:m})]})}export{Pe as A,Ce as F}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as p}from"./react-dgEcD0HR.js";import{B as M,S as ae,$ as ne,h as se,i as ie}from"./heroui-BI50yK5B.js";import{an as oe,ao as le,ap as ce,aq as de}from"./index-MlRogoGm.js";import{R as ue,B as me,X as xe,T as he,a as fe}from"./recharts-C4kRDmvS.js";const pe="var(--otari-brand)",ge=10,ve=22;function $(o,m){const c=new Date(o);return Number.isNaN(c.getTime())?o:m==="hour"?c.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):c.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function be({active:o,label:m,payload:c,bucket:g}){var x;const j=(x=c==null?void 0:c[0])==null?void 0:x.value;return!o||typeof j!="number"||typeof m!="string"?null:t.jsxs("div",{className:"rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-xs shadow-sm",children:[t.jsxs("div",{className:"text-[var(--otari-muted)]",children:[$(m,g)," · UTC"]}),t.jsxs("div",{className:"font-medium tabular-nums text-[var(--otari-ink)]",children:[j.toLocaleString()," requests"]})]})}const je="group top-1/2 h-full w-3 cursor-ew-resize outline-none",F=["Window start","Window end"];function W({index:o}){return t.jsxs(ie,{index:o,"aria-label":F[o],className:`${je} pointer-events-auto`,children:[t.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-1/2 w-0.5 -translate-x-1/2 bg-[var(--otari-brand)]"}),t.jsx("span",{"aria-hidden":!0,className:"absolute left-1/2 top-1/2 h-6 w-2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-surface)] shadow-sm group-focus-visible:ring-2 group-focus-visible:ring-[var(--otari-brand)]"})]})}function Pe({presets:o,extentKey:m,onPreset:c,onSelectRange:g,onSelectFull:j,series:x,bucket:l,windowStart:C,windowEnd:S,loading:K=!1,ariaLabel:_="Request volume over the selected window",action:O}){const w=x.map(e=>e.bucketStart),X=x.map(e=>({x:e.bucketStart,requests:e.requests})),r=x.length,H=oe(C,S),z=()=>{if(r===0)return[0,1];const{startIndex:e,endIndex:s}=ce(w,C,S);return[e,s+1]},[T,Z]=p.useState(z),y=p.useRef(T),v=e=>{y.current=e,Z(e)},N=p.useRef(!1);p.useEffect(()=>{N.current||v(z())},[C,S,r,w[0],w[r-1]]);const b=([e,s])=>{if(N.current=!1,r===0)return;const i=Math.max(0,Math.min(r-1,Math.floor(e+1e-6))),a=Math.max(i,Math.min(r-1,Math.ceil(s-1e-6)-1));if(i===0&&a===r-1){j(),v([0,r]);return}const n=de(w,i,a,l);n&&g(n.startIso,n.endIso)},k=o.findIndex(e=>e.key===m),B=k>=0?o[k].seconds:r*le(l)/1e3,A=k>=0?o[k+1]:o.find(e=>e.seconds===null||B!==null&&e.seconds>B),[d,u]=T,P=d<=.01&&u>=r-.01,L=e=>{const s=Math.max(1,Math.min(r,e)),i=(d+u)/2;let a=i-s/2,n=i+s/2;a<0&&(n-=a,a=0),n>r&&(a-=n-r,n=r);const f=[Math.max(0,a),Math.min(r,n)];v(f),b(f)},V=()=>{if(P){A&&c(A);return}L((u-d)*2)},G=()=>L((u-d)/2),J=(e,s)=>{const[i,a]=y.current,n=e===0?[Math.max(0,Math.min(a-1,Math.round(i)+s)),a]:[i,Math.min(r,Math.max(i+1,Math.round(a)+s))];v(n),b(n)},Q=e=>{var n,f;const s=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:0;if(s===0)return;const i=(f=(n=e.target).getAttribute)==null?void 0:f.call(n,"aria-label"),a=F.indexOf(i);a<0||(e.preventDefault(),e.stopPropagation(),J(a,s))},R=p.useRef(null),h=p.useRef(null),Y=e=>{if(!h.current||!R.current)return;const s=R.current.getBoundingClientRect().width;if(s<=0)return;const i=(e.clientX-h.current.x)/s*r,a=h.current.sel[1]-h.current.sel[0],n=Math.max(0,Math.min(r-a,h.current.sel[0]+i));v([n,n+a])},ee=e=>{const[s,i]=y.current,a=i-s,n=Math.max(0,Math.min(r-a,Math.round(s)+e)),f=[n,n+a];v(f),b(f)},te=e=>{if(P)return;const[s,i]=y.current,a=Math.max(1,Math.round(i-s)),n=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:e.key==="PageUp"?a:e.key==="PageDown"?-a:e.key==="Home"?-r:e.key==="End"?r:0;n!==0&&(e.preventDefault(),ee(n))},I=r?Math.min(d,u)/r*100:0,E=r?Math.max(d,u)/r*100:100,D=!P,re=Math.max(1,Math.round(u-d)),U=Math.max(0,r-re),q=Math.min(Math.max(0,Math.round(Math.min(d,u))),U);return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.map(e=>t.jsx(M,{size:"sm",variant:m===e.key?"primary":"outline",onPress:()=>c(e),children:e.label},e.key)),t.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[t.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",H," · UTC"]}),O]})]}),t.jsxs("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-2",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[t.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:["Requests / ",l==="hour"?"hour":"day"]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"hidden text-[11px] text-[var(--otari-muted)] sm:inline",children:"drag the edges to zoom · the bottom strip to pan"}),t.jsx(M,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom in",isDisabled:r===0,onPress:G,children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:t.jsx("path",{d:"M12 5v14M5 12h14",strokeLinecap:"round"})})}),t.jsx(M,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom out",isDisabled:r===0||P&&!A,onPress:V,children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:t.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})})}),D?t.jsx(M,{size:"sm",variant:"ghost",onPress:()=>b([0,r]),children:"Reset"}):null]})]}),K&&r===0?t.jsx("div",{className:"flex h-[90px] items-center justify-center",children:t.jsx(ae,{size:"sm"})}):r===0?t.jsx("div",{className:"flex h-[90px] items-center justify-center text-xs text-[var(--otari-muted)]",children:"No activity in this range."}):t.jsxs("div",{ref:R,className:"relative w-full",children:[t.jsx("div",{role:"img","aria-label":_,className:"w-full touch-pan-y select-none",children:t.jsx(ue,{width:"100%",height:90,children:t.jsxs(me,{data:X,margin:{top:4,right:0,left:0,bottom:0},children:[t.jsx(xe,{dataKey:"x",tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:40,tickFormatter:e=>$(e,l),tick:{fontSize:10,fill:"var(--otari-muted)"}}),t.jsx(he,{cursor:{fill:"var(--otari-line)",opacity:.35},content:t.jsx(be,{bucket:l})}),t.jsx(fe,{dataKey:"requests",fill:pe,radius:[2,2,0,0],isAnimationActive:!1})]})})}),D?t.jsxs(t.Fragment,{children:[t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-0 bg-[var(--otari-bg)] opacity-70",style:{width:`${I}%`}}),t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 right-0 bg-[var(--otari-bg)] opacity-70",style:{width:`${100-E}%`}})]}):null,t.jsx("div",{role:"slider","aria-label":"Pan the selected window","aria-valuemin":0,"aria-valuemax":U,"aria-valuenow":q,"aria-valuetext":`Window starting at ${$(w[Math.min(q,r-1)]??w[0],l)}`,"aria-disabled":!D,tabIndex:0,className:"absolute bottom-0 z-[1] cursor-grab touch-none rounded bg-[var(--otari-brand)]/10 outline-none hover:bg-[var(--otari-brand)]/20 focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)] active:cursor-grabbing",style:{left:`${I}%`,width:`${Math.max(0,E-I)}%`,height:ve},onKeyDown:te,onPointerDown:e=>{e.stopPropagation(),e.preventDefault(),N.current=!0,h.current={x:e.clientX,sel:[Math.min(d,u),Math.max(d,u)]},e.currentTarget.setPointerCapture(e.pointerId)},onPointerMove:Y,onPointerUp:e=>{e.currentTarget.releasePointerCapture(e.pointerId),h.current=null,b(y.current)},onPointerCancel:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),h.current=null,b(y.current)}}),t.jsx("div",{className:"pointer-events-none absolute inset-0 z-[2]",onKeyDownCapture:Q,children:t.jsx(ne,{"aria-label":"Selected time range",minValue:0,maxValue:r,step:1/ge,value:T,onChange:e=>{N.current=!0,Array.isArray(e)&&e.length===2&&v([e[0],e[1]])},onChangeEnd:e=>{Array.isArray(e)&&e.length===2&&b([e[0],e[1]])},className:"pointer-events-none h-full w-full",children:t.jsxs(se,{className:"pointer-events-none relative h-full w-full",children:[t.jsx(W,{index:0}),t.jsx(W,{index:1})]})})})]})]})]})}function Ce({chips:o,children:m,onClearAll:c}){const[g,j]=p.useState(!1),x=p.useId();return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(M,{size:"sm",variant:"outline",onPress:()=>j(l=>!l),"aria-expanded":g,"aria-controls":x,children:g?"Done":"Add filter"}),o.map(l=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] py-0.5 pl-2.5 pr-1 text-xs text-[var(--otari-brand-dark)]",children:[t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[l.label,":"]}),t.jsx("span",{className:"font-medium",children:l.value}),t.jsx("button",{type:"button",onClick:l.onClear,"aria-label":`Remove ${l.label} filter`,className:"ml-0.5 inline-flex h-4 w-4 items-center justify-center rounded-full text-[var(--otari-muted)] outline-none hover:bg-[var(--otari-line)] hover:text-[var(--otari-ink)] focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)]",children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"h-3 w-3","aria-hidden":"true",children:t.jsx("path",{d:"M6 6l12 12M18 6L6 18",strokeLinecap:"round"})})})]},l.key)),o.length>0&&c?t.jsx(M,{size:"sm",variant:"ghost",onPress:c,children:"Clear all"}):null]}),t.jsx("div",{id:x,className:g?"flex flex-wrap items-end gap-3":"hidden",children:m})]})}export{Pe as A,Ce as F}; diff --git a/src/gateway/static/dashboard/assets/KeysPage-D4g9XrFY.js b/src/gateway/static/dashboard/assets/KeysPage-BBEXGo7q.js similarity index 98% rename from src/gateway/static/dashboard/assets/KeysPage-D4g9XrFY.js rename to src/gateway/static/dashboard/assets/KeysPage-BBEXGo7q.js index ddf0a285f..c58fd6230 100644 --- a/src/gateway/static/dashboard/assets/KeysPage-D4g9XrFY.js +++ b/src/gateway/static/dashboard/assets/KeysPage-BBEXGo7q.js @@ -1,4 +1,4 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{a as J,y as U,z as Q,B as X,P as Z,E as O,w as ee,D as te,u as V,I as se}from"./index-Bi2hajrg.js";import{u as ae,r as ne,B as re}from"./tableSelection-9hV37uhu.js";import{C as ie}from"./ConfirmDialog-ChuHp-Qm.js";import{D as le}from"./DataTable-Bmn_eYSV.js";import{F as A}from"./Field-Dwp6u3t8.js";import{a as F,M as q}from"./ModelScopeControl-DNcVzk1f.js";import{U as oe}from"./UserComboBox-a9wxf8eF.js";import{f as P,B as f,d as D}from"./heroui-BI50yK5B.js";function $(t){if(!t)return"—";const a=new Date(t);return Number.isNaN(a.getTime())?"—":a.toLocaleDateString()}function ce(t){if(!t)return null;const a=new Date(t).getTime();if(Number.isNaN(a))return null;const n=Math.round((a-Date.now())/1e3),r=Math.abs(n),d=[["day",86400],["hour",3600],["minute",60]],o=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[l,x]of d)if(r>=x)return o.format(Math.round(n/x),l);return o.format(n,"second")}function de(t){if(!t.expires_at)return!1;const a=new Date(t.expires_at).getTime();return!Number.isNaN(a)&&aString(r).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}T${n(a.getHours())}:${n(a.getMinutes())}`}const me=t=>(t??"").startsWith("apikey-"),M=t=>t.key_name??t.id,xe=t=>t.id;function K({label:t,value:a,multiline:n=!1,fieldRef:r}){const d=i.useRef(null),o=r??d,[l,x]=i.useState(!1),[g,p]=i.useState(!1),c=async()=>{var m,y,h;(m=o.current)==null||m.focus(),(y=o.current)==null||y.select();try{if((h=navigator.clipboard)!=null&&h.writeText){await navigator.clipboard.writeText(a),x(!0),p(!1),window.setTimeout(()=>x(!1),2e3);return}}catch{}p(!0)},u="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(f,{size:"sm",variant:"outline",onPress:c,children:l?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:o,readOnly:!0,rows:a.split(` +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{a as J,y as U,z as Q,B as X,P as Z,E as O,w as ee,D as te,u as V,I as se}from"./index-MlRogoGm.js";import{u as ae,r as ne,B as re}from"./tableSelection-9hV37uhu.js";import{C as ie}from"./ConfirmDialog-P_P4TNFr.js";import{D as le}from"./DataTable-Bmn_eYSV.js";import{F as A}from"./Field-Dwp6u3t8.js";import{a as F,M as q}from"./ModelScopeControl-Bmks7cWc.js";import{U as oe}from"./UserComboBox-a9wxf8eF.js";import{f as P,B as f,d as D}from"./heroui-BI50yK5B.js";function $(t){if(!t)return"—";const a=new Date(t);return Number.isNaN(a.getTime())?"—":a.toLocaleDateString()}function ce(t){if(!t)return null;const a=new Date(t).getTime();if(Number.isNaN(a))return null;const n=Math.round((a-Date.now())/1e3),r=Math.abs(n),d=[["day",86400],["hour",3600],["minute",60]],o=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[l,x]of d)if(r>=x)return o.format(Math.round(n/x),l);return o.format(n,"second")}function de(t){if(!t.expires_at)return!1;const a=new Date(t.expires_at).getTime();return!Number.isNaN(a)&&aString(r).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}T${n(a.getHours())}:${n(a.getMinutes())}`}const me=t=>(t??"").startsWith("apikey-"),M=t=>t.key_name??t.id,xe=t=>t.id;function K({label:t,value:a,multiline:n=!1,fieldRef:r}){const d=i.useRef(null),o=r??d,[l,x]=i.useState(!1),[g,p]=i.useState(!1),c=async()=>{var m,y,h;(m=o.current)==null||m.focus(),(y=o.current)==null||y.select();try{if((h=navigator.clipboard)!=null&&h.writeText){await navigator.clipboard.writeText(a),x(!0),p(!1),window.setTimeout(()=>x(!1),2e3);return}}catch{}p(!0)},u="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(f,{size:"sm",variant:"outline",onPress:c,children:l?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:o,readOnly:!0,rows:a.split(` `).length,value:a,onFocus:m=>m.currentTarget.select(),className:`${u} resize-none whitespace-pre`}):e.jsx("input",{ref:o,readOnly:!0,value:a,onFocus:m=>m.currentTarget.select(),className:u}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-green-700",children:l?"Copied to clipboard.":""}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function he({title:t,result:a,onClose:n}){const r=i.useRef(null),d=i.useRef(null),o=typeof window<"u"?window.location.origin:"",l=a.key;i.useEffect(()=>{var c,u;(c=d.current)==null||c.focus(),(u=d.current)==null||u.select()},[]);const x=c=>{var h;if(c.key!=="Tab")return;const u=(h=r.current)==null?void 0:h.querySelectorAll('button, input, textarea, a[href], [tabindex]:not([tabindex="-1"])');if(!u||u.length===0)return;const m=u[0],y=u[u.length-1];c.shiftKey&&document.activeElement===m?(c.preventDefault(),y.focus()):!c.shiftKey&&document.activeElement===y&&(c.preventDefault(),m.focus())},g=[`curl ${o}/v1/chat/completions \\`,` -H "Otari-Key: ${l}" \\`,' -H "Content-Type: application/json" \\',` -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'`].join(` `),p=["from openai import OpenAI","",`client = OpenAI(base_url="${o}/v1", api_key="${l}")`,"resp = client.chat.completions.create(",' model="your-model",',' messages=[{"role": "user", "content": "Hello"}],',")","print(resp.choices[0].message.content)"].join(` `);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:x,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(se,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",F(a.allowed_models).text,"."]}),e.jsx(K,{label:"Secret key",value:l,fieldRef:d}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(K,{label:"curl",value:g,multiline:!0}),e.jsx(K,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(f,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function H({trigger:t,message:a,confirmLabel:n,isPending:r,onConfirm:d}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:a}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(f,{size:"sm",variant:"danger",isDisabled:r,onPress:d,children:n}),e.jsx(f,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(f,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:t})}function W({userId:t,users:a}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const r=a.find(l=>l.user_id===n);if(!r)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:d}=F(r.allowed_models),o=r.allowed_models&&r.allowed_models.length>0?r.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:d.toLowerCase()}),o?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:o}),")"]}):null,". This key inherits that, or narrows within it."]})}function Y({checked:t,onChange:a}){return e.jsxs("label",{className:"flex items-start gap-2 rounded-lg border border-[var(--otari-line)] p-3 text-sm",children:[e.jsx("input",{type:"checkbox",checked:t,onChange:n=>a(n.target.checked),className:"mt-0.5 h-4 w-4 accent-[var(--otari-brand)]","aria-label":"Exempt this key from budget"}),e.jsxs("span",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:"Exempt from budget"}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Requests on this key are logged with their cost but never counted toward the owner's budget or spend, and never blocked by it."})]})]})}function fe({onClose:t,onCreated:a}){const n=te(),r=V(),[d,o]=i.useState(""),[l,x]=i.useState(""),[g,p]=i.useState(!1),[c,u]=i.useState(""),[m,y]=i.useState(null),[h,N]=i.useState(!1),[v,I]=i.useState(!0),C=l!==""&&new Date(l).getTime(){if(n.isPending||!v||w)return;const b={key_name:d.trim()||null,user_id:c.trim(),expires_at:l?new Date(l).toISOString():null,allowed_models:m,exclude_from_budget:h};n.mutate(b,{onSuccess:j=>{a(j),t()}})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(A,{label:"Expires (optional)",value:l,onChange:x,type:"datetime-local",description:C?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(oe,{value:c,onChange:u,users:r.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(b=>!b),children:g?"Hide advanced":"Advanced"}),g?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(W,{userId:c,users:r.data??[]}),e.jsx(q,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(b,j)=>{y(b),I(j)}}),e.jsx(Y,{checked:h,onChange:N})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!v||w,onPress:S,children:n.isPending?"Creating…":"Create key"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ge({apiKey:t,onClose:a}){const n=U(),r=V(),[d,o]=i.useState(t.key_name??""),[l,x]=i.useState(ue(t.expires_at)),[g,p]=i.useState(t.allowed_models),[c,u]=i.useState(t.exclude_from_budget),[m,y]=i.useState(!0),h=()=>{n.isPending||!m||n.mutate({id:t.id,body:{key_name:d.trim()||null,expires_at:l?new Date(l).toISOString():null,allowed_models:g,exclude_from_budget:c}},{onSuccess:a})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot"}),e.jsx(A,{label:"Expires",value:l,onChange:x,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(W,{userId:t.user_id,users:r.data??[]}):null,e.jsx(q,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(N,v)=>{p(N),y(v)}}),e.jsx(Y,{checked:c,onChange:u}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!m,onPress:h,children:n.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function pe({apiKey:t}){return t.is_active?de(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function ye({allowed:t}){const{text:a,tone:n}=F(t),r=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",d=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${r}`,title:d,children:a})}function Ae(){const t=J(),a=U(),n=Q(),r=X(),[d,o]=i.useState(!1),[l,x]=i.useState(null),[g,p]=i.useState(null),c=t.data??[],u=t.isLoading,m=c.find(s=>s.id===l)??null,y=!u&&c.length===0&&!d,h=ae(),[N,v]=i.useState(!1),[I,C]=i.useState(void 0),[w,S]=i.useState(!1),b=c.map(s=>s.id),j=ne(h.selectedKeys,b),E=c.filter(s=>j.includes(s.id)),z=i.useCallback((s,k)=>a.mutate({id:s.id,body:{is_active:k}}),[a.mutate]),L=i.useCallback(s=>n.mutate(s.id,{onSuccess:k=>p({title:`New secret for ${M(s)}`,result:k})}),[n.mutate]),R=async(s,k,T)=>{S(!0),C(void 0);try{for(const B of s)await k(B);h.clear(),T==null||T()}catch(B){C(B)}finally{S(!1)}},G=i.useMemo(()=>[{id:"name",header:"Name",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:s.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx(ye,{allowed:s.allowed_models}),s.exclude_from_budget?e.jsx("span",{className:"inline-flex items-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] px-2 py-0.5 text-xs font-medium text-[var(--otari-brand-dark)]",title:"Requests on this key are logged with cost but never counted toward budget",children:"Budget-exempt"}):null]})]})},{id:"status",header:"Status",cell:s=>e.jsx(pe,{apiKey:s})},{id:"owner",header:"Owner",cell:s=>me(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.user_id??"—"})},{id:"key",header:"Key",cell:s=>e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.key_prefix?`${s.key_prefix}…`:"—"})},{id:"created",header:"Created",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:$(s.created_at)})},{id:"last_used",header:"Last used",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:ce(s.last_used_at)??"never"})},{id:"expires",header:"Expires",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.expires_at?new Date(s.expires_at).toLocaleString():void 0,children:s.expires_at?$(s.expires_at):"never"})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:a.isPending,onPress:()=>z(s,!s.is_active),children:s.is_active?"Disable":"Enable"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{o(!1),x(s.id)},children:"Edit"}),e.jsx(H,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:M(s)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>L(s)}),s.is_active?null:e.jsx(H,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:r.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:M(s)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>r.mutate(s.id)})]})}],[a.isPending,n.isPending,r.isPending,r.mutate,z,L]),_=E.filter(s=>!s.is_active);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:d?null:e.jsx(f,{variant:"primary",onPress:()=>{x(null),o(!0)},children:"Create key"})}),e.jsx(O,{error:t.error??a.error??n.error??r.error}),y?e.jsx(ee,{title:"No API keys yet",description:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe.",actionLabel:"Create your first key",onAction:()=>{x(null),o(!0)}}):null,d?e.jsx(fe,{onClose:()=>o(!1),onCreated:s=>p({title:"API key created",result:s})}):null,m?e.jsx(ge,{apiKey:m,onClose:()=>x(null)},m.id):null,j.length>0?e.jsxs(re,{selectedCount:j.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:h.clear,children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{is_active:!1}})),children:"Disable"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{exclude_from_budget:!0}})),children:"Budget-exempt"}),e.jsx(f,{size:"sm",variant:"danger",isDisabled:_.length===0,onPress:()=>v(!0),children:"Delete"})]}):null,y?null:e.jsx(le,{ariaLabel:"API keys",columns:G,rows:c,getRowKey:xe,isLoading:u,emptyContent:"No API keys yet. Create one to authenticate a caller.",selectionMode:"multiple",selectedKeys:h.selectedKeys,onSelectionChange:h.onSelectionChange}),e.jsx(ie,{isOpen:N,onOpenChange:v,heading:"Delete API keys",body:`Permanently delete ${_.length} disabled ${_.length===1?"key":"keys"}? This removes them and unlinks their usage history. Cannot be undone. Active keys in the selection are skipped; disable them first.`,confirmLabel:"Delete permanently",isPending:w,error:I,onConfirm:()=>void R(_,s=>r.mutateAsync(s.id),()=>v(!1))}),g?e.jsx(he,{title:g.title,result:g.result,onClose:()=>{p(null),n.reset()}}):null]})}export{Ae as KeysPage}; diff --git a/src/gateway/static/dashboard/assets/ModelScopeControl-DNcVzk1f.js b/src/gateway/static/dashboard/assets/ModelScopeControl-Bmks7cWc.js similarity index 98% rename from src/gateway/static/dashboard/assets/ModelScopeControl-DNcVzk1f.js rename to src/gateway/static/dashboard/assets/ModelScopeControl-Bmks7cWc.js index 29a3fa63d..f68a33b25 100644 --- a/src/gateway/static/dashboard/assets/ModelScopeControl-DNcVzk1f.js +++ b/src/gateway/static/dashboard/assets/ModelScopeControl-Bmks7cWc.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{T as A,l as $,m as T}from"./index-Bi2hajrg.js";import{C as d,I as P,a as R,b as V}from"./heroui-BI50yK5B.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function W({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=T(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(P,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(R,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function X(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{W as M,X as a}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{T as A,l as $,m as T}from"./index-MlRogoGm.js";import{C as d,I as P,a as R,b as V}from"./heroui-BI50yK5B.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function W({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=T(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(P,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(R,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function X(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{W as M,X as a}; diff --git a/src/gateway/static/dashboard/assets/ModelsPage-r0TNjwml.js b/src/gateway/static/dashboard/assets/ModelsPage-XwbqKUgz.js similarity index 99% rename from src/gateway/static/dashboard/assets/ModelsPage-r0TNjwml.js rename to src/gateway/static/dashboard/assets/ModelsPage-XwbqKUgz.js index dd8bd8b16..b8f6170a2 100644 --- a/src/gateway/static/dashboard/assets/ModelsPage-r0TNjwml.js +++ b/src/gateway/static/dashboard/assets/ModelsPage-XwbqKUgz.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as gt,u as vt,r as c}from"./react-dgEcD0HR.js";import{G as _t,H as bt,l as jt,J as yt,K as je,P as Pt,E as Nt,F as K,I as St,L as ae,M as Re,o as we,N as be,O as Ct,Q as kt,S as E}from"./index-Bi2hajrg.js";import{u as Mt,r as Wt,B as It}from"./tableSelection-9hV37uhu.js";import{D as Tt}from"./DataTable-Bmn_eYSV.js";import{T as Lt,S as $t}from"./TablePagination-8CBn4us4.js";import{B as $,d as se,f as V}from"./heroui-BI50yK5B.js";function Oe(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function At(t,i=Date.now()){const r=new Map;for(const n of t){const l=r.get(n.model_key)??[];l.push(n),r.set(n.model_key,l)}const s=[];for(const n of r.values()){const l=[...n].sort((p,u)=>Date.parse(p.effective_at)-Date.parse(u.effective_at)),m=[...l].reverse().find(p=>Date.parse(p.effective_at)<=i);s.push(m??l[0])}return s.sort((n,l)=>n.model_key.localeCompare(l.model_key))}const Et="otari",De=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],Ot=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Fe={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Dt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],Ft=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Kt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],Bt=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Rt=1440*60*1e3,wt=t=>t.key;function Ke(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function Be(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,l)=>l.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ce(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function z(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function Y(t){return t.trim()===""?null:Number(t)}function ze(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Ve(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(l=>l.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(z))})}function Ye(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function b({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function qe({tiers:t,onChange:i}){const r=(n,l,m)=>{i(t.map(p=>p.id===n?{...p,[l]:m}:p))},s=()=>{const n=t.reduce((l,m)=>Math.max(l,m.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx($,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:l=>r(n.id,"minInputTokens",l.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(b,{value:n.input,onChange:l=>r(n.id,"input",l),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(b,{value:n.output,onChange:l=>r(n.id,"output",l),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(b,{value:n.cacheRead,onChange:l=>r(n.id,"cacheRead",l),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(b,{value:n.cacheWrite,onChange:l=>r(n.id,"cacheWrite",l),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(b,{value:n.cacheWrite1h,onChange:l=>r(n.id,"cacheWrite1h",l),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(l=>l.id!==n.id)),children:"Remove"})]},n.id))]})}function zt({source:t}){return t==="configured"?e.jsx(V,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(V,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function oe({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Vt(){const t=kt();return t.data?t.data.default_pricing?e.jsx(oe,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(oe,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function I({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function le({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Yt({row:t}){const i=je(),r=Re(),[s,n]=c.useState(!1),[l,m]=c.useState(""),[p,u]=c.useState(""),[P,j]=c.useState(""),[k,T]=c.useState(""),[y,h]=c.useState(""),[N,O]=c.useState([]),S=()=>{m(t.inputPrice==null?"":String(t.inputPrice)),u(t.outputPrice==null?"":String(t.outputPrice)),j(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),T(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),h(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),O(ze(t.pricingTiers)),n(!0)},X=ce(l)&&ce(p)&&z(P)&&z(k)&&z(y)&&Ve(N),W=()=>{X&&i.mutate({model_key:t.key,input_price_per_million:Number(l),output_price_per_million:Number(p),cache_read_price_per_million:Y(P),cache_write_price_per_million:Y(k),cache_write_1h_price_per_million:Y(y),pricing_tiers:Ye(N)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(b,{value:l,onChange:m,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(b,{value:p,onChange:u,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(b,{value:P,onChange:j,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(b,{value:k,onChange:T,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(b,{value:y,onChange:h,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(qe,{tiers:N,onChange:O}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:"sm",variant:"primary",isDisabled:i.isPending||!X,onPress:W,children:"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:be(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(I,{label:"Input",value:t.inputPrice==null?"—":`${E(t.inputPrice)} / 1M`}),e.jsx(I,{label:"Output",value:t.outputPrice==null?"—":`${E(t.outputPrice)} / 1M`}),e.jsx(I,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${E(t.cacheReadPrice)} / 1M`}),e.jsx(I,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${E(t.cacheWritePrice)} / 1M`}),e.jsx(I,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${E(t.cacheWrite1hPrice)} / 1M`}),e.jsx(I,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx($,{size:"sm",variant:"outline",onPress:S,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(we,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error)}):null]})]})}function qt({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const l=(i==null?void 0:i.input_modalities)??[],m=(i==null?void 0:i.output_modalities)??[],p=Ot.filter(({key:u})=>i==null?void 0:i[u]);return e.jsx(se,{children:e.jsxs(se.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(V,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(le,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Yt,{row:t},t.key),e.jsx($,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(le,{title:"Specs",children:[e.jsx(I,{label:"Context window",value:ae(t.contextWindow)}),e.jsx(I,{label:"Max output",value:ae((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(I,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(I,{label:"Released",value:Ct(i==null?void 0:i.release_date)}),e.jsx(I,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(le,{title:"Modalities",children:l.length===0&&m.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),l.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),m.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]})]})}),e.jsx(le,{title:"Capabilities",children:p.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(({key:u,label:P})=>e.jsx(V,{size:"sm",color:"default",children:P},u))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Ht=15;function Ut({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}const He="otari.dashboard.modelsSort",_e={col:"model",dir:"asc"},Gt=["model","released","input","output"];function Jt(){if(typeof window>"u")return _e;try{const t=window.localStorage.getItem(He);if(!t)return _e;const i=JSON.parse(t);if(Gt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return _e}function Qt({row:t,onClose:i}){const r=je(),s=Re(),[n,l]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[m,p]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[u,P]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[j,k]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[T,y]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[h,N]=c.useState(ze(t.pricingTiers)),O=ce(n)&&ce(m)&&z(u)&&z(j)&&z(T)&&Ve(h),S=()=>{O&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(m),cache_read_price_per_million:Y(u),cache_write_price_per_million:Y(j),cache_write_1h_price_per_million:Y(T),pricing_tiers:Ye(h)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(b,{value:n,onChange:l,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(b,{value:m,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(b,{value:u,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(b,{value:j,onChange:k,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(b,{value:T,onChange:y,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx($,{size:"sm",variant:"primary",isDisabled:r.isPending||!O,onPress:S,children:r.isPending?"Saving…":"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(we,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error??s.error)}):null]}),e.jsx(qe,{tiers:h,onChange:N})]})}function Xt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:l}){const m=(p,u)=>e.jsx("button",{type:"button","aria-label":`Edit ${u} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:P=>{P.stopPropagation(),l()},children:p==null?"—":E(p)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[m(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),m(i,n)]})}function Zt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${E(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${E(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${E(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function ei({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,l)=>n.min_input_tokens-l.min_input_tokens).map(n=>ae(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function ti({rows:t,isLoading:i,empty:r,sortDescriptor:s,onSortChange:n,selectedKey:l,onSelect:m,onEditPricing:p,comparisonContextTokens:u,selectedKeys:P,onSelectionChange:j}){const k=c.useMemo(()=>{const y=u==null?"Base":`at ${ae(u)}`;return[{id:"model",header:"Model",isRowHeader:!0,allowsSorting:!0,cell:h=>e.jsxs("span",{className:"font-medium break-all",children:[h.model,e.jsx("span",{className:"sr-only",children:h.key})]})},{id:"provider",header:"Provider",cell:h=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:h.provider})},{id:"input",header:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[`${y} in / out $ / 1M`,e.jsx(Vt,{})]}),align:"end",allowsSorting:!0,cell:h=>{const N=Be(h,u);return e.jsx(Xt,{primary:N.inputPrice,secondary:N.outputPrice,rowKey:h.key,primaryLabel:"input",secondaryLabel:"output",onEdit:()=>p(h.key)})}},{id:"caching",header:`Caching ${u==null?"policy":y}`,align:"end",cell:h=>e.jsx(Zt,{rates:Be(h,u),rowKey:h.key,onEdit:()=>p(h.key)})},{id:"policy",header:"Pricing policy",align:"end",cell:h=>e.jsx(ei,{row:h,onEdit:()=>p(h.key)})}]},[u,p]),T=c.useCallback(y=>y.key===l?"bg-[var(--otari-brand-tint)]":void 0,[l]);return e.jsx(Tt,{ariaLabel:"Models",columns:k,rows:t,getRowKey:wt,isLoading:i,emptyContent:r,selectionMode:"multiple",selectedKeys:P,onSelectionChange:j,sortDescriptor:s,onSortChange:n,onRowAction:m,rowClassName:T})}function ii({providers:t}){if(t.length===0)return null;const i=t.filter(l=>!l.discovery_unsupported),r=t.filter(l=>l.discovery_unsupported),s=l=>l.map(m=>m.provider).join(", "),n=l=>l.length===1;return e.jsxs(St,{tone:"warning",children:[i.length>0?e.jsxs("span",{className:"block",children:["Could not list ",s(i),". Check ",n(i)?"that provider's":"those providers'"," ","credentials in config.yml; ",n(i)?"its":"their"," models are missing from the list below."]}):null,r.length>0?e.jsxs("span",{className:"block",children:[s(r)," ",n(r)?"does":"do"," not offer model discovery, so"," ",n(r)?"its":"their"," models are missing from the list below."," ",n(r)?"The provider":"They"," may still serve requests; declare the model ids"," ",n(r)?"it serves":"they serve"," under the ",e.jsx("code",{children:"models:"})," key in config.yml to list them here."]}):null]})}function pi(){var Te,Le,$e;const t=gt(),[i]=vt(),r=_t(),s=bt(),n=jt(),l=yt(),m=je(),[p,u]=c.useState(""),[P,j]=c.useState(0),[k,T]=c.useState(Ht),[y,h]=c.useState(null),[N,O]=c.useState(null),[S,X]=c.useState(Jt),W=Mt(),[Ue,ue]=c.useState(!1),[Ge,ye]=c.useState(!1),[Je,Pe]=c.useState(void 0);c.useEffect(()=>{try{window.localStorage.setItem(He,JSON.stringify(S))}catch{}},[S]);const[D,Ne]=c.useState(i.get("provider")||"all"),[B,Qe]=c.useState("all"),[q,Xe]=c.useState("all"),[H,Ze]=c.useState("all"),[de,et]=c.useState("0"),[Z,tt]=c.useState(""),[ee,it]=c.useState("all"),[pe,rt]=c.useState(""),F=((Te=l.data)==null?void 0:Te.models)??{},nt=((Le=l.data)==null?void 0:Le.available)??!1,Se=c.useMemo(()=>{var a;return new Set((((a=n.data)==null?void 0:a.providers)??[]).flatMap(x=>x.models.map(o=>o.key)))},[n.data]),lt=a=>{u(a),j(0)},R=a=>x=>{a(x),j(0)},te=c.useMemo(()=>{var M,v,_,A,L,w,Ae;const a=new Map(At(s.data??[]).map(d=>[d.model_key,d])),x=[],o=new Set,g=(d,ve,Ee,f)=>{if(o.has(d))return;o.add(d);const C=a.get(d);x.push({key:d,model:Ke(ve,Ee),provider:Ee,isDiscovered:Se.has(d),contextWindow:(f==null?void 0:f.contextWindow)??null,inputPrice:C?C.input_price_per_million:(f==null?void 0:f.inputPrice)??null,outputPrice:C?C.output_price_per_million:(f==null?void 0:f.outputPrice)??null,cacheReadPrice:C?C.cache_read_price_per_million:(f==null?void 0:f.cacheReadPrice)??null,cacheWritePrice:C?C.cache_write_price_per_million:(f==null?void 0:f.cacheWritePrice)??null,cacheWrite1hPrice:C?C.cache_write_1h_price_per_million??null:(f==null?void 0:f.cacheWrite1hPrice)??null,pricingTiers:C?C.pricing_tiers??[]:(f==null?void 0:f.pricingTiers)??[],source:C?"configured":(f==null?void 0:f.source)??"none"})};for(const d of((M=r.data)==null?void 0:M.data)??[]){if(d.owned_by===Et)continue;const ve=d.pricing_source==="default"?"default":d.pricing?"configured":"none";g(d.id,d.id,d.owned_by||Oe(d.id),{key:d.id,model:d.id,provider:d.owned_by,contextWindow:d.context_window,inputPrice:((v=d.pricing)==null?void 0:v.input_price_per_million)??null,outputPrice:((_=d.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:((A=d.pricing)==null?void 0:A.cache_read_price_per_million)??null,cacheWritePrice:((L=d.pricing)==null?void 0:L.cache_write_price_per_million)??null,cacheWrite1hPrice:((w=d.pricing)==null?void 0:w.cache_write_1h_price_per_million)??null,pricingTiers:((Ae=d.pricing)==null?void 0:Ae.pricing_tiers)??[],source:ve})}for(const d of a.keys())g(d,d,Oe(d));return x},[r.data,s.data,Se]),Ce=c.useMemo(()=>new Map(te.map(a=>[a.key,a])),[te]),ie=c.useMemo(()=>{var o,g,M;const a=te.map(v=>{var _,A;return{...v,contextWindow:v.contextWindow??((_=F[v.key])==null?void 0:_.context_window)??null,releaseDate:((A=F[v.key])==null?void 0:A.release_date)??null}}),x=new Set(a.map(v=>v.key));for(const v of((o=n.data)==null?void 0:o.providers)??[])for(const _ of v.models)x.has(_.key)||(x.add(_.key),a.push({key:_.key,model:Ke(_.key,v.provider),provider:v.provider,isDiscovered:!0,contextWindow:((g=F[_.key])==null?void 0:g.context_window)??null,releaseDate:((M=F[_.key])==null?void 0:M.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return a},[te,n.data,F]),at=((($e=n.data)==null?void 0:$e.providers)??[]).filter(a=>!a.ok),re=c.useMemo(()=>{const a=Array.from(new Set(ie.map(x=>x.provider))).sort((x,o)=>x.localeCompare(o));return[{value:"all",label:"All providers"},...a.map(x=>({value:x,label:x}))]},[ie]);c.useEffect(()=>{D==="all"||re.length<=1||re.some(a=>a.value===D)||Ne("all")},[re,D]);const U=p.trim().toLowerCase(),he=Number(de)||0,me=Z===""?Number.POSITIVE_INFINITY:Number(Z),st=pe===""?null:Number(pe),xe=ee==="all"?null:Date.now()-Number(ee)*Rt,G=c.useMemo(()=>{const a=o=>{if(U&&!o.key.toLowerCase().includes(U)&&!o.provider.toLowerCase().includes(U)||D!=="all"&&o.provider!==D||B==="configured"&&o.source!=="configured"||B==="default"&&o.source!=="default"||B==="priced"&&o.inputPrice==null||B==="unpriced"&&o.inputPrice!=null||q==="discovered"&&!o.isDiscovered||q==="custom"&&o.isDiscovered)return!1;if(H!=="all"){const g=De.find(v=>v.value===H),M=F[o.key];if(!g||!M||!g.test(M))return!1}if(he>0&&(o.contextWindow==null||o.contextWindowme))return!1;if(xe!=null){const g=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(g)||g{const M=S.dir==="asc"?1:-1;if(S.col==="model")return o.model.localeCompare(g.model)*M;if(S.col==="released"){const L=o.releaseDate??null,w=g.releaseDate??null;return!L&&!w?o.model.localeCompare(g.model):L?w?(Lw?1:0)*M||o.model.localeCompare(g.model):-1:1}const v=L=>S.col==="input"?L.inputPrice:L.outputPrice,_=v(o),A=v(g);return _==null&&A==null?o.model.localeCompare(g.model):_==null?1:A==null?-1:(_-A)*M||o.model.localeCompare(g.model)};return ie.filter(a).sort(x)},[ie,U,D,B,q,H,he,me,xe,F,S]),J=G.length,ct=Math.max(1,Math.ceil(J/k)),ke=Math.min(P,ct-1),Me=ke*k,fe=G.slice(Me,Me+k),ot={column:S.col,direction:S.dir==="asc"?"ascending":"descending"},ut=a=>{X({col:String(a.column),dir:a.direction==="ascending"?"asc":"desc"}),j(0)},dt=c.useCallback(a=>h(x=>x===a?null:a),[]),ge=fe.map(a=>a.key),Q=Wt(W.selectedKeys,ge),pt=ge.length>0&&Q.length===ge.length&&J>Q.length,ht=W.allMatching?G.map(a=>a.key):Q,We=W.allMatching?J:Q.length,Ie=y?G.find(a=>a.key===y)??Ce.get(y)??null:null,mt=async a=>{ye(!0),Pe(void 0);try{for(const x of ht)await m.mutateAsync({model_key:x,input_price_per_million:a.input_price_per_million,output_price_per_million:a.output_price_per_million,cache_read_price_per_million:a.cache_read_price_per_million??null,cache_write_price_per_million:a.cache_write_price_per_million??null,cache_write_1h_price_per_million:null,pricing_tiers:[]});W.clear(),ue(!1)}catch(x){Pe(x)}finally{ye(!1)}},xt=r.isLoading||s.isLoading||n.isLoading,ft=U!==""||D!=="all"||B!=="all"||q!=="all"||H!=="all"||de!=="0"||Z!==""||ee!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",ne=N?G.find(a=>a.key===N)??Ce.get(N)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Pt,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(Nt,{error:r.error??s.error??n.error??l.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${ne?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ut,{value:p,onChange:lt,placeholder:"Search models…"}),e.jsx(K,{ariaLabel:"Filter by provider",value:D,onChange:R(Ne),options:re}),e.jsx(K,{ariaLabel:"Filter by pricing",value:B,onChange:R(Qe),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(K,{ariaLabel:"Filter by source",value:q,onChange:R(Xe),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(K,{ariaLabel:"Filter by capability",value:H,onChange:R(Ze),options:[{value:"all",label:"Any capability"},...De.map(a=>({value:a.value,label:a.label}))]}),e.jsx(K,{ariaLabel:"Minimum context window",value:de,onChange:R(et),options:Dt}),e.jsx(K,{ariaLabel:"Maximum input price",value:Z,onChange:R(tt),options:Ft}),e.jsx(K,{ariaLabel:"Compare prices at context",value:pe,onChange:rt,options:Kt}),e.jsx(K,{ariaLabel:"Filter by release date",value:ee,onChange:R(it),options:Bt})]}),e.jsx(ii,{providers:at}),Q.length>0?e.jsx(It,{selectedCount:We,allMatching:W.allMatching,matchingTotal:J,canSelectAllMatching:pt,onSelectAllMatching:W.enableAllMatching,onClear:W.clear,children:e.jsx($,{size:"sm",variant:"primary",onPress:()=>ue(!0),children:"Set pricing"})}):null,e.jsx(ti,{rows:fe,isLoading:xt,empty:ft,sortDescriptor:ot,onSortChange:ut,selectedKey:N,onSelect:O,onEditPricing:dt,comparisonContextTokens:st,selectedKeys:W.selectedKeys,onSelectionChange:W.onSelectionChange}),Ie?e.jsx(se,{children:e.jsxs(se.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Edit pricing"}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>h(null),children:"Close"})]}),e.jsx(Qt,{row:Ie,onClose:()=>h(null)})]})}):null,e.jsx(Lt,{page:ke,pageSize:k,total:J,rowsOnPage:fe.length,onPageChange:j,onPageSizeChange:a=>{T(a),j(0)},pageSizeOptions:[15,25,50]})]}),ne?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(qt,{row:ne,metadata:F[ne.key],metadataAvailable:nt,onMakeAlias:a=>t(`/aliases?target=${encodeURIComponent(a)}`),onClose:()=>O(null)})}):null]}),e.jsx($t,{isOpen:Ue,onOpenChange:ue,targetCount:We,isPending:Ge,error:Je,onSubmit:mt,title:"Set pricing",description:a=>`Apply these per-1M rates to ${a.toLocaleString()} selected ${a===1?"model":"models"}. This replaces each model's price; pricing tiers and the 1h cache rate are cleared. Edit a single model for tiers.`})]})}export{pi as ModelsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as gt,u as vt,r as c}from"./react-dgEcD0HR.js";import{G as _t,H as bt,l as jt,J as yt,K as je,P as Pt,E as Nt,F as K,I as St,L as ae,M as Re,o as we,N as be,O as Ct,Q as kt,S as E}from"./index-MlRogoGm.js";import{u as Mt,r as Wt,B as It}from"./tableSelection-9hV37uhu.js";import{D as Tt}from"./DataTable-Bmn_eYSV.js";import{T as Lt,S as $t}from"./TablePagination-BHTN5PVb.js";import{B as $,d as se,f as V}from"./heroui-BI50yK5B.js";function Oe(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function At(t,i=Date.now()){const r=new Map;for(const n of t){const l=r.get(n.model_key)??[];l.push(n),r.set(n.model_key,l)}const s=[];for(const n of r.values()){const l=[...n].sort((p,u)=>Date.parse(p.effective_at)-Date.parse(u.effective_at)),m=[...l].reverse().find(p=>Date.parse(p.effective_at)<=i);s.push(m??l[0])}return s.sort((n,l)=>n.model_key.localeCompare(l.model_key))}const Et="otari",De=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],Ot=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Fe={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Dt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],Ft=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Kt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],Bt=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Rt=1440*60*1e3,wt=t=>t.key;function Ke(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function Be(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,l)=>l.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ce(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function z(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function Y(t){return t.trim()===""?null:Number(t)}function ze(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Ve(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(l=>l.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(z))})}function Ye(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function b({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function qe({tiers:t,onChange:i}){const r=(n,l,m)=>{i(t.map(p=>p.id===n?{...p,[l]:m}:p))},s=()=>{const n=t.reduce((l,m)=>Math.max(l,m.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx($,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:l=>r(n.id,"minInputTokens",l.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(b,{value:n.input,onChange:l=>r(n.id,"input",l),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(b,{value:n.output,onChange:l=>r(n.id,"output",l),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(b,{value:n.cacheRead,onChange:l=>r(n.id,"cacheRead",l),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(b,{value:n.cacheWrite,onChange:l=>r(n.id,"cacheWrite",l),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(b,{value:n.cacheWrite1h,onChange:l=>r(n.id,"cacheWrite1h",l),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(l=>l.id!==n.id)),children:"Remove"})]},n.id))]})}function zt({source:t}){return t==="configured"?e.jsx(V,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(V,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function oe({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Vt(){const t=kt();return t.data?t.data.default_pricing?e.jsx(oe,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(oe,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function I({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function le({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Yt({row:t}){const i=je(),r=Re(),[s,n]=c.useState(!1),[l,m]=c.useState(""),[p,u]=c.useState(""),[P,j]=c.useState(""),[k,T]=c.useState(""),[y,h]=c.useState(""),[N,O]=c.useState([]),S=()=>{m(t.inputPrice==null?"":String(t.inputPrice)),u(t.outputPrice==null?"":String(t.outputPrice)),j(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),T(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),h(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),O(ze(t.pricingTiers)),n(!0)},X=ce(l)&&ce(p)&&z(P)&&z(k)&&z(y)&&Ve(N),W=()=>{X&&i.mutate({model_key:t.key,input_price_per_million:Number(l),output_price_per_million:Number(p),cache_read_price_per_million:Y(P),cache_write_price_per_million:Y(k),cache_write_1h_price_per_million:Y(y),pricing_tiers:Ye(N)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(b,{value:l,onChange:m,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(b,{value:p,onChange:u,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(b,{value:P,onChange:j,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(b,{value:k,onChange:T,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(b,{value:y,onChange:h,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(qe,{tiers:N,onChange:O}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:"sm",variant:"primary",isDisabled:i.isPending||!X,onPress:W,children:"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:be(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(I,{label:"Input",value:t.inputPrice==null?"—":`${E(t.inputPrice)} / 1M`}),e.jsx(I,{label:"Output",value:t.outputPrice==null?"—":`${E(t.outputPrice)} / 1M`}),e.jsx(I,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${E(t.cacheReadPrice)} / 1M`}),e.jsx(I,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${E(t.cacheWritePrice)} / 1M`}),e.jsx(I,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${E(t.cacheWrite1hPrice)} / 1M`}),e.jsx(I,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx($,{size:"sm",variant:"outline",onPress:S,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(we,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error)}):null]})]})}function qt({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const l=(i==null?void 0:i.input_modalities)??[],m=(i==null?void 0:i.output_modalities)??[],p=Ot.filter(({key:u})=>i==null?void 0:i[u]);return e.jsx(se,{children:e.jsxs(se.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(V,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(le,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Yt,{row:t},t.key),e.jsx($,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(le,{title:"Specs",children:[e.jsx(I,{label:"Context window",value:ae(t.contextWindow)}),e.jsx(I,{label:"Max output",value:ae((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(I,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(I,{label:"Released",value:Ct(i==null?void 0:i.release_date)}),e.jsx(I,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(le,{title:"Modalities",children:l.length===0&&m.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),l.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),m.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]})]})}),e.jsx(le,{title:"Capabilities",children:p.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(({key:u,label:P})=>e.jsx(V,{size:"sm",color:"default",children:P},u))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Ht=15;function Ut({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}const He="otari.dashboard.modelsSort",_e={col:"model",dir:"asc"},Gt=["model","released","input","output"];function Jt(){if(typeof window>"u")return _e;try{const t=window.localStorage.getItem(He);if(!t)return _e;const i=JSON.parse(t);if(Gt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return _e}function Qt({row:t,onClose:i}){const r=je(),s=Re(),[n,l]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[m,p]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[u,P]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[j,k]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[T,y]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[h,N]=c.useState(ze(t.pricingTiers)),O=ce(n)&&ce(m)&&z(u)&&z(j)&&z(T)&&Ve(h),S=()=>{O&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(m),cache_read_price_per_million:Y(u),cache_write_price_per_million:Y(j),cache_write_1h_price_per_million:Y(T),pricing_tiers:Ye(h)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(b,{value:n,onChange:l,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(b,{value:m,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(b,{value:u,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(b,{value:j,onChange:k,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(b,{value:T,onChange:y,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx($,{size:"sm",variant:"primary",isDisabled:r.isPending||!O,onPress:S,children:r.isPending?"Saving…":"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(we,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error??s.error)}):null]}),e.jsx(qe,{tiers:h,onChange:N})]})}function Xt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:l}){const m=(p,u)=>e.jsx("button",{type:"button","aria-label":`Edit ${u} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:P=>{P.stopPropagation(),l()},children:p==null?"—":E(p)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[m(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),m(i,n)]})}function Zt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${E(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${E(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${E(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function ei({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,l)=>n.min_input_tokens-l.min_input_tokens).map(n=>ae(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function ti({rows:t,isLoading:i,empty:r,sortDescriptor:s,onSortChange:n,selectedKey:l,onSelect:m,onEditPricing:p,comparisonContextTokens:u,selectedKeys:P,onSelectionChange:j}){const k=c.useMemo(()=>{const y=u==null?"Base":`at ${ae(u)}`;return[{id:"model",header:"Model",isRowHeader:!0,allowsSorting:!0,cell:h=>e.jsxs("span",{className:"font-medium break-all",children:[h.model,e.jsx("span",{className:"sr-only",children:h.key})]})},{id:"provider",header:"Provider",cell:h=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:h.provider})},{id:"input",header:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[`${y} in / out $ / 1M`,e.jsx(Vt,{})]}),align:"end",allowsSorting:!0,cell:h=>{const N=Be(h,u);return e.jsx(Xt,{primary:N.inputPrice,secondary:N.outputPrice,rowKey:h.key,primaryLabel:"input",secondaryLabel:"output",onEdit:()=>p(h.key)})}},{id:"caching",header:`Caching ${u==null?"policy":y}`,align:"end",cell:h=>e.jsx(Zt,{rates:Be(h,u),rowKey:h.key,onEdit:()=>p(h.key)})},{id:"policy",header:"Pricing policy",align:"end",cell:h=>e.jsx(ei,{row:h,onEdit:()=>p(h.key)})}]},[u,p]),T=c.useCallback(y=>y.key===l?"bg-[var(--otari-brand-tint)]":void 0,[l]);return e.jsx(Tt,{ariaLabel:"Models",columns:k,rows:t,getRowKey:wt,isLoading:i,emptyContent:r,selectionMode:"multiple",selectedKeys:P,onSelectionChange:j,sortDescriptor:s,onSortChange:n,onRowAction:m,rowClassName:T})}function ii({providers:t}){if(t.length===0)return null;const i=t.filter(l=>!l.discovery_unsupported),r=t.filter(l=>l.discovery_unsupported),s=l=>l.map(m=>m.provider).join(", "),n=l=>l.length===1;return e.jsxs(St,{tone:"warning",children:[i.length>0?e.jsxs("span",{className:"block",children:["Could not list ",s(i),". Check ",n(i)?"that provider's":"those providers'"," ","credentials in config.yml; ",n(i)?"its":"their"," models are missing from the list below."]}):null,r.length>0?e.jsxs("span",{className:"block",children:[s(r)," ",n(r)?"does":"do"," not offer model discovery, so"," ",n(r)?"its":"their"," models are missing from the list below."," ",n(r)?"The provider":"They"," may still serve requests; declare the model ids"," ",n(r)?"it serves":"they serve"," under the ",e.jsx("code",{children:"models:"})," key in config.yml to list them here."]}):null]})}function pi(){var Te,Le,$e;const t=gt(),[i]=vt(),r=_t(),s=bt(),n=jt(),l=yt(),m=je(),[p,u]=c.useState(""),[P,j]=c.useState(0),[k,T]=c.useState(Ht),[y,h]=c.useState(null),[N,O]=c.useState(null),[S,X]=c.useState(Jt),W=Mt(),[Ue,ue]=c.useState(!1),[Ge,ye]=c.useState(!1),[Je,Pe]=c.useState(void 0);c.useEffect(()=>{try{window.localStorage.setItem(He,JSON.stringify(S))}catch{}},[S]);const[D,Ne]=c.useState(i.get("provider")||"all"),[B,Qe]=c.useState("all"),[q,Xe]=c.useState("all"),[H,Ze]=c.useState("all"),[de,et]=c.useState("0"),[Z,tt]=c.useState(""),[ee,it]=c.useState("all"),[pe,rt]=c.useState(""),F=((Te=l.data)==null?void 0:Te.models)??{},nt=((Le=l.data)==null?void 0:Le.available)??!1,Se=c.useMemo(()=>{var a;return new Set((((a=n.data)==null?void 0:a.providers)??[]).flatMap(x=>x.models.map(o=>o.key)))},[n.data]),lt=a=>{u(a),j(0)},R=a=>x=>{a(x),j(0)},te=c.useMemo(()=>{var M,v,_,A,L,w,Ae;const a=new Map(At(s.data??[]).map(d=>[d.model_key,d])),x=[],o=new Set,g=(d,ve,Ee,f)=>{if(o.has(d))return;o.add(d);const C=a.get(d);x.push({key:d,model:Ke(ve,Ee),provider:Ee,isDiscovered:Se.has(d),contextWindow:(f==null?void 0:f.contextWindow)??null,inputPrice:C?C.input_price_per_million:(f==null?void 0:f.inputPrice)??null,outputPrice:C?C.output_price_per_million:(f==null?void 0:f.outputPrice)??null,cacheReadPrice:C?C.cache_read_price_per_million:(f==null?void 0:f.cacheReadPrice)??null,cacheWritePrice:C?C.cache_write_price_per_million:(f==null?void 0:f.cacheWritePrice)??null,cacheWrite1hPrice:C?C.cache_write_1h_price_per_million??null:(f==null?void 0:f.cacheWrite1hPrice)??null,pricingTiers:C?C.pricing_tiers??[]:(f==null?void 0:f.pricingTiers)??[],source:C?"configured":(f==null?void 0:f.source)??"none"})};for(const d of((M=r.data)==null?void 0:M.data)??[]){if(d.owned_by===Et)continue;const ve=d.pricing_source==="default"?"default":d.pricing?"configured":"none";g(d.id,d.id,d.owned_by||Oe(d.id),{key:d.id,model:d.id,provider:d.owned_by,contextWindow:d.context_window,inputPrice:((v=d.pricing)==null?void 0:v.input_price_per_million)??null,outputPrice:((_=d.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:((A=d.pricing)==null?void 0:A.cache_read_price_per_million)??null,cacheWritePrice:((L=d.pricing)==null?void 0:L.cache_write_price_per_million)??null,cacheWrite1hPrice:((w=d.pricing)==null?void 0:w.cache_write_1h_price_per_million)??null,pricingTiers:((Ae=d.pricing)==null?void 0:Ae.pricing_tiers)??[],source:ve})}for(const d of a.keys())g(d,d,Oe(d));return x},[r.data,s.data,Se]),Ce=c.useMemo(()=>new Map(te.map(a=>[a.key,a])),[te]),ie=c.useMemo(()=>{var o,g,M;const a=te.map(v=>{var _,A;return{...v,contextWindow:v.contextWindow??((_=F[v.key])==null?void 0:_.context_window)??null,releaseDate:((A=F[v.key])==null?void 0:A.release_date)??null}}),x=new Set(a.map(v=>v.key));for(const v of((o=n.data)==null?void 0:o.providers)??[])for(const _ of v.models)x.has(_.key)||(x.add(_.key),a.push({key:_.key,model:Ke(_.key,v.provider),provider:v.provider,isDiscovered:!0,contextWindow:((g=F[_.key])==null?void 0:g.context_window)??null,releaseDate:((M=F[_.key])==null?void 0:M.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return a},[te,n.data,F]),at=((($e=n.data)==null?void 0:$e.providers)??[]).filter(a=>!a.ok),re=c.useMemo(()=>{const a=Array.from(new Set(ie.map(x=>x.provider))).sort((x,o)=>x.localeCompare(o));return[{value:"all",label:"All providers"},...a.map(x=>({value:x,label:x}))]},[ie]);c.useEffect(()=>{D==="all"||re.length<=1||re.some(a=>a.value===D)||Ne("all")},[re,D]);const U=p.trim().toLowerCase(),he=Number(de)||0,me=Z===""?Number.POSITIVE_INFINITY:Number(Z),st=pe===""?null:Number(pe),xe=ee==="all"?null:Date.now()-Number(ee)*Rt,G=c.useMemo(()=>{const a=o=>{if(U&&!o.key.toLowerCase().includes(U)&&!o.provider.toLowerCase().includes(U)||D!=="all"&&o.provider!==D||B==="configured"&&o.source!=="configured"||B==="default"&&o.source!=="default"||B==="priced"&&o.inputPrice==null||B==="unpriced"&&o.inputPrice!=null||q==="discovered"&&!o.isDiscovered||q==="custom"&&o.isDiscovered)return!1;if(H!=="all"){const g=De.find(v=>v.value===H),M=F[o.key];if(!g||!M||!g.test(M))return!1}if(he>0&&(o.contextWindow==null||o.contextWindowme))return!1;if(xe!=null){const g=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(g)||g{const M=S.dir==="asc"?1:-1;if(S.col==="model")return o.model.localeCompare(g.model)*M;if(S.col==="released"){const L=o.releaseDate??null,w=g.releaseDate??null;return!L&&!w?o.model.localeCompare(g.model):L?w?(Lw?1:0)*M||o.model.localeCompare(g.model):-1:1}const v=L=>S.col==="input"?L.inputPrice:L.outputPrice,_=v(o),A=v(g);return _==null&&A==null?o.model.localeCompare(g.model):_==null?1:A==null?-1:(_-A)*M||o.model.localeCompare(g.model)};return ie.filter(a).sort(x)},[ie,U,D,B,q,H,he,me,xe,F,S]),J=G.length,ct=Math.max(1,Math.ceil(J/k)),ke=Math.min(P,ct-1),Me=ke*k,fe=G.slice(Me,Me+k),ot={column:S.col,direction:S.dir==="asc"?"ascending":"descending"},ut=a=>{X({col:String(a.column),dir:a.direction==="ascending"?"asc":"desc"}),j(0)},dt=c.useCallback(a=>h(x=>x===a?null:a),[]),ge=fe.map(a=>a.key),Q=Wt(W.selectedKeys,ge),pt=ge.length>0&&Q.length===ge.length&&J>Q.length,ht=W.allMatching?G.map(a=>a.key):Q,We=W.allMatching?J:Q.length,Ie=y?G.find(a=>a.key===y)??Ce.get(y)??null:null,mt=async a=>{ye(!0),Pe(void 0);try{for(const x of ht)await m.mutateAsync({model_key:x,input_price_per_million:a.input_price_per_million,output_price_per_million:a.output_price_per_million,cache_read_price_per_million:a.cache_read_price_per_million??null,cache_write_price_per_million:a.cache_write_price_per_million??null,cache_write_1h_price_per_million:null,pricing_tiers:[]});W.clear(),ue(!1)}catch(x){Pe(x)}finally{ye(!1)}},xt=r.isLoading||s.isLoading||n.isLoading,ft=U!==""||D!=="all"||B!=="all"||q!=="all"||H!=="all"||de!=="0"||Z!==""||ee!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",ne=N?G.find(a=>a.key===N)??Ce.get(N)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Pt,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(Nt,{error:r.error??s.error??n.error??l.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${ne?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ut,{value:p,onChange:lt,placeholder:"Search models…"}),e.jsx(K,{ariaLabel:"Filter by provider",value:D,onChange:R(Ne),options:re}),e.jsx(K,{ariaLabel:"Filter by pricing",value:B,onChange:R(Qe),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(K,{ariaLabel:"Filter by source",value:q,onChange:R(Xe),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(K,{ariaLabel:"Filter by capability",value:H,onChange:R(Ze),options:[{value:"all",label:"Any capability"},...De.map(a=>({value:a.value,label:a.label}))]}),e.jsx(K,{ariaLabel:"Minimum context window",value:de,onChange:R(et),options:Dt}),e.jsx(K,{ariaLabel:"Maximum input price",value:Z,onChange:R(tt),options:Ft}),e.jsx(K,{ariaLabel:"Compare prices at context",value:pe,onChange:rt,options:Kt}),e.jsx(K,{ariaLabel:"Filter by release date",value:ee,onChange:R(it),options:Bt})]}),e.jsx(ii,{providers:at}),Q.length>0?e.jsx(It,{selectedCount:We,allMatching:W.allMatching,matchingTotal:J,canSelectAllMatching:pt,onSelectAllMatching:W.enableAllMatching,onClear:W.clear,children:e.jsx($,{size:"sm",variant:"primary",onPress:()=>ue(!0),children:"Set pricing"})}):null,e.jsx(ti,{rows:fe,isLoading:xt,empty:ft,sortDescriptor:ot,onSortChange:ut,selectedKey:N,onSelect:O,onEditPricing:dt,comparisonContextTokens:st,selectedKeys:W.selectedKeys,onSelectionChange:W.onSelectionChange}),Ie?e.jsx(se,{children:e.jsxs(se.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Edit pricing"}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>h(null),children:"Close"})]}),e.jsx(Qt,{row:Ie,onClose:()=>h(null)})]})}):null,e.jsx(Lt,{page:ke,pageSize:k,total:J,rowsOnPage:fe.length,onPageChange:j,onPageSizeChange:a=>{T(a),j(0)},pageSizeOptions:[15,25,50]})]}),ne?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(qt,{row:ne,metadata:F[ne.key],metadataAvailable:nt,onMakeAlias:a=>t(`/aliases?target=${encodeURIComponent(a)}`),onClose:()=>O(null)})}):null]}),e.jsx($t,{isOpen:Ue,onOpenChange:ue,targetCount:We,isPending:Ge,error:Je,onSubmit:mt,title:"Set pricing",description:a=>`Apply these per-1M rates to ${a.toLocaleString()} selected ${a===1?"model":"models"}. This replaces each model's price; pricing tiers and the 1h cache rate are cleared. Edit a single model for tiers.`})]})}export{pi as ModelsPage}; diff --git a/src/gateway/static/dashboard/assets/OverviewPage-WmIAewmo.js b/src/gateway/static/dashboard/assets/OverviewPage-XfWqfHJ2.js similarity index 99% rename from src/gateway/static/dashboard/assets/OverviewPage-WmIAewmo.js rename to src/gateway/static/dashboard/assets/OverviewPage-XfWqfHJ2.js index 33e85108c..e7c7ac25d 100644 --- a/src/gateway/static/dashboard/assets/OverviewPage-WmIAewmo.js +++ b/src/gateway/static/dashboard/assets/OverviewPage-XfWqfHJ2.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as y,i as st,N as I}from"./react-dgEcD0HR.js";import{T as at,U as nt,d as S,V as ot,q as it,a as lt,u as dt,b as ct,W as w,P as ut,R as mt,E as Y,X as b,Z as _,_ as N,$ as R,a0 as D,a1 as vt}from"./index-Bi2hajrg.js";import{S as H}from"./charts-DIsd9m--.js";import{D as ht}from"./DataTable-Bmn_eYSV.js";import{d as B,B as xt}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function M(e){return e==="neutral"?void 0:e}const ft=.02,pt=.1;function W(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,s=n>=pt?"alert":n>=ft?"warn":"ok";return{rate:n,status:s}}function gt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy+e.degraded===0?"alert":"warn"}const bt=.8;function yt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(o=>o.max_budget!==null&&o.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let s=0,l=0,r,m=-1;for(const o of n){const a=o.max_budget*o.user_count,i=a>0?o.total_spend/a:0;i>=1?s+=1:i>=bt&&(l+=1),i>m&&(m=i,r={name:o.name??o.budget_id,spent:o.total_spend,allocated:a,pct:i})}const d=s>0?"alert":l>0?"warn":"ok",h=s>0?`${s} over limit`:l>0?`${l} near limit`:"All within budget";return{status:d,label:h,overCount:s,nearCount:l,cappedCount:n.length,worst:r}}const K=864e5,T=30;function G(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function jt(){const[e,n]=y.useState(G);return y.useEffect(()=>{const s=()=>{if(document.visibilityState==="visible"){const l=G();n(r=>r===l?r:l)}};return document.addEventListener("visibilitychange",s),window.addEventListener("focus",s),()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("focus",s)}},[]),y.useMemo(()=>{const s=Date.now(),l=new Date(s);return{today:new Date(l.getFullYear(),l.getMonth(),l.getDate()).toISOString(),periodStart:new Date(s-T*K).toISOString(),prevStart:new Date(s-2*T*K).toISOString()}},[e])}const St={ok:"Healthy",warn:"Elevated",alert:"High"},wt={ok:"On track",warn:"Near limit",alert:"Over budget"};function qt(){const e=at();return e.isLoading?t.jsx(nt,{}):t.jsx(Nt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function Nt({needsSetup:e=!1}){var $,L,O,A,F,P,q,U;const n=jt(),s=y.useMemo(()=>({start_date:n.today}),[n]),l=y.useMemo(()=>({start_date:n.periodStart}),[n]),r=y.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=S(s,"hour"),d=S(l,"day"),h=S(r,"day"),o=ot(),a=it(),i=lt(),x=dt(),f=ct({},0,5),E=($=m.data)==null?void 0:$.totals,v=(L=d.data)==null?void 0:L.totals,p=(O=h.data)==null?void 0:O.totals,j=((A=d.data)==null?void 0:A.series)??[],C=j.length>1,c=W(v),k=W(p),V=c.rate!==null&&k.rate!==null?w(c.rate,k.rate):null,u=yt(a.data??[]),X=gt(o.data),Z=(i.data??[]).filter(g=>g.is_active).length,z=(x.data??[]).filter(g=>!g.blocked).length,J=(((F=f.data)==null?void 0:F.length)??0)>0,Q=e&&f.isSuccess&&!J,tt=m.error??d.error??o.error??a.error??i.error??x.error,et=()=>{m.refetch(),d.refetch(),h.refetch(),o.refetch(),a.refetch(),i.refetch(),x.refetch(),f.refetch()},rt=m.isFetching||d.isFetching||h.isFetching||o.isFetching||a.isFetching||i.isFetching||x.isFetching||f.isFetching;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ut,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway.",action:t.jsx(mt,{onRefresh:et,isFetching:rt,updatedAt:d.dataUpdatedAt})}),Q?t.jsx(Rt,{}):null,t.jsx(Y,{error:tt}),t.jsx(Dt,{providerHealth:X,healthy:((P=o.data)==null?void 0:P.healthy)??0,degraded:((q=o.data)==null?void 0:q.degraded)??0,total:((U=o.data)==null?void 0:U.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:o.isSuccess&&a.isSuccess&&d.isSuccess,failed:o.isError||a.isError||d.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(b,{label:"Spend today",value:E?_(E.cost):"—"}),t.jsx(b,{label:"Spend, last 30 days",value:v?_(v.cost):"—",hint:v?t.jsx(N,{fraction:w(v.cost,p==null?void 0:p.cost)}):null,chart:C?t.jsx(H,{values:j.map(g=>g.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Requests, last 30 days",value:v?R(v.request_count):"—",hint:v?t.jsx(N,{fraction:w(v.request_count,p==null?void 0:p.request_count)}):null,chart:C?t.jsx(H,{values:j.map(g=>g.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Error rate, last 30 days",value:c.rate===null?"—":D(c.rate),status:M(c.status),statusLabel:c.status==="neutral"?void 0:St[c.status],hint:c.rate!==null?t.jsx(N,{fraction:V}):null}),t.jsx(b,{label:"Budget health",value:a.data&&u.worst?D(u.worst.pct):"—",status:a.data?M(u.status):void 0,statusLabel:a.data&&u.status!=="neutral"?wt[u.status]:void 0,hint:a.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(b,{label:"Active keys",value:i.data?R(Z):"—",to:"/keys"}),t.jsx(b,{label:"Active users",value:x.data?R(z):"—",to:"/users"})]}),t.jsx(Ct,{entries:f.data??[],loading:f.isLoading,error:f.error})]})}function Rt(){const e=st();return t.jsx(B,{children:t.jsxs(B.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(xt,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function _t({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function Dt({providerHealth:e,healthy:n,degraded:s,total:l,budget:r,errStatus:m,errRate:d,ready:h,failed:o}){if(o)return t.jsx(_t,{text:"Some status data could not be loaded."});if(!h)return null;const a=[];if((e==="warn"||e==="alert")&&l>0){const i=l-n-s;i>0&&a.push({text:`${i} provider${i===1?"":"s"} unreachable`,to:"/providers"}),s>0&&a.push({text:`${s} provider${s===1?"":"s"} without model discovery`,to:"/providers"})}return r.overCount>0?a.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&a.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),m==="alert"&&d!==null&&a.push({text:`error rate ${D(d)}`,to:"/activity?status=error"}),a.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),a.map((i,x)=>t.jsxs("span",{className:"flex items-center gap-2",children:[x>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(I,{to:i.to,className:"underline underline-offset-2 hover:text-amber-950",children:i.text})]},i.to+i.text))]})}function Et(e){return e==="error"?"error":"ok"}function Ct({entries:e,loading:n,error:s}){const l=[{id:"time",header:"Time",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(r.timestamp).toLocaleString(),children:vt(r.timestamp)})},{id:"model",header:"Model",isRowHeader:!0,cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:r.model})},{id:"cost",header:"Cost",align:"end",cell:r=>r.cost===null?"—":_(r.cost)},{id:"status",header:"Status",cell:r=>t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Et(r.status)})}];return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(I,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(Y,{error:s}),t.jsx(ht,{ariaLabel:"Recent activity",columns:l,rows:e,getRowKey:r=>r.id,isLoading:n,emptyContent:"No requests yet. Once the gateway serves traffic, it appears here."})]})}export{qt as OverviewIndex,Nt as OverviewPage,G as localDayKey}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as y,i as st,N as I}from"./react-dgEcD0HR.js";import{T as at,U as nt,d as S,V as ot,q as it,a as lt,u as dt,b as ct,W as w,P as ut,R as mt,E as Y,X as b,Z as _,_ as N,$ as R,a0 as D,a1 as vt}from"./index-MlRogoGm.js";import{S as H}from"./charts-DIsd9m--.js";import{D as ht}from"./DataTable-Bmn_eYSV.js";import{d as B,B as xt}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function M(e){return e==="neutral"?void 0:e}const ft=.02,pt=.1;function W(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,s=n>=pt?"alert":n>=ft?"warn":"ok";return{rate:n,status:s}}function gt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy+e.degraded===0?"alert":"warn"}const bt=.8;function yt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(o=>o.max_budget!==null&&o.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let s=0,l=0,r,m=-1;for(const o of n){const a=o.max_budget*o.user_count,i=a>0?o.total_spend/a:0;i>=1?s+=1:i>=bt&&(l+=1),i>m&&(m=i,r={name:o.name??o.budget_id,spent:o.total_spend,allocated:a,pct:i})}const d=s>0?"alert":l>0?"warn":"ok",h=s>0?`${s} over limit`:l>0?`${l} near limit`:"All within budget";return{status:d,label:h,overCount:s,nearCount:l,cappedCount:n.length,worst:r}}const K=864e5,T=30;function G(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function jt(){const[e,n]=y.useState(G);return y.useEffect(()=>{const s=()=>{if(document.visibilityState==="visible"){const l=G();n(r=>r===l?r:l)}};return document.addEventListener("visibilitychange",s),window.addEventListener("focus",s),()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("focus",s)}},[]),y.useMemo(()=>{const s=Date.now(),l=new Date(s);return{today:new Date(l.getFullYear(),l.getMonth(),l.getDate()).toISOString(),periodStart:new Date(s-T*K).toISOString(),prevStart:new Date(s-2*T*K).toISOString()}},[e])}const St={ok:"Healthy",warn:"Elevated",alert:"High"},wt={ok:"On track",warn:"Near limit",alert:"Over budget"};function qt(){const e=at();return e.isLoading?t.jsx(nt,{}):t.jsx(Nt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function Nt({needsSetup:e=!1}){var $,L,O,A,F,P,q,U;const n=jt(),s=y.useMemo(()=>({start_date:n.today}),[n]),l=y.useMemo(()=>({start_date:n.periodStart}),[n]),r=y.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=S(s,"hour"),d=S(l,"day"),h=S(r,"day"),o=ot(),a=it(),i=lt(),x=dt(),f=ct({},0,5),E=($=m.data)==null?void 0:$.totals,v=(L=d.data)==null?void 0:L.totals,p=(O=h.data)==null?void 0:O.totals,j=((A=d.data)==null?void 0:A.series)??[],C=j.length>1,c=W(v),k=W(p),V=c.rate!==null&&k.rate!==null?w(c.rate,k.rate):null,u=yt(a.data??[]),X=gt(o.data),Z=(i.data??[]).filter(g=>g.is_active).length,z=(x.data??[]).filter(g=>!g.blocked).length,J=(((F=f.data)==null?void 0:F.length)??0)>0,Q=e&&f.isSuccess&&!J,tt=m.error??d.error??o.error??a.error??i.error??x.error,et=()=>{m.refetch(),d.refetch(),h.refetch(),o.refetch(),a.refetch(),i.refetch(),x.refetch(),f.refetch()},rt=m.isFetching||d.isFetching||h.isFetching||o.isFetching||a.isFetching||i.isFetching||x.isFetching||f.isFetching;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ut,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway.",action:t.jsx(mt,{onRefresh:et,isFetching:rt,updatedAt:d.dataUpdatedAt})}),Q?t.jsx(Rt,{}):null,t.jsx(Y,{error:tt}),t.jsx(Dt,{providerHealth:X,healthy:((P=o.data)==null?void 0:P.healthy)??0,degraded:((q=o.data)==null?void 0:q.degraded)??0,total:((U=o.data)==null?void 0:U.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:o.isSuccess&&a.isSuccess&&d.isSuccess,failed:o.isError||a.isError||d.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(b,{label:"Spend today",value:E?_(E.cost):"—"}),t.jsx(b,{label:"Spend, last 30 days",value:v?_(v.cost):"—",hint:v?t.jsx(N,{fraction:w(v.cost,p==null?void 0:p.cost)}):null,chart:C?t.jsx(H,{values:j.map(g=>g.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Requests, last 30 days",value:v?R(v.request_count):"—",hint:v?t.jsx(N,{fraction:w(v.request_count,p==null?void 0:p.request_count)}):null,chart:C?t.jsx(H,{values:j.map(g=>g.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Error rate, last 30 days",value:c.rate===null?"—":D(c.rate),status:M(c.status),statusLabel:c.status==="neutral"?void 0:St[c.status],hint:c.rate!==null?t.jsx(N,{fraction:V}):null}),t.jsx(b,{label:"Budget health",value:a.data&&u.worst?D(u.worst.pct):"—",status:a.data?M(u.status):void 0,statusLabel:a.data&&u.status!=="neutral"?wt[u.status]:void 0,hint:a.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(b,{label:"Active keys",value:i.data?R(Z):"—",to:"/keys"}),t.jsx(b,{label:"Active users",value:x.data?R(z):"—",to:"/users"})]}),t.jsx(Ct,{entries:f.data??[],loading:f.isLoading,error:f.error})]})}function Rt(){const e=st();return t.jsx(B,{children:t.jsxs(B.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(xt,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function _t({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function Dt({providerHealth:e,healthy:n,degraded:s,total:l,budget:r,errStatus:m,errRate:d,ready:h,failed:o}){if(o)return t.jsx(_t,{text:"Some status data could not be loaded."});if(!h)return null;const a=[];if((e==="warn"||e==="alert")&&l>0){const i=l-n-s;i>0&&a.push({text:`${i} provider${i===1?"":"s"} unreachable`,to:"/providers"}),s>0&&a.push({text:`${s} provider${s===1?"":"s"} without model discovery`,to:"/providers"})}return r.overCount>0?a.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&a.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),m==="alert"&&d!==null&&a.push({text:`error rate ${D(d)}`,to:"/activity?status=error"}),a.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),a.map((i,x)=>t.jsxs("span",{className:"flex items-center gap-2",children:[x>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(I,{to:i.to,className:"underline underline-offset-2 hover:text-amber-950",children:i.text})]},i.to+i.text))]})}function Et(e){return e==="error"?"error":"ok"}function Ct({entries:e,loading:n,error:s}){const l=[{id:"time",header:"Time",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(r.timestamp).toLocaleString(),children:vt(r.timestamp)})},{id:"model",header:"Model",isRowHeader:!0,cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:r.model})},{id:"cost",header:"Cost",align:"end",cell:r=>r.cost===null?"—":_(r.cost)},{id:"status",header:"Status",cell:r=>t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Et(r.status)})}];return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(I,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(Y,{error:s}),t.jsx(ht,{ariaLabel:"Recent activity",columns:l,rows:e,getRowKey:r=>r.id,isLoading:n,emptyContent:"No requests yet. Once the gateway serves traffic, it appears here."})]})}export{qt as OverviewIndex,Nt as OverviewPage,G as localDayKey}; diff --git a/src/gateway/static/dashboard/assets/ProvidersPage-BRQCYCYu.js b/src/gateway/static/dashboard/assets/ProvidersPage-HN_Zodtk.js similarity index 99% rename from src/gateway/static/dashboard/assets/ProvidersPage-BRQCYCYu.js rename to src/gateway/static/dashboard/assets/ProvidersPage-HN_Zodtk.js index e623a3559..3a5ef3b0e 100644 --- a/src/gateway/static/dashboard/assets/ProvidersPage-BRQCYCYu.js +++ b/src/gateway/static/dashboard/assets/ProvidersPage-HN_Zodtk.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,L as M}from"./react-dgEcD0HR.js";import{T as Y,a2 as V,Q as G,V as Q,a3 as W,a4 as J,a5 as X,P as Z,E as I,I as ee,a6 as te,a7 as se,a1 as q,o as ae,a8 as $,a9 as re,N as O,aa as ne,ab as ie}from"./index-Bi2hajrg.js";import{F as _}from"./Field-Dwp6u3t8.js";import{D as oe}from"./DataTable-Bmn_eYSV.js";import{B as f,d as S,f as de,T as le,L as F,I as H,D as ce,S as me,C as T,a as ue,b as xe}from"./heroui-BI50yK5B.js";function E({value:t,onChange:s,label:a,placeholder:n,description:i}){return e.jsxs(le,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(H,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),i?e.jsx(ce,{className:"text-xs text-[var(--otari-muted)]",children:i}):null]})}function z({label:t,value:s,onChange:a,description:n,placeholder:i,extra:d=[],includeCatalog:l=!0}){var k;const g=ne(),u=x.useMemo(()=>l?[...d,...(g.data??[]).map(o=>({id:o.id,name:o.name}))]:d,[g.data,d,l]),[p,m]=x.useState(()=>{var o;return((o=u.find(b=>b.id===s))==null?void 0:o.name)??""}),j=((k=u.find(o=>o.id===s))==null?void 0:k.name)??"",h=p.trim()===j.trim()?"":p.trim().toLowerCase(),c=u.filter(o=>!h||o.name.toLowerCase().includes(h)||o.id.toLowerCase().includes(h)).slice(0,50);return e.jsxs(T.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:p,onInputChange:m,onSelectionChange:o=>{var b;o!=null?(a(String(o)),m(((b=u.find(N=>N.id===String(o)))==null?void 0:b.name)??"")):(a(""),m(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(T.InputGroup,{children:[e.jsx(H,{placeholder:i??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:o=>o.currentTarget.select()}),e.jsx(T.Trigger,{})]}),e.jsx(T.Popover,{children:e.jsx(ue,{items:c,className:"max-h-72 overflow-auto",children:o=>e.jsx(xe,{id:o.id,textValue:o.name,children:o.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function U({getPayload:t}){const s=ie(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:O(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):s.data.discovery_unsupported?e.jsxs("span",{className:"block max-w-md break-words text-xs text-amber-800",children:["This provider does not list models, so the key could not be verified here. Save it and use the provider; declare its model ids under ",e.jsx("code",{children:"models:"})," to have them show up in the catalogue. If you did not expect this, check the provider's reply below.",s.data.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:s.data.error}):null]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function pe({onClose:t}){var A;const s=$(),[a,n]=x.useState(""),[i,d]=x.useState(""),[l,g]=x.useState(!1),[u,p]=x.useState(""),[m,j]=x.useState(""),h=re(a),c=((A=h.data)==null?void 0:A.id)===a?h.data:void 0;x.useEffect(()=>{c&&p(c.default_api_base??"")},[c]);const k=(c==null?void 0:c.env_key_present)??!1,o=((c==null?void 0:c.requires_api_key)??!0)&&!k,b=m.trim()!==""&&m.trim()!==a,N=/[:/]/.test(m),P=a!==""&&!N&&(!o||i.trim()!=="")&&!s.isPending,C=()=>{P&&s.mutate({instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsx(z,{label:"Provider",value:a,onChange:w=>{n(w),j(""),p("")},description:"Its endpoint is built in."}),e.jsx(E,{value:i,onChange:d,label:c&&!o?"API key (optional)":"API key",description:c?o?`${c.name}'s endpoint is built in — just add your key.`:k?`${c.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${c.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>g(w=>!w),children:l?"Hide advanced":"Advanced (API base, rename)"}),l?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:u,onChange:p,placeholder:(c==null?void 0:c.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:m,onChange:j,placeholder:a||"instance name",description:N?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!P,onPress:C,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a===""?null:{instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null}})]})]})}function he({onClose:t}){const s=$(),[a,n]=x.useState(""),[i,d]=x.useState("openai-compatible"),[l,g]=x.useState(""),[u,p]=x.useState(""),m=/[:/]/.test(a),j=a.trim()!==""&&!m&&l.trim()!==""&&!s.isPending,h=()=>{j&&s.mutate({instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:m?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(z,{label:"Compatible with",value:i,onChange:d,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:l,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(E,{value:u,onChange:p,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!j,onPress:h,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a.trim()===""||l.trim()===""?null:{instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null}})]})]})}function ve({onClose:t}){const[s,a]=x.useState("known");return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,i])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:i},n))})}),s==="known"?e.jsx(pe,{onClose:t}):e.jsx(he,{onClose:t})]})})}function ge({provider:t,onClose:s}){const a=te(),[n,i]=x.useState(t.provider_type??""),[d,l]=x.useState(t.api_base??""),[g,u]=x.useState(!1),[p,m]=x.useState(""),j=()=>{if(a.isPending)return;const h={provider_type:n.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};g&&p.trim()&&(h.api_key=p.trim()),a.mutate({instance:t.instance,body:h},{onSuccess:s})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(I,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:i,placeholder:"openai"}),e.jsx(_,{label:"API base",value:d,onChange:l,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(E,{value:p,onChange:m,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),m("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(f,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:a.isPending,onPress:j,children:a.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function fe(t,s){const a=new Map((s??[]).map(d=>[d.instance,d])),n=new Map((t??[]).map(d=>[d.instance,d]));return[...new Set([...a.keys(),...n.keys()])].sort().map(d=>{const l=a.get(d);return{instance:d,source:l?"stored":"config",stored:l,meta:n.get(d)}})}function je({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(me,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):t.discovery_unsupported?e.jsxs("span",{className:"block max-w-xs break-words text-xs text-amber-800",children:["Could not list models, so the key could not be verified. It may still work for requests.",t.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:t.error}):null]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function be({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=!t.ok&&t.discovery_unsupported,a=t.ok?"border-green-200 bg-green-50 text-green-700":s?"border-amber-200 bg-amber-50 text-amber-800":"border-red-200 bg-red-50 text-red-700",n=t.ok?"bg-green-500":s?"bg-amber-500":"bg-red-500",i=t.checked_at?`Last checked ${q(t.checked_at)}`:"Not checked yet",d=s?`${t.error??"This provider does not list models."} Requests to it may still work.`:t.error??"Unreachable",l=t.ok?i:`${d} · ${i}`;return e.jsxs("span",{title:l,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${n}`}),t.ok?"Reachable":s?"No model discovery":"Unreachable"]})}function ye({healthy:t,degraded:s,total:a,checkedAt:n}){const d=t===a?"bg-green-500":t+s===a?"bg-amber-500":"bg-red-500",l=se();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${d}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s>0?e.jsxs("span",{className:"text-amber-800",children:[s," without model discovery"]}):null,n?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",q(n)]}):null,e.jsx(f,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function R({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function ke({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n,secretKeyConfigured:i}){return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(R,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(R,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(R,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(f,{variant:"primary",isDisabled:!i,onPress:t,children:"Add your first provider"})})]})})}function Ae(){var K,B,D,L;const t=Y(),s=V(),a=G(),n=Q(),i=W(),d=J(),l=X(),[g,u]=x.useState(!1),[p,m]=x.useState(null),[j,h]=x.useState({}),c=fe((K=t.data)==null?void 0:K.providers,s.data),k=new Map((((B=n.data)==null?void 0:B.providers)??[]).map(r=>[r.instance,r])),o=t.isLoading||s.isLoading,b=((D=s.data)==null?void 0:D.find(r=>r.instance===p))??null,N=((L=a.data)==null?void 0:L.require_pricing)===!0&&a.data.default_pricing===!1,P=a.data?a.data.secret_key_configured!==!1:!a.isError,C=!o&&c.length===0&&!g,A=r=>{h(v=>({...v,[r]:{status:"pending"}})),d.mutate(r,{onSuccess:v=>h(y=>({...y,[r]:{status:"done",...v}})),onError:v=>h(y=>({...y,[r]:{status:"done",ok:!1,model_count:0,error:O(v),discovery_unsupported:!1}}))})},w=[{id:"provider",header:"Provider",isRowHeader:!0,cell:r=>e.jsx(M,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"font-medium text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})},{id:"type",header:"Type",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:((v=r.meta)==null?void 0:v.provider_type)??((y=r.stored)==null?void 0:y.provider_type)??r.instance})}},{id:"source",header:"Source",cell:r=>e.jsx(de,{size:"sm",color:r.source==="stored"?"accent":"default",children:r.source==="stored"?"stored":"config"})},{id:"api_key",header:"API key",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:(v=r.stored)!=null&&v.last4?`••••${r.stored.last4}`:"none set"}):(y=r.meta)!=null&&y.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"})}},{id:"status",header:"Status",cell:r=>e.jsx(be,{health:k.get(r.instance)})},{id:"actions",header:"Actions",align:"end",cell:r=>{var v,y;return r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:((v=j[r.instance])==null?void 0:v.status)==="pending"||((y=r.stored)==null?void 0:y.decryptable)===!1,onPress:()=>A(r.instance),children:"Test"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{u(!1),m(r.instance)},children:"Edit"}),e.jsx(ae,{confirmLabel:"Delete",isPending:i.isPending,onConfirm:()=>i.mutate(r.instance),children:"Delete"})]}),e.jsx(je,{state:j[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})}}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||C?null:e.jsx(f,{variant:"primary",isDisabled:!P,onPress:()=>{m(null),u(!0)},children:"Add provider"})}),e.jsx(I,{error:t.error??s.error??a.error??n.error??l.error??i.error}),P?null:e.jsxs(ee,{tone:"warning",children:[e.jsx("code",{children:"OTARI_SECRET_KEY"})," is not set, so provider keys can't be encrypted at rest and adding providers from the dashboard is disabled. Set it on the server and restart to add providers here. Providers defined in"," ",e.jsx("code",{children:"config.yml"})," keep working without it."]}),C?e.jsx(ke,{onAddProvider:()=>{m(null),u(!0)},needsPricing:N,onEnablePricing:()=>l.mutate({default_pricing:!0}),enabling:l.isPending,secretKeyConfigured:P}):null,g&&P?e.jsx(ve,{onClose:()=>u(!1)}):null,b?e.jsx(ge,{provider:b,onClose:()=>m(null)}):null,!o&&c.length>0&&n.data&&n.data.total>0?e.jsx(ye,{healthy:n.data.healthy,degraded:n.data.degraded,total:n.data.total,checkedAt:n.data.checked_at}):null,C?null:e.jsx(oe,{ariaLabel:"Providers",columns:w,rows:c,getRowKey:r=>r.instance,isLoading:o,emptyContent:"No providers yet. Add your first provider to start serving models."})]})}export{Ae as ProvidersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,L as M}from"./react-dgEcD0HR.js";import{T as Y,a2 as V,Q as G,V as Q,a3 as W,a4 as J,a5 as X,P as Z,E as I,I as ee,a6 as te,a7 as se,a1 as q,o as ae,a8 as $,a9 as re,N as O,aa as ne,ab as ie}from"./index-MlRogoGm.js";import{F as _}from"./Field-Dwp6u3t8.js";import{D as oe}from"./DataTable-Bmn_eYSV.js";import{B as f,d as S,f as de,T as le,L as F,I as H,D as ce,S as me,C as T,a as ue,b as xe}from"./heroui-BI50yK5B.js";function E({value:t,onChange:s,label:a,placeholder:n,description:i}){return e.jsxs(le,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(H,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),i?e.jsx(ce,{className:"text-xs text-[var(--otari-muted)]",children:i}):null]})}function z({label:t,value:s,onChange:a,description:n,placeholder:i,extra:d=[],includeCatalog:l=!0}){var k;const g=ne(),u=x.useMemo(()=>l?[...d,...(g.data??[]).map(o=>({id:o.id,name:o.name}))]:d,[g.data,d,l]),[p,m]=x.useState(()=>{var o;return((o=u.find(b=>b.id===s))==null?void 0:o.name)??""}),j=((k=u.find(o=>o.id===s))==null?void 0:k.name)??"",h=p.trim()===j.trim()?"":p.trim().toLowerCase(),c=u.filter(o=>!h||o.name.toLowerCase().includes(h)||o.id.toLowerCase().includes(h)).slice(0,50);return e.jsxs(T.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:p,onInputChange:m,onSelectionChange:o=>{var b;o!=null?(a(String(o)),m(((b=u.find(N=>N.id===String(o)))==null?void 0:b.name)??"")):(a(""),m(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(T.InputGroup,{children:[e.jsx(H,{placeholder:i??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:o=>o.currentTarget.select()}),e.jsx(T.Trigger,{})]}),e.jsx(T.Popover,{children:e.jsx(ue,{items:c,className:"max-h-72 overflow-auto",children:o=>e.jsx(xe,{id:o.id,textValue:o.name,children:o.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function U({getPayload:t}){const s=ie(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:O(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):s.data.discovery_unsupported?e.jsxs("span",{className:"block max-w-md break-words text-xs text-amber-800",children:["This provider does not list models, so the key could not be verified here. Save it and use the provider; declare its model ids under ",e.jsx("code",{children:"models:"})," to have them show up in the catalogue. If you did not expect this, check the provider's reply below.",s.data.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:s.data.error}):null]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function pe({onClose:t}){var A;const s=$(),[a,n]=x.useState(""),[i,d]=x.useState(""),[l,g]=x.useState(!1),[u,p]=x.useState(""),[m,j]=x.useState(""),h=re(a),c=((A=h.data)==null?void 0:A.id)===a?h.data:void 0;x.useEffect(()=>{c&&p(c.default_api_base??"")},[c]);const k=(c==null?void 0:c.env_key_present)??!1,o=((c==null?void 0:c.requires_api_key)??!0)&&!k,b=m.trim()!==""&&m.trim()!==a,N=/[:/]/.test(m),P=a!==""&&!N&&(!o||i.trim()!=="")&&!s.isPending,C=()=>{P&&s.mutate({instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsx(z,{label:"Provider",value:a,onChange:w=>{n(w),j(""),p("")},description:"Its endpoint is built in."}),e.jsx(E,{value:i,onChange:d,label:c&&!o?"API key (optional)":"API key",description:c?o?`${c.name}'s endpoint is built in — just add your key.`:k?`${c.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${c.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>g(w=>!w),children:l?"Hide advanced":"Advanced (API base, rename)"}),l?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:u,onChange:p,placeholder:(c==null?void 0:c.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:m,onChange:j,placeholder:a||"instance name",description:N?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!P,onPress:C,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a===""?null:{instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null}})]})]})}function he({onClose:t}){const s=$(),[a,n]=x.useState(""),[i,d]=x.useState("openai-compatible"),[l,g]=x.useState(""),[u,p]=x.useState(""),m=/[:/]/.test(a),j=a.trim()!==""&&!m&&l.trim()!==""&&!s.isPending,h=()=>{j&&s.mutate({instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:m?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(z,{label:"Compatible with",value:i,onChange:d,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:l,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(E,{value:u,onChange:p,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!j,onPress:h,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a.trim()===""||l.trim()===""?null:{instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null}})]})]})}function ve({onClose:t}){const[s,a]=x.useState("known");return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,i])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:i},n))})}),s==="known"?e.jsx(pe,{onClose:t}):e.jsx(he,{onClose:t})]})})}function ge({provider:t,onClose:s}){const a=te(),[n,i]=x.useState(t.provider_type??""),[d,l]=x.useState(t.api_base??""),[g,u]=x.useState(!1),[p,m]=x.useState(""),j=()=>{if(a.isPending)return;const h={provider_type:n.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};g&&p.trim()&&(h.api_key=p.trim()),a.mutate({instance:t.instance,body:h},{onSuccess:s})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(I,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:i,placeholder:"openai"}),e.jsx(_,{label:"API base",value:d,onChange:l,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(E,{value:p,onChange:m,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),m("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(f,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:a.isPending,onPress:j,children:a.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function fe(t,s){const a=new Map((s??[]).map(d=>[d.instance,d])),n=new Map((t??[]).map(d=>[d.instance,d]));return[...new Set([...a.keys(),...n.keys()])].sort().map(d=>{const l=a.get(d);return{instance:d,source:l?"stored":"config",stored:l,meta:n.get(d)}})}function je({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(me,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):t.discovery_unsupported?e.jsxs("span",{className:"block max-w-xs break-words text-xs text-amber-800",children:["Could not list models, so the key could not be verified. It may still work for requests.",t.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:t.error}):null]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function be({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=!t.ok&&t.discovery_unsupported,a=t.ok?"border-green-200 bg-green-50 text-green-700":s?"border-amber-200 bg-amber-50 text-amber-800":"border-red-200 bg-red-50 text-red-700",n=t.ok?"bg-green-500":s?"bg-amber-500":"bg-red-500",i=t.checked_at?`Last checked ${q(t.checked_at)}`:"Not checked yet",d=s?`${t.error??"This provider does not list models."} Requests to it may still work.`:t.error??"Unreachable",l=t.ok?i:`${d} · ${i}`;return e.jsxs("span",{title:l,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${n}`}),t.ok?"Reachable":s?"No model discovery":"Unreachable"]})}function ye({healthy:t,degraded:s,total:a,checkedAt:n}){const d=t===a?"bg-green-500":t+s===a?"bg-amber-500":"bg-red-500",l=se();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${d}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s>0?e.jsxs("span",{className:"text-amber-800",children:[s," without model discovery"]}):null,n?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",q(n)]}):null,e.jsx(f,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function R({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function ke({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n,secretKeyConfigured:i}){return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(R,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(R,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(R,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(f,{variant:"primary",isDisabled:!i,onPress:t,children:"Add your first provider"})})]})})}function Ae(){var K,B,D,L;const t=Y(),s=V(),a=G(),n=Q(),i=W(),d=J(),l=X(),[g,u]=x.useState(!1),[p,m]=x.useState(null),[j,h]=x.useState({}),c=fe((K=t.data)==null?void 0:K.providers,s.data),k=new Map((((B=n.data)==null?void 0:B.providers)??[]).map(r=>[r.instance,r])),o=t.isLoading||s.isLoading,b=((D=s.data)==null?void 0:D.find(r=>r.instance===p))??null,N=((L=a.data)==null?void 0:L.require_pricing)===!0&&a.data.default_pricing===!1,P=a.data?a.data.secret_key_configured!==!1:!a.isError,C=!o&&c.length===0&&!g,A=r=>{h(v=>({...v,[r]:{status:"pending"}})),d.mutate(r,{onSuccess:v=>h(y=>({...y,[r]:{status:"done",...v}})),onError:v=>h(y=>({...y,[r]:{status:"done",ok:!1,model_count:0,error:O(v),discovery_unsupported:!1}}))})},w=[{id:"provider",header:"Provider",isRowHeader:!0,cell:r=>e.jsx(M,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"font-medium text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})},{id:"type",header:"Type",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:((v=r.meta)==null?void 0:v.provider_type)??((y=r.stored)==null?void 0:y.provider_type)??r.instance})}},{id:"source",header:"Source",cell:r=>e.jsx(de,{size:"sm",color:r.source==="stored"?"accent":"default",children:r.source==="stored"?"stored":"config"})},{id:"api_key",header:"API key",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:(v=r.stored)!=null&&v.last4?`••••${r.stored.last4}`:"none set"}):(y=r.meta)!=null&&y.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"})}},{id:"status",header:"Status",cell:r=>e.jsx(be,{health:k.get(r.instance)})},{id:"actions",header:"Actions",align:"end",cell:r=>{var v,y;return r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:((v=j[r.instance])==null?void 0:v.status)==="pending"||((y=r.stored)==null?void 0:y.decryptable)===!1,onPress:()=>A(r.instance),children:"Test"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{u(!1),m(r.instance)},children:"Edit"}),e.jsx(ae,{confirmLabel:"Delete",isPending:i.isPending,onConfirm:()=>i.mutate(r.instance),children:"Delete"})]}),e.jsx(je,{state:j[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})}}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||C?null:e.jsx(f,{variant:"primary",isDisabled:!P,onPress:()=>{m(null),u(!0)},children:"Add provider"})}),e.jsx(I,{error:t.error??s.error??a.error??n.error??l.error??i.error}),P?null:e.jsxs(ee,{tone:"warning",children:[e.jsx("code",{children:"OTARI_SECRET_KEY"})," is not set, so provider keys can't be encrypted at rest and adding providers from the dashboard is disabled. Set it on the server and restart to add providers here. Providers defined in"," ",e.jsx("code",{children:"config.yml"})," keep working without it."]}),C?e.jsx(ke,{onAddProvider:()=>{m(null),u(!0)},needsPricing:N,onEnablePricing:()=>l.mutate({default_pricing:!0}),enabling:l.isPending,secretKeyConfigured:P}):null,g&&P?e.jsx(ve,{onClose:()=>u(!1)}):null,b?e.jsx(ge,{provider:b,onClose:()=>m(null)}):null,!o&&c.length>0&&n.data&&n.data.total>0?e.jsx(ye,{healthy:n.data.healthy,degraded:n.data.degraded,total:n.data.total,checkedAt:n.data.checked_at}):null,C?null:e.jsx(oe,{ariaLabel:"Providers",columns:w,rows:c,getRowKey:r=>r.instance,isLoading:o,emptyContent:"No providers yet. Add your first provider to start serving models."})]})}export{Ae as ProvidersPage}; diff --git a/src/gateway/static/dashboard/assets/SettingsPage-DjaTcy-f.js b/src/gateway/static/dashboard/assets/SettingsPage-Csgj1pAU.js similarity index 99% rename from src/gateway/static/dashboard/assets/SettingsPage-DjaTcy-f.js rename to src/gateway/static/dashboard/assets/SettingsPage-Csgj1pAU.js index f7086c774..60fd82e29 100644 --- a/src/gateway/static/dashboard/assets/SettingsPage-DjaTcy-f.js +++ b/src/gateway/static/dashboard/assets/SettingsPage-Csgj1pAU.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{Q as R,a5 as C,P,E as y,U as E,ac as T,ad as _,ae as D,F as A,af as O,a2 as F,ag as I,I as w}from"./index-Bi2hajrg.js";import{d as v,B as h,A as d,g as K,I as z}from"./heroui-BI50yK5B.js";function b(t,r){return{[t]:r}}function M(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function L(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||M(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(A,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function U({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function V({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(V,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function Q({source:t}){const r=O(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:K({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(G,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function X(){var o;const t=F(),r=I(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(Q,{source:t}),e.jsx(X,{})]})})]})}function W({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=T(),r=_(),s=D(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(W,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&L(l,n)),k=ee(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,t.isLoading?e.jsx(E,{}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(U,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,L as fieldMatches}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{Q as R,a5 as C,P,E as y,U as E,ac as T,ad as _,ae as D,F as A,af as O,a2 as F,ag as I,I as w}from"./index-MlRogoGm.js";import{d as v,B as h,A as d,g as K,I as z}from"./heroui-BI50yK5B.js";function b(t,r){return{[t]:r}}function M(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function L(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||M(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(A,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function U({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function V({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(V,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function Q({source:t}){const r=O(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:K({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(G,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function X(){var o;const t=F(),r=I(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(Q,{source:t}),e.jsx(X,{})]})})]})}function W({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=T(),r=_(),s=D(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(W,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&L(l,n)),k=ee(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,t.isLoading?e.jsx(E,{}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(U,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,L as fieldMatches}; diff --git a/src/gateway/static/dashboard/assets/TablePagination-8CBn4us4.js b/src/gateway/static/dashboard/assets/TablePagination-BHTN5PVb.js similarity index 98% rename from src/gateway/static/dashboard/assets/TablePagination-8CBn4us4.js rename to src/gateway/static/dashboard/assets/TablePagination-BHTN5PVb.js index 08fc1ac90..92f714a9e 100644 --- a/src/gateway/static/dashboard/assets/TablePagination-8CBn4us4.js +++ b/src/gateway/static/dashboard/assets/TablePagination-BHTN5PVb.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{I as w,E as M,F as D}from"./index-Bi2hajrg.js";import{A as o,B as x,T as F,L as $,I as T,S as y}from"./heroui-BI50yK5B.js";function _({label:t,value:r,onChange:a,isRequired:c,autoFocus:i}){return e.jsxs(F,{value:r,onChange:a,isRequired:c,className:"flex flex-col gap-1",children:[e.jsx($,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsx(T,{inputMode:"decimal",placeholder:"0.00",autoFocus:i})]})}function R(t){const r=t.trim();if(r==="")return null;const a=Number(r);return Number.isFinite(a)&&a>=0?a:Number.NaN}const C=t=>`Recompute cost for ${t.toLocaleString()} imported ${t===1?"row":"rows"} from each row's own token counts at these per-1M rates. Enforced gateway rows are never affected.`;function W({isOpen:t,onOpenChange:r,targetCount:a,isPending:c,error:i,onSubmit:E,title:I="Set price",description:L=C}){const[j,p]=u.useState(""),[n,h]=u.useState(""),[b,N]=u.useState(""),[f,v]=u.useState("");u.useEffect(()=>{t&&(p(""),h(""),N(""),v(""))},[t]);const m=R(j),l=R(n),d=R(b),s=R(f),g=m===null||Number.isNaN(m)||l===null||Number.isNaN(l)||Number.isNaN(d??0)||Number.isNaN(s??0),S=()=>{g||m===null||l===null||E({input_price_per_million:m,output_price_per_million:l,...d!==null&&!Number.isNaN(d)?{cache_read_price_per_million:d}:{},...s!==null&&!Number.isNaN(s)?{cache_write_price_per_million:s}:{}})};return e.jsx(o,{isOpen:t,onOpenChange:r,children:t?e.jsx(o.Backdrop,{children:e.jsx(o.Container,{placement:"center",size:"lg",children:e.jsxs(o.Dialog,{children:[e.jsx(o.Header,{children:e.jsx(o.Heading,{children:I})}),e.jsxs(o.Body,{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:L(a)}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(_,{label:"Input $ / 1M",value:j,onChange:p,isRequired:!0,autoFocus:!0}),e.jsx(_,{label:"Output $ / 1M",value:n,onChange:h,isRequired:!0}),e.jsx(_,{label:"Cache read $ / 1M",value:b,onChange:N}),e.jsx(_,{label:"Cache write $ / 1M",value:f,onChange:v})]}),e.jsx(w,{tone:"info",children:"Leave a cache rate blank to bill those tokens at the input rate."}),e.jsx(M,{error:i})]}),e.jsxs(o.Footer,{children:[e.jsx(x,{variant:"ghost",isDisabled:c,onPress:()=>r(!1),children:"Cancel"}),e.jsx(x,{variant:"primary",isDisabled:g,isPending:c,onPress:S,children:"Set price"})]})]})})}):null})}const P=[25,50,100];function q({page:t,pageSize:r,total:a,rowsOnPage:c,onPageChange:i,onPageSizeChange:E,pageSizeOptions:I=P,isFetching:L=!1,hasNextFallback:j=!1}){const p=u.useId(),n=a!=null?Math.max(1,Math.ceil(a/r)):null,h=t===0,b=n!=null?t>=n-1:!j,N=c>0?t*r+1:0,f=t*r+c,v=a!=null?a===0?"0 of 0":`${N.toLocaleString()}–${f.toLocaleString()} of ${a.toLocaleString()}`:c>0?`${N.toLocaleString()}–${f.toLocaleString()}`:"0",[m,l]=u.useState(String(t+1));u.useEffect(()=>{l(String(t+1))},[t]);const d=()=>{const s=Number.parseInt(m,10);if(Number.isNaN(s)){l(String(t+1));return}const g=n??Number.MAX_SAFE_INTEGER,S=Math.min(Math.max(s,1),g);S-1!==t?i(S-1):l(String(t+1))};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:p,className:"text-sm text-[var(--otari-muted)]",children:"Rows"}),e.jsx(D,{id:p,ariaLabel:"Rows per page",value:String(r),onChange:s=>E(Number.parseInt(s,10)),options:I.map(s=>({value:String(s),label:String(s)}))}),L?e.jsx(y,{size:"sm"}):null]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[var(--otari-muted)] tabular-nums",children:v}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"outline","aria-label":"First page",isDisabled:h,onPress:()=>i(0),children:"«"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Previous page",isDisabled:h,onPress:()=>i(t-1),children:"‹"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{"aria-label":"Page number",inputMode:"numeric",value:m,onChange:s=>l(s.target.value.replace(/[^0-9]/g,"")),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()},onBlur:d,className:"w-12 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-2 py-1 text-center text-sm text-[var(--otari-ink)] tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"}),n!=null?e.jsxs("span",{className:"tabular-nums",children:["/ ",n.toLocaleString()]}):null]}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Next page",isDisabled:b,onPress:()=>i(t+1),children:"›"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Last page",isDisabled:n==null||b,onPress:()=>n!=null&&i(n-1),children:"»"})]})]})]})}export{P,W as S,q as T}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{I as w,E as M,F as D}from"./index-MlRogoGm.js";import{A as o,B as x,T as F,L as $,I as T,S as y}from"./heroui-BI50yK5B.js";function _({label:t,value:r,onChange:a,isRequired:c,autoFocus:i}){return e.jsxs(F,{value:r,onChange:a,isRequired:c,className:"flex flex-col gap-1",children:[e.jsx($,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsx(T,{inputMode:"decimal",placeholder:"0.00",autoFocus:i})]})}function R(t){const r=t.trim();if(r==="")return null;const a=Number(r);return Number.isFinite(a)&&a>=0?a:Number.NaN}const C=t=>`Recompute cost for ${t.toLocaleString()} imported ${t===1?"row":"rows"} from each row's own token counts at these per-1M rates. Enforced gateway rows are never affected.`;function W({isOpen:t,onOpenChange:r,targetCount:a,isPending:c,error:i,onSubmit:E,title:I="Set price",description:L=C}){const[j,p]=u.useState(""),[n,h]=u.useState(""),[b,N]=u.useState(""),[f,v]=u.useState("");u.useEffect(()=>{t&&(p(""),h(""),N(""),v(""))},[t]);const m=R(j),l=R(n),d=R(b),s=R(f),g=m===null||Number.isNaN(m)||l===null||Number.isNaN(l)||Number.isNaN(d??0)||Number.isNaN(s??0),S=()=>{g||m===null||l===null||E({input_price_per_million:m,output_price_per_million:l,...d!==null&&!Number.isNaN(d)?{cache_read_price_per_million:d}:{},...s!==null&&!Number.isNaN(s)?{cache_write_price_per_million:s}:{}})};return e.jsx(o,{isOpen:t,onOpenChange:r,children:t?e.jsx(o.Backdrop,{children:e.jsx(o.Container,{placement:"center",size:"lg",children:e.jsxs(o.Dialog,{children:[e.jsx(o.Header,{children:e.jsx(o.Heading,{children:I})}),e.jsxs(o.Body,{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:L(a)}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(_,{label:"Input $ / 1M",value:j,onChange:p,isRequired:!0,autoFocus:!0}),e.jsx(_,{label:"Output $ / 1M",value:n,onChange:h,isRequired:!0}),e.jsx(_,{label:"Cache read $ / 1M",value:b,onChange:N}),e.jsx(_,{label:"Cache write $ / 1M",value:f,onChange:v})]}),e.jsx(w,{tone:"info",children:"Leave a cache rate blank to bill those tokens at the input rate."}),e.jsx(M,{error:i})]}),e.jsxs(o.Footer,{children:[e.jsx(x,{variant:"ghost",isDisabled:c,onPress:()=>r(!1),children:"Cancel"}),e.jsx(x,{variant:"primary",isDisabled:g,isPending:c,onPress:S,children:"Set price"})]})]})})}):null})}const P=[25,50,100];function q({page:t,pageSize:r,total:a,rowsOnPage:c,onPageChange:i,onPageSizeChange:E,pageSizeOptions:I=P,isFetching:L=!1,hasNextFallback:j=!1}){const p=u.useId(),n=a!=null?Math.max(1,Math.ceil(a/r)):null,h=t===0,b=n!=null?t>=n-1:!j,N=c>0?t*r+1:0,f=t*r+c,v=a!=null?a===0?"0 of 0":`${N.toLocaleString()}–${f.toLocaleString()} of ${a.toLocaleString()}`:c>0?`${N.toLocaleString()}–${f.toLocaleString()}`:"0",[m,l]=u.useState(String(t+1));u.useEffect(()=>{l(String(t+1))},[t]);const d=()=>{const s=Number.parseInt(m,10);if(Number.isNaN(s)){l(String(t+1));return}const g=n??Number.MAX_SAFE_INTEGER,S=Math.min(Math.max(s,1),g);S-1!==t?i(S-1):l(String(t+1))};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:p,className:"text-sm text-[var(--otari-muted)]",children:"Rows"}),e.jsx(D,{id:p,ariaLabel:"Rows per page",value:String(r),onChange:s=>E(Number.parseInt(s,10)),options:I.map(s=>({value:String(s),label:String(s)}))}),L?e.jsx(y,{size:"sm"}):null]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[var(--otari-muted)] tabular-nums",children:v}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"outline","aria-label":"First page",isDisabled:h,onPress:()=>i(0),children:"«"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Previous page",isDisabled:h,onPress:()=>i(t-1),children:"‹"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{"aria-label":"Page number",inputMode:"numeric",value:m,onChange:s=>l(s.target.value.replace(/[^0-9]/g,"")),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()},onBlur:d,className:"w-12 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-2 py-1 text-center text-sm text-[var(--otari-ink)] tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"}),n!=null?e.jsxs("span",{className:"tabular-nums",children:["/ ",n.toLocaleString()]}):null]}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Next page",isDisabled:b,onPress:()=>i(t+1),children:"›"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Last page",isDisabled:n==null||b,onPress:()=>n!=null&&i(n-1),children:"»"})]})]})]})}export{P,W as S,q as T}; diff --git a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-B4MIR_ke.js b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-DPdRTl_b.js similarity index 99% rename from src/gateway/static/dashboard/assets/ToolsGuardrailsPage-B4MIR_ke.js rename to src/gateway/static/dashboard/assets/ToolsGuardrailsPage-DPdRTl_b.js index 39f7e3e57..7cd6fdd1d 100644 --- a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-B4MIR_ke.js +++ b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-DPdRTl_b.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x}from"./react-dgEcD0HR.js";import{ah as L,ai as C,P,E,U as R,N as w,aj as D,F as U}from"./index-Bi2hajrg.js";import{d as N,B as g}from"./heroui-BI50yK5B.js";function M(s,t){return{[s]:t}}const B=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=x.useState(null),a=x.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function z({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",b="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r),[m,p]=x.useState(null),c=D();x.useEffect(()=>{i(r)},[r]);const o=l.trim()!==r,d=l.trim(),h=m!==null&&m===d;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:l,disabled:n,placeholder:"unset",onChange:v=>{i(v.target.value),c.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(d===""?null:d),children:"Save"}),e.jsx(g,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:d===""||c.isPending,onPress:()=>{p(d),c.mutate({service:s.service,url:d})},children:c.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:c.isPending||!h?null:c.error?e.jsx("span",{className:"text-red-700",children:w(c.error)}):c.data?e.jsx("span",{className:c.data.ok?"font-medium text-green-700":"text-red-700",children:c.data.reason}):null}),e.jsx(j,{message:a})]})]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:p=>i(p.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(l.trim()===""?null:l.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l.trim(),p=Number(m),o=(m===""||Number.isInteger(p)&&p>=1)&&m!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:d=>i(d.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(m===""?null:p),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(U,{ariaLabel:s.key,value:r,onChange:l=>t(l==="default"?null:l==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function O({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(F,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n})}function V(){const s=L(),t=C(),[a,n]=$(),[r,l]=x.useState({}),i=s.data,m=!i||t.isPending,p=new Map(((i==null?void 0:i.fields)??[]).map(o=>[o.key,o])),c=(o,d)=>{l(h=>{const{[o.key]:v,...u}=h;return u}),t.mutate(M(o.key,d),{onSuccess:()=>n(`${o.key} saved`),onError:h=>l(v=>({...v,[o.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(E,{error:s.error}),s.isLoading?e.jsx(R,{}):null,B.map(o=>{const d=o.order.map(u=>p.get(u)).filter(u=>u!==void 0),h=((i==null?void 0:i.fields)??[]).filter(u=>u.service===o.key&&!o.order.includes(u.key)),v=[...d,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:o.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:o.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(O,{field:u,onSave:T=>c(u,T),saveError:r[u.key],disabled:m},u.key))})})]},o.key)}),e.jsx(z,{message:a})]})}export{V as ToolsGuardrailsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x}from"./react-dgEcD0HR.js";import{ah as L,ai as C,P,E,U as R,N as w,aj as D,F as U}from"./index-MlRogoGm.js";import{d as N,B as g}from"./heroui-BI50yK5B.js";function M(s,t){return{[s]:t}}const B=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=x.useState(null),a=x.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function z({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",b="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r),[m,p]=x.useState(null),c=D();x.useEffect(()=>{i(r)},[r]);const o=l.trim()!==r,d=l.trim(),h=m!==null&&m===d;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:l,disabled:n,placeholder:"unset",onChange:v=>{i(v.target.value),c.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(d===""?null:d),children:"Save"}),e.jsx(g,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:d===""||c.isPending,onPress:()=>{p(d),c.mutate({service:s.service,url:d})},children:c.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:c.isPending||!h?null:c.error?e.jsx("span",{className:"text-red-700",children:w(c.error)}):c.data?e.jsx("span",{className:c.data.ok?"font-medium text-green-700":"text-red-700",children:c.data.reason}):null}),e.jsx(j,{message:a})]})]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:p=>i(p.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(l.trim()===""?null:l.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l.trim(),p=Number(m),o=(m===""||Number.isInteger(p)&&p>=1)&&m!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:d=>i(d.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(m===""?null:p),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(U,{ariaLabel:s.key,value:r,onChange:l=>t(l==="default"?null:l==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function O({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(F,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n})}function V(){const s=L(),t=C(),[a,n]=$(),[r,l]=x.useState({}),i=s.data,m=!i||t.isPending,p=new Map(((i==null?void 0:i.fields)??[]).map(o=>[o.key,o])),c=(o,d)=>{l(h=>{const{[o.key]:v,...u}=h;return u}),t.mutate(M(o.key,d),{onSuccess:()=>n(`${o.key} saved`),onError:h=>l(v=>({...v,[o.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(E,{error:s.error}),s.isLoading?e.jsx(R,{}):null,B.map(o=>{const d=o.order.map(u=>p.get(u)).filter(u=>u!==void 0),h=((i==null?void 0:i.fields)??[]).filter(u=>u.service===o.key&&!o.order.includes(u.key)),v=[...d,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:o.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:o.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(O,{field:u,onSave:T=>c(u,T),saveError:r[u.key],disabled:m},u.key))})})]},o.key)}),e.jsx(z,{message:a})]})}export{V as ToolsGuardrailsPage}; diff --git a/src/gateway/static/dashboard/assets/UsagePage-CGU7s9AT.js b/src/gateway/static/dashboard/assets/UsagePage-BAefkQlH.js similarity index 98% rename from src/gateway/static/dashboard/assets/UsagePage-CGU7s9AT.js rename to src/gateway/static/dashboard/assets/UsagePage-BAefkQlH.js index 374685167..e5263271a 100644 --- a/src/gateway/static/dashboard/assets/UsagePage-CGU7s9AT.js +++ b/src/gateway/static/dashboard/assets/UsagePage-BAefkQlH.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as Ae,r as i}from"./react-dgEcD0HR.js";import{u as Ue,a as Re,k as te,e as Oe,d as Y,W as T,ak as ke,P as Ke,E as ye,al as je,R as $e,j as se,w as Be,X as q,_ as A,Z as V,a0 as Ie,am as B,f as ze,g as He,h as Ze,b as Ge,c as xe}from"./index-Bi2hajrg.js";import{A as We,F as Ye}from"./FilterChips-Dqy1SR3R.js";import{u as Qe,r as Ve,B as Je}from"./tableSelection-9hV37uhu.js";import{S as ae,B as Xe}from"./charts-DIsd9m--.js";import{C as et}from"./ConfirmDialog-ChuHp-Qm.js";import{D as we}from"./DataTable-Bmn_eYSV.js";import{T as tt,S as st}from"./TablePagination-8CBn4us4.js";import{B as I,S as pe}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function Q(t){return t.toLocaleString()}function at(t){return t===null?"—":t<1e3?`${Math.round(t)} ms`:`${(t/1e3).toFixed(2)} s`}const fe=ze(je,ke),ne=15,_e="__other__",ve="__unknown__";function Se({title:t,rows:r,totalCost:h,emptyLabel:n,onDrill:v,loading:m}){const[c,x]=i.useState(!1),j=c?r:r.slice(0,ne),U=r.length-j.length,N=o=>o.is_other?_e:o.key??ve,R=[{id:"name",header:t.replace("Spend by ",""),isRowHeader:!0,cell:o=>{const d=h>0?o.cost/h:0;return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate text-[var(--otari-ink)]",children:o.is_other?`Other (${o.requests.toLocaleString()} req)`:o.key===null?"(unknown)":o.key}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,d*100)}%`}})})]})}},{id:"requests",header:"Requests",align:"end",cell:o=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:Q(o.requests)})},{id:"spend",header:"Spend",align:"end",cell:o=>e.jsx("span",{className:"text-[var(--otari-ink)]",children:V(o.cost)})}];return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(we,{ariaLabel:t,columns:R,rows:j,getRowKey:N,isLoading:m,emptyContent:n,onRowAction:o=>{o!==_e&&o!==ve&&v(o)}}),!m&&U>0?e.jsxs(I,{size:"sm",variant:"ghost",onPress:()=>x(!0),children:["Show all ",r.length]}):null,!m&&c&&r.length>ne?e.jsxs(I,{size:"sm",variant:"ghost",onPress:()=>x(!1),children:["Show top ",ne]}):null]})}const nt=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function ot(t,r){return r==="cost"?t.cost:r==="tokens"?t.tokens:t.requests}function be(t,r){return r==="cost"?V(t):r==="tokens"?B(t):Q(t)}function rt(t,r){const h=new Date(t);return Number.isNaN(h.getTime())?t:r==="hour"?h.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):h.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function lt(t,r,h){const n=t.map(m=>({label:rt(m.bucket_start,h),value:ot(m,r)})),v=n.length?Math.max(...n.map(m=>m.value)):0;return{points:n,peak:v,count:t.length}}const it=50;function ct(t){const r=new Date(t).getTime();if(Number.isNaN(r))return t;const h=Math.max(0,Math.round((Date.now()-r)/1e3));if(h<60)return`${h}s ago`;const n=Math.round(h/60);if(n<60)return`${n}m ago`;const v=Math.round(n/60);return v<24?`${v}h ago`:`${Math.round(v/24)}d ago`}function dt({status:t}){return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:t})}const ut=[{id:"time",header:"Time",isRowHeader:!0,cell:t=>e.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(t.timestamp).toLocaleString(),children:ct(t.timestamp)})},{id:"model",header:"Model",cell:t=>e.jsx("span",{className:"text-[var(--otari-ink)]",children:t.model})},{id:"user",header:"User",cell:t=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:t.user_id??"—"})},{id:"tokens",header:"Tokens",align:"end",cell:t=>t.total_tokens===null?"—":t.total_tokens.toLocaleString()},{id:"cost",header:"Cost",align:"end",cell:t=>t.cost===null?"—":V(t.cost)},{id:"status",header:"Status",cell:t=>e.jsx(dt,{status:t.status})}],mt=t=>t.id;function ht({filters:t,anyFilter:r}){var $,H;const[h,n]=i.useState(0),[v,m]=i.useState(it),c=Qe(),x=He(),j=Ze(),[U,N]=i.useState(!1),[R,o]=i.useState(!1),d=JSON.stringify(t),L=i.useRef(d);i.useEffect(()=>{L.current!==d&&(L.current=d,n(0),c.clear())},[d,c]);const p=Ge(t,h,v),C=xe(t),g=p.data??[],P=C.isSuccess&&!C.isPlaceholderData?(($=C.data)==null?void 0:$.total)??0:null,O=g.filter(_=>!_.counts_toward_budget).map(_=>_.id),f=g.filter(_=>_.counts_toward_budget).map(_=>_.id),S=Ve(c.selectedKeys,O),b=S.length,y=c.allMatching||b>0,D=i.useMemo(()=>({...t,counts_toward_budget:!1}),[t]),k=xe(D,y),E=k.isSuccess?((H=k.data)==null?void 0:H.total)??null:null,K=O.length>0&&b===O.length&&E!=null&&E>b,F=c.allMatching?E??b:b,l=()=>c.allMatching?{by_filter:!0,model:t.model,user_id:t.user_id,api_key_id:t.api_key_id,start_date:t.start_date,end_date:t.end_date,priced:t.priced}:{ids:S},a=()=>x.mutate(l(),{onSuccess:()=>{N(!1),c.clear()}}),u=_=>j.mutate({...l(),..._},{onSuccess:()=>{o(!1),c.clear()}});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Individual requests"}),e.jsx(ye,{error:p.error??C.error}),y?e.jsxs(Je,{selectedCount:F,allMatching:c.allMatching,matchingTotal:E,canSelectAllMatching:K,onSelectAllMatching:c.enableAllMatching,onClear:c.clear,children:[e.jsx(I,{size:"sm",variant:"primary",onPress:()=>o(!0),children:"Set price"}),e.jsx(I,{size:"sm",variant:"danger",onPress:()=>N(!0),children:"Delete"})]}):null,e.jsx(we,{ariaLabel:"Individual requests",columns:ut,rows:g,getRowKey:mt,isLoading:p.isLoading,emptyContent:r?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:c.selectedKeys,onSelectionChange:c.onSelectionChange,disabledKeys:f}),e.jsx(tt,{page:h,pageSize:v,total:P,rowsOnPage:g.length,onPageChange:n,onPageSizeChange:_=>{m(_),n(0)},isFetching:p.isFetching,hasNextFallback:g.length===v}),e.jsx(et,{isOpen:U,onOpenChange:N,heading:"Delete usage rows",body:`Delete ${F.toLocaleString()} imported ${F===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:x.isPending,error:x.error,onConfirm:a}),e.jsx(st,{isOpen:R,onOpenChange:o,targetCount:F,isPending:j.isPending,error:j.error,onSubmit:u})]})}function wt(){var ue,me,he,ge;const t=Ae(),r=Ue(),h=Re(),[n,v]=i.useState(fe),[m,c]=i.useState(()=>te(fe.seconds??0)),[x,j]=i.useState(!1),[U,N]=i.useState(),[R,o]=i.useState(),[d,L]=i.useState(""),[p,C]=i.useState(""),[g,z]=i.useState(""),[P,O]=i.useState("cost"),f=x?U:m,S=x?R:void 0,b=x?f?Oe(f,S):"day":n.bucket,y=i.useMemo(()=>({start_date:f,end_date:S,model:d.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0}),[f,S,d,p,g]),D=i.useMemo(()=>{if(x){if(!f||!S)return null;const s=new Date(S).getTime()-new Date(f).getTime();return s>0?{...y,start_date:new Date(new Date(f).getTime()-s).toISOString(),end_date:f}:null}return!m||n.seconds===null?null:{...y,start_date:new Date(new Date(m).getTime()-n.seconds*1e3).toISOString(),end_date:m}},[x,f,S,y,n.seconds,m]),k=Y(y,b),E=Y(D??y,b,D!==null),oe=i.useMemo(()=>({start_date:m,model:d.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0}),[m,d,p,g]),K=Y(oe,n.bucket),F=(((ue=K.data)==null?void 0:ue.series)??[]).map(s=>({bucketStart:s.bucket_start,requests:s.requests})),l=k.data,a=l==null?void 0:l.totals,u=D!==null?(me=E.data)==null?void 0:me.totals:void 0,$=a?T(a.cost,u==null?void 0:u.cost):null,H=i.useMemo(()=>({...y,model:void 0}),[y]),_=Y(H,b),J=((ge=(he=_.data)==null?void 0:he.by_model)==null?void 0:ge.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],re=(r.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),le=(h.data??[]).map(s=>({value:s.id,label:s.key_name??`${s.id.slice(0,8)}…`})),Ne=(d&&!J.includes(d)?[d,...J]:J).map(s=>({value:s,label:s})),Ce=x||n.key!==ke,Z=!!(d.trim()||p||g||Ce),ie=(s,w)=>{var G;return((G=s.find(W=>W.value===w))==null?void 0:G.label)??w},Pe=()=>{L(""),C(""),z("")},Ee=[...p?[{key:"user",label:"User",value:ie(re,p),onClear:()=>C("")}]:[],...d.trim()?[{key:"model",label:"Model",value:d.trim(),onClear:()=>L("")}]:[],...g?[{key:"key",label:"API key",value:ie(le,g),onClear:()=>z("")}]:[]],qe=!!(l&&a&&a.request_count===0&&!Z),Le=(l==null?void 0:l.start_date)??f,De=(l==null?void 0:l.end_date)??S,ce=s=>{j(!1),v(s),c(te(s.seconds??0)),N(void 0),o(void 0)},Fe=(s,w)=>{j(!0),N(s),o(w)},Me=()=>{x||c(te(n.seconds??0)),k.refetch(),K.refetch(),_.refetch(),D!==null&&E.refetch()},de=s=>{const w=new URLSearchParams;f&&w.set("start_date",f),S&&w.set("end_date",S);for(const[G,W]of Object.entries(s))W&&w.set(G,W);t(`/activity?${w.toString()}`)},Te=a&&a.request_count>0?a.error_count/a.request_count:0,M=(l==null?void 0:l.series)??[],X=M.length>1,ee=lt(M,P,b);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Ke,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log."}),e.jsx(ye,{error:k.error}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(We,{presets:je,extentKey:n.key,onPreset:ce,onSelectRange:Fe,onSelectFull:()=>ce(n),series:F,bucket:n.bucket,windowStart:Le,windowEnd:De,loading:K.isLoading,ariaLabel:"Usage request volume over the selected window",action:e.jsx($e,{onRefresh:Me,isFetching:k.isFetching,updatedAt:k.dataUpdatedAt})}),e.jsxs(Ye,{chips:Ee,onClearAll:Pe,children:[e.jsx(se,{label:"User",value:p,onChange:C,options:re,placeholder:"All users"}),e.jsx(se,{label:"Model",value:d,onChange:L,options:Ne,placeholder:"All models"}),e.jsx(se,{label:"API key",value:g,onChange:z,options:le,placeholder:"All keys"})]})]}),qe?e.jsx(Be,{title:"No usage yet",description:"Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[e.jsx(q,{label:"Tracked cost",value:a?V(a.cost):"—",hint:a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[e.jsx(A,{fraction:$}),a.unpriced_requests?`${$!==null?" · ":""}${Q(a.unpriced_requests)} unpriced`:null]}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),e.jsx(q,{label:"Requests",value:a?Q(a.request_count):"—",hint:a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Ie(Te)," errors",u?e.jsxs(e.Fragment,{children:[" · ",e.jsx(A,{fraction:T(a.request_count,u.request_count)})]}):null]}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),e.jsx(q,{label:"Tokens",value:a?B(a.total_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.total_tokens,u==null?void 0:u.total_tokens)}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.tokens),ariaLabel:"Token usage trend over the selected window"}):void 0}),e.jsx(q,{label:"Cache read",value:a?B(a.cache_read_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.cache_read_tokens,u==null?void 0:u.cache_read_tokens)}):null}),e.jsx(q,{label:"Cache write",value:a?B(a.cache_write_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.cache_write_tokens,u==null?void 0:u.cache_write_tokens)}):null}),e.jsx(q,{label:"1h cache write",value:a?B(a.cache_write_1h_tokens??0):"—",hint:a?e.jsx(A,{fraction:T(a.cache_write_1h_tokens??0,(u==null?void 0:u.cache_write_1h_tokens)??0)}):null}),e.jsx(q,{label:"Avg latency",value:a?at(a.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(Se,{title:"Spend by model",rows:(l==null?void 0:l.by_model)??[],totalCost:(a==null?void 0:a.cost)??0,emptyLabel:Z?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>de({model:s,user_id:p||void 0,api_key_id:g||void 0}),loading:k.isLoading}),e.jsx(Se,{title:"Spend by user",rows:(l==null?void 0:l.by_user)??[],totalCost:(a==null?void 0:a.cost)??0,emptyLabel:Z?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>de({user_id:s,model:d.trim()||void 0,api_key_id:g||void 0}),loading:k.isLoading})]}),e.jsx(ht,{filters:y,anyFilter:Z}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[nt.map(s=>e.jsx(I,{size:"sm",variant:P===s.key?"primary":"outline",onPress:()=>O(s.key),children:s.label},s.key)),k.isFetching?e.jsx(pe,{size:"sm"}):null]})]}),k.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(pe,{size:"sm"})}):M.length===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsx(Xe,{data:ee.points,formatValue:s=>be(s,P),ariaLabel:`${P} per ${b}`}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[be(ee.peak,P)," peak · ",ee.count," ",b==="hour"?"hours":"days"," (times in UTC)"]})]})]})]})]})}export{wt as UsagePage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as Ae,r as i}from"./react-dgEcD0HR.js";import{u as Ue,a as Re,k as te,e as Oe,d as Y,W as T,ak as ke,P as Ke,E as ye,al as je,R as $e,j as se,w as Be,X as q,_ as A,Z as V,a0 as Ie,am as B,f as ze,g as He,h as Ze,b as Ge,c as xe}from"./index-MlRogoGm.js";import{A as We,F as Ye}from"./FilterChips-CxOVvh-O.js";import{u as Qe,r as Ve,B as Je}from"./tableSelection-9hV37uhu.js";import{S as ae,B as Xe}from"./charts-DIsd9m--.js";import{C as et}from"./ConfirmDialog-P_P4TNFr.js";import{D as we}from"./DataTable-Bmn_eYSV.js";import{T as tt,S as st}from"./TablePagination-BHTN5PVb.js";import{B as I,S as pe}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function Q(t){return t.toLocaleString()}function at(t){return t===null?"—":t<1e3?`${Math.round(t)} ms`:`${(t/1e3).toFixed(2)} s`}const fe=ze(je,ke),ne=15,_e="__other__",ve="__unknown__";function Se({title:t,rows:r,totalCost:h,emptyLabel:n,onDrill:v,loading:m}){const[c,x]=i.useState(!1),j=c?r:r.slice(0,ne),U=r.length-j.length,N=o=>o.is_other?_e:o.key??ve,R=[{id:"name",header:t.replace("Spend by ",""),isRowHeader:!0,cell:o=>{const d=h>0?o.cost/h:0;return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate text-[var(--otari-ink)]",children:o.is_other?`Other (${o.requests.toLocaleString()} req)`:o.key===null?"(unknown)":o.key}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,d*100)}%`}})})]})}},{id:"requests",header:"Requests",align:"end",cell:o=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:Q(o.requests)})},{id:"spend",header:"Spend",align:"end",cell:o=>e.jsx("span",{className:"text-[var(--otari-ink)]",children:V(o.cost)})}];return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(we,{ariaLabel:t,columns:R,rows:j,getRowKey:N,isLoading:m,emptyContent:n,onRowAction:o=>{o!==_e&&o!==ve&&v(o)}}),!m&&U>0?e.jsxs(I,{size:"sm",variant:"ghost",onPress:()=>x(!0),children:["Show all ",r.length]}):null,!m&&c&&r.length>ne?e.jsxs(I,{size:"sm",variant:"ghost",onPress:()=>x(!1),children:["Show top ",ne]}):null]})}const nt=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function ot(t,r){return r==="cost"?t.cost:r==="tokens"?t.tokens:t.requests}function be(t,r){return r==="cost"?V(t):r==="tokens"?B(t):Q(t)}function rt(t,r){const h=new Date(t);return Number.isNaN(h.getTime())?t:r==="hour"?h.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):h.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function lt(t,r,h){const n=t.map(m=>({label:rt(m.bucket_start,h),value:ot(m,r)})),v=n.length?Math.max(...n.map(m=>m.value)):0;return{points:n,peak:v,count:t.length}}const it=50;function ct(t){const r=new Date(t).getTime();if(Number.isNaN(r))return t;const h=Math.max(0,Math.round((Date.now()-r)/1e3));if(h<60)return`${h}s ago`;const n=Math.round(h/60);if(n<60)return`${n}m ago`;const v=Math.round(n/60);return v<24?`${v}h ago`:`${Math.round(v/24)}d ago`}function dt({status:t}){return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:t})}const ut=[{id:"time",header:"Time",isRowHeader:!0,cell:t=>e.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(t.timestamp).toLocaleString(),children:ct(t.timestamp)})},{id:"model",header:"Model",cell:t=>e.jsx("span",{className:"text-[var(--otari-ink)]",children:t.model})},{id:"user",header:"User",cell:t=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:t.user_id??"—"})},{id:"tokens",header:"Tokens",align:"end",cell:t=>t.total_tokens===null?"—":t.total_tokens.toLocaleString()},{id:"cost",header:"Cost",align:"end",cell:t=>t.cost===null?"—":V(t.cost)},{id:"status",header:"Status",cell:t=>e.jsx(dt,{status:t.status})}],mt=t=>t.id;function ht({filters:t,anyFilter:r}){var $,H;const[h,n]=i.useState(0),[v,m]=i.useState(it),c=Qe(),x=He(),j=Ze(),[U,N]=i.useState(!1),[R,o]=i.useState(!1),d=JSON.stringify(t),L=i.useRef(d);i.useEffect(()=>{L.current!==d&&(L.current=d,n(0),c.clear())},[d,c]);const p=Ge(t,h,v),C=xe(t),g=p.data??[],P=C.isSuccess&&!C.isPlaceholderData?(($=C.data)==null?void 0:$.total)??0:null,O=g.filter(_=>!_.counts_toward_budget).map(_=>_.id),f=g.filter(_=>_.counts_toward_budget).map(_=>_.id),S=Ve(c.selectedKeys,O),b=S.length,y=c.allMatching||b>0,D=i.useMemo(()=>({...t,counts_toward_budget:!1}),[t]),k=xe(D,y),E=k.isSuccess?((H=k.data)==null?void 0:H.total)??null:null,K=O.length>0&&b===O.length&&E!=null&&E>b,F=c.allMatching?E??b:b,l=()=>c.allMatching?{by_filter:!0,model:t.model,user_id:t.user_id,api_key_id:t.api_key_id,start_date:t.start_date,end_date:t.end_date,priced:t.priced}:{ids:S},a=()=>x.mutate(l(),{onSuccess:()=>{N(!1),c.clear()}}),u=_=>j.mutate({...l(),..._},{onSuccess:()=>{o(!1),c.clear()}});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Individual requests"}),e.jsx(ye,{error:p.error??C.error}),y?e.jsxs(Je,{selectedCount:F,allMatching:c.allMatching,matchingTotal:E,canSelectAllMatching:K,onSelectAllMatching:c.enableAllMatching,onClear:c.clear,children:[e.jsx(I,{size:"sm",variant:"primary",onPress:()=>o(!0),children:"Set price"}),e.jsx(I,{size:"sm",variant:"danger",onPress:()=>N(!0),children:"Delete"})]}):null,e.jsx(we,{ariaLabel:"Individual requests",columns:ut,rows:g,getRowKey:mt,isLoading:p.isLoading,emptyContent:r?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:c.selectedKeys,onSelectionChange:c.onSelectionChange,disabledKeys:f}),e.jsx(tt,{page:h,pageSize:v,total:P,rowsOnPage:g.length,onPageChange:n,onPageSizeChange:_=>{m(_),n(0)},isFetching:p.isFetching,hasNextFallback:g.length===v}),e.jsx(et,{isOpen:U,onOpenChange:N,heading:"Delete usage rows",body:`Delete ${F.toLocaleString()} imported ${F===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:x.isPending,error:x.error,onConfirm:a}),e.jsx(st,{isOpen:R,onOpenChange:o,targetCount:F,isPending:j.isPending,error:j.error,onSubmit:u})]})}function wt(){var ue,me,he,ge;const t=Ae(),r=Ue(),h=Re(),[n,v]=i.useState(fe),[m,c]=i.useState(()=>te(fe.seconds??0)),[x,j]=i.useState(!1),[U,N]=i.useState(),[R,o]=i.useState(),[d,L]=i.useState(""),[p,C]=i.useState(""),[g,z]=i.useState(""),[P,O]=i.useState("cost"),f=x?U:m,S=x?R:void 0,b=x?f?Oe(f,S):"day":n.bucket,y=i.useMemo(()=>({start_date:f,end_date:S,model:d.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0}),[f,S,d,p,g]),D=i.useMemo(()=>{if(x){if(!f||!S)return null;const s=new Date(S).getTime()-new Date(f).getTime();return s>0?{...y,start_date:new Date(new Date(f).getTime()-s).toISOString(),end_date:f}:null}return!m||n.seconds===null?null:{...y,start_date:new Date(new Date(m).getTime()-n.seconds*1e3).toISOString(),end_date:m}},[x,f,S,y,n.seconds,m]),k=Y(y,b),E=Y(D??y,b,D!==null),oe=i.useMemo(()=>({start_date:m,model:d.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0}),[m,d,p,g]),K=Y(oe,n.bucket),F=(((ue=K.data)==null?void 0:ue.series)??[]).map(s=>({bucketStart:s.bucket_start,requests:s.requests})),l=k.data,a=l==null?void 0:l.totals,u=D!==null?(me=E.data)==null?void 0:me.totals:void 0,$=a?T(a.cost,u==null?void 0:u.cost):null,H=i.useMemo(()=>({...y,model:void 0}),[y]),_=Y(H,b),J=((ge=(he=_.data)==null?void 0:he.by_model)==null?void 0:ge.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],re=(r.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),le=(h.data??[]).map(s=>({value:s.id,label:s.key_name??`${s.id.slice(0,8)}…`})),Ne=(d&&!J.includes(d)?[d,...J]:J).map(s=>({value:s,label:s})),Ce=x||n.key!==ke,Z=!!(d.trim()||p||g||Ce),ie=(s,w)=>{var G;return((G=s.find(W=>W.value===w))==null?void 0:G.label)??w},Pe=()=>{L(""),C(""),z("")},Ee=[...p?[{key:"user",label:"User",value:ie(re,p),onClear:()=>C("")}]:[],...d.trim()?[{key:"model",label:"Model",value:d.trim(),onClear:()=>L("")}]:[],...g?[{key:"key",label:"API key",value:ie(le,g),onClear:()=>z("")}]:[]],qe=!!(l&&a&&a.request_count===0&&!Z),Le=(l==null?void 0:l.start_date)??f,De=(l==null?void 0:l.end_date)??S,ce=s=>{j(!1),v(s),c(te(s.seconds??0)),N(void 0),o(void 0)},Fe=(s,w)=>{j(!0),N(s),o(w)},Me=()=>{x||c(te(n.seconds??0)),k.refetch(),K.refetch(),_.refetch(),D!==null&&E.refetch()},de=s=>{const w=new URLSearchParams;f&&w.set("start_date",f),S&&w.set("end_date",S);for(const[G,W]of Object.entries(s))W&&w.set(G,W);t(`/activity?${w.toString()}`)},Te=a&&a.request_count>0?a.error_count/a.request_count:0,M=(l==null?void 0:l.series)??[],X=M.length>1,ee=lt(M,P,b);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Ke,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log."}),e.jsx(ye,{error:k.error}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(We,{presets:je,extentKey:n.key,onPreset:ce,onSelectRange:Fe,onSelectFull:()=>ce(n),series:F,bucket:n.bucket,windowStart:Le,windowEnd:De,loading:K.isLoading,ariaLabel:"Usage request volume over the selected window",action:e.jsx($e,{onRefresh:Me,isFetching:k.isFetching,updatedAt:k.dataUpdatedAt})}),e.jsxs(Ye,{chips:Ee,onClearAll:Pe,children:[e.jsx(se,{label:"User",value:p,onChange:C,options:re,placeholder:"All users"}),e.jsx(se,{label:"Model",value:d,onChange:L,options:Ne,placeholder:"All models"}),e.jsx(se,{label:"API key",value:g,onChange:z,options:le,placeholder:"All keys"})]})]}),qe?e.jsx(Be,{title:"No usage yet",description:"Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[e.jsx(q,{label:"Tracked cost",value:a?V(a.cost):"—",hint:a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[e.jsx(A,{fraction:$}),a.unpriced_requests?`${$!==null?" · ":""}${Q(a.unpriced_requests)} unpriced`:null]}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),e.jsx(q,{label:"Requests",value:a?Q(a.request_count):"—",hint:a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Ie(Te)," errors",u?e.jsxs(e.Fragment,{children:[" · ",e.jsx(A,{fraction:T(a.request_count,u.request_count)})]}):null]}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),e.jsx(q,{label:"Tokens",value:a?B(a.total_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.total_tokens,u==null?void 0:u.total_tokens)}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.tokens),ariaLabel:"Token usage trend over the selected window"}):void 0}),e.jsx(q,{label:"Cache read",value:a?B(a.cache_read_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.cache_read_tokens,u==null?void 0:u.cache_read_tokens)}):null}),e.jsx(q,{label:"Cache write",value:a?B(a.cache_write_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.cache_write_tokens,u==null?void 0:u.cache_write_tokens)}):null}),e.jsx(q,{label:"1h cache write",value:a?B(a.cache_write_1h_tokens??0):"—",hint:a?e.jsx(A,{fraction:T(a.cache_write_1h_tokens??0,(u==null?void 0:u.cache_write_1h_tokens)??0)}):null}),e.jsx(q,{label:"Avg latency",value:a?at(a.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(Se,{title:"Spend by model",rows:(l==null?void 0:l.by_model)??[],totalCost:(a==null?void 0:a.cost)??0,emptyLabel:Z?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>de({model:s,user_id:p||void 0,api_key_id:g||void 0}),loading:k.isLoading}),e.jsx(Se,{title:"Spend by user",rows:(l==null?void 0:l.by_user)??[],totalCost:(a==null?void 0:a.cost)??0,emptyLabel:Z?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>de({user_id:s,model:d.trim()||void 0,api_key_id:g||void 0}),loading:k.isLoading})]}),e.jsx(ht,{filters:y,anyFilter:Z}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[nt.map(s=>e.jsx(I,{size:"sm",variant:P===s.key?"primary":"outline",onPress:()=>O(s.key),children:s.label},s.key)),k.isFetching?e.jsx(pe,{size:"sm"}):null]})]}),k.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(pe,{size:"sm"})}):M.length===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsx(Xe,{data:ee.points,formatValue:s=>be(s,P),ariaLabel:`${P} per ${b}`}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[be(ee.peak,P)," peak · ",ee.count," ",b==="hour"?"hours":"days"," (times in UTC)"]})]})]})]})]})}export{wt as UsagePage}; diff --git a/src/gateway/static/dashboard/assets/UsersPage-CUF9BhT-.js b/src/gateway/static/dashboard/assets/UsersPage-Lrd1SvIH.js similarity index 98% rename from src/gateway/static/dashboard/assets/UsersPage-CUF9BhT-.js rename to src/gateway/static/dashboard/assets/UsersPage-Lrd1SvIH.js index 7e094b9d3..4b496db22 100644 --- a/src/gateway/static/dashboard/assets/UsersPage-CUF9BhT-.js +++ b/src/gateway/static/dashboard/assets/UsersPage-Lrd1SvIH.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r}from"./react-dgEcD0HR.js";import{u as Q,q as M,v as K,ar as X,P as Y,E as A,w as Z,as as ee,F as se}from"./index-Bi2hajrg.js";import{u as te,r as ae,B as ne}from"./tableSelection-9hV37uhu.js";import{C as re}from"./ConfirmDialog-ChuHp-Qm.js";import{D as le}from"./DataTable-Bmn_eYSV.js";import{F as B}from"./Field-Dwp6u3t8.js";import{a as ie,M as R}from"./ModelScopeControl-DNcVzk1f.js";import{f as I,B as d,d as S,A as f}from"./heroui-BI50yK5B.js";const de=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return de.format(t)}const oe=t=>t.user_id,D=t=>t.startsWith("apikey-");function H(t){return t.split("-")[0]}function E(t){return t.name??H(t.budget_id)}function $({value:t,onChange:l,budgets:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>l(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),n.map(a=>e.jsxs("option",{value:a.budget_id,children:[E(a),a.max_budget===null?" · no limit":` · ${U(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function ce({onClose:t}){const l=ee(),n=M(),[a,i]=r.useState(""),[o,u]=r.useState(""),[c,g]=r.useState(null),[p,m]=r.useState(null),[b,j]=r.useState(!0),x=()=>{if(l.isPending||!b||a.trim()==="")return;const h={user_id:a.trim(),alias:o.trim()||null,budget_id:c,allowed_models:p};l.mutate(h,{onSuccess:t})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:l.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(B,{label:"User ID",value:a,onChange:i,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(B,{label:"Alias (optional)",value:o,onChange:u,placeholder:"Alice"})]}),e.jsx($,{value:c,onChange:g,budgets:n.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{m(h),j(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:l.isPending||!b||a.trim()==="",onPress:x,children:l.isPending?"Creating…":"Create user"}),e.jsx(d,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ue({user:t,onClose:l}){const n=K(),a=M(),[i,o]=r.useState(t.alias??""),[u,c]=r.useState(t.budget_id),[g,p]=r.useState(t.allowed_models),[m,b]=r.useState(!0),j=()=>{if(n.isPending||!m)return;const x={alias:i.trim()||null,budget_id:u,allowed_models:g};n.mutate({id:t.user_id,body:x},{onSuccess:l})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:n.error}),e.jsx(B,{label:"Alias",value:i,onChange:o,placeholder:"Alice"}),e.jsx($,{value:u,onChange:c,budgets:a.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(x,h)=>{p(x),b(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:n.isPending||!m,onPress:j,children:n.isPending?"Saving…":"Save changes"}),e.jsx(d,{variant:"ghost",onPress:l,children:"Cancel"})]})]})})}function ge({trigger:t,message:l,confirmLabel:n,isPending:a,onConfirm:i}){const[o,u]=r.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:l}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(d,{size:"sm",variant:"danger",isDisabled:a,onPress:i,children:n}),e.jsx(d,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>u(!1),children:"Cancel"})]})]}):e.jsx(d,{size:"sm",variant:"danger-soft",onPress:()=>u(!0),children:t})}function me({user:t}){return t.blocked?e.jsx(I,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(I,{size:"sm",color:"accent",children:"Active"})}function xe({allowed:t}){const{text:l,tone:n}=ie(t),a=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",i=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:i,children:l})}function he({isOpen:t,onOpenChange:l,budgets:n,count:a,isPending:i,error:o,onAssign:u}){const[c,g]=r.useState("");return r.useEffect(()=>{t&&g("")},[t]),e.jsx(f,{isOpen:t,onOpenChange:l,children:t?e.jsx(f.Backdrop,{children:e.jsx(f.Container,{placement:"center",size:"md",children:e.jsxs(f.Dialog,{children:[e.jsx(f.Header,{children:e.jsx(f.Heading,{children:"Assign budget"})}),e.jsxs(f.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Assign a budget to ",a," selected ",a===1?"user":"users","."]}),e.jsx(se,{label:"Budget",value:c,onChange:g,options:[{value:"",label:"Select a budget…"},...n.map(p=>({value:p.budget_id,label:E(p)}))]}),e.jsx(A,{error:o})]}),e.jsxs(f.Footer,{children:[e.jsx(d,{variant:"ghost",isDisabled:i,onPress:()=>l(!1),children:"Cancel"}),e.jsx(d,{variant:"primary",isDisabled:!c,isPending:i,onPress:()=>u(c),children:"Assign"})]})]})})}):null})}function Ae(){const t=Q(),l=M(),n=K(),a=X(),[i,o]=r.useState(!1),[u,c]=r.useState(null),[g,p]=r.useState(!1),m=t.data??[],b=t.isLoading,j=m.filter(s=>D(s.user_id)).length,x=g?m:m.filter(s=>!D(s.user_id)),h=m.find(s=>s.user_id===u)??null,C=!b&&x.length===0&&!i,P=r.useMemo(()=>new Map((l.data??[]).map(s=>[s.budget_id,s])),[l.data]),y=te(),[q,_]=r.useState(!1),[W,N]=r.useState(!1),[F,z]=r.useState(void 0),[T,L]=r.useState(!1),G=x.map(s=>s.user_id),v=ae(y.selectedKeys,G),O=r.useCallback((s,k)=>n.mutate({id:s.user_id,body:{blocked:k}}),[n.mutate]),V=async(s,k)=>{L(!0),z(void 0);try{for(const w of v)await s(w);y.clear(),k()}catch(w){z(w)}finally{L(!1)}},J=r.useMemo(()=>[{id:"user",header:"User",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-medium text-[var(--otari-ink)]",children:s.user_id}),D(s.user_id)?e.jsx(I,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})},{id:"status",header:"Status",cell:s=>e.jsx(me,{user:s})},{id:"budget",header:"Budget",cell:s=>s.budget_id?e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.budget_id,children:P.get(s.budget_id)?E(P.get(s.budget_id)):H(s.budget_id)}):e.jsx("span",{className:"text-[var(--otari-muted)]",children:"—"})},{id:"spend",header:"Spend",cell:s=>e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[U(s.spend),s.reserved>0?e.jsxs("span",{children:[" (+",U(s.reserved)," held)"]}):null]})},{id:"access",header:"Model access",cell:s=>e.jsx(xe,{allowed:s.allowed_models})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(d,{size:"sm",variant:"outline",isDisabled:n.isPending,onPress:()=>O(s,!s.blocked),children:s.blocked?"Unblock":"Block"}),e.jsx(d,{size:"sm",variant:"ghost",onPress:()=>{o(!1),c(s.user_id)},children:"Edit"}),e.jsx(ge,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})}],[P,n.isPending,a.isPending,a.mutate,O]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:i?null:e.jsx(d,{variant:"primary",onPress:()=>{c(null),o(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??n.error??a.error}),C?e.jsx(Z,{title:"No users yet",description:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page.",actionLabel:"Create your first user",onAction:()=>{c(null),o(!0)}}):null,j>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>p(s.target.checked)}),"Show auto-created (virtual) users (",j,")"]}):null,i?e.jsx(ce,{onClose:()=>o(!1)}):null,h?e.jsx(ue,{user:h,onClose:()=>c(null)},h.user_id):null,v.length>0?e.jsxs(ne,{selectedCount:v.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:y.clear,children:[e.jsx(d,{size:"sm",variant:"primary",onPress:()=>N(!0),children:"Assign budget"}),e.jsx(d,{size:"sm",variant:"danger",onPress:()=>_(!0),children:"Delete"})]}):null,C?null:e.jsx(le,{ariaLabel:"Users",columns:J,rows:x,getRowKey:oe,isLoading:b,emptyContent:"No users yet. Create one, or create an API key to auto-create one.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange}),e.jsx(re,{isOpen:q,onOpenChange:_,heading:"Delete users",body:`Delete ${v.length} ${v.length===1?"user":"users"}? This deactivates their API keys and hides them; usage history is preserved.`,confirmLabel:"Delete",isPending:T,error:F,onConfirm:()=>V(s=>a.mutateAsync(s),()=>_(!1))}),e.jsx(he,{isOpen:W,onOpenChange:N,budgets:l.data??[],count:v.length,isPending:T,error:F,onAssign:s=>V(k=>n.mutateAsync({id:k,body:{budget_id:s}}),()=>N(!1))})]})}export{Ae as UsersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r}from"./react-dgEcD0HR.js";import{u as Q,q as M,v as K,ar as X,P as Y,E as A,w as Z,as as ee,F as se}from"./index-MlRogoGm.js";import{u as te,r as ae,B as ne}from"./tableSelection-9hV37uhu.js";import{C as re}from"./ConfirmDialog-P_P4TNFr.js";import{D as le}from"./DataTable-Bmn_eYSV.js";import{F as B}from"./Field-Dwp6u3t8.js";import{a as ie,M as R}from"./ModelScopeControl-Bmks7cWc.js";import{f as I,B as d,d as S,A as f}from"./heroui-BI50yK5B.js";const de=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return de.format(t)}const oe=t=>t.user_id,D=t=>t.startsWith("apikey-");function H(t){return t.split("-")[0]}function E(t){return t.name??H(t.budget_id)}function $({value:t,onChange:l,budgets:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>l(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),n.map(a=>e.jsxs("option",{value:a.budget_id,children:[E(a),a.max_budget===null?" · no limit":` · ${U(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function ce({onClose:t}){const l=ee(),n=M(),[a,i]=r.useState(""),[o,u]=r.useState(""),[c,g]=r.useState(null),[p,m]=r.useState(null),[b,j]=r.useState(!0),x=()=>{if(l.isPending||!b||a.trim()==="")return;const h={user_id:a.trim(),alias:o.trim()||null,budget_id:c,allowed_models:p};l.mutate(h,{onSuccess:t})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:l.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(B,{label:"User ID",value:a,onChange:i,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(B,{label:"Alias (optional)",value:o,onChange:u,placeholder:"Alice"})]}),e.jsx($,{value:c,onChange:g,budgets:n.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{m(h),j(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:l.isPending||!b||a.trim()==="",onPress:x,children:l.isPending?"Creating…":"Create user"}),e.jsx(d,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ue({user:t,onClose:l}){const n=K(),a=M(),[i,o]=r.useState(t.alias??""),[u,c]=r.useState(t.budget_id),[g,p]=r.useState(t.allowed_models),[m,b]=r.useState(!0),j=()=>{if(n.isPending||!m)return;const x={alias:i.trim()||null,budget_id:u,allowed_models:g};n.mutate({id:t.user_id,body:x},{onSuccess:l})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:n.error}),e.jsx(B,{label:"Alias",value:i,onChange:o,placeholder:"Alice"}),e.jsx($,{value:u,onChange:c,budgets:a.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(x,h)=>{p(x),b(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:n.isPending||!m,onPress:j,children:n.isPending?"Saving…":"Save changes"}),e.jsx(d,{variant:"ghost",onPress:l,children:"Cancel"})]})]})})}function ge({trigger:t,message:l,confirmLabel:n,isPending:a,onConfirm:i}){const[o,u]=r.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:l}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(d,{size:"sm",variant:"danger",isDisabled:a,onPress:i,children:n}),e.jsx(d,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>u(!1),children:"Cancel"})]})]}):e.jsx(d,{size:"sm",variant:"danger-soft",onPress:()=>u(!0),children:t})}function me({user:t}){return t.blocked?e.jsx(I,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(I,{size:"sm",color:"accent",children:"Active"})}function xe({allowed:t}){const{text:l,tone:n}=ie(t),a=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",i=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:i,children:l})}function he({isOpen:t,onOpenChange:l,budgets:n,count:a,isPending:i,error:o,onAssign:u}){const[c,g]=r.useState("");return r.useEffect(()=>{t&&g("")},[t]),e.jsx(f,{isOpen:t,onOpenChange:l,children:t?e.jsx(f.Backdrop,{children:e.jsx(f.Container,{placement:"center",size:"md",children:e.jsxs(f.Dialog,{children:[e.jsx(f.Header,{children:e.jsx(f.Heading,{children:"Assign budget"})}),e.jsxs(f.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Assign a budget to ",a," selected ",a===1?"user":"users","."]}),e.jsx(se,{label:"Budget",value:c,onChange:g,options:[{value:"",label:"Select a budget…"},...n.map(p=>({value:p.budget_id,label:E(p)}))]}),e.jsx(A,{error:o})]}),e.jsxs(f.Footer,{children:[e.jsx(d,{variant:"ghost",isDisabled:i,onPress:()=>l(!1),children:"Cancel"}),e.jsx(d,{variant:"primary",isDisabled:!c,isPending:i,onPress:()=>u(c),children:"Assign"})]})]})})}):null})}function Ae(){const t=Q(),l=M(),n=K(),a=X(),[i,o]=r.useState(!1),[u,c]=r.useState(null),[g,p]=r.useState(!1),m=t.data??[],b=t.isLoading,j=m.filter(s=>D(s.user_id)).length,x=g?m:m.filter(s=>!D(s.user_id)),h=m.find(s=>s.user_id===u)??null,C=!b&&x.length===0&&!i,P=r.useMemo(()=>new Map((l.data??[]).map(s=>[s.budget_id,s])),[l.data]),y=te(),[q,_]=r.useState(!1),[W,N]=r.useState(!1),[F,z]=r.useState(void 0),[T,L]=r.useState(!1),G=x.map(s=>s.user_id),v=ae(y.selectedKeys,G),O=r.useCallback((s,k)=>n.mutate({id:s.user_id,body:{blocked:k}}),[n.mutate]),V=async(s,k)=>{L(!0),z(void 0);try{for(const w of v)await s(w);y.clear(),k()}catch(w){z(w)}finally{L(!1)}},J=r.useMemo(()=>[{id:"user",header:"User",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-medium text-[var(--otari-ink)]",children:s.user_id}),D(s.user_id)?e.jsx(I,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})},{id:"status",header:"Status",cell:s=>e.jsx(me,{user:s})},{id:"budget",header:"Budget",cell:s=>s.budget_id?e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.budget_id,children:P.get(s.budget_id)?E(P.get(s.budget_id)):H(s.budget_id)}):e.jsx("span",{className:"text-[var(--otari-muted)]",children:"—"})},{id:"spend",header:"Spend",cell:s=>e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[U(s.spend),s.reserved>0?e.jsxs("span",{children:[" (+",U(s.reserved)," held)"]}):null]})},{id:"access",header:"Model access",cell:s=>e.jsx(xe,{allowed:s.allowed_models})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(d,{size:"sm",variant:"outline",isDisabled:n.isPending,onPress:()=>O(s,!s.blocked),children:s.blocked?"Unblock":"Block"}),e.jsx(d,{size:"sm",variant:"ghost",onPress:()=>{o(!1),c(s.user_id)},children:"Edit"}),e.jsx(ge,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})}],[P,n.isPending,a.isPending,a.mutate,O]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:i?null:e.jsx(d,{variant:"primary",onPress:()=>{c(null),o(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??n.error??a.error}),C?e.jsx(Z,{title:"No users yet",description:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page.",actionLabel:"Create your first user",onAction:()=>{c(null),o(!0)}}):null,j>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>p(s.target.checked)}),"Show auto-created (virtual) users (",j,")"]}):null,i?e.jsx(ce,{onClose:()=>o(!1)}):null,h?e.jsx(ue,{user:h,onClose:()=>c(null)},h.user_id):null,v.length>0?e.jsxs(ne,{selectedCount:v.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:y.clear,children:[e.jsx(d,{size:"sm",variant:"primary",onPress:()=>N(!0),children:"Assign budget"}),e.jsx(d,{size:"sm",variant:"danger",onPress:()=>_(!0),children:"Delete"})]}):null,C?null:e.jsx(le,{ariaLabel:"Users",columns:J,rows:x,getRowKey:oe,isLoading:b,emptyContent:"No users yet. Create one, or create an API key to auto-create one.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange}),e.jsx(re,{isOpen:q,onOpenChange:_,heading:"Delete users",body:`Delete ${v.length} ${v.length===1?"user":"users"}? This deactivates their API keys and hides them; usage history is preserved.`,confirmLabel:"Delete",isPending:T,error:F,onConfirm:()=>V(s=>a.mutateAsync(s),()=>_(!1))}),e.jsx(he,{isOpen:W,onOpenChange:N,budgets:l.data??[],count:v.length,isPending:T,error:F,onAssign:s=>V(k=>n.mutateAsync({id:k,body:{budget_id:s}}),()=>N(!1))})]})}export{Ae as UsersPage}; diff --git a/src/gateway/static/dashboard/assets/index-w6diat9F.css b/src/gateway/static/dashboard/assets/index-BqdGY8GQ.css similarity index 93% rename from src/gateway/static/dashboard/assets/index-w6diat9F.css rename to src/gateway/static/dashboard/assets/index-BqdGY8GQ.css index 88a41198c..8cfdebdf5 100644 --- a/src/gateway/static/dashboard/assets/index-w6diat9F.css +++ b/src/gateway/static/dashboard/assets/index-BqdGY8GQ.css @@ -1 +1 @@ -/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--tw-content:"";--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-space-y-reverse:0;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-700:oklch(50.5% .213 27.518);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-500:oklch(72.3% .219 149.579);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-xl:calc(var(--radius) * 1.5);--radius-2xl:calc(var(--radius) * 2);--radius-3xl:calc(var(--radius) * 3);--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow-surface:var(--surface-shadow);--shadow-overlay:var(--overlay-shadow);--border-width-field:var(--field-border-width,var(--border-width));--ease-smooth:ease;--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-fluid:cubic-bezier(.32, .72, 0, 1);--ease-linear:linear}@layer theme.base{:root,.light,.default,[data-theme=light],[data-theme=default]{color-scheme:light;--white:oklch(100% 0 0);--black:oklch(0% 0 0);--snow:oklch(99.11% 0 0);--eclipse:oklch(21.03% .0059 285.89);--spacing:.25rem;--border-width:1px;--field-border-width:0px;--disabled-opacity:.5;--ring-offset-width:2px;--cursor-interactive:pointer;--cursor-disabled:not-allowed;--radius:.5rem;--field-radius:calc(var(--radius) * 1.5);--background:oklch(97.02% 0 0);--foreground:var(--eclipse);--surface:var(--white);--surface-foreground:var(--foreground);--surface-secondary:oklch(95.24% .0013 286.37);--surface-secondary-foreground:var(--foreground);--surface-tertiary:oklch(93.73% .0013 286.37);--surface-tertiary-foreground:var(--foreground);--overlay:var(--white);--overlay-foreground:var(--foreground);--muted:oklch(55.17% .0138 285.94);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(94% .001 286.375);--default-foreground:var(--eclipse);--accent:oklch(62.04% .195 253.83);--accent-foreground:var(--snow);--field-background:var(--white);--field-foreground:oklch(21.03% .0059 285.89);--field-placeholder:var(--muted);--field-border:transparent;--success:oklch(73.29% .1935 150.81);--success-foreground:var(--eclipse);--warning:oklch(78.19% .1585 72.33);--warning-foreground:var(--eclipse);--danger:oklch(65.32% .2328 25.74);--danger-foreground:var(--snow);--segment:var(--white);--segment-foreground:var(--eclipse);--border:oklch(90% .004 286.32);--separator:oklch(92% .004 286.32);--focus:var(--accent);--link:var(--foreground);--backdrop:#00000080;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:color-mix(in oklab, var(--accent) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 70%, var(--foreground) 30%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:color-mix(in oklab, var(--accent) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 70%, var(--foreground) 40%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:color-mix(in oklab, var(--warning) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 70%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:color-mix(in oklab, var(--warning) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:color-mix(in oklab, var(--success) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 60%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:color-mix(in oklab, var(--success) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--overlay-shadow:0 2px 8px 0 #0000000f, 0 -6px 12px 0 #00000008, 0 14px 28px 0 #00000014;--field-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--skeleton-animation:shimmer;--tooltip-delay:1.5s;--tooltip-close-delay:.5s}.dark,[data-theme=dark]{color-scheme:dark;--background:oklch(12% .005 285.823);--foreground:var(--snow);--surface:oklch(21.03% .0059 285.89);--surface-foreground:var(--foreground);--surface-secondary:oklch(25.7% .0037 286.14);--surface-tertiary:oklch(27.21% .0024 247.91);--overlay:oklch(21.03% .0059 285.89);--overlay-foreground:var(--foreground);--muted:oklch(70.5% .015 286.067);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}.dark,[data-theme=dark]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(27.4% .006 286.033);--default-foreground:var(--snow);--field-background:oklch(21.03% .0059 285.89);--field-foreground:var(--foreground);--warning:oklch(82.03% .1388 76.34);--warning-foreground:var(--eclipse);--danger:oklch(59.4% .1967 24.63);--danger-foreground:var(--snow);--segment:oklch(39.64% .01 285.93);--segment-foreground:var(--foreground);--border:oklch(28% .006 286.033);--separator:oklch(25% .006 286.033);--focus:var(--accent);--link:var(--foreground);--backdrop:#0009;--surface-shadow:0 0 0 0 transparent inset;--overlay-shadow:0 0 1px 0 #ffffff4d inset;--field-shadow:0 0 0 0 transparent inset;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}.dark,[data-theme=dark]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}.dark,[data-theme=dark]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}.dark,[data-theme=dark]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}.dark,[data-theme=dark]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}.dark,[data-theme=dark]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}.dark,[data-theme=dark]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}.dark,[data-theme=dark]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}.dark,[data-theme=dark]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}.dark,[data-theme=dark]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}.dark,[data-theme=dark]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}.dark,[data-theme=dark]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}.dark,[data-theme=dark]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}.dark,[data-theme=dark]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft:color-mix(in oklab, var(--accent) 12%, transparent)}}.dark,[data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-hover:color-mix(in oklab, var(--accent) 16%, transparent)}}.dark,[data-theme=dark]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}.dark,[data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}.dark,[data-theme=dark]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft:color-mix(in oklab, var(--warning) 12%, transparent)}}.dark,[data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-hover:color-mix(in oklab, var(--warning) 16%, transparent)}}.dark,[data-theme=dark]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft:color-mix(in oklab, var(--success) 12%, transparent)}}.dark,[data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-hover:color-mix(in oklab, var(--success) 16%, transparent)}}.dark,[data-theme=dark]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}.dark,[data-theme=dark]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}.dark,[data-theme=dark]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}.dark,[data-theme=dark]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}}@layer components;}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--border,currentColor)}::file-selector-button{border-color:var(--border,currentColor)}:root{view-transition-name:none}::view-transition{pointer-events:none}[data-scrollbar=thin]{--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--scrollbar-gutter:auto}[data-scrollbar=default]{--scrollbar-width:auto;--scrollbar-color:auto;--scrollbar-gutter:auto}[data-scrollbar=none]{--scrollbar-width:none;--scrollbar-color:auto;--scrollbar-gutter:auto}}@layer components{.close-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),color .15s var(--ease-out),background-color .1s var(--ease-out),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.close-button:focus-visible:not(:focus),.close-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.close-button:disabled,.close-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.close-button[data-pending=true]{pointer-events:none}.close-button svg{pointer-events:none;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);flex-shrink:0;align-self:center}.close-button--default{background-color:var(--default);color:var(--muted)}@media(hover:hover){.close-button--default:hover,.close-button--default[data-hovered=true]{background-color:var(--default-hover)}}.close-button--default:active,.close-button--default[data-pressed=true]{transform:scale(.93)}.description{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted)}.error-message{height:auto;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *),.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.field-error{height:0;padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);opacity:0}.field-error[data-visible]{opacity:1;height:auto}.field-error{transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *),.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox>.field-error,.checkbox>[data-slot=field-error],.switch>.field-error,.switch>[data-slot=field-error],.radio>.field-error,.radio>[data-slot=field-error]{height:auto;min-height:0;color:var(--muted);opacity:1;margin:0;padding:0;transition:none}.label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}:is(.label--required,[data-required=true]:not([role=group]):not([role=radiogroup]):not([role=checkboxgroup])>.label,[data-required=true]:not([data-slot=radio]):not([data-slot=checkbox])>.label):after{margin-left:calc(var(--spacing) * .5);color:var(--danger);--tw-content:"*";content:var(--tw-content)}.label--disabled,[data-disabled=true] .label{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.label--invalid,[data-invalid=true] .label,[aria-invalid=true] .label{color:var(--danger)}.accordion{contain:layout style;width:100%}.accordion__body{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.accordion__body-inner{padding-inline:calc(var(--spacing) * 4);padding-top:0;padding-bottom:calc(var(--spacing) * 4);color:var(--muted)}.accordion__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__indicator[data-expanded=true]{rotate:-180deg}.accordion__item{--tw-border-style:none;border-style:none;position:relative}.accordion__item:after{content:"";border-radius:calc(var(--radius) * .25);background-color:var(--separator);width:100%;height:1px;position:absolute;bottom:0;left:0}.accordion__item:last-child:after{content:none}.accordion__item[data-hide-separator=true]:after{display:none}.accordion__trigger{cursor:var(--cursor-interactive);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 4);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-tap-highlight-color:transparent;transition:opacity .15s var(--ease-out),box-shadow .15s var(--ease-out);flex:1;justify-content:space-between;align-items:center;display:flex}.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:color-mix(in oklab,var(--foreground) 3%,transparent 90%)}}}.accordion__trigger:focus-visible:not(:focus),.accordion__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.accordion__trigger:disabled,.accordion__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.accordion__panel{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__panel[data-expanded=true]{will-change:height,opacity;opacity:1}.accordion--surface{background-color:var(--surface);border-radius:min(32px,var(--radius-3xl))}@media(hover:hover){.accordion--surface .accordion__trigger:hover:not([aria-expanded=true]),.accordion--surface .accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--default)}}.accordion--surface .accordion__item:after{background-color:var(--surface-foreground)}@supports (color:color-mix(in lab,red,red)){.accordion--surface .accordion__item:after{background-color:color-mix(in oklab,var(--surface-foreground) 6%,transparent)}}.accordion--surface .accordion__item:after{width:94%;left:3%}.accordion--surface .accordion__item:first-child [data-slot=accordion-trigger]{border-top-left-radius:min(32px,var(--radius-3xl));border-top-right-radius:min(32px,var(--radius-3xl))}.accordion--surface .accordion__item:last-child:not(:has([data-slot=accordion-trigger][aria-expanded=true])) [data-slot=accordion-trigger]{border-bottom-left-radius:min(32px,var(--radius-3xl));border-bottom-right-radius:min(32px,var(--radius-3xl))}.breadcrumbs{align-items:center;display:flex}.breadcrumbs .breadcrumbs__link{padding-inline:calc(var(--spacing) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);opacity:1;text-decoration-line:none;position:relative}.breadcrumbs .breadcrumbs__link:hover,.breadcrumbs .breadcrumbs__link[data-hovered=true]{text-decoration-line:underline}.breadcrumbs .breadcrumbs__link[data-current=true]{color:var(--link);opacity:1}.breadcrumbs .breadcrumbs__item{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);padding-inline:calc(var(--spacing) * .5);flex-shrink:0;display:flex}.breadcrumbs .breadcrumbs__separator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:var(--muted)}.breadcrumbs .breadcrumbs__separator:where(:dir(rtl),[dir=rtl],[dir=rtl] *){rotate:180deg}.disclosure-group{contain:layout style;width:100%}.disclosure{position:relative}.accordion__heading{display:flex}.disclosure__trigger{cursor:var(--cursor-interactive);-webkit-tap-highlight-color:transparent;display:inline-block}.disclosure__trigger:focus-visible:not(:focus),.disclosure__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.disclosure__trigger:disabled,.disclosure__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.disclosure__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:inherit;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__indicator[data-expanded=true]{rotate:-180deg}.disclosure__content{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__content[data-expanded=true]{will-change:height,opacity;opacity:1}.disclosure__body{padding:calc(var(--spacing) * 2)}.link{border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);width:fit-content;height:fit-content;font-weight:var(--font-weight-medium);color:var(--link);text-decoration-line:none;-webkit-text-decoration-color:var(--separator-tertiary);text-decoration-color:var(--separator-tertiary);text-underline-offset:4px;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .1s var(--ease-out);align-items:center;text-decoration-thickness:1.5px;display:inline-flex;position:relative}.link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link{cursor:var(--cursor-interactive)}@media(hover:hover){.link:hover,.link[data-hovered=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.link:hover,.link[data-hovered=true]{-webkit-text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent);text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent)}}:is(.link:hover,.link[data-hovered=true]) .link__icon{opacity:1}}.link:active,.link[data-pressed=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}:is(.link:active,.link[data-pressed=true]) .link__icon{opacity:1}.link:focus-visible:not(:focus),.link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}:is(.link:focus-visible:not(:focus),.link[data-focus-visible=true]) .link__icon{opacity:1}.link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.link .link__icon{pointer-events:none;color:currentColor;opacity:.6;width:.75em;height:.75em;transition:opacity .15s var(--ease-out);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link .link__icon svg{transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.link .link__icon[data-default-icon=true]{margin-left:var(--spacing);padding-bottom:calc(var(--spacing) * 1.5)}.link.button{gap:0;text-decoration-line:none}.pagination{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);flex-direction:column;width:100%;display:flex}@media(min-width:40rem){.pagination{flex-direction:row}}.pagination__summary{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__summary{align-self:center}}.pagination__content{align-items:center;gap:var(--spacing);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__content{align-self:center}}.pagination__item{display:inline-flex}.pagination__link{isolation:isolate;width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);transform-origin:50%;border-radius:calc(var(--radius) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}@media(min-width:48rem){.pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.pagination__link{--pagination-link-bg:transparent;--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover);--pagination-link-fg:var(--default-foreground);background-color:var(--pagination-link-bg);color:var(--pagination-link-fg)}.pagination__link:focus-visible,.pagination__link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.pagination__link:disabled,.pagination__link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.pagination__link:hover,.pagination__link[data-hovered=true]{background-color:var(--pagination-link-bg-hover)}}.pagination__link:active,.pagination__link[data-pressed=true]{background-color:var(--pagination-link-bg-pressed);transform:scale(.97)}.pagination__link[data-active=true]{--pagination-link-bg:var(--default);--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover)}.pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:inline-flex}@media(min-width:48rem){.pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link--nav{gap:calc(var(--spacing) * 1.5);width:auto;padding-inline:calc(var(--spacing) * 2.5)}.pagination--sm .pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__link{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__link:active,.pagination--sm .pagination__link[data-pressed=true]{transform:scale(.98)}.pagination--sm .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 2)}.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.pagination--lg .pagination__link{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__link{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__link:active,.pagination--lg .pagination__link[data-pressed=true]{transform:scale(.96)}.pagination--lg .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 3)}.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__summary{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.tabs{gap:calc(var(--spacing) * 2);display:flex}.tabs[data-orientation=horizontal]{flex-direction:column}.tabs[data-orientation=vertical]{flex-direction:row}.tabs__list-container{position:relative}.tabs__list{background-color:var(--default);padding:var(--spacing);border-radius:calc(var(--radius) * 2.5);display:inline-flex}.tabs__list[data-orientation=horizontal]{flex-direction:row;width:100%}.tabs__list[data-orientation=vertical]{gap:var(--spacing);flex-direction:column}.tabs__list[data-orientation=vertical] .tabs__tab{min-width:calc(var(--spacing) * 20)}.tabs__tab{z-index:1;cursor:var(--cursor-interactive);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);width:100%;padding-inline:calc(var(--spacing) * 4);text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .15s var(--ease-smooth);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__tab[data-selected=true]{color:var(--segment-foreground)}.tabs__tab[data-selected=true] .tabs__separator,.tabs__tab[data-selected=true]+.tabs__tab .tabs__separator{opacity:0}.tabs__tab:disabled,.tabs__tab[data-disabled=true],.tabs__tab[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.tabs__tab:not([data-selected=true]):not([data-disabled=true]):hover,.tabs__tab[data-hovered=true]:not([data-selected=true]):not([data-disabled=true]){opacity:.7}}.tabs__tab:focus-visible:not(:focus),.tabs__tab[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tabs__separator{border-radius:calc(var(--radius) * .5);background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.tabs__separator{background-color:color-mix(in oklab,var(--muted) 25%,transparent)}}.tabs__separator{pointer-events:none;transition:opacity .15s var(--ease-smooth);position:absolute}.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__list[data-orientation=horizontal] .tabs__separator{width:1px;height:50%;top:25%;left:0}.tabs__list[data-orientation=vertical] .tabs__separator{width:90%;height:1px;top:0;left:5%}.tabs__panel{width:100%;padding:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none}.tabs__panel[data-exiting=true]{width:100%;position:absolute;top:0;left:0}.tabs__panel[data-orientation=horizontal]{margin-top:calc(var(--spacing) * 4)}.tabs__panel[data-orientation=vertical]{margin-left:calc(var(--spacing) * 4)}.tabs__indicator{box-shadow:var(--shadow-surface);z-index:-1;border-radius:var(--radius-3xl);background-color:var(--segment);width:100%;height:100%;transition-property:translate,width,height;transition-duration:.25s;transition-timing-function:var(--ease-out-fluid);position:absolute;top:0;left:0}.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs--secondary>.tabs__list-container>.tabs__list{background-color:#0000;border-radius:0;padding:0}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=horizontal]{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border);max-width:100%;overflow:auto clip}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=vertical]{border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--border)}.tabs--secondary>.tabs__list-container .tabs__tab{border-radius:0}.tabs--secondary>.tabs__list-container .tabs__tab[data-selected=true]{color:var(--foreground)}.tabs--secondary>.tabs__list-container .tabs__separator{display:none}.tabs--secondary>.tabs__list-container .tabs__indicator{background-color:var(--accent);box-shadow:none;border-radius:0}.tabs--secondary[data-orientation=horizontal]>.tabs__list-container .tabs__indicator{height:2px;top:auto;bottom:0}.tabs--secondary[data-orientation=vertical]>.tabs__list-container .tabs__indicator{width:2px;height:100%;top:0;left:0}.button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.button{height:calc(var(--spacing) * 9)}}.button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button{cursor:var(--cursor-interactive);--button-bg:transparent;--button-bg-hover:var(--button-bg);--button-bg-pressed:var(--button-bg-hover);--button-fg:currentColor;background-color:var(--button-bg);color:var(--button-fg)}.button:focus-visible:not(:focus),.button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.button:disabled,.button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.button[data-pending=true]{pointer-events:none}.button:active,.button[data-pressed=true]{background-color:var(--button-bg-pressed);transform:scale(.97)}@media(hover:hover){.button:hover,.button[data-hovered=true]{background-color:var(--button-bg-hover)}}.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.button--sm{height:calc(var(--spacing) * 8)}}.button--sm svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.button--sm:active,.button--sm[data-pressed=true]{transform:scale(.98)}.button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.button--lg{height:calc(var(--spacing) * 10)}}.button--lg:active,.button--lg[data-pressed=true]{transform:scale(.96)}.button--primary{--button-bg:var(--accent);--button-bg-hover:var(--accent-hover);--button-bg-pressed:var(--accent-hover);--button-fg:var(--accent-foreground)}.button--secondary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover);--button-fg:var(--accent-soft-foreground)}.button--tertiary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover)}.button--ghost,.button--outline{--button-bg:transparent;--button-bg-hover:var(--default);--button-bg-pressed:var(--default);--button-fg:var(--default-foreground)}.button--outline{border-style:var(--tw-border-style);border-width:1px;border-color:var(--border);--button-bg-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.button--outline{--button-bg-hover:color-mix(in srgb, var(--default) 60%, transparent)}}.button--danger{--button-bg:var(--danger);--button-bg-hover:var(--danger-hover);--button-bg-pressed:var(--danger-hover);--button-fg:var(--danger-foreground)}.button--danger-soft{--button-bg:var(--danger-soft);--button-bg-hover:var(--danger-soft-hover);--button-bg-pressed:var(--danger-soft-hover);--button-fg:var(--danger-soft-foreground)}.button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.button--icon-only{width:calc(var(--spacing) * 9)}}.button--icon-only.button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.button--icon-only.button--sm{width:calc(var(--spacing) * 8)}}.button--icon-only.button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.button--icon-only.button--lg{width:calc(var(--spacing) * 10)}}.button--full-width{width:100%}.button-group{justify-content:center;align-items:center;gap:0;height:auto;display:inline-flex}.button-group--horizontal{flex-direction:row}.button-group--vertical{flex-direction:column}.button-group .button{border-radius:0}.button-group--horizontal .button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.button-group--vertical .button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group .button:active,.button-group .button[data-pressed=true]{transform:none}.button-group .button:focus-visible:not(:focus),.button-group .button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button-group--horizontal .button-group__separator{width:1px;height:50%;top:25%;left:-1px}.button-group--vertical .button-group__separator{width:50%;height:1px;top:-1px;left:25%}.button-group--horizontal .button--outline:first-child{border-inline-end-style:var(--tw-border-style);border-inline-end-width:0}.button-group--horizontal .button--outline:last-child{border-inline-start-style:var(--tw-border-style);border-inline-start-width:0}.button-group--horizontal .button--outline:not(:first-child):not(:last-child){border-inline-style:var(--tw-border-style);border-inline-width:0}.button-group--vertical .button--outline:first-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.button-group--vertical .button--outline:last-child{border-top-style:var(--tw-border-style);border-top-width:0}.button-group--vertical .button--outline:not(:first-child):not(:last-child){border-block-style:var(--tw-border-style);border-block-width:0}.button-group--full-width{width:100%}.toggle-button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.toggle-button{height:calc(var(--spacing) * 9)}}.toggle-button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button{cursor:var(--cursor-interactive);--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover);--toggle-button-fg:currentColor;--toggle-button-bg-selected:var(--accent-soft);--toggle-button-bg-selected-hover:var(--accent-soft-hover);--toggle-button-bg-selected-pressed:var(--accent-soft-hover);--toggle-button-fg-selected:var(--accent-soft-foreground);background-color:var(--toggle-button-bg);color:var(--toggle-button-fg)}.toggle-button:focus-visible:not(:focus),.toggle-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.toggle-button:disabled,.toggle-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.toggle-button:hover,.toggle-button[data-hovered=true]{background-color:var(--toggle-button-bg-hover)}}.toggle-button:active,.toggle-button[data-pressed=true]{background-color:var(--toggle-button-bg-pressed);transform:scale(.97)}.toggle-button[data-selected=true]{background-color:var(--toggle-button-bg-selected);color:var(--toggle-button-fg-selected)}@media(hover:hover){.toggle-button[data-selected=true]:hover,.toggle-button[data-selected=true][data-hovered=true]{background-color:var(--toggle-button-bg-selected-hover)}}.toggle-button[data-selected=true]:active,.toggle-button[data-selected=true][data-pressed=true]{background-color:var(--toggle-button-bg-selected-pressed)}.toggle-button svg{pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.toggle-button svg{margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.toggle-button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.toggle-button--sm{height:calc(var(--spacing) * 8)}}.toggle-button--sm svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toggle-button--sm:active,.toggle-button--sm[data-pressed=true]{transform:scale(.98)}.toggle-button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.toggle-button--lg{height:calc(var(--spacing) * 10)}}.toggle-button--lg:active,.toggle-button--lg[data-pressed=true]{transform:scale(.96)}.toggle-button--default{--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover)}.toggle-button--ghost{--toggle-button-bg:transparent;--toggle-button-bg-hover:var(--default);--toggle-button-bg-pressed:var(--default);--toggle-button-fg:var(--default-foreground)}.toggle-button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.toggle-button--icon-only{width:calc(var(--spacing) * 9)}}.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 8)}}.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 10)}}.toggle-button-group{justify-content:center;align-items:center;gap:0;width:fit-content;height:auto;display:inline-flex}.toggle-button-group--horizontal{flex-direction:row}.toggle-button-group--vertical{flex-direction:column}.toggle-button-group--full-width{width:100%}.toggle-button-group .toggle-button{border-radius:0}.toggle-button-group--horizontal .toggle-button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group .toggle-button:active,.toggle-button-group .toggle-button[data-pressed=true]{transform:none}.toggle-button-group .toggle-button:focus-visible:not(:focus),.toggle-button-group .toggle-button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.toggle-button-group--full-width .toggle-button{flex:1}.toggle-button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button-group--horizontal .toggle-button-group__separator{width:1px;height:50%;top:25%;left:-1px}.toggle-button-group--vertical .toggle-button-group__separator{width:50%;height:1px;top:-1px;left:25%}.toggle-button-group--detached{gap:var(--spacing)}.toggle-button-group--detached .toggle-button{border-radius:calc(var(--radius) * 3)}.toggle-button-group--detached .toggle-button-group__separator{display:none}.toolbar{align-items:center;gap:calc(var(--spacing) * 2);grid-auto-flow:column;width:fit-content;display:grid}.toolbar .separator--vertical{align-self:center;height:50%}.toolbar .separator--horizontal{justify-content:center;justify-self:center;width:50%}.toolbar--vertical{grid-auto-flow:row;justify-content:flex-start;align-items:flex-start}.toolbar--vertical .button-group{justify-content:flex-start}.toolbar--attached{border-radius:calc(var(--radius) * 3);background-color:var(--surface);padding:var(--spacing);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dropdown{gap:var(--spacing);flex-direction:column;display:flex}.dropdown__trigger{--tw-outline-style:none;transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;display:inline-block}.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.dropdown__trigger{cursor:var(--cursor-interactive)}.dropdown__trigger:focus-visible:not(:focus),.dropdown__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.dropdown__trigger:disabled,.dropdown__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.dropdown__trigger[data-pending=true]{pointer-events:none}.dropdown__trigger:active,.dropdown__trigger[data-pressed=true]{transform:scale(.97)}.dropdown__popover{max-width:48svw;transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));padding:0;overflow-y:auto}@media(min-width:48rem){.dropdown__popover{min-width:calc(var(--spacing) * 55)}}.dropdown__popover{border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay)}.dropdown__popover:focus-visible:not(:focus),.dropdown__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.dropdown__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.dropdown__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.dropdown__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.dropdown__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.dropdown__popover[data-exiting=true],.dropdown__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.dropdown__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.dropdown__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.dropdown__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.dropdown__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.dropdown__popover [data-slot=dropdown-menu]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.dropdown__popover [data-slot=menu-item]{padding-inline:calc(var(--spacing) * 2.5)}.dropdown__menu{gap:calc(var(--spacing) * .5);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.dropdown__menu [data-slot=separator]{width:94%;margin-left:3%}.list-box-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item{cursor:var(--cursor-interactive)}.list-box-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.list-box-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.list-box-item:has(.list-box-item__indicator){padding-inline-end:calc(var(--spacing) * 7)}.list-box-item:focus-visible:not(:focus),.list-box-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.list-box-item:active,.list-box-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.list-box-item:hover,.list-box-item[data-hovered=true]{background-color:var(--default)}}.list-box-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.list-box-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--default-foreground);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-end:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]{transition:stroke-dashoffset .25s linear}:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item--danger .list-box-item__indicator,.list-box-item--danger [data-slot=label]{color:var(--danger)}.list-box-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.list-box{width:100%;padding:var(--spacing);position:relative;overflow:clip}.list-box>*+*{margin-top:var(--spacing)}.list-box [data-slot=separator][data-orientation=horizontal]{width:94%;margin-left:3%}.menu-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item{cursor:var(--cursor-interactive)}.menu-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.menu-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.menu-item [data-slot=submenu-indicator] svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.menu-item:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 7)}.menu-item[data-has-submenu=true]:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 7)}.menu-item:focus-visible:not(:focus),.menu-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.menu-item:active,.menu-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.menu-item:hover,.menu-item[data-hovered=true]{background-color:var(--default)}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]{transition:stroke-dashoffset .1s linear}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--dot]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.menu-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.menu-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-start:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item[data-has-submenu=true] .menu-item__indicator{inset-inline-start:auto;inset-inline-end:calc(var(--spacing) * 2)}.menu-item__indicator [data-slot=menu-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:0}.menu-item__indicator--submenu{color:var(--muted)}.menu-item__indicator--submenu svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.menu-item--danger .menu-item__indicator,.menu-item--danger [data-slot=label]{color:var(--danger)}.menu-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.menu{gap:var(--spacing);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.menu [data-slot=separator]{width:94%;margin-left:3%}.tag-group{gap:var(--spacing);flex-direction:column;display:flex;position:relative}.tag-group__list{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex;position:relative}.tag-group [slot=description],.tag-group [data-slot=description],.tag-group [slot=errorMessage],.tag-group [data-slot=error-message]{padding:var(--spacing)}.tag{--optical-offset:.031em;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:inline-flex;position:relative}.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tag{cursor:var(--cursor-interactive)}.tag svg{pointer-events:none;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:currentColor;flex-shrink:0;align-self:center}.tag:is([data-disabled=true],[aria-disabled=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tag:is(:focus-visible,[data-focus-visible]){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tag:is([data-selected=true],[aria-selected=true]){background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.tag:is([data-selected=true],[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-soft-hover)}}.tag--sm{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--md{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--lg{border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.tag--default{background-color:var(--default);color:var(--default-foreground)}@media(hover:hover){.tag--default:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--default-hover)}}.tag--surface{background-color:var(--surface);color:var(--surface-foreground)}@media(hover:hover){.tag--surface:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--surface-hover)}}.tag__remove-button{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:inherit}.tag__remove-button svg{width:inherit;height:inherit;color:currentColor;flex-shrink:0;align-self:center}.color-area{width:100%;max-width:calc(var(--spacing) * 56);border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;aspect-ratio:1;background:var(--color-area-background);flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-area[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-area--show-dots:after{content:"";pointer-events:none;border-radius:inherit;background-image:radial-gradient(circle,#fff3 1px,#0000 1px);background-size:8px 8px;position:absolute;top:0;right:0;bottom:0;left:0}.color-area__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);will-change:width,height;background-color:var(--color-area-thumb-color);transition:width .15s var(--ease-out),height .15s var(--ease-out);border:3px solid #fff;box-shadow:0 0 0 1px #0000001a,inset 0 0 0 1px #0000001a}.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-area__thumb[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-area__thumb[data-dragging=true]{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.color-area__thumb[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker{display:inline-flex}.color-picker__trigger{align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-flex}.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-picker__trigger [data-slot=label]{cursor:var(--cursor-interactive)}.color-picker__trigger:focus-visible:not(:focus),.color-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-picker__trigger:disabled,.color-picker__trigger[data-disabled=true],.color-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker__popover{min-width:calc(var(--spacing) * 62);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 3);box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5));gap:calc(var(--spacing) * 3);flex-direction:column;display:flex;overflow:hidden auto}.color-picker__popover:focus-visible:not(:focus),.color-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.color-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.color-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.color-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.color-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.color-picker__popover[data-exiting=true],.color-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.color-slider{gap:var(--spacing);grid-template:"label output""track track"/1fr auto;width:100%;display:grid}.color-slider:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template:"track"/1fr;gap:0}.color-slider:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-columns:1fr;grid-template-areas:"label""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output){grid-template-columns:1fr;grid-template-areas:"output""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output) .color-slider__output{justify-self:end}.color-slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.color-slider .color-slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.color-slider .color-slider__track{border-radius:calc(var(--radius) * 2);grid-area:track;position:relative}.color-slider .color-slider__track:before,.color-slider .color-slider__track:after{content:"";z-index:0;pointer-events:none;position:absolute}.color-slider .color-slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;border-style:var(--tw-border-style);border-width:3px;border-color:var(--color-white);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);z-index:1;transition:transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-slider .color-slider__thumb[data-dragging=true]{cursor:grabbing}.color-slider .color-slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-slider .color-slider__thumb[data-disabled=true]{cursor:default;background-color:var(--default)}.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]) [data-slot=label]{opacity:1}.color-slider[data-orientation=horizontal]{flex-direction:column}.color-slider[data-orientation=horizontal] .color-slider__track{height:calc(var(--spacing) * 5);border-radius:0;justify-self:center;width:calc(100% - 1.25rem);box-shadow:inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:before,.color-slider[data-orientation=horizontal] .color-slider__track:after{width:.625rem;height:100%;top:0}.color-slider[data-orientation=horizontal] .color-slider__track:before{border-top-left-radius:calc(var(--radius) * 2);border-bottom-left-radius:calc(var(--radius) * 2);background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;left:-.625rem;box-shadow:inset 1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:after{border-top-right-radius:calc(var(--radius) * 2);border-bottom-right-radius:calc(var(--radius) * 2);background-color:var(--track-end-color,transparent);right:-.625rem;box-shadow:inset -1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);top:50%}.color-slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;place-items:center;height:100%}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template-rows:1fr;grid-template-areas:"track";gap:0}.color-slider[data-orientation=vertical]:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-rows:1fr auto;grid-template-areas:"track""label"}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):has(.color-slider__output){grid-template-rows:auto 1fr;grid-template-areas:"output""track"}.color-slider[data-orientation=vertical] .color-slider__output,.color-slider[data-orientation=vertical] [data-slot=label]{text-align:center}.color-slider[data-orientation=vertical] .color-slider__track{width:calc(var(--spacing) * 5);border-radius:0;justify-self:center;height:calc(100% - 1.25rem);box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:before,.color-slider[data-orientation=vertical] .color-slider__track:after{width:100%;height:.625rem;left:0}.color-slider[data-orientation=vertical] .color-slider__track:before{background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;border-bottom-right-radius:999px;border-bottom-left-radius:999px;bottom:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:after{background-color:var(--track-end-color,transparent);border-top-left-radius:999px;border-top-right-radius:999px;top:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);left:50%}.color-swatch{box-sizing:border-box;width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);background:linear-gradient(var(--color-swatch-current),var(--color-swatch-current)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-swatch--circle{border-radius:calc(var(--radius) * 2)}.color-swatch--square{border-radius:calc(var(--radius) * .75)}.color-swatch--xs{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.color-swatch--xs.color-swatch--circle{border-radius:calc(var(--radius) * 1)}.color-swatch--sm{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.color-swatch--sm.color-swatch--circle{border-radius:calc(var(--radius) * 1.5)}.color-swatch--lg{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.color-swatch--lg.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.color-swatch--xl.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch-picker{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.color-swatch-picker__item{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);border-style:var(--tw-border-style);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:border-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);border-width:2px;border-color:#0000;outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__item:focus-visible,.color-swatch-picker__item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-swatch-picker__item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-swatch-picker__item[data-selected=true]{border-color:var(--color-swatch-current);box-shadow:var(--field-shadow)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{transform:scale(.77)}.color-swatch-picker__swatch{border-radius:inherit;width:100%;height:100%;transition:transform .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:block}.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-swatch-picker__swatch:hover{transform:scale(1.1)}}.color-swatch-picker__indicator{pointer-events:none;z-index:10;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.color-swatch-picker__indicator>*{width:33.3333%;height:33.3333%;color:var(--color-white);transition:transform .15s var(--ease-out);transform:scale(0)translateZ(0)}.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__indicator[data-light-color=true] .color-swatch-picker__indicator>*{color:var(--color-black)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__indicator>*{transform:scale(1)translateZ(0)}.color-swatch-picker--stack{flex-direction:column}.color-swatch-picker--xs .color-swatch-picker__item{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px}.color-swatch-picker--sm .color-swatch-picker__item{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);border-style:var(--tw-border-style);border-width:2px}.color-swatch-picker--lg .color-swatch-picker__item{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--xl .color-swatch-picker__item{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--square .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-input-group:hover:not(:focus-within),.color-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.color-input-group[data-focus-within=true],.color-input-group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.color-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group[data-invalid=true]:focus,.color-input-group[data-invalid=true]:focus-visible,.color-input-group[data-invalid=true][data-focused=true],.color-input-group[data-invalid=true][data-focus-visible=true],.color-input-group[data-invalid=true]:focus-within,.color-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.color-input-group[data-disabled=true],.color-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-input-group__input{cursor:text;border-style:var(--tw-border-style);height:100%;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;display:flex}@media(min-width:40rem){.color-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.color-input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}.color-input-group:has([data-slot=color-input-group-prefix]) .color-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.color-input-group:has([data-slot=color-input-group-suffix]) .color-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.color-input-group__input:focus,.color-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.color-input-group__prefix{color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group__suffix{color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--color-input-group-bg);--color-input-group-bg:var(--default);--color-input-group-bg-hover:var(--default-hover);--color-input-group-bg-focus:var(--default)}@media(hover:hover){.color-input-group--secondary:hover:not(:focus-within),.color-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--color-input-group-bg-hover)}}.color-input-group--secondary:focus-within,.color-input-group--secondary[data-focus-within=true]{background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group--secondary[data-invalid=true]:focus,.color-input-group--secondary[data-invalid=true]:focus-visible,.color-input-group--secondary[data-invalid=true][data-focused=true],.color-input-group--secondary[data-invalid=true][data-focus-visible=true],.color-input-group--secondary[data-invalid=true]:focus-within,.color-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary [data-slot=color-input-group-input]{background-color:#0000}.color-input-group--full-width{width:100%}.color-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.color-field[data-invalid=true],.color-field[aria-invalid=true]) [data-slot=description]{display:none}.color-field [data-slot=label]{width:fit-content}.color-field--full-width{width:100%}.slider{gap:var(--spacing);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.slider .slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.slider .slider__track{border-radius:calc(var(--radius) * 1.5);background-color:var(--default);grid-area:track;position:relative}.slider .slider__fill{pointer-events:none;background-color:var(--accent);position:absolute}.slider .slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 1.5);background-color:var(--accent);-webkit-tap-highlight-color:transparent;transition:background-color .25s var(--ease-smooth),transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.slider .slider__thumb:after{z-index:10;border-radius:calc(var(--radius) * 1);background-color:var(--accent-foreground);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);content:"";transform-origin:50%;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));position:relative}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:after:not(:is()){transition-property:none}}.slider .slider__thumb[data-dragging=true]{cursor:grabbing}.slider .slider__thumb[data-dragging=true]:after{scale:.9}@media(prefers-reduced-motion:reduce){.slider .slider__thumb[data-dragging=true]:after:not(:is()){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.slider .slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.slider .slider__thumb[data-disabled=true]{cursor:default}.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]) [data-slot=label]{opacity:1}.slider[data-orientation=horizontal]{flex-direction:column}.slider[data-orientation=horizontal] .slider__track{height:calc(var(--spacing) * 5);border-inline-style:var(--tw-border-style);border-inline-width:.75rem;border-inline-color:#0000;width:100%}.slider[data-orientation=horizontal] .slider__track[data-fill-start=true]{border-inline-start-color:var(--accent)}.slider[data-orientation=horizontal] .slider__track[data-fill-end=true]{border-inline-end-color:var(--accent)}.slider[data-orientation=horizontal] .slider__fill,.slider[data-orientation=horizontal] .slider__thumb{height:100%}.slider[data-orientation=horizontal] .slider__thumb{width:1.75rem;top:50%}.slider[data-orientation=horizontal] .slider__thumb:after{width:1.5rem;height:1rem}.slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;height:100%}.slider[data-orientation=vertical] .slider__output,.slider[data-orientation=vertical] [data-slot=label]{text-align:center}.slider[data-orientation=vertical] .slider__track{height:100%;width:calc(var(--spacing) * 5);border-block-style:var(--tw-border-style);border-block-width:.75rem;border-block-color:#0000;justify-self:center}.slider[data-orientation=vertical] .slider__track[data-fill-start=true]{border-bottom-color:var(--accent)}.slider[data-orientation=vertical] .slider__track[data-fill-end=true]{border-top-color:var(--accent)}.slider[data-orientation=vertical] .slider__fill,.slider[data-orientation=vertical] .slider__thumb{width:100%}.slider[data-orientation=vertical] .slider__thumb{height:1.75rem;left:50%}.slider[data-orientation=vertical] .slider__thumb:after{width:1rem;height:1.5rem}.switch{align-items:flex-start;gap:var(--spacing);-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);--switch-control-bg:var(--default);--switch-control-bg-hover:var(--switch-control-bg);flex-direction:column;display:flex}@supports (color:color-mix(in lab,red,red)){.switch{--switch-control-bg-hover:color-mix(in oklab, var(--switch-control-bg), transparent 20%)}}.switch{--switch-control-bg-pressed:var(--switch-control-bg-hover);--switch-control-bg-checked:var(--accent);--switch-control-bg-checked-hover:var(--accent-hover)}.switch[data-disabled=true],.switch[data-disabled=true] [data-slot=description],.switch[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.switch[data-disabled=true] .switch__thumb{background-color:var(--default-foreground)}@supports (color:color-mix(in lab,red,red)){.switch[data-disabled=true] .switch__thumb{background-color:color-mix(in oklab,var(--default-foreground) 20%,transparent)}}.switch>[data-slot=description]{width:100%;min-width:0;padding-inline-start:3.25rem}.switch>[data-slot=field-error]{width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--muted);padding-inline-start:3.25rem}.switch.switch--sm>[data-slot=description],.switch.switch--sm>[data-slot=field-error]{padding-inline-start:2.75rem}.switch.switch--lg>[data-slot=description],.switch.switch--lg>[data-slot=field-error]{padding-inline-start:3.75rem}:is(.switch:disabled[aria-checked=true],.switch:disabled[data-selected=true],.switch[data-disabled=true][aria-checked=true],.switch[data-disabled=true][data-selected=true],.switch[aria-disabled=true][aria-checked=true],.switch[aria-disabled=true][data-selected=true]) .switch__thumb{opacity:.4}.switch__control{border-radius:calc(var(--radius) * 1.5);background-color:var(--switch-control-bg);width:2.5rem;height:1.25rem;transition:background-color .25s var(--ease-smooth),box-shadow .15s var(--ease-out);flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch:focus-visible .switch__control,.switch:has([data-slot=switch-content][data-focus-visible=true]) .switch__control,.switch [data-slot=switch-content][data-focus-visible=true] .switch__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.switch:hover .switch__control,.switch:has([data-slot=switch-content][data-hovered=true]) .switch__control,.switch [data-slot=switch-content][data-hovered=true] .switch__control{background-color:var(--switch-control-bg-hover)}.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control{background-color:var(--switch-control-bg-pressed)}:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transform:none}@media(prefers-reduced-motion:reduce){:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transform:none}}.switch[aria-checked=true] .switch__control,.switch[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked)}.switch[aria-checked=true]:hover .switch__control,.switch[data-selected=true]:hover .switch__control,.switch[aria-checked=true][data-hovered=true] .switch__control,.switch[data-selected=true][data-hovered=true] .switch__control,.switch:has([data-slot=switch-content][data-hovered=true])[data-selected=true] .switch__control,.switch[aria-checked=true]:active .switch__control,.switch[data-selected=true]:active .switch__control,.switch[aria-checked=true][data-pressed=true] .switch__control,.switch[data-selected=true][data-pressed=true] .switch__control,.switch:has([data-slot=switch-content][data-pressed=true])[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked-hover)}.switch__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.switch--sm .switch__control{border-radius:calc(var(--radius) * 1);width:2rem;height:1rem}.switch--lg .switch__control{width:3rem;height:1.5rem}.switch__thumb{transform-origin:50%;border-radius:calc(var(--radius) * 1);background-color:var(--color-white);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);width:1.375rem;height:1rem;transition:margin .3s var(--ease-out-fluid),background-color .2s var(--ease-out);margin-inline-start:calc(var(--spacing) * .5);display:flex}.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch[aria-checked=true] .switch__thumb,.switch[data-selected=true] .switch__thumb{background-color:var(--accent-foreground);color:var(--accent);margin-inline-start:calc(100% - 1.5rem);box-shadow:0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d}.switch--sm .switch__thumb{border-radius:calc(var(--radius) * .75);width:1.03125rem;height:.75rem}.switch[aria-checked=true] :is(.switch--sm .switch__thumb),.switch[data-selected=true] :is(.switch--sm .switch__thumb){margin-inline-start:calc(100% - 1.15625rem)}.switch--lg .switch__thumb{border-radius:calc(var(--radius) * 1.5);width:1.71875rem;height:1.25rem}.switch[aria-checked=true] :is(.switch--lg .switch__thumb),.switch[data-selected=true] :is(.switch--lg .switch__thumb){margin-inline-start:calc(100% - 1.84375rem)}.switch__thumb>*{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.switch__label{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.switch [data-slot=label]{-webkit-user-select:none;user-select:none}.switch__content [data-slot=label]{cursor:var(--cursor-interactive)}.switch [data-slot=description]{cursor:default;-webkit-user-select:none;user-select:none}.switch-group{gap:calc(var(--spacing) * 6);flex-direction:column;display:flex}.switch-group__items{gap:calc(var(--spacing) * 4);display:flex}.switch-group--horizontal .switch-group__items{flex-direction:row}.switch-group--vertical .switch-group__items{flex-direction:column}.badge{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);min-height:calc(var(--spacing) * 7);min-width:calc(var(--spacing) * 7);border-radius:calc(var(--radius) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:1.34;--badge-bg:var(--default);--badge-fg:var(--default-foreground);--badge-border:var(--background);background-color:var(--badge-bg);color:var(--badge-fg);border:1px solid var(--badge-border);flex-shrink:0;line-height:1.34;display:inline-flex}.badge__label{padding-inline:calc(var(--spacing) * .5)}.badge-anchor{flex-shrink:0;display:inline-flex;position:relative}.badge--lg{min-height:calc(var(--spacing) * 8);min-width:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;line-height:1.43}.badge--sm{min-height:calc(var(--spacing) * 4);min-width:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);--tw-leading:1.34;font-size:10px;line-height:1.34}.badge--accent{--badge-fg:var(--accent-soft-foreground)}.badge--default{--badge-fg:var(--default-foreground)}.badge--success{--badge-fg:var(--success-soft-foreground)}.badge--warning{--badge-fg:var(--warning-soft-foreground)}.badge--danger{--badge-fg:var(--danger-soft-foreground)}.badge--top-right{position:absolute;top:0;right:0;transform:translate(25%,-25%)}.badge--top-left{position:absolute;top:0;left:0;transform:translate(-25%,-25%)}.badge--bottom-right{position:absolute;bottom:0;right:0;transform:translate(25%,25%)}.badge--bottom-left{position:absolute;bottom:0;left:0;transform:translate(-25%,25%)}.badge--primary.badge--accent{--badge-bg:var(--accent);--badge-fg:var(--accent-foreground)}.badge--primary.badge--default{--badge-bg:var(--default);--badge-fg:var(--default-foreground)}.badge--primary.badge--success{--badge-bg:var(--success);--badge-fg:var(--success-foreground)}.badge--primary.badge--warning{--badge-bg:var(--warning);--badge-fg:var(--warning-foreground)}.badge--primary.badge--danger{--badge-bg:var(--danger);--badge-fg:var(--danger-foreground)}.badge--soft.badge--accent{--badge-bg:var(--accent-soft);--badge-fg:var(--accent-soft-foreground)}.badge--soft.badge--default{--badge-bg:var(--default-soft);--badge-fg:var(--default-soft-foreground)}.badge--soft.badge--success{--badge-bg:var(--success-soft);--badge-fg:var(--success-soft-foreground)}.badge--soft.badge--warning{--badge-bg:var(--warning-soft);--badge-fg:var(--warning-soft-foreground)}.badge--soft.badge--danger{--badge-bg:var(--danger-soft);--badge-fg:var(--danger-soft-foreground)}.chip{align-items:center;gap:calc(var(--spacing) * .5);border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--chip-bg:var(--default);--chip-fg:currentColor;background-color:var(--chip-bg);color:var(--chip-fg);flex-shrink:0;display:inline-flex}.chip__label{padding-inline:calc(var(--spacing) * .5)}.chip--accent{--chip-fg:var(--accent-soft-foreground)}.chip--danger{--chip-fg:var(--danger-soft-foreground)}.chip--default{--chip-fg:var(--default-foreground)}.chip--success{--chip-fg:var(--success-soft-foreground)}.chip--warning{--chip-fg:var(--warning-soft-foreground)}.chip--tertiary{--chip-bg:transparent}.chip--sm{padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));padding-block:0}.chip--md{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.chip--lg{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.chip--primary.chip--accent{--chip-bg:var(--accent);--chip-fg:var(--accent-foreground)}.chip--primary.chip--success{--chip-bg:var(--success);--chip-fg:var(--success-foreground)}.chip--primary.chip--warning{--chip-bg:var(--warning);--chip-fg:var(--warning-foreground)}.chip--primary.chip--danger{--chip-bg:var(--danger);--chip-fg:var(--danger-foreground)}.chip--accent.chip--soft{--chip-bg:var(--accent-soft);--chip-fg:var(--accent-soft-foreground)}.chip--success.chip--soft{--chip-bg:var(--success-soft);--chip-fg:var(--success-soft-foreground)}.chip--warning.chip--soft{--chip-bg:var(--warning-soft);--chip-fg:var(--warning-soft-foreground)}.chip--danger.chip--soft{--chip-bg:var(--danger-soft);--chip-fg:var(--danger-soft-foreground)}.chip--default.chip--soft{--chip-bg:var(--default-soft);--chip-fg:var(--default-soft-foreground)}.table-root{grid-template-columns:minmax(0,1fr);width:100%;display:grid;position:relative;overflow:clip}.table__scroll-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;overflow-x:auto}.table-root--primary{background-color:var(--surface-secondary);padding-inline:var(--spacing);padding-bottom:var(--spacing);border-radius:min(32px,calc(var(--radius) * 2.5))}.table-root--secondary .table__header{border-bottom-style:var(--tw-border-style);background-color:#0000;border-bottom-width:0}.table-root--secondary .table__column{background-color:var(--surface-secondary)}.table-root--secondary :is(th.table__column:first-child,[role=row]>[role=presentation]:first-of-type>.table__column){border-start-start-radius:min(32px,var(--radius-2xl));border-end-start-radius:min(32px,var(--radius-2xl))}.table-root--secondary :is(th.table__column:last-child,[role=row]>[role=presentation]:last-of-type>.table__column){border-start-end-radius:min(32px,var(--radius-2xl));border-end-end-radius:min(32px,var(--radius-2xl))}.table-root--secondary .table__body{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table-root--secondary .table__body tr:first-child td:first-child,.table-root--secondary .table__body tr:first-child td:last-child,.table-root--secondary .table__body tr:last-child td:first-child,.table-root--secondary .table__body tr:last-child td:last-child{border-radius:0}.table-root--secondary .table__body:not(tbody){border-radius:0;overflow:visible}.table-root--secondary .table__row .table__cell{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row .table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table-root--secondary .table__row .table__cell{background-color:#0000}@media(hover:hover){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--default) 50%,transparent)}}}.table__content{border-collapse:separate;--tw-border-spacing-x:0;--tw-border-spacing-y:0;width:100%;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.table-root--primary .table__content{overflow:clip}.table__header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator)}@supports (color:color-mix(in lab,red,red)){.table__header{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__header{background-color:var(--surface-secondary)}.table__column{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);position:relative}.table__column:after{content:"";pointer-events:none;height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .5);background-color:var(--separator);inset-inline-end:calc(var(--spacing) * 0);position:absolute;top:50%}.table__column:last-child:not(:only-child):after{content:none}.table__column[data-allows-sorting=true]{cursor:var(--cursor-interactive)}@media(hover:hover){.table__column[data-allows-sorting=true]:hover,.table__column[data-allows-sorting=true][data-hovered=true]{color:var(--foreground)}}.table__column:focus-visible,.table__column[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}[role=row]>[role=presentation]:last-of-type:not(:only-of-type)>.table__column:after{content:none}.table__sortable-column-header{justify-content:space-between;align-items:center;display:flex}.table__sortable-column-indicator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out)}.table__sortable-column-indicator[data-direction=descending]{rotate:180deg}.table__body tr:first-child td:first-child{border-start-start-radius:min(32px,var(--radius-2xl))}.table__body tr:first-child td:last-child{border-start-end-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:first-child{border-end-start-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:last-child{border-end-end-radius:min(32px,var(--radius-2xl))}.table__body:not(tbody){border-radius:min(32px,var(--radius-2xl));height:100%;position:relative;overflow:clip}.table__row{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator);height:100%;position:relative}@supports (color:color-mix(in lab,red,red)){.table__row{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__row:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 40%,transparent)}}}.table__row[data-selected=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row[data-selected=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 10%,transparent)}}.table__row[aria-disabled=true],.table__row[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.table__row:focus-visible,.table__row[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.table__row[data-dragging=true]{opacity:.5}.table__row[data-drop-target=true] .table__cell{background-color:var(--accent-soft)}.table__cell{background-color:var(--surface);height:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);vertical-align:middle;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table__cell:focus-visible,.table__cell[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true]) :is(.table__cell,.table__column){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):only-child,.table__row:is(:focus-visible,[data-focus-visible=true])>:only-child :is(.table__cell,.table__column){border-radius:calc(var(--radius) * 1);--tw-shadow:inset 0 0 0 2px var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):first-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:first-child:not(:only-child) :is(.table__cell,.table__column){border-top-left-radius:calc(var(--radius) * 1);border-bottom-left-radius:calc(var(--radius) * 1);--tw-shadow:inset 2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):last-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:last-child:not(:only-child) :is(.table__cell,.table__column){border-top-right-radius:calc(var(--radius) * 1);border-bottom-right-radius:calc(var(--radius) * 1);--tw-shadow:inset -2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):not(:first-child):not(:last-child):not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:not(:first-child):not(:last-child):not(:only-child) :is(.table__cell,.table__column){--tw-shadow:inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__cell[data-tree-column]{padding-inline-start:calc(1rem * var(--table-row-level,1))}.table__footer{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);align-items:center;display:flex}.table__resizable-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;position:relative;overflow:auto}.table__column-resizer{height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;border-radius:calc(var(--radius) * .5);background-color:var(--separator);box-sizing:content-box;--tw-translate-x: 50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:col-resize;touch-action:none;padding-inline:calc(var(--spacing) * 2);--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-clip:content-box;border-style:none;outline-style:none;position:absolute;top:50%}.table__column-resizer[data-hovered=true],.table__column-resizer:hover,.table__column-resizer[data-resizing=true]{height:100%;width:calc(var(--spacing) * .5);background-color:var(--accent)}.table__column-resizer[data-focus-visible=true],.table__column-resizer:focus-visible{height:100%;width:calc(var(--spacing) * .5);background-color:var(--focus)}.table__column:has(.table__column-resizer):after{content:none}.table__load-more td,.table__load-more [role=rowheader]{padding-block:calc(var(--spacing) * 3);text-align:center}:is(.table__load-more td,.table__load-more [role=rowheader])>*{margin-inline:auto}.table__load-more-content{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 2);display:flex}.alert{justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 4);background-color:var(--surface);width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex}.alert__content{flex-direction:column;flex-grow:1;align-items:flex-start;height:100%;display:flex}.alert__indicator{padding:var(--spacing);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:flex}.alert__indicator [data-slot=alert-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.alert__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.alert__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.alert--default .alert__indicator,.alert--default .alert__title{color:var(--foreground)}.alert--accent .alert__indicator,.alert--accent .alert__title{color:var(--accent-soft-foreground)}.alert--success .alert__indicator,.alert--success .alert__title{color:var(--success-soft-foreground)}.alert--warning .alert__indicator,.alert--warning .alert__title{color:var(--warning-soft-foreground)}.alert--danger .alert__indicator,.alert--danger .alert__title{color:var(--danger-soft-foreground)}.empty-state{padding:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.skeleton{pointer-events:none;border-radius:calc(var(--radius) * .5);background-color:var(--surface-tertiary);position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.skeleton{background-color:color-mix(in oklab,var(--surface-tertiary) 70%,transparent)}}.skeleton--shimmer:after{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-gradient-position:to right;animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}@supports (background-image:linear-gradient(in lab,red,red)){.skeleton--shimmer:after{--tw-gradient-position:to right in oklab}}.skeleton--shimmer:after{background-image:linear-gradient(var(--tw-gradient-stops));--tw-gradient-from:transparent;--tw-gradient-via:var(--surface-tertiary);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));--tw-gradient-to:transparent;--tw-content:"";content:var(--tw-content)}.skeleton--shimmer:has(.skeleton):after{content:none}.skeleton--shimmer:has(.skeleton):before{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-content:"";content:var(--tw-content);z-index:10;pointer-events:none;mix-blend-mode:overlay;background:linear-gradient(90deg,#0000,#ffffff80,#0000);animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}.skeleton--shimmer:has(.skeleton) .skeleton:after{content:none}.skeleton--pulse{animation:var(--animate-pulse)}.meter{gap:var(--spacing);--meter-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.meter [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.meter .meter__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.meter .meter__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.meter .meter__fill{border-radius:calc(var(--radius) * .5);background-color:var(--meter-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]) [data-slot=label]{opacity:1}.meter--sm .meter__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.meter--sm .meter__fill{border-radius:calc(var(--radius) * .25)}.meter--lg .meter__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.meter--lg .meter__fill{border-radius:calc(var(--radius) * .75)}.meter--default{--meter-fill:var(--default-foreground)}.meter--accent{--meter-fill:var(--accent)}.meter--success{--meter-fill:var(--success)}.meter--warning{--meter-fill:var(--warning)}.meter--danger{--meter-fill:var(--danger)}.progress-bar{gap:var(--spacing);--progress-bar-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.progress-bar [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.progress-bar .progress-bar__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.progress-bar .progress-bar__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.progress-bar .progress-bar__fill{border-radius:calc(var(--radius) * .5);background-color:var(--progress-bar-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-bar:not([aria-valuenow]) .progress-bar__fill{width:40%;animation:1.5s cubic-bezier(.65,0,.35,1) infinite progress-bar-indeterminate}.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]) [data-slot=label]{opacity:1}@keyframes progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(350%)}}.progress-bar--sm .progress-bar__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.progress-bar--sm .progress-bar__fill{border-radius:calc(var(--radius) * .25)}.progress-bar--lg .progress-bar__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.progress-bar--lg .progress-bar__fill{border-radius:calc(var(--radius) * .75)}.progress-bar--default{--progress-bar-fill:var(--default-foreground)}.progress-bar--accent{--progress-bar-fill:var(--accent)}.progress-bar--success{--progress-bar-fill:var(--success)}.progress-bar--warning{--progress-bar-fill:var(--warning)}.progress-bar--danger{--progress-bar-fill:var(--danger)}.progress-circle{--progress-circle-stroke:var(--accent);--progress-circle-track-stroke:var(--default);justify-content:center;align-items:center;display:inline-flex}.progress-circle .progress-circle__track{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.progress-circle .progress-circle__track-circle{stroke:var(--progress-circle-track-stroke)}.progress-circle .progress-circle__fill-circle{stroke:var(--progress-circle-stroke);transition:stroke-dashoffset .3s var(--ease-out)}.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-circle:not([aria-valuenow]) .progress-circle__track{animation:1s linear infinite progress-circle-spin}.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-circle:disabled,.progress-circle[data-disabled=true],.progress-circle[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@keyframes progress-circle-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.progress-circle--sm .progress-circle__track{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.progress-circle--lg .progress-circle__track{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.progress-circle--default{--progress-circle-stroke:var(--default-foreground)}.progress-circle--accent{--progress-circle-stroke:var(--accent)}.progress-circle--success{--progress-circle-stroke:var(--success)}.progress-circle--warning{--progress-circle-stroke:var(--warning)}.progress-circle--danger{--progress-circle-stroke:var(--danger)}.spinner{pointer-events:none;width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);flex-shrink:0;animation:.75s linear infinite spin;display:inline-flex}.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *),.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.spinner--sm{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.spinner--lg{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.spinner--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.spinner--current{color:inherit}.spinner--accent{color:var(--accent)}.spinner--danger{color:var(--danger)}.spinner--success{color:var(--success)}.spinner--warning{color:var(--warning)}.toast-region{pointer-events:none;z-index:50;--tw-outline-style:none;outline-style:none;width:calc(100vw - 2rem);position:fixed}@media(min-width:40rem){.toast-region{width:auto;min-width:var(--toast-width)}}.toast-region{display:block}.toast-region--bottom{bottom:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--bottom-start{bottom:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--bottom-end{right:calc(var(--spacing) * 4);bottom:calc(var(--spacing) * 4)}.toast-region--top{top:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--top-start{top:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--top-end{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4)}.toast-region:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast{pointer-events:auto;justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 1.5);background-color:var(--surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex;position:absolute;left:0;right:0}.toast--bottom,.toast--bottom-start,.toast--bottom-end{bottom:0}.toast--top,.toast--top-start,.toast--top-end{top:0}.toast:not([data-frontmost=true]){pointer-events:none;height:var(--front-height);overflow:hidden}.toast:not([data-frontmost=true]) .toast__close-button{pointer-events:none;opacity:0;outline:none}.toast[data-hidden=true]{pointer-events:none;opacity:0;display:flex}.toast:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast--bottom,.toast--bottom-start,.toast--bottom-end{view-transition-class:toast-bottom}.toast--top,.toast--top-start,.toast--top-end{view-transition-class:toast-top}.toast__content{flex-direction:column;flex-grow:1;align-self:center;align-items:flex-start;height:100%;display:flex}.toast__indicator{padding:var(--spacing);color:var(--overlay-foreground);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.toast__indicator [data-slot=toast-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__indicator [data-slot=spinner],.toast__indicator [data-slot=spinner-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--overlay-foreground)}.toast__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.toast__close-button{pointer-events:none;top:calc(var(--spacing) * -1);right:calc(var(--spacing) * -1);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);border-color:var(--border);background-color:var(--default);opacity:0;position:absolute}@media(min-width:40rem){.toast__close-button{border-style:var(--tw-border-style);background-color:var(--overlay);border-width:1px}}.toast__close-button{transition:opacity .15s var(--ease-smooth)}.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(min-width:40rem){.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}}@media(hover:hover){.toast__close-button:hover,.toast__close-button[data-hovered=true]{background-color:var(--default)}}.toast[data-frontmost=true]:hover .toast__close-button{pointer-events:auto;opacity:1}.toast__action{margin-top:calc(var(--spacing) * 2)}@media(min-width:40rem){.toast__action{margin-top:0}}.toast--accent .toast__title{color:var(--accent-soft-foreground)}.toast--success .toast__title,.toast--success .toast__indicator{color:var(--success-soft-foreground)}.toast--warning .toast__title,.toast--warning .toast__indicator{color:var(--warning-soft-foreground)}.toast--danger .toast__title,.toast--danger .toast__indicator{color:var(--danger-soft-foreground)}::view-transition-old(*){will-change:translate,opacity}::view-transition-new(*){will-change:translate,opacity}::view-transition-new(.toast-bottom):only-child{animation:.35s toast-slide-bottom-in}::view-transition-old(.toast-bottom):only-child{animation:.35s forwards toast-slide-bottom-out}::view-transition-new(.toast-top):only-child{animation:.35s toast-slide-top-in}::view-transition-old(.toast-top):only-child{animation:.35s forwards toast-slide-top-out}@keyframes toast-slide-bottom-in{0%{opacity:0;translate:0 100%}}@keyframes toast-slide-bottom-out{to{opacity:0;translate:0 100%}}@keyframes toast-slide-top-in{0%{opacity:0;translate:0 -100%}}@keyframes toast-slide-top-out{to{opacity:0;translate:0 -100%}}.checkbox-group{flex-direction:column;display:flex}.checkbox-group [data-slot=checkbox]{margin-top:calc(var(--spacing) * 4)}.checkbox{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.checkbox>[data-slot=description],.checkbox>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.checkbox [data-slot=label]{-webkit-user-select:none;user-select:none}.checkbox .checkbox__content [data-slot=label]{cursor:var(--cursor-interactive)}.checkbox[data-disabled=true],.checkbox[data-disabled=true] [data-slot=description],.checkbox[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.checkbox[data-selected=true],.checkbox[data-indeterminate=true]) .checkbox__indicator{border-color:var(--accent-foreground)}.checkbox [data-slot=checkbox-default-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);stroke-width:2.5px;color:var(--accent-foreground);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.2s;transition-duration:.2s}.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox[data-selected=true] [data-slot=checkbox-default-indicator--checkmark]{transition:stroke-dashoffset .15s linear 15ms}.checkbox[data-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[data-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark]{color:var(--danger-foreground)}.checkbox[data-indeterminate=true] [data-slot=checkbox-default-indicator--indeterminate]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.checkbox[data-indeterminate=true][data-invalid=true] [data-slot=checkbox-default-indicator--indeterminate],.checkbox[data-indeterminate=true][aria-invalid=true] [data-slot=checkbox-default-indicator--indeterminate]{color:var(--danger-foreground)}.checkbox__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .75);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative;overflow:hidden}.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox__control{cursor:var(--cursor-interactive)}.checkbox__control:before{pointer-events:none;z-index:0;transform-origin:50%;--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);border-radius:calc(var(--radius) * .75);background-color:var(--accent);opacity:0;--tw-content:"";content:var(--tw-content);transition:scale .1s var(--ease-linear),opacity .2s var(--ease-linear),background-color .2s var(--ease-out);position:absolute;top:0;right:0;bottom:0;left:0}@media(prefers-reduced-motion:reduce){.checkbox__control:before:not(:is()){transition-property:none}}.checkbox:focus-visible .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-focus-visible=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-focus-visible=true] .checkbox__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control{border-color:var(--field-border-hover)}:is(.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control):before{background-color:var(--accent-hover)}.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control{color:var(--accent-foreground);border-color:#0000}:is(.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.checkbox[data-indeterminate=true] .checkbox__control{background-color:var(--accent);color:var(--accent-foreground)}.checkbox:active[data-indeterminate=true] .checkbox__control,.checkbox[data-pressed=true][data-indeterminate=true] .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-pressed=true])[data-indeterminate=true] .checkbox__control{background-color:var(--accent-hover)}.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-visible,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focused=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-visible=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-within,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground);border-color:#0000}:is(.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);background-color:var(--danger);opacity:1}.checkbox[data-indeterminate=true][aria-invalid=true] .checkbox__control,.checkbox[data-indeterminate=true][data-invalid=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground)}.checkbox__indicator{z-index:10;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);justify-content:center;align-items:center;display:flex;position:relative}.checkbox__indicator svg{width:100%;height:100%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.checkbox--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.checkbox--secondary .checkbox__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--checkbox-control-bg);--checkbox-control-bg:var(--default)}.checkbox:hover :is(.checkbox--secondary .checkbox__control),.checkbox:has([data-slot=checkbox-content][data-hovered=true]) :is(.checkbox--secondary .checkbox__control),.checkbox [data-slot=checkbox-content][data-hovered=true] :is(.checkbox--secondary .checkbox__control){border-color:var(--field-border-hover)}.checkbox__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.checkbox--secondary:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{background-color:var(--checkbox-control-bg)}:is(.checkbox--secondary[aria-checked=true] .checkbox__control,.checkbox--secondary[data-selected=true] .checkbox__control):before,.checkbox--secondary[data-indeterminate=true] .checkbox__control,.checkbox--secondary[data-indeterminate=true] .checkbox__control:before{background-color:var(--accent)}.fieldset{gap:calc(var(--spacing) * 6);flex-direction:column;flex:1 1 0;display:flex}.fieldset__legend{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.fieldset__field_group{width:100%}:where(.fieldset__field_group>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.fieldset__actions{align-items:center;gap:calc(var(--spacing) * 2);padding-top:var(--spacing);display:flex}.input-otp{align-items:center;gap:calc(var(--spacing) * 2);display:flex;position:relative}.input-otp[data-disabled=true]{cursor:not-allowed;opacity:.5}.input-otp__group{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.input-otp__slot{height:calc(var(--spacing) * 10);width:calc(var(--spacing) * 9.5);border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:var(--field-radius,calc(var(--radius) * 1.5));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;flex:1;justify-content:center;align-items:center;display:flex;position:relative}.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-otp__slot:hover,.input-otp__slot[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-otp__slot[data-active=true]{z-index:10;background-color:var(--field-focus);--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.input-otp__slot[data-filled=true]{background-color:var(--field-focus)}.input-otp__slot[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input-otp__slot[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-otp__slot[data-invalid=true]:focus,.input-otp__slot[data-invalid=true]:focus-visible,.input-otp__slot[data-invalid=true][data-focused=true],.input-otp__slot[data-invalid=true][data-focus-visible=true],.input-otp__slot[data-invalid=true]:focus-within,.input-otp__slot[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-otp__slot[data-invalid=true]{background-color:var(--field-focus)}.input-otp__slot-value{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-tracking:-.27px;letter-spacing:-.27px;animation:slot-value-in .25s var(--ease-smooth) both;transform-origin:bottom}.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.input-otp__caret{height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .5);background-color:var(--field-placeholder,var(--muted));width:2px;animation:1.2s ease-out infinite caret-blink;position:absolute}.input-otp__separator{border-radius:calc(var(--radius) * .5);background-color:var(--separator);flex-shrink:0;width:6px;height:2px}.input-otp--secondary .input-otp__slot{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-otp-slot-bg);--input-otp-slot-bg:var(--default);--input-otp-slot-bg-hover:var(--default-hover);--input-otp-slot-bg-focus:var(--default)}@media(hover:hover){.input-otp--secondary .input-otp__slot:hover,.input-otp--secondary .input-otp__slot[data-hovered=true]{background-color:var(--input-otp-slot-bg-hover)}}.input-otp--secondary .input-otp__slot[data-active=true],.input-otp--secondary .input-otp__slot[data-filled=true]{background-color:var(--input-otp-slot-bg-focus)}@keyframes slot-value-in{0%{opacity:0;transform:translateY(8px)scale(.8)}to{opacity:1;transform:translateY(0)scale(1)}}.input{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input{border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input:hover:not(:focus):not(:focus-visible),.input[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input:focus,.input[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input[data-invalid=true]:focus,.input[data-invalid=true]:focus-visible,.input[data-invalid=true][data-focused=true],.input[data-invalid=true][data-focus-visible=true],.input[data-invalid=true]:focus-within,.input[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input[data-invalid=true]{background-color:var(--field-focus)}.input:disabled,.input[data-disabled=true],.input[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-bg);--input-bg:var(--default);--input-bg-hover:var(--default-hover);--input-bg-focus:var(--default)}@media(hover:hover){.input--secondary:hover:not(:focus):not(:focus-visible),.input--secondary[data-hovered=true]:not([data-focus-visible=true]):not([data-focused=true]){background-color:var(--input-bg-hover)}}.input--secondary:focus,.input--secondary[data-focused=true]{background-color:var(--input-bg-focus)}.input--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input--secondary[data-invalid=true]:focus,.input--secondary[data-invalid=true]:focus-visible,.input--secondary[data-invalid=true][data-focused=true],.input--secondary[data-invalid=true][data-focus-visible=true],.input--secondary[data-invalid=true]:focus-within,.input--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input--secondary[data-invalid=true]{background-color:var(--input-bg-focus)}.input--full-width{width:100%}.input-group{min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);outline-style:none;align-items:center;display:inline-flex}.input-group:has([data-slot=input-group-textarea]){align-items:flex-start;height:auto}.input-group{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-group:hover:not(:focus-within),.input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-group:has([data-slot=input-group-input]:focus),.input-group:has([data-slot=input-group-textarea]:focus){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group[data-invalid=true]:focus,.input-group[data-invalid=true]:focus-visible,.input-group[data-invalid=true][data-focused=true],.input-group[data-invalid=true][data-focus-visible=true],.input-group[data-invalid=true]:focus-within,.input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.input-group[data-disabled=true],.input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.input-group:has([data-slot=input-group-input]:-webkit-autofill),.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.input-group__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}.input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input-group:has([data-slot=input-group-prefix]) .input-group__input{border-top-left-radius:0;border-bottom-left-radius:0;padding-left:0}.input-group:has([data-slot=input-group-suffix]) .input-group__input{border-top-right-radius:0;border-bottom-right-radius:0;padding-right:0}.input-group__input:focus,.input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.input-group__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input[data-slot=input-group-textarea]{resize:vertical;min-height:38px}.input-group__prefix{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-right-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-left:none;border-top-right-radius:0;border-bottom-right-radius:0;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__prefix{align-items:flex-start;padding-top:.5rem}.input-group__prefix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group__suffix{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-left-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-right:none;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__suffix{align-items:flex-start;padding-top:.5rem}.input-group__suffix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-group-bg);--input-group-bg:var(--default);--input-group-bg-hover:var(--default-hover);--input-group-bg-focus:var(--default)}@media(hover:hover){.input-group--secondary:hover:not(:focus-within),.input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--input-group-bg-hover)}}.input-group--secondary:has([data-slot=input-group-input]:focus),.input-group--secondary:has([data-slot=input-group-textarea]:focus){background-color:var(--input-group-bg-focus)}.input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group--secondary[data-invalid=true]:focus,.input-group--secondary[data-invalid=true]:focus-visible,.input-group--secondary[data-invalid=true][data-focused=true],.input-group--secondary[data-invalid=true][data-focus-visible=true],.input-group--secondary[data-invalid=true]:focus-within,.input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--input-group-bg-focus)}.input-group--secondary [data-slot=input-group-input],.input-group--secondary [data-slot=input-group-textarea]{background-color:#0000}.input-group--full-width{width:100%}.number-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.number-field[data-invalid=true],.number-field[aria-invalid=true]) [data-slot=description]{display:none}.number-field [data-slot=label]{width:fit-content}.number-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;grid-template-columns:40px 1fr 40px;align-items:center;display:grid;overflow:hidden}.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.number-field__group:hover:not(:focus-within),.number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.number-field__group[data-focus-within=true],.number-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field__group[data-invalid=true]:focus,.number-field__group[data-invalid=true]:focus-visible,.number-field__group[data-invalid=true][data-focused=true],.number-field__group[data-invalid=true][data-focus-visible=true],.number-field__group[data-invalid=true]:focus-within,.number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.number-field__group[data-disabled=true],.number-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.number-field__group:has([data-slot=number-field-input]:-webkit-autofill),.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.number-field__input{border-style:var(--tw-border-style);min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none}@media(min-width:40rem){.number-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.number-field__group:has([slot=decrement]) .number-field__input{border-top-left-radius:0;border-bottom-left-radius:0}.number-field__group:has([slot=increment]) .number-field__input{border-top-right-radius:0;border-bottom-right-radius:0}.number-field__input:focus,.number-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.number-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__increment-button,.number-field__decrement-button{height:100%;width:calc(var(--spacing) * 10);color:var(--field-foreground,var(--foreground));--tw-outline-style:none;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth);background-color:#0000;border-style:solid;border-radius:0;outline-style:none;justify-content:center;align-items:center;display:flex}:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.number-field__increment-button,.number-field__decrement-button{cursor:var(--cursor-interactive)}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:var(--field-foreground,var(--foreground))}@supports (color:color-mix(in lab,red,red)){:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:color-mix(in oklab,var(--field-foreground,var(--foreground)) 10%,transparent)}}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{transform:scale(.97)}:is(.number-field__increment-button,.number-field__decrement-button):disabled,:is(.number-field__increment-button,.number-field__decrement-button)[data-disabled=true],:is(.number-field__increment-button,.number-field__decrement-button)[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-increment-button-icon],:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-decrement-button-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.number-field__increment-button{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--field-placeholder,var(--muted))}@supports (color:color-mix(in lab,red,red)){.number-field__increment-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field__decrement-button{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--field-placeholder,var(--muted));border-top-right-radius:0;border-bottom-right-radius:0}@supports (color:color-mix(in lab,red,red)){.number-field__decrement-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field--secondary .number-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--number-field-group-bg);--number-field-group-bg:var(--default);--number-field-group-bg-hover:var(--default-hover);--number-field-group-bg-focus:var(--default)}@media(hover:hover){.number-field--secondary .number-field__group:hover:not(:focus-within),.number-field--secondary .number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--number-field-group-bg-hover)}}.number-field--secondary .number-field__group:focus-within,.number-field--secondary .number-field__group[data-focus-within=true]{background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field--secondary .number-field__group[data-invalid=true]:focus,.number-field--secondary .number-field__group[data-invalid=true]:focus-visible,.number-field--secondary .number-field__group[data-invalid=true][data-focused=true],.number-field--secondary .number-field__group[data-invalid=true][data-focus-visible=true],.number-field--secondary .number-field__group[data-invalid=true]:focus-within,.number-field--secondary .number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field--secondary .number-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group [data-slot=number-field-input]{background-color:#0000}.number-field--full-width,.number-field__group--full-width{width:100%}.radio-group{flex-direction:column;display:flex}.radio-group[data-orientation=vertical] [data-slot=radio]{margin-top:calc(var(--spacing) * 4)}.radio-group[data-orientation=horizontal]{gap:calc(var(--spacing) * 4);flex-flow:wrap}.radio-group--secondary .radio__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--radio-control-bg);--radio-control-bg:var(--default);--radio-control-bg-hover:var(--default-hover)}.radio:has([data-slot=radio-content][data-hovered=true]) :is(.radio-group--secondary .radio__control),.radio [data-slot=radio-content][data-hovered=true] :is(.radio-group--secondary .radio__control){border-color:var(--field-border-hover)}.radio:not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg-hover)}.radio{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.radio [data-slot=label]{-webkit-user-select:none;user-select:none}.radio .radio__content [data-slot=label]{cursor:var(--cursor-interactive)}.radio>[data-slot=description],.radio>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=description],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.radio__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.radio__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.radio__control{cursor:var(--cursor-interactive)}.radio:has([data-slot=radio-content][data-focus-visible=true]) .radio__control,.radio [data-slot=radio-content][data-focus-visible=true] .radio__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.radio:has([data-slot=radio-content][data-hovered=true]) .radio__control,.radio [data-slot=radio-content][data-hovered=true] .radio__control{border-color:var(--field-border-hover)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) .radio__control .radio__indicator:empty:before{background-color:var(--field-hover)}.radio:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio [data-slot=radio-content][data-pressed=true] .radio__control{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.radio[data-selected] .radio__control,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__control,.radio:has(input:checked) .radio__control{background-color:var(--accent);border-color:#0000}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__control,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__control{background-color:var(--accent-hover)}.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-visible,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focused=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-within,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-visible,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focused=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-within,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio__indicator{pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.radio__indicator:empty:before{content:"";border-radius:calc(var(--radius) * 1);background-color:var(--field-background,var(--default));width:100%;height:100%;transition:scale .2s var(--ease-out),background-color .2s var(--ease-out);scale:1}@media(prefers-reduced-motion:reduce){.radio__indicator:empty:before:not(:is()){transition-property:none}}.radio[data-selected] .radio__indicator:empty:before,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked) .radio__indicator:empty:before{background-color:var(--accent-foreground);scale:.4286}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before{scale:.5714}.radio--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textfield{gap:var(--spacing);flex-direction:column;display:flex}:is(.textfield[data-invalid=true],.textfield[aria-invalid=true]) [data-slot=description]{display:none}.textfield--full-width,.textfield--full-width [data-slot=input],.textfield--full-width [data-slot=textarea]{width:100%}.search-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.search-field[data-invalid=true],.search-field[aria-invalid=true]) [data-slot=description]{display:none}.search-field [data-slot=label]{width:fit-content}.search-field[data-empty=true] [data-slot=search-field-clear-button]{pointer-events:none;opacity:0}.search-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;position:relative;overflow:hidden}.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.search-field__group:hover:not(:focus-within),.search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.search-field__group[data-focus-within=true],.search-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field__group[data-invalid=true]:focus,.search-field__group[data-invalid=true]:focus-visible,.search-field__group[data-invalid=true][data-focused=true],.search-field__group[data-invalid=true][data-focus-visible=true],.search-field__group[data-invalid=true]:focus-within,.search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.search-field__group[data-disabled=true],.search-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.search-field__group:has([data-slot=search-field-input]:-webkit-autofill),.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.search-field__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}@media(min-width:40rem){.search-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.search-field__input::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__input::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__group:has([data-slot=search-field-search-icon]) .search-field__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.search-field__group:has([slot=clear]) .search-field__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.search-field__input:focus,.search-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.search-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__search-icon{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);flex-shrink:0}.search-field__clear-button{margin-right:calc(var(--spacing) * 2);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0}.search-field__clear-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.search-field--secondary .search-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--search-field-group-bg);--search-field-group-bg:var(--default);--search-field-group-bg-hover:var(--default-hover);--search-field-group-bg-focus:var(--default)}@media(hover:hover){.search-field--secondary .search-field__group:hover:not(:focus-within),.search-field--secondary .search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--search-field-group-bg-hover)}}.search-field--secondary .search-field__group:focus-within,.search-field--secondary .search-field__group[data-focus-within=true]{background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field--secondary .search-field__group[data-invalid=true]:focus,.search-field--secondary .search-field__group[data-invalid=true]:focus-visible,.search-field--secondary .search-field__group[data-invalid=true][data-focused=true],.search-field--secondary .search-field__group[data-invalid=true][data-focus-visible=true],.search-field--secondary .search-field__group[data-invalid=true]:focus-within,.search-field--secondary .search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field--secondary .search-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group [data-slot=search-field-input]{background-color:#0000}.search-field--full-width,.search-field__group--full-width{width:100%}.textarea{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.textarea::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.textarea{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.textarea{border-width:var(--border-width-field);border-color:var(--field-border);min-height:38px;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *),.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.textarea:hover:not(:focus):not(:focus-visible),.textarea[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.textarea:focus,.textarea[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.textarea[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea[data-invalid=true]:focus,.textarea[data-invalid=true]:focus-visible,.textarea[data-invalid=true][data-focused=true],.textarea[data-invalid=true][data-focus-visible=true],.textarea[data-invalid=true]:focus-within,.textarea[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea[data-invalid=true]{background-color:var(--field-focus)}.textarea:disabled,.textarea[data-disabled=true],.textarea[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textarea--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--textarea-bg);--textarea-bg:var(--default);--textarea-bg-hover:var(--default-hover);--textarea-bg-focus:var(--default)}@media(hover:hover){.textarea--secondary:hover:not(:focus):not(:focus-visible),.textarea--secondary[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--textarea-bg-hover)}}.textarea--secondary:focus,.textarea--secondary[data-focused=true]{background-color:var(--textarea-bg-focus)}.textarea--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea--secondary[data-invalid=true]:focus,.textarea--secondary[data-invalid=true]:focus-visible,.textarea--secondary[data-invalid=true][data-focused=true],.textarea--secondary[data-invalid=true][data-focus-visible=true],.textarea--secondary[data-invalid=true]:focus-within,.textarea--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea--secondary[data-invalid=true]{background-color:var(--textarea-bg-focus)}.textarea--full-width{width:100%}.calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.calendar--week-view .calendar__cell,.calendar--day-view .calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.calendar--day-view .calendar__grid{flex-direction:column;display:flex}.calendar--day-view .calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-header>tr{display:contents}.calendar--day-view .calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-body>tr{display:contents}.calendar--day-view .calendar__grid-body>tr:first-child>td{margin-top:0}.calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .calendar__nav-button{pointer-events:none;opacity:0}.calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 2);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.calendar__nav-button:hover,.calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.calendar__nav-button:active,.calendar__nav-button[data-pressed=true]{transform:scale(.95)}.calendar__nav-button:focus-visible,.calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__nav-button:disabled,.calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar__grid[aria-readonly=true] .calendar__cell{pointer-events:none}.calendar__grid-header,.calendar__grid-header>tr,.calendar__grid-body,.calendar__grid-body>tr{display:contents}.calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.calendar__grid-row{display:contents}.calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.calendar__cell{aspect-ratio:1;border-radius:calc(var(--radius) * 3);text-align:center;width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;will-change:scale;transition:transform .25s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__cell{cursor:var(--cursor-interactive)}.calendar__cell:focus-visible:not(:focus),.calendar__cell[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__cell[data-today=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.calendar__cell[data-today=true]:hover:not([data-selected=true]),.calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true]){background-color:var(--accent-soft-hover)}}.calendar__cell[data-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}.calendar__cell:active,.calendar__cell[data-pressed=true]{background-color:var(--default);transform:scale(.95)}:is(.calendar__cell:active,.calendar__cell[data-pressed=true])[data-selected=true]{background-color:var(--accent-hover)}@media(hover:hover){.calendar__cell:hover:not([data-selected=true]),.calendar__cell[data-hovered=true]:not([data-selected=true]){background-color:var(--default)}}.calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.calendar__cell[data-selected=true][data-outside-month=true]{background-color:var(--default)}.calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__cell:disabled:not([data-outside-month=true]),.calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.calendar__cell-indicator{background-color:var(--accent-foreground)}.range-calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.range-calendar--week-view .range-calendar__cell,.range-calendar--day-view .range-calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.range-calendar--day-view .range-calendar__grid{flex-direction:column;display:flex}.range-calendar--day-view .range-calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-header>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-body>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body>tr:first-child>td{margin-top:0}.range-calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.range-calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .range-calendar__nav-button{pointer-events:none;opacity:0}.range-calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.range-calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.range-calendar__nav-button:hover,.range-calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.range-calendar__nav-button:active,.range-calendar__nav-button[data-pressed=true]{transform:scale(.95)}.range-calendar__nav-button:focus-visible,.range-calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__nav-button:disabled,.range-calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.range-calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar__grid[aria-readonly=true] .range-calendar__cell{pointer-events:none}.range-calendar__grid-header,.range-calendar__grid-header>tr,.range-calendar__grid-body,.range-calendar__grid-body>tr{display:contents}.range-calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.range-calendar__grid-row{display:contents}.range-calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.range-calendar__cell{z-index:1;border-radius:calc(var(--radius) * 3);--tw-outline-style:none;cursor:var(--cursor-interactive);will-change:background-color,border-color;transition:box-shadow .1s var(--ease-out),border-color .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;margin-block:2px;margin-inline:0;padding:0;position:relative}.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell .range-calendar__cell-button{aspect-ratio:1;border-radius:calc(var(--radius) * 3);width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);-webkit-tap-highlight-color:transparent;will-change:scale;transition:scale .2s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]{z-index:2}:is(.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]) .range-calendar__cell-button{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__cell[data-today=true] .range-calendar__cell-button{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){:is(.range-calendar__cell[data-today=true]:hover:not([data-selected=true]),.range-calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--accent-soft-hover)}}.range-calendar__cell[data-selected=true]:not([data-outside-month=true]){background-color:var(--accent-soft);border-radius:0}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*){border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*)[data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*){border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*)[data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){z-index:2}:is(.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true])) .range-calendar__cell-button{background-color:var(--accent);color:var(--accent-foreground)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]){border-top-left-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){border-top-right-radius:calc(var(--radius) * 3);border-bottom-right-radius:calc(var(--radius) * 3)}:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true]) .range-calendar__cell-button{scale:.9}:is(:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-start=true],:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-end=true]) .range-calendar__cell-button{background-color:var(--accent-hover)}@media(hover:hover){:is(.range-calendar__cell:hover:not([data-selected=true]),.range-calendar__cell[data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--default)}}.range-calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:color-mix(in oklab,var(--default) 20%,transparent)}}.range-calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__cell:disabled:not([data-outside-month=true]),.range-calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true]{border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true]{border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.range-calendar__cell-indicator{background-color:var(--accent-foreground)}.calendar:has(.calendar-year-picker__year-grid),.range-calendar:has(.calendar-year-picker__year-grid){position:relative}.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]{will-change:opacity;transition:opacity .15s var(--ease-out),visibility 0s linear}:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]{pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s var(--ease-out),visibility 0s linear .15s}:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger{justify-content:flex-start;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1);--tw-outline-style:none;cursor:var(--cursor-interactive);touch-action:manipulation;outline-style:none;flex:1;display:flex}.calendar-year-picker__trigger:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar-year-picker__trigger-heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition:color .15s var(--ease-out)}.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger-indicator{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--accent-soft-foreground);transition:transform .15s var(--ease-out)}.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-indicator{transform:rotate(90deg)}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-heading{color:var(--accent-soft-foreground)}.calendar-year-picker__year-grid{pointer-events:none;scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);align-content:flex-start;gap:var(--spacing);padding:var(--spacing);opacity:0;will-change:opacity;grid-template-columns:repeat(3,1fr);display:grid;position:absolute;left:0;right:0;overflow-y:auto}.calendar-year-picker__year-grid[data-open=true]{pointer-events:auto;opacity:1;transition:opacity .2s var(--ease-out) 50ms}.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);padding-inline:calc(var(--spacing) * 2.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{cursor:var(--cursor-interactive)}@media(hover:hover)and (pointer:fine){.calendar-year-picker__year-cell:is(:hover,[data-hovered=true]):not([data-selected=true]){background-color:var(--default);color:var(--default-foreground)}}.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}@media(hover:hover)and (pointer:fine){:is(.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-hover)}}.calendar-year-picker__year-cell:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.date-field[data-invalid=true],.date-field[aria-invalid=true]) [data-slot=description]{display:none}.date-field [data-slot=label]{width:fit-content}.date-field--full-width{width:100%}.time-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.time-field[data-invalid=true],.time-field[aria-invalid=true]) [data-slot=description]{display:none}.time-field [data-slot=label]{width:fit-content}.time-field--full-width{width:100%}.date-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.date-input-group:hover:not(:focus-within),.date-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.date-input-group[data-focus-within=true]:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])),.date-input-group:focus-within:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.date-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group[data-invalid=true]:focus,.date-input-group[data-invalid=true]:focus-visible,.date-input-group[data-invalid=true][data-focused=true],.date-input-group[data-invalid=true][data-focus-visible=true],.date-input-group[data-invalid=true]:focus-within,.date-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.date-input-group[data-disabled=true],.date-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-input-group__input{cursor:text;border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;gap:1px;display:flex}@media(min-width:40rem){.date-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.date-input-group:has([data-slot=date-input-group-prefix]) .date-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.date-input-group:has([data-slot=date-input-group-suffix]) .date-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=start]{flex:none;padding-right:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=end]{padding-left:0}.date-input-group__input:focus,.date-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.date-input-group__input-container{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;flex:1;align-items:center;width:fit-content;display:flex;overflow:auto clip}.date-input-group__segment{border-radius:calc(var(--radius) * .75);padding-inline:calc(var(--spacing) * .5);text-align:end;text-wrap:nowrap;--tw-outline-style:none;outline-style:none;display:inline-block}.date-input-group__segment[data-type=literal]{color:var(--muted);padding:0}.date-input-group__segment[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.date-input-group__segment:focus,.date-input-group__segment[data-focused=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.date-input-group__segment[data-disabled=true]{opacity:.5}.date-input-group__segment[data-invalid=true]{color:var(--danger)}.date-input-group__segment[data-invalid=true]:focus,.date-input-group__segment[data-invalid=true][data-focused=true]{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.date-input-group__prefix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group__suffix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--date-input-group-bg);--date-input-group-bg:var(--default);--date-input-group-bg-hover:var(--default-hover);--date-input-group-bg-focus:var(--default)}@media(hover:hover){.date-input-group--secondary:hover:not(:focus-within),.date-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--date-input-group-bg-hover)}}.date-input-group--secondary:focus-within,.date-input-group--secondary[data-focus-within=true]{background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group--secondary[data-invalid=true]:focus,.date-input-group--secondary[data-invalid=true]:focus-visible,.date-input-group--secondary[data-invalid=true][data-focused=true],.date-input-group--secondary[data-invalid=true][data-focus-visible=true],.date-input-group--secondary[data-invalid=true]:focus-within,.date-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary [data-slot=date-input-group-input]{background-color:#0000}.date-input-group--full-width{width:100%}.date-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-picker .date-input-group__suffix,.date-picker .date-input-group__prefix{pointer-events:auto}.date-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__trigger:focus-visible:not(:focus),.date-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-picker__trigger:disabled,.date-picker__trigger[data-disabled=true],.date-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-picker__popover:focus-visible:not(:focus),.date-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-picker__popover[data-exiting=true],.date-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.date-range-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-range-picker .date-input-group__suffix,.date-range-picker .date-input-group__prefix{pointer-events:auto}.date-range-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__trigger:focus-visible:not(:focus),.date-range-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-range-picker__trigger:disabled,.date-range-picker__trigger[data-disabled=true],.date-range-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-range-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-range-picker__range-separator{padding-inline:var(--spacing);color:var(--field-placeholder,var(--muted));-webkit-user-select:none;user-select:none}.date-range-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-range-picker__popover:focus-visible:not(:focus),.date-range-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-range-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-range-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-range-picker__popover[data-exiting=true],.date-range-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.card{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 4);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:column;display:flex;position:relative;overflow:visible}.card__header{flex-direction:column;display:flex}.card__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.card__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);color:var(--muted)}.card__content{gap:var(--spacing);flex-direction:column;flex:1;display:flex}.card__footer{flex-direction:row;align-items:center;display:flex}.card--transparent{--tw-border-style:none;--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000;border-style:none}.card--default{background-color:var(--surface)}.card--secondary{background-color:var(--surface-secondary)}.card--tertiary{background-color:var(--surface-tertiary)}.header{width:100%;padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 1.5);padding-bottom:var(--spacing);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted)}.separator{border-radius:calc(var(--radius) * .5);border-top-style:var(--tw-border-style);border-top-width:0;border-bottom-style:var(--tw-border-style);background-color:var(--separator);border-bottom-width:0;flex-shrink:0;width:100%;height:1px}.separator--horizontal{width:100%;height:1px}.separator--vertical{height:auto;min-height:calc(var(--spacing) * 2);align-self:stretch;width:1px}.separator--default{background-color:var(--separator)}.separator--secondary{background-color:var(--separator-secondary)}.separator--tertiary{background-color:var(--separator-tertiary)}.separator__container{align-items:center;gap:calc(var(--spacing) * 3);display:flex}.separator__container--horizontal{flex-direction:row;width:100%}.separator__container--vertical{flex-direction:column;justify-content:center;height:100%}.separator__line{flex-grow:1;flex-shrink:0}.separator__content{text-align:center;white-space:nowrap;color:var(--muted);justify-content:center;align-items:center;display:inline-flex}.separator__content--horizontal,.separator__content--vertical{text-align:center}.surface{color:var(--foreground);position:relative}.surface--transparent{background-color:#0000}.surface--default{background-color:var(--surface);color:var(--surface-foreground)}.surface--secondary{background-color:var(--surface-secondary);color:var(--surface-secondary-foreground)}.surface--tertiary{background-color:var(--surface-tertiary);color:var(--surface-tertiary-foreground)}.avatar{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);background-color:var(--default);flex-shrink:0;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}.avatar__fallback{background-color:var(--default);width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);justify-content:center;align-items:center;display:flex}.avatar__image{aspect-ratio:1;width:100%;height:100%;transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s;position:absolute;top:0;right:0;bottom:0;left:0}.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *),.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.avatar--sm{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2)}.avatar--lg{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12);border-radius:calc(var(--radius) * 3)}.avatar--lg .avatar__fallback{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.avatar__fallback--accent{color:var(--accent-soft-foreground)}.avatar__fallback--default{color:var(--default-soft-foreground)}.avatar__fallback--success{color:var(--success-soft-foreground)}.avatar__fallback--warning{color:var(--warning-soft-foreground)}.avatar__fallback--danger{color:var(--danger-soft-foreground)}.avatar--soft{background-color:#0000}.avatar--soft .avatar__fallback--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.avatar--soft .avatar__fallback--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.avatar--soft .avatar__fallback--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.avatar--soft .avatar__fallback--default{background-color:var(--default-soft);color:var(--default-soft-foreground)}.avatar--soft .avatar__fallback--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.alert-dialog__trigger:focus-visible:not(:focus),.alert-dialog__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.alert-dialog__trigger:disabled,.alert-dialog__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.alert-dialog__trigger:active,.alert-dialog__trigger[data-pressed=true]{transform:scale(.97)}.alert-dialog__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.alert-dialog__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.alert-dialog__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]{will-change:opacity}:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__backdrop--transparent{background-color:#0000}.alert-dialog__backdrop--opaque{background-color:var(--backdrop)}.alert-dialog__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.alert-dialog__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.alert-dialog__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.alert-dialog__container{pointer-events:none}.alert-dialog__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.alert-dialog__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.alert-dialog__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.alert-dialog__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.alert-dialog__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]{will-change:opacity,transform}:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;min-height:0;max-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative;overflow:clip}.alert-dialog__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.alert-dialog__dialog[data-placement=auto]{margin-block:auto}}.alert-dialog__dialog[data-placement=center]{margin-block:auto}.alert-dialog__dialog[data-placement=bottom]{margin-top:auto}.alert-dialog__dialog[data-placement=top]{margin-top:0}.alert-dialog__dialog--xs{max-width:var(--container-xs)}.alert-dialog__dialog--sm{max-width:var(--container-sm)}.alert-dialog__dialog--md{max-width:var(--container-md)}.alert-dialog__dialog--lg{max-width:var(--container-lg)}.alert-dialog__dialog--cover{width:100%;height:100%;min-height:100%}.alert-dialog__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.alert-dialog__header>.modal__icon{margin-bottom:0}.alert-dialog__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.alert-dialog__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.alert-dialog__icon [data-slot=alert-dialog-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.alert-dialog__icon--default{background-color:var(--default);color:var(--foreground)}.alert-dialog__icon--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.alert-dialog__icon--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.alert-dialog__icon--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.alert-dialog__icon--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.alert-dialog__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.alert-dialog__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.alert-dialog__header+.alert-dialog__body{margin-top:calc(var(--spacing) * 2)}.alert-dialog__header+.alert-dialog__footer,.alert-dialog__body+.alert-dialog__footer{margin-top:calc(var(--spacing) * 5)}.drawer__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.drawer__trigger:focus-visible:not(:focus),.drawer__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.drawer__trigger:disabled,.drawer__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.drawer__trigger:active,.drawer__trigger[data-pressed=true]{transform:scale(.97)}.drawer__backdrop{z-index:50;height:var(--visual-viewport-height);opacity:1;width:100%;transition:opacity .25s cubic-bezier(.32,.72,0,1);position:fixed;top:0;right:0;bottom:0;left:0}.drawer__backdrop[data-entering=true]{opacity:0}.drawer__backdrop[data-exiting=true]{opacity:0;transition-duration:.2s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.drawer__backdrop[data-exiting=true],.drawer__backdrop[data-entering=true]{will-change:opacity}@media(prefers-reduced-motion:reduce){.drawer__backdrop{transition:none}}.drawer__backdrop--transparent{background-color:#0000}.drawer__backdrop--opaque{background-color:var(--backdrop)}.drawer__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.drawer__content{pointer-events:none;z-index:50;height:var(--visual-viewport-height);width:100%;min-width:0;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.drawer__content--bottom{align-items:flex-end}.drawer__content--top{align-items:flex-start}.drawer__content--left{justify-content:flex-start}.drawer__content--right{justify-content:flex-end}.drawer__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;padding:calc(var(--spacing) * 6);pointer-events:auto;--drawer-enter-duration:.25s;--drawer-exit-duration:.2s;--drawer-enter-ease:cubic-bezier(.32, .72, 0, 1);--drawer-exit-ease:cubic-bezier(.32, .72, 0, 1);will-change:translate;transition:translate var(--drawer-enter-duration) var(--drawer-enter-ease);outline-style:none;flex-direction:column;display:flex;position:relative}@media(prefers-reduced-motion:reduce){.drawer__dialog{transition:none}}.drawer__dialog[data-placement=bottom]{border-top-left-radius:min(32px,var(--radius-2xl));border-top-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=top]{border-bottom-left-radius:min(32px,var(--radius-2xl));border-bottom-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=left]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=left]{width:calc(var(--spacing) * 96)}}.drawer__dialog[data-placement=right]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=right]{width:calc(var(--spacing) * 96)}}[data-exiting=true] .drawer__dialog{transition-duration:var(--drawer-exit-duration);transition-timing-function:var(--drawer-exit-ease)}.drawer__content--left .drawer__dialog,.drawer__content--right .drawer__dialog,.drawer__content--top .drawer__dialog,.drawer__content--bottom .drawer__dialog{translate:0}.drawer__content--left[data-entering=true] .drawer__dialog,.drawer__content--left[data-exiting=true] .drawer__dialog{translate:-100%}.drawer__content--right[data-entering=true] .drawer__dialog,.drawer__content--right[data-exiting=true] .drawer__dialog{translate:100%}.drawer__content--top[data-entering=true] .drawer__dialog,.drawer__content--top[data-exiting=true] .drawer__dialog{translate:0 -100%}.drawer__content--bottom[data-entering=true] .drawer__dialog,.drawer__content--bottom[data-exiting=true] .drawer__dialog{translate:0 100%}.drawer__dialog--top{padding-bottom:calc(var(--spacing) * 2)}.drawer__dialog--top .drawer__handle{padding-bottom:0}.drawer__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.drawer__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.drawer__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.drawer__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.drawer__handle{padding-bottom:calc(var(--spacing) * 2);justify-content:center;align-items:center;display:flex}.drawer__handle>[data-slot=drawer-handle-bar]{height:var(--spacing);width:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * .25);background-color:var(--separator)}.drawer__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.drawer__header+.drawer__body{margin-top:calc(var(--spacing) * 2)}.drawer__header+.drawer__footer,.drawer__body+.drawer__footer{margin-top:calc(var(--spacing) * 5)}.drawer__handle+.drawer__header,.drawer__handle+.drawer__body{margin-top:0}.modal__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.modal__trigger:focus-visible:not(:focus),.modal__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.modal__trigger:disabled,.modal__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.modal__trigger:active,.modal__trigger[data-pressed=true]{transform:scale(.97)}.modal__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.modal__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.modal__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]{will-change:opacity}:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__backdrop--transparent{background-color:#0000}.modal__backdrop--opaque{background-color:var(--backdrop)}.modal__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.modal__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.modal__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.modal__container{pointer-events:none}.modal__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.modal__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.modal__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.modal__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.modal__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-exiting=true],.modal__container[data-entering=true]{will-change:opacity,transform}:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__container--scroll-outside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);pointer-events:auto;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__container--full{padding:0}@media(min-width:40rem){.modal__container--full{padding:0}}.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% ;--tw-enter-scale:1}@media(min-width:40rem){.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% }}.modal__container--full[data-exiting=true]{--tw-exit-scale:1}.modal__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative}.modal__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.modal__dialog[data-placement=auto]{margin-block:auto}}.modal__dialog[data-placement=center]{margin-block:auto}.modal__dialog[data-placement=bottom]{margin-top:auto}.modal__dialog[data-placement=top]{margin-top:0}.modal__dialog--scroll-inside{min-height:0;max-height:100%;overflow:clip}.modal__dialog--scroll-outside{flex-shrink:0;height:auto;min-height:0}.modal__dialog--xs{max-width:var(--container-xs)}.modal__dialog--sm{max-width:var(--container-sm)}.modal__dialog--md{max-width:var(--container-md)}.modal__dialog--lg{max-width:var(--container-lg)}.modal__dialog--cover{width:100%;height:100%;min-height:100%}.modal__dialog--full{--tw-shadow:0 0 #0000;width:100%;height:100%;min-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:0}.modal__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.modal__header>.modal__icon{margin-bottom:0}.modal__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.modal__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.modal__body{min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow:visible}.modal__body--scroll-inside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__body--scroll-outside{overflow-y:visible}.modal__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.modal__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.modal__header+.modal__body{margin-top:calc(var(--spacing) * 2)}.modal__header+.modal__footer,.modal__body+.modal__footer{margin-top:calc(var(--spacing) * 5)}.popover{transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0}.popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.popover[data-exiting=true],.popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.popover__dialog{padding:calc(var(--spacing) * 4);--tw-outline-style:none;outline-style:none}.popover__heading{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.popover__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.popover__trigger{cursor:var(--cursor-interactive)}.popover__trigger:focus-visible:not(:focus),.popover__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.popover__trigger:disabled,.popover__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tooltip{max-width:var(--container-xs);transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);padding:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));word-break:break-all;border-radius:min(32px,var(--radius-xl));box-shadow:var(--shadow-overlay)}.tooltip[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.tooltip[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.tooltip[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.tooltip[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.tooltip[data-exiting=true],.tooltip[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.tooltip [data-slot=overlay-arrow]{stroke:var(--border)}@supports (color:color-mix(in lab,red,red)){.tooltip [data-slot=overlay-arrow]{stroke:color-mix(in oklab,var(--border) 40%,transparent)}}.tooltip [data-slot=overlay-arrow]{fill:var(--overlay)}.tooltip[data-placement=bottom] [data-slot=overlay-arrow]{rotate:180deg}.tooltip[data-placement=left] [data-slot=overlay-arrow]{rotate:-90deg}.tooltip[data-placement=right] [data-slot=overlay-arrow]{rotate:90deg}.tooltip__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tooltip__trigger:focus-visible:not(:focus),.tooltip__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.combo-box{gap:var(--spacing);flex-direction:column;display:flex}:is(.combo-box[data-invalid=true],.combo-box[aria-invalid=true]) [data-slot=description]{display:none}.combo-box [data-slot=label]{width:fit-content}.combo-box [data-slot=input]{flex:1;min-width:0}.combo-box [data-slot=input]:has(+.combo-box__trigger){padding-inline-end:calc(var(--spacing) * 7)}.combo-box [data-slot=input]:focus,.combo-box [data-slot=input][data-focus]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.combo-box [data-slot=input]:disabled,.combo-box [data-slot=input][data-disabled],.combo-box [data-slot=input][aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.combo-box__input-group{isolation:isolate;align-items:center;display:inline-flex;position:relative}.combo-box__trigger{--tw-translate-y: -50% ;height:100%;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:pointer;color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;-webkit-tap-highlight-color:transparent;--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-color:#0000;border-style:none;outline-style:none;flex-shrink:0;justify-content:center;align-items:center;padding-inline-end:calc(var(--spacing) * 2);transition-duration:.15s;display:flex;position:absolute;top:50%}@media(hover:hover){.combo-box__trigger:hover,.combo-box__trigger[data-hovered=true]{color:var(--field-foreground,var(--foreground))}}.combo-box__trigger:focus-visible:not(:focus),.combo-box__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-radius:.25rem;outline-style:none}.combo-box__trigger[data-pressed=true]{opacity:.7}.combo-box__trigger:disabled,.combo-box__trigger[data-disabled],.combo-box__trigger[aria-disabled=true]{cursor:not-allowed;opacity:.5}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;transition-duration:.15s}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.combo-box__trigger[data-open=true] [data-slot=combo-box-trigger-default-icon]{rotate:180deg}.combo-box__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.combo-box__popover:focus-visible:not(:focus),.combo-box__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.combo-box__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.combo-box__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.combo-box__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.combo-box__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.combo-box__popover[data-exiting=true],.combo-box__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.combo-box__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.combo-box__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.combo-box__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.combo-box__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.combo-box__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.combo-box__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.combo-box__popover [data-slot=list-box-item] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.combo-box--full-width,.combo-box__input-group--full-width{width:100%}.select{gap:var(--spacing);flex-direction:column;display:flex}:is(.select[data-invalid=true],.select[aria-invalid=true]) [data-slot=description]{display:none}.select [data-slot=label]{width:fit-content}.select__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.select__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.select__trigger:has(.select__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.select__trigger:hover,.select__trigger[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.select__trigger:focus-visible:not(:focus),.select__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-visible,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focused=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-visible=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-within,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{background-color:var(--field-focus)}.select__trigger:disabled,.select__trigger[data-disabled=true],.select__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.select--secondary .select__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--select-trigger-bg);--select-trigger-bg:var(--default);--select-trigger-bg-hover:var(--default-hover);--select-trigger-bg-focus:var(--default)}@media(hover:hover){.select--secondary .select__trigger:hover,.select--secondary .select__trigger[data-hovered=true]{background-color:var(--select-trigger-bg-hover)}}.select--secondary .select__trigger:focus-visible:not(:focus),.select--secondary .select__trigger[data-focus-visible=true],.select[data-invalid=true] :is(.select--secondary .select__trigger),.select[aria-invalid=true] :is(.select--secondary .select__trigger){background-color:var(--select-trigger-bg-focus)}.select__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.select__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.select__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.select__value [data-slot=list-box-item-indicator]{display:none}.select__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.select__indicator[data-open=true]{rotate:180deg}.select__indicator[data-slot=select-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.select__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.select__popover:focus-visible:not(:focus),.select__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.select__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.select__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.select__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.select__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.select__popover[data-exiting=true],.select__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.select__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.select__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.select__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.select__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.select__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.select__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.select--full-width,.select__trigger--full-width{width:100%}.autocomplete{gap:var(--spacing);flex-direction:column;display:flex}.autocomplete__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.autocomplete__trigger:has(.autocomplete__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.autocomplete__trigger:focus-visible:not(:focus),.autocomplete__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-visible,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focused=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-visible=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-within,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{background-color:var(--field-focus)}.autocomplete__trigger:disabled,.autocomplete__trigger[data-disabled=true],.autocomplete__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.autocomplete--secondary .autocomplete__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--autocomplete-trigger-bg);--autocomplete-trigger-bg:var(--default);--autocomplete-trigger-bg-hover:var(--default-hover);--autocomplete-trigger-bg-focus:var(--default)}@media(hover:hover){.autocomplete--secondary .autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete--secondary .autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--autocomplete-trigger-bg-hover)}}.autocomplete--secondary .autocomplete__trigger:focus-visible:not(:focus),.autocomplete--secondary .autocomplete__trigger[data-focus-visible=true],.autocomplete[data-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger),.autocomplete[aria-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger){background-color:var(--autocomplete-trigger-bg-focus)}.autocomplete__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.autocomplete__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.autocomplete__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.autocomplete__value [data-slot=list-box-item-indicator]{display:none}.autocomplete__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;cursor:var(--cursor-interactive);flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.autocomplete__indicator[data-open=true]{rotate:180deg}.autocomplete__indicator[data-slot=autocomplete-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.autocomplete__popover{width:var(--trigger-width);max-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);overscroll-behavior:contain;background-color:var(--overlay);padding:0;padding-top:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);overflow:hidden}.autocomplete__popover:focus-visible:not(:focus),.autocomplete__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.32, .72, 0, 1);--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.25s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.autocomplete__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.autocomplete__popover[data-exiting=true],.autocomplete__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.autocomplete__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.autocomplete__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.autocomplete__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.autocomplete__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.autocomplete__popover [data-slot=list-box]{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);max-height:320px;padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none;overflow-y:auto}.autocomplete__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.autocomplete__popover [data-slot=search-field]{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);--tw-outline-style:none;outline-style:none}.autocomplete__popover [data-slot=empty-state]{text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--overlay-foreground)}@supports (color:color-mix(in lab,red,red)){.autocomplete__popover [data-slot=empty-state]{color:color-mix(in oklab,var(--overlay-foreground) 60%,transparent)}}.autocomplete__popover-dialog,.autocomplete__popover-dialog:focus,.autocomplete__popover-dialog:focus-visible,.autocomplete__popover-dialog[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete--full-width,.autocomplete__trigger--full-width{width:100%}.autocomplete__clear-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);color:var(--muted);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);cursor:var(--cursor-interactive);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);background-color:#0000;flex-shrink:0;justify-content:center;align-self:center;align-items:center;margin-inline-end:0;display:inline-flex;position:relative}.autocomplete__clear-button:not([data-empty=true]){transition:opacity .15s var(--ease-smooth)}.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__clear-button[data-empty=true]{pointer-events:none;opacity:0}.autocomplete__clear-button [data-slot=autocomplete-clear-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(hover:hover){.autocomplete__clear-button:hover,.autocomplete__clear-button[data-hovered=true]{background-color:var(--default-hover)}}.autocomplete__clear-button:active,.autocomplete__clear-button[data-pressed=true]{transform:scale(.93)}.kbd{height:calc(var(--spacing) * 6);align-items:center;display:inline-flex}:where(.kbd>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * .5) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-x-reverse)))}.kbd{border-radius:calc(var(--radius) * 1);background-color:var(--default);padding-inline:calc(var(--spacing) * 2);text-align:center;font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;color:var(--muted)}:where(.kbd:where(:dir(rtl),[dir=rtl],[dir=rtl] *)>:not(:last-child)){--tw-space-x-reverse:1}.kbd{word-spacing:-.25rem}.kbd__abbr{justify-content:center;align-items:center;width:100%;height:100%;text-decoration:none;display:flex}.kbd__content{justify-content:center;align-items:center;display:flex}.kbd--light{background-color:#0000}.typography,.typography-prose{color:var(--foreground)}.typography-prose h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose p{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography-prose a{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--link);text-underline-offset:4px;text-decoration-line:underline}.typography-prose blockquote{margin-top:calc(var(--spacing) * 4);border-left-style:var(--tw-border-style);border-left-width:4px;border-color:var(--border);padding-left:calc(var(--spacing) * 4);color:var(--muted);font-style:italic}.typography-prose ul{margin-block:calc(var(--spacing) * 4);list-style-type:disc}:where(.typography-prose ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ul{padding-left:calc(var(--spacing) * 6)}.typography-prose ol{margin-block:calc(var(--spacing) * 4);list-style-type:decimal}:where(.typography-prose ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ol{padding-left:calc(var(--spacing) * 6)}.typography-prose li{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose hr{margin-block:calc(var(--spacing) * 8);border-color:var(--separator)}.typography-prose pre{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);background-color:var(--default);padding:calc(var(--spacing) * 4);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);overflow-x:auto}.typography-prose strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--foreground)}.typography-prose em{font-style:italic}.typography-prose img{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5)}.typography--h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--body{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography--body-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.typography--body-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.typography--code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography--align-start{text-align:left}.typography--align-start:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:right}.typography--align-center{text-align:center}.typography--align-end{text-align:right}.typography--align-end:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:left}.typography--align-justify{text-align:justify}.typography--color-default{color:var(--foreground)}.typography--color-muted{color:var(--muted)}.typography--truncate{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.typography--weight-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.typography--weight-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.typography--weight-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.typography--weight-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.scroll-shadow{--scroll-shadow-size:40px;--scroll-shadow-scrollbar-size:10px;position:relative}.scroll-shadow--vertical{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-y:auto}.scroll-shadow--horizontal{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-x:auto}.scroll-shadow--fade.scroll-shadow--vertical:where([data-top-scroll=true],[data-bottom-scroll=true],[data-top-bottom-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,100% 0;mask-repeat:no-repeat;mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%;-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,100% 0;-webkit-mask-repeat:no-repeat;-webkit-mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%}.scroll-shadow--fade.scroll-shadow--vertical[data-top-scroll=true]{--scroll-linear-gradient:0deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-bottom-scroll=true]{--scroll-linear-gradient:180deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-top-bottom-scroll=true]{--scroll-linear-gradient:#000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal:where([data-left-scroll=true],[data-right-scroll=true],[data-left-right-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,0 100%;mask-repeat:no-repeat;mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,0 100%;-webkit-mask-repeat:no-repeat;-webkit-mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size)}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-scroll=true]{--scroll-linear-gradient:270deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-right-scroll=true]{--scroll-linear-gradient:90deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-right-scroll=true]{--scroll-linear-gradient:to right, #000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--hide-scrollbar{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;--scroll-shadow-scrollbar-size:0px}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{inset-inline:0}.inset-y-0{inset-block:0}.top-0{top:0}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.-right-3{right:calc(var(--spacing) * -3)}.right-0{right:0}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:0}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-0{left:0}.left-1\/2{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[1\]{z-index:1}.z-\[2\]{z-index:2}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing) * -1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:var(--spacing)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-12{height:calc(var(--spacing) * 12)}.h-48{height:calc(var(--spacing) * 48)}.h-\[90px\]{height:90px}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:0}.min-h-full{min-height:100%}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-28{width:calc(var(--spacing) * 28)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-\[17rem\]{width:17rem}.w-\[calc\(100\%-2rem\)\]{width:calc(100% - 2rem)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-44{max-width:calc(var(--spacing) * 44)}.max-w-\[1800px\]{max-width:1800px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-\[140px\]{min-width:140px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing) * 5);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-ew-resize{cursor:ew-resize}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y:pan-y;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--otari-line\)\]>:not(:last-child)){border-color:var(--otari-line)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:calc(var(--radius) * 1)}.rounded-md{border-radius:calc(var(--radius) * .75)}.rounded-xl{border-radius:calc(var(--radius) * 1.5)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-\[\#c2843a\]{border-color:#c2843a}.border-\[var\(--otari-brand\)\]{border-color:var(--otari-brand)}.border-\[var\(--otari-line\)\]{border-color:var(--otari-line)}.border-amber-200{border-color:var(--color-amber-200)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-red-500{border-left-color:var(--color-red-500)}.bg-\[var\(--otari-bg\)\]{background-color:var(--otari-bg)}.bg-\[var\(--otari-brand\)\],.bg-\[var\(--otari-brand\)\]\/10{background-color:var(--otari-brand)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--otari-brand\)\]\/10{background-color:color-mix(in oklab,var(--otari-brand) 10%,transparent)}}.bg-\[var\(--otari-brand-tint\)\]{background-color:var(--otari-brand-tint)}.bg-\[var\(--otari-line\)\]{background-color:var(--otari-line)}.bg-\[var\(--otari-surface\)\]{background-color:var(--otari-surface)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-500{background-color:var(--color-green-500)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1{padding-bottom:var(--spacing)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#b45309\]{color:#b45309}.text-\[var\(--otari-brand-dark\)\]{color:var(--otari-brand-dark)}.text-\[var\(--otari-ink\)\]{color:var(--otari-ink)}.text-\[var\(--otari-muted\)\]{color:var(--otari-muted)}.text-amber-400{color:var(--color-amber-400)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-emerald-700{color:var(--color-emerald-700)}.text-green-700{color:var(--color-green-700)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.accent-\[var\(--otari-brand\)\]{accent-color:var(--otari-brand)}.opacity-0{opacity:0}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.running{animation-play-state:running}.zoom-out{--tw-exit-scale:0}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-focus-visible\:ring-2:is(:where(.group):focus-visible *){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-focus-visible\:ring-\[var\(--otari-brand\)\]:is(:where(.group):focus-visible *){--tw-ring-color:var(--otari-brand)}.group-data-\[focus-visible\]\:outline-2:is(:where(.group)[data-focus-visible] *){outline-style:var(--tw-outline-style);outline-width:2px}.group-data-\[focus-visible\]\:outline-\[var\(--otari-brand\)\]:is(:where(.group)[data-focus-visible] *){outline-color:var(--otari-brand)}@media(hover:hover){.hover\:border-\[var\(--otari-brand\)\]:hover{border-color:var(--otari-brand)}.hover\:bg-\[var\(--otari-bg\)\]:hover{background-color:var(--otari-bg)}.hover\:bg-\[var\(--otari-brand\)\]:hover,.hover\:bg-\[var\(--otari-brand\)\]\/20:hover{background-color:var(--otari-brand)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--otari-brand\)\]\/20:hover{background-color:color-mix(in oklab,var(--otari-brand) 20%,transparent)}}.hover\:bg-\[var\(--otari-line\)\]:hover{background-color:var(--otari-line)}.hover\:text-\[var\(--otari-brand\)\]:hover{color:var(--otari-brand)}.hover\:text-\[var\(--otari-brand-dark\)\]:hover{color:var(--otari-brand-dark)}.hover\:text-\[var\(--otari-ink\)\]:hover{color:var(--otari-ink)}.hover\:text-amber-950:hover{color:var(--color-amber-950)}.hover\:text-red-700:hover{color:var(--color-red-700)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:not-sr-only:focus{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.focus\:absolute:focus{position:absolute}.focus\:top-3:focus{top:calc(var(--spacing) * 3)}.focus\:left-3:focus{left:calc(var(--spacing) * 3)}.focus\:z-50:focus{z-index:50}.focus\:rounded-lg:focus{border-radius:calc(var(--radius) * 1)}.focus\:border:focus{border-style:var(--tw-border-style);border-width:1px}.focus\:border-\[var\(--otari-brand\)\]:focus{border-color:var(--otari-brand)}.focus\:bg-\[var\(--otari-surface\)\]:focus{background-color:var(--otari-surface)}.focus\:px-4:focus{padding-inline:calc(var(--spacing) * 4)}.focus\:py-2:focus{padding-block:calc(var(--spacing) * 2)}.focus\:text-sm:focus{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.focus\:font-medium:focus{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.focus\:text-\[var\(--otari-brand-dark\)\]:focus{color:var(--otari-brand-dark)}.focus\:shadow-md:focus{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:bg-\[var\(--otari-brand\)\]:focus-visible{background-color:var(--otari-brand)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[var\(--otari-brand\)\]:focus-visible{--tw-ring-color:var(--otari-brand)}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-start-1{grid-column-start:1}.sm\:col-start-2{grid-column-start:2}.sm\:col-start-3{grid-column-start:3}.sm\:inline{display:inline}.sm\:w-28{width:calc(var(--spacing) * 28)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[minmax\(0\,1fr\)_16rem_10rem\]{grid-template-columns:minmax(0,1fr) 16rem 10rem}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-self-end{justify-self:flex-end}.sm\:justify-self-start{justify-self:flex-start}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}@media(min-width:48rem){.md\:flex{display:flex}.md\:hidden{display:none}.md\:px-6{padding-inline:calc(var(--spacing) * 6)}.md\:py-6{padding-block:calc(var(--spacing) * 6)}}@media(min-width:64rem){.lg\:sticky{position:sticky}.lg\:top-4{top:calc(var(--spacing) * 4)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_360px\]{grid-template-columns:minmax(0,1fr) 360px}.lg\:items-start{align-items:flex-start}}@media(min-width:80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--otari-brand:#4e8295;--otari-brand-dark:#3c6678;--otari-brand-tint:#eaf1f3;--otari-ink:#14242c;--otari-muted:#5b6b73;--otari-line:#dbe5e8;--otari-surface:#fff;--otari-bg:#f6f9fa;--otari-code-ink:#e8eef0}.otari-table.table-root{background-color:var(--otari-surface);border:1px solid var(--otari-line);border-radius:.75rem;padding:0;overflow:hidden}.otari-table .table__header{background-color:var(--otari-brand-tint);border-bottom:1px solid var(--otari-line)}.otari-table .table__column,.otari-table [role=row]>[role=presentation]:first-of-type>.table__column,.otari-table [role=row]>[role=presentation]:last-of-type>.table__column{color:var(--otari-ink);background-color:#0000;border-radius:0;font-weight:600}.otari-table .table__column:after{content:none}.otari-table .table__row .table__cell{border-color:var(--otari-line)}.otari-table .table__row:hover .table__cell{background-color:var(--otari-bg)}.otari-table .otari-detail-row>td{border-bottom:1px solid var(--otari-line);background-color:var(--otari-bg);padding:0}.otari-table .otari-detail-opening .table__cell{background-color:var(--otari-brand-tint)}.otari-detail-reveal{grid-template-rows:0fr;animation:.18s ease-out forwards otari-detail-open;display:grid}.otari-detail-reveal>div{overflow:hidden}@keyframes otari-detail-open{0%{opacity:.5;grid-template-rows:0fr}to{opacity:1;grid-template-rows:1fr}}.otari-bulk-bar{animation:.16s ease-out otari-bulk-bar-in}@keyframes otari-bulk-bar-in{0%{opacity:0;transform:translate(-50%,.5rem)}to{opacity:1;transform:translate(-50%)}}@media(prefers-reduced-motion:reduce){.otari-detail-reveal{grid-template-rows:1fr;animation:none}.otari-bulk-bar{animation:none}}.otari-markdown{color:var(--otari-ink);font-size:.875rem;line-height:1.65}.otari-markdown>:first-child{margin-top:0}.otari-markdown h1,.otari-markdown h2,.otari-markdown h3,.otari-markdown h4{color:var(--otari-ink);font-weight:600;line-height:1.3}.otari-markdown h1{margin:2rem 0 .75rem;font-size:1.5rem}.otari-markdown h2{border-bottom:1px solid var(--otari-line);margin:2rem 0 .5rem;padding-bottom:.3rem;font-size:1.25rem}.otari-markdown h3{margin:1.5rem 0 .5rem;font-size:1.05rem}.otari-markdown h4{margin:1.25rem 0 .25rem;font-size:.95rem}.otari-markdown p{margin:.75rem 0}.otari-markdown a{color:var(--otari-brand-dark);text-underline-offset:2px;text-decoration:underline}.otari-markdown a:hover{text-decoration-thickness:2px}.otari-markdown ul,.otari-markdown ol{margin:.75rem 0;padding-left:1.5rem}.otari-markdown ul{list-style:outside}.otari-markdown ol{list-style:decimal}.otari-markdown li,.otari-markdown li>ul,.otari-markdown li>ol{margin:.25rem 0}.otari-markdown code{background-color:var(--otari-brand-tint);color:var(--otari-brand-dark);border-radius:.35rem;padding:.1rem .35rem;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,monospace;font-size:.85em}.otari-markdown pre{background-color:var(--otari-ink);border-radius:.6rem;margin:1rem 0;padding:.85rem 1rem;overflow-x:auto}.otari-markdown pre code{color:var(--otari-code-ink);background-color:#0000;border-radius:0;padding:0;font-size:.82rem;line-height:1.55}.otari-markdown blockquote{border-left:3px solid var(--otari-brand);color:var(--otari-muted);margin:1rem 0;padding:.25rem 0 .25rem 1rem}.otari-markdown hr{border:0;border-top:1px solid var(--otari-line);margin:1.5rem 0}.otari-markdown-scroll{max-width:100%;margin:1rem 0;overflow-x:auto}.otari-markdown table{border-collapse:collapse;font-size:.85rem}.otari-markdown th,.otari-markdown td{border:1px solid var(--otari-line);text-align:left;vertical-align:top;padding:.4rem .7rem}.otari-markdown th{background-color:var(--otari-brand-tint);color:var(--otari-ink);font-weight:600}.otari-markdown tbody tr:hover td,.otari-markdown tr:hover td{background-color:var(--otari-bg)}html,body,#root{height:100%}body{background-color:var(--otari-bg);color:var(--otari-ink);margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}@keyframes caret-blink{0%,70%,to{opacity:1}20%,50%{opacity:0}}@keyframes skeleton{to{transform:translate(200%)}} +/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--tw-content:"";--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-space-y-reverse:0;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-700:oklch(50.5% .213 27.518);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-500:oklch(72.3% .219 149.579);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-xl:calc(var(--radius) * 1.5);--radius-2xl:calc(var(--radius) * 2);--radius-3xl:calc(var(--radius) * 3);--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow-surface:var(--surface-shadow);--shadow-overlay:var(--overlay-shadow);--border-width-field:var(--field-border-width,var(--border-width));--ease-smooth:ease;--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-fluid:cubic-bezier(.32, .72, 0, 1);--ease-linear:linear}@layer theme.base{:root,.light,.default,[data-theme=light],[data-theme=default]{color-scheme:light;--white:oklch(100% 0 0);--black:oklch(0% 0 0);--snow:oklch(99.11% 0 0);--eclipse:oklch(21.03% .0059 285.89);--spacing:.25rem;--border-width:1px;--field-border-width:0px;--disabled-opacity:.5;--ring-offset-width:2px;--cursor-interactive:pointer;--cursor-disabled:not-allowed;--radius:.5rem;--field-radius:calc(var(--radius) * 1.5);--background:oklch(97.02% 0 0);--foreground:var(--eclipse);--surface:var(--white);--surface-foreground:var(--foreground);--surface-secondary:oklch(95.24% .0013 286.37);--surface-secondary-foreground:var(--foreground);--surface-tertiary:oklch(93.73% .0013 286.37);--surface-tertiary-foreground:var(--foreground);--overlay:var(--white);--overlay-foreground:var(--foreground);--muted:oklch(55.17% .0138 285.94);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(94% .001 286.375);--default-foreground:var(--eclipse);--accent:oklch(62.04% .195 253.83);--accent-foreground:var(--snow);--field-background:var(--white);--field-foreground:oklch(21.03% .0059 285.89);--field-placeholder:var(--muted);--field-border:transparent;--success:oklch(73.29% .1935 150.81);--success-foreground:var(--eclipse);--warning:oklch(78.19% .1585 72.33);--warning-foreground:var(--eclipse);--danger:oklch(65.32% .2328 25.74);--danger-foreground:var(--snow);--segment:var(--white);--segment-foreground:var(--eclipse);--border:oklch(90% .004 286.32);--separator:oklch(92% .004 286.32);--focus:var(--accent);--link:var(--foreground);--backdrop:#00000080;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:color-mix(in oklab, var(--accent) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 70%, var(--foreground) 30%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:color-mix(in oklab, var(--accent) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 70%, var(--foreground) 40%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:color-mix(in oklab, var(--warning) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 70%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:color-mix(in oklab, var(--warning) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:color-mix(in oklab, var(--success) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 60%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:color-mix(in oklab, var(--success) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--overlay-shadow:0 2px 8px 0 #0000000f, 0 -6px 12px 0 #00000008, 0 14px 28px 0 #00000014;--field-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--skeleton-animation:shimmer;--tooltip-delay:1.5s;--tooltip-close-delay:.5s}.dark,[data-theme=dark]{color-scheme:dark;--background:oklch(12% .005 285.823);--foreground:var(--snow);--surface:oklch(21.03% .0059 285.89);--surface-foreground:var(--foreground);--surface-secondary:oklch(25.7% .0037 286.14);--surface-tertiary:oklch(27.21% .0024 247.91);--overlay:oklch(21.03% .0059 285.89);--overlay-foreground:var(--foreground);--muted:oklch(70.5% .015 286.067);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}.dark,[data-theme=dark]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(27.4% .006 286.033);--default-foreground:var(--snow);--field-background:oklch(21.03% .0059 285.89);--field-foreground:var(--foreground);--warning:oklch(82.03% .1388 76.34);--warning-foreground:var(--eclipse);--danger:oklch(59.4% .1967 24.63);--danger-foreground:var(--snow);--segment:oklch(39.64% .01 285.93);--segment-foreground:var(--foreground);--border:oklch(28% .006 286.033);--separator:oklch(25% .006 286.033);--focus:var(--accent);--link:var(--foreground);--backdrop:#0009;--surface-shadow:0 0 0 0 transparent inset;--overlay-shadow:0 0 1px 0 #ffffff4d inset;--field-shadow:0 0 0 0 transparent inset;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}.dark,[data-theme=dark]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}.dark,[data-theme=dark]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}.dark,[data-theme=dark]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}.dark,[data-theme=dark]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}.dark,[data-theme=dark]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}.dark,[data-theme=dark]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}.dark,[data-theme=dark]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}.dark,[data-theme=dark]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}.dark,[data-theme=dark]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}.dark,[data-theme=dark]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}.dark,[data-theme=dark]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}.dark,[data-theme=dark]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}.dark,[data-theme=dark]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft:color-mix(in oklab, var(--accent) 12%, transparent)}}.dark,[data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-hover:color-mix(in oklab, var(--accent) 16%, transparent)}}.dark,[data-theme=dark]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}.dark,[data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}.dark,[data-theme=dark]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft:color-mix(in oklab, var(--warning) 12%, transparent)}}.dark,[data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-hover:color-mix(in oklab, var(--warning) 16%, transparent)}}.dark,[data-theme=dark]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft:color-mix(in oklab, var(--success) 12%, transparent)}}.dark,[data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-hover:color-mix(in oklab, var(--success) 16%, transparent)}}.dark,[data-theme=dark]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}.dark,[data-theme=dark]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}.dark,[data-theme=dark]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}.dark,[data-theme=dark]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}}@layer components;}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--border,currentColor)}::file-selector-button{border-color:var(--border,currentColor)}:root{view-transition-name:none}::view-transition{pointer-events:none}[data-scrollbar=thin]{--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--scrollbar-gutter:auto}[data-scrollbar=default]{--scrollbar-width:auto;--scrollbar-color:auto;--scrollbar-gutter:auto}[data-scrollbar=none]{--scrollbar-width:none;--scrollbar-color:auto;--scrollbar-gutter:auto}}@layer components{.close-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),color .15s var(--ease-out),background-color .1s var(--ease-out),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.close-button:focus-visible:not(:focus),.close-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.close-button:disabled,.close-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.close-button[data-pending=true]{pointer-events:none}.close-button svg{pointer-events:none;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);flex-shrink:0;align-self:center}.close-button--default{background-color:var(--default);color:var(--muted)}@media(hover:hover){.close-button--default:hover,.close-button--default[data-hovered=true]{background-color:var(--default-hover)}}.close-button--default:active,.close-button--default[data-pressed=true]{transform:scale(.93)}.description{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted)}.error-message{height:auto;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *),.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.field-error{height:0;padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);opacity:0}.field-error[data-visible]{opacity:1;height:auto}.field-error{transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *),.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox>.field-error,.checkbox>[data-slot=field-error],.switch>.field-error,.switch>[data-slot=field-error],.radio>.field-error,.radio>[data-slot=field-error]{height:auto;min-height:0;color:var(--muted);opacity:1;margin:0;padding:0;transition:none}.label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}:is(.label--required,[data-required=true]:not([role=group]):not([role=radiogroup]):not([role=checkboxgroup])>.label,[data-required=true]:not([data-slot=radio]):not([data-slot=checkbox])>.label):after{margin-left:calc(var(--spacing) * .5);color:var(--danger);--tw-content:"*";content:var(--tw-content)}.label--disabled,[data-disabled=true] .label{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.label--invalid,[data-invalid=true] .label,[aria-invalid=true] .label{color:var(--danger)}.accordion{contain:layout style;width:100%}.accordion__body{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.accordion__body-inner{padding-inline:calc(var(--spacing) * 4);padding-top:0;padding-bottom:calc(var(--spacing) * 4);color:var(--muted)}.accordion__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__indicator[data-expanded=true]{rotate:-180deg}.accordion__item{--tw-border-style:none;border-style:none;position:relative}.accordion__item:after{content:"";border-radius:calc(var(--radius) * .25);background-color:var(--separator);width:100%;height:1px;position:absolute;bottom:0;left:0}.accordion__item:last-child:after{content:none}.accordion__item[data-hide-separator=true]:after{display:none}.accordion__trigger{cursor:var(--cursor-interactive);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 4);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-tap-highlight-color:transparent;transition:opacity .15s var(--ease-out),box-shadow .15s var(--ease-out);flex:1;justify-content:space-between;align-items:center;display:flex}.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:color-mix(in oklab,var(--foreground) 3%,transparent 90%)}}}.accordion__trigger:focus-visible:not(:focus),.accordion__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.accordion__trigger:disabled,.accordion__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.accordion__panel{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__panel[data-expanded=true]{will-change:height,opacity;opacity:1}.accordion--surface{background-color:var(--surface);border-radius:min(32px,var(--radius-3xl))}@media(hover:hover){.accordion--surface .accordion__trigger:hover:not([aria-expanded=true]),.accordion--surface .accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--default)}}.accordion--surface .accordion__item:after{background-color:var(--surface-foreground)}@supports (color:color-mix(in lab,red,red)){.accordion--surface .accordion__item:after{background-color:color-mix(in oklab,var(--surface-foreground) 6%,transparent)}}.accordion--surface .accordion__item:after{width:94%;left:3%}.accordion--surface .accordion__item:first-child [data-slot=accordion-trigger]{border-top-left-radius:min(32px,var(--radius-3xl));border-top-right-radius:min(32px,var(--radius-3xl))}.accordion--surface .accordion__item:last-child:not(:has([data-slot=accordion-trigger][aria-expanded=true])) [data-slot=accordion-trigger]{border-bottom-left-radius:min(32px,var(--radius-3xl));border-bottom-right-radius:min(32px,var(--radius-3xl))}.breadcrumbs{align-items:center;display:flex}.breadcrumbs .breadcrumbs__link{padding-inline:calc(var(--spacing) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);opacity:1;text-decoration-line:none;position:relative}.breadcrumbs .breadcrumbs__link:hover,.breadcrumbs .breadcrumbs__link[data-hovered=true]{text-decoration-line:underline}.breadcrumbs .breadcrumbs__link[data-current=true]{color:var(--link);opacity:1}.breadcrumbs .breadcrumbs__item{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);padding-inline:calc(var(--spacing) * .5);flex-shrink:0;display:flex}.breadcrumbs .breadcrumbs__separator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:var(--muted)}.breadcrumbs .breadcrumbs__separator:where(:dir(rtl),[dir=rtl],[dir=rtl] *){rotate:180deg}.disclosure-group{contain:layout style;width:100%}.disclosure{position:relative}.accordion__heading{display:flex}.disclosure__trigger{cursor:var(--cursor-interactive);-webkit-tap-highlight-color:transparent;display:inline-block}.disclosure__trigger:focus-visible:not(:focus),.disclosure__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.disclosure__trigger:disabled,.disclosure__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.disclosure__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:inherit;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__indicator[data-expanded=true]{rotate:-180deg}.disclosure__content{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__content[data-expanded=true]{will-change:height,opacity;opacity:1}.disclosure__body{padding:calc(var(--spacing) * 2)}.link{border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);width:fit-content;height:fit-content;font-weight:var(--font-weight-medium);color:var(--link);text-decoration-line:none;-webkit-text-decoration-color:var(--separator-tertiary);text-decoration-color:var(--separator-tertiary);text-underline-offset:4px;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .1s var(--ease-out);align-items:center;text-decoration-thickness:1.5px;display:inline-flex;position:relative}.link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link{cursor:var(--cursor-interactive)}@media(hover:hover){.link:hover,.link[data-hovered=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.link:hover,.link[data-hovered=true]{-webkit-text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent);text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent)}}:is(.link:hover,.link[data-hovered=true]) .link__icon{opacity:1}}.link:active,.link[data-pressed=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}:is(.link:active,.link[data-pressed=true]) .link__icon{opacity:1}.link:focus-visible:not(:focus),.link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}:is(.link:focus-visible:not(:focus),.link[data-focus-visible=true]) .link__icon{opacity:1}.link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.link .link__icon{pointer-events:none;color:currentColor;opacity:.6;width:.75em;height:.75em;transition:opacity .15s var(--ease-out);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link .link__icon svg{transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.link .link__icon[data-default-icon=true]{margin-left:var(--spacing);padding-bottom:calc(var(--spacing) * 1.5)}.link.button{gap:0;text-decoration-line:none}.pagination{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);flex-direction:column;width:100%;display:flex}@media(min-width:40rem){.pagination{flex-direction:row}}.pagination__summary{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__summary{align-self:center}}.pagination__content{align-items:center;gap:var(--spacing);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__content{align-self:center}}.pagination__item{display:inline-flex}.pagination__link{isolation:isolate;width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);transform-origin:50%;border-radius:calc(var(--radius) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}@media(min-width:48rem){.pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.pagination__link{--pagination-link-bg:transparent;--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover);--pagination-link-fg:var(--default-foreground);background-color:var(--pagination-link-bg);color:var(--pagination-link-fg)}.pagination__link:focus-visible,.pagination__link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.pagination__link:disabled,.pagination__link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.pagination__link:hover,.pagination__link[data-hovered=true]{background-color:var(--pagination-link-bg-hover)}}.pagination__link:active,.pagination__link[data-pressed=true]{background-color:var(--pagination-link-bg-pressed);transform:scale(.97)}.pagination__link[data-active=true]{--pagination-link-bg:var(--default);--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover)}.pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:inline-flex}@media(min-width:48rem){.pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link--nav{gap:calc(var(--spacing) * 1.5);width:auto;padding-inline:calc(var(--spacing) * 2.5)}.pagination--sm .pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__link{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__link:active,.pagination--sm .pagination__link[data-pressed=true]{transform:scale(.98)}.pagination--sm .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 2)}.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.pagination--lg .pagination__link{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__link{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__link:active,.pagination--lg .pagination__link[data-pressed=true]{transform:scale(.96)}.pagination--lg .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 3)}.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__summary{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.tabs{gap:calc(var(--spacing) * 2);display:flex}.tabs[data-orientation=horizontal]{flex-direction:column}.tabs[data-orientation=vertical]{flex-direction:row}.tabs__list-container{position:relative}.tabs__list{background-color:var(--default);padding:var(--spacing);border-radius:calc(var(--radius) * 2.5);display:inline-flex}.tabs__list[data-orientation=horizontal]{flex-direction:row;width:100%}.tabs__list[data-orientation=vertical]{gap:var(--spacing);flex-direction:column}.tabs__list[data-orientation=vertical] .tabs__tab{min-width:calc(var(--spacing) * 20)}.tabs__tab{z-index:1;cursor:var(--cursor-interactive);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);width:100%;padding-inline:calc(var(--spacing) * 4);text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .15s var(--ease-smooth);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__tab[data-selected=true]{color:var(--segment-foreground)}.tabs__tab[data-selected=true] .tabs__separator,.tabs__tab[data-selected=true]+.tabs__tab .tabs__separator{opacity:0}.tabs__tab:disabled,.tabs__tab[data-disabled=true],.tabs__tab[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.tabs__tab:not([data-selected=true]):not([data-disabled=true]):hover,.tabs__tab[data-hovered=true]:not([data-selected=true]):not([data-disabled=true]){opacity:.7}}.tabs__tab:focus-visible:not(:focus),.tabs__tab[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tabs__separator{border-radius:calc(var(--radius) * .5);background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.tabs__separator{background-color:color-mix(in oklab,var(--muted) 25%,transparent)}}.tabs__separator{pointer-events:none;transition:opacity .15s var(--ease-smooth);position:absolute}.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__list[data-orientation=horizontal] .tabs__separator{width:1px;height:50%;top:25%;left:0}.tabs__list[data-orientation=vertical] .tabs__separator{width:90%;height:1px;top:0;left:5%}.tabs__panel{width:100%;padding:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none}.tabs__panel[data-exiting=true]{width:100%;position:absolute;top:0;left:0}.tabs__panel[data-orientation=horizontal]{margin-top:calc(var(--spacing) * 4)}.tabs__panel[data-orientation=vertical]{margin-left:calc(var(--spacing) * 4)}.tabs__indicator{box-shadow:var(--shadow-surface);z-index:-1;border-radius:var(--radius-3xl);background-color:var(--segment);width:100%;height:100%;transition-property:translate,width,height;transition-duration:.25s;transition-timing-function:var(--ease-out-fluid);position:absolute;top:0;left:0}.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs--secondary>.tabs__list-container>.tabs__list{background-color:#0000;border-radius:0;padding:0}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=horizontal]{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border);max-width:100%;overflow:auto clip}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=vertical]{border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--border)}.tabs--secondary>.tabs__list-container .tabs__tab{border-radius:0}.tabs--secondary>.tabs__list-container .tabs__tab[data-selected=true]{color:var(--foreground)}.tabs--secondary>.tabs__list-container .tabs__separator{display:none}.tabs--secondary>.tabs__list-container .tabs__indicator{background-color:var(--accent);box-shadow:none;border-radius:0}.tabs--secondary[data-orientation=horizontal]>.tabs__list-container .tabs__indicator{height:2px;top:auto;bottom:0}.tabs--secondary[data-orientation=vertical]>.tabs__list-container .tabs__indicator{width:2px;height:100%;top:0;left:0}.button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.button{height:calc(var(--spacing) * 9)}}.button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button{cursor:var(--cursor-interactive);--button-bg:transparent;--button-bg-hover:var(--button-bg);--button-bg-pressed:var(--button-bg-hover);--button-fg:currentColor;background-color:var(--button-bg);color:var(--button-fg)}.button:focus-visible:not(:focus),.button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.button:disabled,.button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.button[data-pending=true]{pointer-events:none}.button:active,.button[data-pressed=true]{background-color:var(--button-bg-pressed);transform:scale(.97)}@media(hover:hover){.button:hover,.button[data-hovered=true]{background-color:var(--button-bg-hover)}}.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.button--sm{height:calc(var(--spacing) * 8)}}.button--sm svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.button--sm:active,.button--sm[data-pressed=true]{transform:scale(.98)}.button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.button--lg{height:calc(var(--spacing) * 10)}}.button--lg:active,.button--lg[data-pressed=true]{transform:scale(.96)}.button--primary{--button-bg:var(--accent);--button-bg-hover:var(--accent-hover);--button-bg-pressed:var(--accent-hover);--button-fg:var(--accent-foreground)}.button--secondary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover);--button-fg:var(--accent-soft-foreground)}.button--tertiary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover)}.button--ghost,.button--outline{--button-bg:transparent;--button-bg-hover:var(--default);--button-bg-pressed:var(--default);--button-fg:var(--default-foreground)}.button--outline{border-style:var(--tw-border-style);border-width:1px;border-color:var(--border);--button-bg-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.button--outline{--button-bg-hover:color-mix(in srgb, var(--default) 60%, transparent)}}.button--danger{--button-bg:var(--danger);--button-bg-hover:var(--danger-hover);--button-bg-pressed:var(--danger-hover);--button-fg:var(--danger-foreground)}.button--danger-soft{--button-bg:var(--danger-soft);--button-bg-hover:var(--danger-soft-hover);--button-bg-pressed:var(--danger-soft-hover);--button-fg:var(--danger-soft-foreground)}.button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.button--icon-only{width:calc(var(--spacing) * 9)}}.button--icon-only.button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.button--icon-only.button--sm{width:calc(var(--spacing) * 8)}}.button--icon-only.button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.button--icon-only.button--lg{width:calc(var(--spacing) * 10)}}.button--full-width{width:100%}.button-group{justify-content:center;align-items:center;gap:0;height:auto;display:inline-flex}.button-group--horizontal{flex-direction:row}.button-group--vertical{flex-direction:column}.button-group .button{border-radius:0}.button-group--horizontal .button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.button-group--vertical .button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group .button:active,.button-group .button[data-pressed=true]{transform:none}.button-group .button:focus-visible:not(:focus),.button-group .button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button-group--horizontal .button-group__separator{width:1px;height:50%;top:25%;left:-1px}.button-group--vertical .button-group__separator{width:50%;height:1px;top:-1px;left:25%}.button-group--horizontal .button--outline:first-child{border-inline-end-style:var(--tw-border-style);border-inline-end-width:0}.button-group--horizontal .button--outline:last-child{border-inline-start-style:var(--tw-border-style);border-inline-start-width:0}.button-group--horizontal .button--outline:not(:first-child):not(:last-child){border-inline-style:var(--tw-border-style);border-inline-width:0}.button-group--vertical .button--outline:first-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.button-group--vertical .button--outline:last-child{border-top-style:var(--tw-border-style);border-top-width:0}.button-group--vertical .button--outline:not(:first-child):not(:last-child){border-block-style:var(--tw-border-style);border-block-width:0}.button-group--full-width{width:100%}.toggle-button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.toggle-button{height:calc(var(--spacing) * 9)}}.toggle-button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button{cursor:var(--cursor-interactive);--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover);--toggle-button-fg:currentColor;--toggle-button-bg-selected:var(--accent-soft);--toggle-button-bg-selected-hover:var(--accent-soft-hover);--toggle-button-bg-selected-pressed:var(--accent-soft-hover);--toggle-button-fg-selected:var(--accent-soft-foreground);background-color:var(--toggle-button-bg);color:var(--toggle-button-fg)}.toggle-button:focus-visible:not(:focus),.toggle-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.toggle-button:disabled,.toggle-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.toggle-button:hover,.toggle-button[data-hovered=true]{background-color:var(--toggle-button-bg-hover)}}.toggle-button:active,.toggle-button[data-pressed=true]{background-color:var(--toggle-button-bg-pressed);transform:scale(.97)}.toggle-button[data-selected=true]{background-color:var(--toggle-button-bg-selected);color:var(--toggle-button-fg-selected)}@media(hover:hover){.toggle-button[data-selected=true]:hover,.toggle-button[data-selected=true][data-hovered=true]{background-color:var(--toggle-button-bg-selected-hover)}}.toggle-button[data-selected=true]:active,.toggle-button[data-selected=true][data-pressed=true]{background-color:var(--toggle-button-bg-selected-pressed)}.toggle-button svg{pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.toggle-button svg{margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.toggle-button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.toggle-button--sm{height:calc(var(--spacing) * 8)}}.toggle-button--sm svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toggle-button--sm:active,.toggle-button--sm[data-pressed=true]{transform:scale(.98)}.toggle-button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.toggle-button--lg{height:calc(var(--spacing) * 10)}}.toggle-button--lg:active,.toggle-button--lg[data-pressed=true]{transform:scale(.96)}.toggle-button--default{--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover)}.toggle-button--ghost{--toggle-button-bg:transparent;--toggle-button-bg-hover:var(--default);--toggle-button-bg-pressed:var(--default);--toggle-button-fg:var(--default-foreground)}.toggle-button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.toggle-button--icon-only{width:calc(var(--spacing) * 9)}}.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 8)}}.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 10)}}.toggle-button-group{justify-content:center;align-items:center;gap:0;width:fit-content;height:auto;display:inline-flex}.toggle-button-group--horizontal{flex-direction:row}.toggle-button-group--vertical{flex-direction:column}.toggle-button-group--full-width{width:100%}.toggle-button-group .toggle-button{border-radius:0}.toggle-button-group--horizontal .toggle-button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group .toggle-button:active,.toggle-button-group .toggle-button[data-pressed=true]{transform:none}.toggle-button-group .toggle-button:focus-visible:not(:focus),.toggle-button-group .toggle-button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.toggle-button-group--full-width .toggle-button{flex:1}.toggle-button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button-group--horizontal .toggle-button-group__separator{width:1px;height:50%;top:25%;left:-1px}.toggle-button-group--vertical .toggle-button-group__separator{width:50%;height:1px;top:-1px;left:25%}.toggle-button-group--detached{gap:var(--spacing)}.toggle-button-group--detached .toggle-button{border-radius:calc(var(--radius) * 3)}.toggle-button-group--detached .toggle-button-group__separator{display:none}.toolbar{align-items:center;gap:calc(var(--spacing) * 2);grid-auto-flow:column;width:fit-content;display:grid}.toolbar .separator--vertical{align-self:center;height:50%}.toolbar .separator--horizontal{justify-content:center;justify-self:center;width:50%}.toolbar--vertical{grid-auto-flow:row;justify-content:flex-start;align-items:flex-start}.toolbar--vertical .button-group{justify-content:flex-start}.toolbar--attached{border-radius:calc(var(--radius) * 3);background-color:var(--surface);padding:var(--spacing);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dropdown{gap:var(--spacing);flex-direction:column;display:flex}.dropdown__trigger{--tw-outline-style:none;transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;display:inline-block}.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.dropdown__trigger{cursor:var(--cursor-interactive)}.dropdown__trigger:focus-visible:not(:focus),.dropdown__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.dropdown__trigger:disabled,.dropdown__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.dropdown__trigger[data-pending=true]{pointer-events:none}.dropdown__trigger:active,.dropdown__trigger[data-pressed=true]{transform:scale(.97)}.dropdown__popover{max-width:48svw;transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));padding:0;overflow-y:auto}@media(min-width:48rem){.dropdown__popover{min-width:calc(var(--spacing) * 55)}}.dropdown__popover{border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay)}.dropdown__popover:focus-visible:not(:focus),.dropdown__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.dropdown__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.dropdown__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.dropdown__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.dropdown__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.dropdown__popover[data-exiting=true],.dropdown__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.dropdown__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.dropdown__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.dropdown__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.dropdown__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.dropdown__popover [data-slot=dropdown-menu]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.dropdown__popover [data-slot=menu-item]{padding-inline:calc(var(--spacing) * 2.5)}.dropdown__menu{gap:calc(var(--spacing) * .5);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.dropdown__menu [data-slot=separator]{width:94%;margin-left:3%}.list-box-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item{cursor:var(--cursor-interactive)}.list-box-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.list-box-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.list-box-item:has(.list-box-item__indicator){padding-inline-end:calc(var(--spacing) * 7)}.list-box-item:focus-visible:not(:focus),.list-box-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.list-box-item:active,.list-box-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.list-box-item:hover,.list-box-item[data-hovered=true]{background-color:var(--default)}}.list-box-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.list-box-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--default-foreground);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-end:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]{transition:stroke-dashoffset .25s linear}:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item--danger .list-box-item__indicator,.list-box-item--danger [data-slot=label]{color:var(--danger)}.list-box-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.list-box{width:100%;padding:var(--spacing);position:relative;overflow:clip}.list-box>*+*{margin-top:var(--spacing)}.list-box [data-slot=separator][data-orientation=horizontal]{width:94%;margin-left:3%}.menu-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item{cursor:var(--cursor-interactive)}.menu-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.menu-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.menu-item [data-slot=submenu-indicator] svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.menu-item:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 7)}.menu-item[data-has-submenu=true]:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 7)}.menu-item:focus-visible:not(:focus),.menu-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.menu-item:active,.menu-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.menu-item:hover,.menu-item[data-hovered=true]{background-color:var(--default)}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]{transition:stroke-dashoffset .1s linear}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--dot]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.menu-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.menu-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-start:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item[data-has-submenu=true] .menu-item__indicator{inset-inline-start:auto;inset-inline-end:calc(var(--spacing) * 2)}.menu-item__indicator [data-slot=menu-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:0}.menu-item__indicator--submenu{color:var(--muted)}.menu-item__indicator--submenu svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.menu-item--danger .menu-item__indicator,.menu-item--danger [data-slot=label]{color:var(--danger)}.menu-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.menu{gap:var(--spacing);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.menu [data-slot=separator]{width:94%;margin-left:3%}.tag-group{gap:var(--spacing);flex-direction:column;display:flex;position:relative}.tag-group__list{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex;position:relative}.tag-group [slot=description],.tag-group [data-slot=description],.tag-group [slot=errorMessage],.tag-group [data-slot=error-message]{padding:var(--spacing)}.tag{--optical-offset:.031em;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:inline-flex;position:relative}.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tag{cursor:var(--cursor-interactive)}.tag svg{pointer-events:none;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:currentColor;flex-shrink:0;align-self:center}.tag:is([data-disabled=true],[aria-disabled=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tag:is(:focus-visible,[data-focus-visible]){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tag:is([data-selected=true],[aria-selected=true]){background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.tag:is([data-selected=true],[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-soft-hover)}}.tag--sm{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--md{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--lg{border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.tag--default{background-color:var(--default);color:var(--default-foreground)}@media(hover:hover){.tag--default:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--default-hover)}}.tag--surface{background-color:var(--surface);color:var(--surface-foreground)}@media(hover:hover){.tag--surface:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--surface-hover)}}.tag__remove-button{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:inherit}.tag__remove-button svg{width:inherit;height:inherit;color:currentColor;flex-shrink:0;align-self:center}.color-area{width:100%;max-width:calc(var(--spacing) * 56);border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;aspect-ratio:1;background:var(--color-area-background);flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-area[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-area--show-dots:after{content:"";pointer-events:none;border-radius:inherit;background-image:radial-gradient(circle,#fff3 1px,#0000 1px);background-size:8px 8px;position:absolute;top:0;right:0;bottom:0;left:0}.color-area__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);will-change:width,height;background-color:var(--color-area-thumb-color);transition:width .15s var(--ease-out),height .15s var(--ease-out);border:3px solid #fff;box-shadow:0 0 0 1px #0000001a,inset 0 0 0 1px #0000001a}.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-area__thumb[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-area__thumb[data-dragging=true]{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.color-area__thumb[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker{display:inline-flex}.color-picker__trigger{align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-flex}.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-picker__trigger [data-slot=label]{cursor:var(--cursor-interactive)}.color-picker__trigger:focus-visible:not(:focus),.color-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-picker__trigger:disabled,.color-picker__trigger[data-disabled=true],.color-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker__popover{min-width:calc(var(--spacing) * 62);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 3);box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5));gap:calc(var(--spacing) * 3);flex-direction:column;display:flex;overflow:hidden auto}.color-picker__popover:focus-visible:not(:focus),.color-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.color-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.color-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.color-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.color-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.color-picker__popover[data-exiting=true],.color-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.color-slider{gap:var(--spacing);grid-template:"label output""track track"/1fr auto;width:100%;display:grid}.color-slider:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template:"track"/1fr;gap:0}.color-slider:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-columns:1fr;grid-template-areas:"label""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output){grid-template-columns:1fr;grid-template-areas:"output""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output) .color-slider__output{justify-self:end}.color-slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.color-slider .color-slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.color-slider .color-slider__track{border-radius:calc(var(--radius) * 2);grid-area:track;position:relative}.color-slider .color-slider__track:before,.color-slider .color-slider__track:after{content:"";z-index:0;pointer-events:none;position:absolute}.color-slider .color-slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;border-style:var(--tw-border-style);border-width:3px;border-color:var(--color-white);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);z-index:1;transition:transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-slider .color-slider__thumb[data-dragging=true]{cursor:grabbing}.color-slider .color-slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-slider .color-slider__thumb[data-disabled=true]{cursor:default;background-color:var(--default)}.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]) [data-slot=label]{opacity:1}.color-slider[data-orientation=horizontal]{flex-direction:column}.color-slider[data-orientation=horizontal] .color-slider__track{height:calc(var(--spacing) * 5);border-radius:0;justify-self:center;width:calc(100% - 1.25rem);box-shadow:inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:before,.color-slider[data-orientation=horizontal] .color-slider__track:after{width:.625rem;height:100%;top:0}.color-slider[data-orientation=horizontal] .color-slider__track:before{border-top-left-radius:calc(var(--radius) * 2);border-bottom-left-radius:calc(var(--radius) * 2);background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;left:-.625rem;box-shadow:inset 1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:after{border-top-right-radius:calc(var(--radius) * 2);border-bottom-right-radius:calc(var(--radius) * 2);background-color:var(--track-end-color,transparent);right:-.625rem;box-shadow:inset -1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);top:50%}.color-slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;place-items:center;height:100%}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template-rows:1fr;grid-template-areas:"track";gap:0}.color-slider[data-orientation=vertical]:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-rows:1fr auto;grid-template-areas:"track""label"}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):has(.color-slider__output){grid-template-rows:auto 1fr;grid-template-areas:"output""track"}.color-slider[data-orientation=vertical] .color-slider__output,.color-slider[data-orientation=vertical] [data-slot=label]{text-align:center}.color-slider[data-orientation=vertical] .color-slider__track{width:calc(var(--spacing) * 5);border-radius:0;justify-self:center;height:calc(100% - 1.25rem);box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:before,.color-slider[data-orientation=vertical] .color-slider__track:after{width:100%;height:.625rem;left:0}.color-slider[data-orientation=vertical] .color-slider__track:before{background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;border-bottom-right-radius:999px;border-bottom-left-radius:999px;bottom:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:after{background-color:var(--track-end-color,transparent);border-top-left-radius:999px;border-top-right-radius:999px;top:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);left:50%}.color-swatch{box-sizing:border-box;width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);background:linear-gradient(var(--color-swatch-current),var(--color-swatch-current)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-swatch--circle{border-radius:calc(var(--radius) * 2)}.color-swatch--square{border-radius:calc(var(--radius) * .75)}.color-swatch--xs{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.color-swatch--xs.color-swatch--circle{border-radius:calc(var(--radius) * 1)}.color-swatch--sm{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.color-swatch--sm.color-swatch--circle{border-radius:calc(var(--radius) * 1.5)}.color-swatch--lg{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.color-swatch--lg.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.color-swatch--xl.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch-picker{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.color-swatch-picker__item{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);border-style:var(--tw-border-style);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:border-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);border-width:2px;border-color:#0000;outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__item:focus-visible,.color-swatch-picker__item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-swatch-picker__item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-swatch-picker__item[data-selected=true]{border-color:var(--color-swatch-current);box-shadow:var(--field-shadow)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{transform:scale(.77)}.color-swatch-picker__swatch{border-radius:inherit;width:100%;height:100%;transition:transform .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:block}.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-swatch-picker__swatch:hover{transform:scale(1.1)}}.color-swatch-picker__indicator{pointer-events:none;z-index:10;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.color-swatch-picker__indicator>*{width:33.3333%;height:33.3333%;color:var(--color-white);transition:transform .15s var(--ease-out);transform:scale(0)translateZ(0)}.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__indicator[data-light-color=true] .color-swatch-picker__indicator>*{color:var(--color-black)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__indicator>*{transform:scale(1)translateZ(0)}.color-swatch-picker--stack{flex-direction:column}.color-swatch-picker--xs .color-swatch-picker__item{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px}.color-swatch-picker--sm .color-swatch-picker__item{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);border-style:var(--tw-border-style);border-width:2px}.color-swatch-picker--lg .color-swatch-picker__item{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--xl .color-swatch-picker__item{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--square .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-input-group:hover:not(:focus-within),.color-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.color-input-group[data-focus-within=true],.color-input-group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.color-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group[data-invalid=true]:focus,.color-input-group[data-invalid=true]:focus-visible,.color-input-group[data-invalid=true][data-focused=true],.color-input-group[data-invalid=true][data-focus-visible=true],.color-input-group[data-invalid=true]:focus-within,.color-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.color-input-group[data-disabled=true],.color-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-input-group__input{cursor:text;border-style:var(--tw-border-style);height:100%;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;display:flex}@media(min-width:40rem){.color-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.color-input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}.color-input-group:has([data-slot=color-input-group-prefix]) .color-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.color-input-group:has([data-slot=color-input-group-suffix]) .color-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.color-input-group__input:focus,.color-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.color-input-group__prefix{color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group__suffix{color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--color-input-group-bg);--color-input-group-bg:var(--default);--color-input-group-bg-hover:var(--default-hover);--color-input-group-bg-focus:var(--default)}@media(hover:hover){.color-input-group--secondary:hover:not(:focus-within),.color-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--color-input-group-bg-hover)}}.color-input-group--secondary:focus-within,.color-input-group--secondary[data-focus-within=true]{background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group--secondary[data-invalid=true]:focus,.color-input-group--secondary[data-invalid=true]:focus-visible,.color-input-group--secondary[data-invalid=true][data-focused=true],.color-input-group--secondary[data-invalid=true][data-focus-visible=true],.color-input-group--secondary[data-invalid=true]:focus-within,.color-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary [data-slot=color-input-group-input]{background-color:#0000}.color-input-group--full-width{width:100%}.color-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.color-field[data-invalid=true],.color-field[aria-invalid=true]) [data-slot=description]{display:none}.color-field [data-slot=label]{width:fit-content}.color-field--full-width{width:100%}.slider{gap:var(--spacing);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.slider .slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.slider .slider__track{border-radius:calc(var(--radius) * 1.5);background-color:var(--default);grid-area:track;position:relative}.slider .slider__fill{pointer-events:none;background-color:var(--accent);position:absolute}.slider .slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 1.5);background-color:var(--accent);-webkit-tap-highlight-color:transparent;transition:background-color .25s var(--ease-smooth),transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.slider .slider__thumb:after{z-index:10;border-radius:calc(var(--radius) * 1);background-color:var(--accent-foreground);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);content:"";transform-origin:50%;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));position:relative}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:after:not(:is()){transition-property:none}}.slider .slider__thumb[data-dragging=true]{cursor:grabbing}.slider .slider__thumb[data-dragging=true]:after{scale:.9}@media(prefers-reduced-motion:reduce){.slider .slider__thumb[data-dragging=true]:after:not(:is()){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.slider .slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.slider .slider__thumb[data-disabled=true]{cursor:default}.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]) [data-slot=label]{opacity:1}.slider[data-orientation=horizontal]{flex-direction:column}.slider[data-orientation=horizontal] .slider__track{height:calc(var(--spacing) * 5);border-inline-style:var(--tw-border-style);border-inline-width:.75rem;border-inline-color:#0000;width:100%}.slider[data-orientation=horizontal] .slider__track[data-fill-start=true]{border-inline-start-color:var(--accent)}.slider[data-orientation=horizontal] .slider__track[data-fill-end=true]{border-inline-end-color:var(--accent)}.slider[data-orientation=horizontal] .slider__fill,.slider[data-orientation=horizontal] .slider__thumb{height:100%}.slider[data-orientation=horizontal] .slider__thumb{width:1.75rem;top:50%}.slider[data-orientation=horizontal] .slider__thumb:after{width:1.5rem;height:1rem}.slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;height:100%}.slider[data-orientation=vertical] .slider__output,.slider[data-orientation=vertical] [data-slot=label]{text-align:center}.slider[data-orientation=vertical] .slider__track{height:100%;width:calc(var(--spacing) * 5);border-block-style:var(--tw-border-style);border-block-width:.75rem;border-block-color:#0000;justify-self:center}.slider[data-orientation=vertical] .slider__track[data-fill-start=true]{border-bottom-color:var(--accent)}.slider[data-orientation=vertical] .slider__track[data-fill-end=true]{border-top-color:var(--accent)}.slider[data-orientation=vertical] .slider__fill,.slider[data-orientation=vertical] .slider__thumb{width:100%}.slider[data-orientation=vertical] .slider__thumb{height:1.75rem;left:50%}.slider[data-orientation=vertical] .slider__thumb:after{width:1rem;height:1.5rem}.switch{align-items:flex-start;gap:var(--spacing);-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);--switch-control-bg:var(--default);--switch-control-bg-hover:var(--switch-control-bg);flex-direction:column;display:flex}@supports (color:color-mix(in lab,red,red)){.switch{--switch-control-bg-hover:color-mix(in oklab, var(--switch-control-bg), transparent 20%)}}.switch{--switch-control-bg-pressed:var(--switch-control-bg-hover);--switch-control-bg-checked:var(--accent);--switch-control-bg-checked-hover:var(--accent-hover)}.switch[data-disabled=true],.switch[data-disabled=true] [data-slot=description],.switch[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.switch[data-disabled=true] .switch__thumb{background-color:var(--default-foreground)}@supports (color:color-mix(in lab,red,red)){.switch[data-disabled=true] .switch__thumb{background-color:color-mix(in oklab,var(--default-foreground) 20%,transparent)}}.switch>[data-slot=description]{width:100%;min-width:0;padding-inline-start:3.25rem}.switch>[data-slot=field-error]{width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--muted);padding-inline-start:3.25rem}.switch.switch--sm>[data-slot=description],.switch.switch--sm>[data-slot=field-error]{padding-inline-start:2.75rem}.switch.switch--lg>[data-slot=description],.switch.switch--lg>[data-slot=field-error]{padding-inline-start:3.75rem}:is(.switch:disabled[aria-checked=true],.switch:disabled[data-selected=true],.switch[data-disabled=true][aria-checked=true],.switch[data-disabled=true][data-selected=true],.switch[aria-disabled=true][aria-checked=true],.switch[aria-disabled=true][data-selected=true]) .switch__thumb{opacity:.4}.switch__control{border-radius:calc(var(--radius) * 1.5);background-color:var(--switch-control-bg);width:2.5rem;height:1.25rem;transition:background-color .25s var(--ease-smooth),box-shadow .15s var(--ease-out);flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch:focus-visible .switch__control,.switch:has([data-slot=switch-content][data-focus-visible=true]) .switch__control,.switch [data-slot=switch-content][data-focus-visible=true] .switch__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.switch:hover .switch__control,.switch:has([data-slot=switch-content][data-hovered=true]) .switch__control,.switch [data-slot=switch-content][data-hovered=true] .switch__control{background-color:var(--switch-control-bg-hover)}.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control{background-color:var(--switch-control-bg-pressed)}:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transform:none}@media(prefers-reduced-motion:reduce){:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transform:none}}.switch[aria-checked=true] .switch__control,.switch[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked)}.switch[aria-checked=true]:hover .switch__control,.switch[data-selected=true]:hover .switch__control,.switch[aria-checked=true][data-hovered=true] .switch__control,.switch[data-selected=true][data-hovered=true] .switch__control,.switch:has([data-slot=switch-content][data-hovered=true])[data-selected=true] .switch__control,.switch[aria-checked=true]:active .switch__control,.switch[data-selected=true]:active .switch__control,.switch[aria-checked=true][data-pressed=true] .switch__control,.switch[data-selected=true][data-pressed=true] .switch__control,.switch:has([data-slot=switch-content][data-pressed=true])[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked-hover)}.switch__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.switch--sm .switch__control{border-radius:calc(var(--radius) * 1);width:2rem;height:1rem}.switch--lg .switch__control{width:3rem;height:1.5rem}.switch__thumb{transform-origin:50%;border-radius:calc(var(--radius) * 1);background-color:var(--color-white);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);width:1.375rem;height:1rem;transition:margin .3s var(--ease-out-fluid),background-color .2s var(--ease-out);margin-inline-start:calc(var(--spacing) * .5);display:flex}.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch[aria-checked=true] .switch__thumb,.switch[data-selected=true] .switch__thumb{background-color:var(--accent-foreground);color:var(--accent);margin-inline-start:calc(100% - 1.5rem);box-shadow:0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d}.switch--sm .switch__thumb{border-radius:calc(var(--radius) * .75);width:1.03125rem;height:.75rem}.switch[aria-checked=true] :is(.switch--sm .switch__thumb),.switch[data-selected=true] :is(.switch--sm .switch__thumb){margin-inline-start:calc(100% - 1.15625rem)}.switch--lg .switch__thumb{border-radius:calc(var(--radius) * 1.5);width:1.71875rem;height:1.25rem}.switch[aria-checked=true] :is(.switch--lg .switch__thumb),.switch[data-selected=true] :is(.switch--lg .switch__thumb){margin-inline-start:calc(100% - 1.84375rem)}.switch__thumb>*{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.switch__label{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.switch [data-slot=label]{-webkit-user-select:none;user-select:none}.switch__content [data-slot=label]{cursor:var(--cursor-interactive)}.switch [data-slot=description]{cursor:default;-webkit-user-select:none;user-select:none}.switch-group{gap:calc(var(--spacing) * 6);flex-direction:column;display:flex}.switch-group__items{gap:calc(var(--spacing) * 4);display:flex}.switch-group--horizontal .switch-group__items{flex-direction:row}.switch-group--vertical .switch-group__items{flex-direction:column}.badge{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);min-height:calc(var(--spacing) * 7);min-width:calc(var(--spacing) * 7);border-radius:calc(var(--radius) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:1.34;--badge-bg:var(--default);--badge-fg:var(--default-foreground);--badge-border:var(--background);background-color:var(--badge-bg);color:var(--badge-fg);border:1px solid var(--badge-border);flex-shrink:0;line-height:1.34;display:inline-flex}.badge__label{padding-inline:calc(var(--spacing) * .5)}.badge-anchor{flex-shrink:0;display:inline-flex;position:relative}.badge--lg{min-height:calc(var(--spacing) * 8);min-width:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;line-height:1.43}.badge--sm{min-height:calc(var(--spacing) * 4);min-width:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);--tw-leading:1.34;font-size:10px;line-height:1.34}.badge--accent{--badge-fg:var(--accent-soft-foreground)}.badge--default{--badge-fg:var(--default-foreground)}.badge--success{--badge-fg:var(--success-soft-foreground)}.badge--warning{--badge-fg:var(--warning-soft-foreground)}.badge--danger{--badge-fg:var(--danger-soft-foreground)}.badge--top-right{position:absolute;top:0;right:0;transform:translate(25%,-25%)}.badge--top-left{position:absolute;top:0;left:0;transform:translate(-25%,-25%)}.badge--bottom-right{position:absolute;bottom:0;right:0;transform:translate(25%,25%)}.badge--bottom-left{position:absolute;bottom:0;left:0;transform:translate(-25%,25%)}.badge--primary.badge--accent{--badge-bg:var(--accent);--badge-fg:var(--accent-foreground)}.badge--primary.badge--default{--badge-bg:var(--default);--badge-fg:var(--default-foreground)}.badge--primary.badge--success{--badge-bg:var(--success);--badge-fg:var(--success-foreground)}.badge--primary.badge--warning{--badge-bg:var(--warning);--badge-fg:var(--warning-foreground)}.badge--primary.badge--danger{--badge-bg:var(--danger);--badge-fg:var(--danger-foreground)}.badge--soft.badge--accent{--badge-bg:var(--accent-soft);--badge-fg:var(--accent-soft-foreground)}.badge--soft.badge--default{--badge-bg:var(--default-soft);--badge-fg:var(--default-soft-foreground)}.badge--soft.badge--success{--badge-bg:var(--success-soft);--badge-fg:var(--success-soft-foreground)}.badge--soft.badge--warning{--badge-bg:var(--warning-soft);--badge-fg:var(--warning-soft-foreground)}.badge--soft.badge--danger{--badge-bg:var(--danger-soft);--badge-fg:var(--danger-soft-foreground)}.chip{align-items:center;gap:calc(var(--spacing) * .5);border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--chip-bg:var(--default);--chip-fg:currentColor;background-color:var(--chip-bg);color:var(--chip-fg);flex-shrink:0;display:inline-flex}.chip__label{padding-inline:calc(var(--spacing) * .5)}.chip--accent{--chip-fg:var(--accent-soft-foreground)}.chip--danger{--chip-fg:var(--danger-soft-foreground)}.chip--default{--chip-fg:var(--default-foreground)}.chip--success{--chip-fg:var(--success-soft-foreground)}.chip--warning{--chip-fg:var(--warning-soft-foreground)}.chip--tertiary{--chip-bg:transparent}.chip--sm{padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));padding-block:0}.chip--md{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.chip--lg{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.chip--primary.chip--accent{--chip-bg:var(--accent);--chip-fg:var(--accent-foreground)}.chip--primary.chip--success{--chip-bg:var(--success);--chip-fg:var(--success-foreground)}.chip--primary.chip--warning{--chip-bg:var(--warning);--chip-fg:var(--warning-foreground)}.chip--primary.chip--danger{--chip-bg:var(--danger);--chip-fg:var(--danger-foreground)}.chip--accent.chip--soft{--chip-bg:var(--accent-soft);--chip-fg:var(--accent-soft-foreground)}.chip--success.chip--soft{--chip-bg:var(--success-soft);--chip-fg:var(--success-soft-foreground)}.chip--warning.chip--soft{--chip-bg:var(--warning-soft);--chip-fg:var(--warning-soft-foreground)}.chip--danger.chip--soft{--chip-bg:var(--danger-soft);--chip-fg:var(--danger-soft-foreground)}.chip--default.chip--soft{--chip-bg:var(--default-soft);--chip-fg:var(--default-soft-foreground)}.table-root{grid-template-columns:minmax(0,1fr);width:100%;display:grid;position:relative;overflow:clip}.table__scroll-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;overflow-x:auto}.table-root--primary{background-color:var(--surface-secondary);padding-inline:var(--spacing);padding-bottom:var(--spacing);border-radius:min(32px,calc(var(--radius) * 2.5))}.table-root--secondary .table__header{border-bottom-style:var(--tw-border-style);background-color:#0000;border-bottom-width:0}.table-root--secondary .table__column{background-color:var(--surface-secondary)}.table-root--secondary :is(th.table__column:first-child,[role=row]>[role=presentation]:first-of-type>.table__column){border-start-start-radius:min(32px,var(--radius-2xl));border-end-start-radius:min(32px,var(--radius-2xl))}.table-root--secondary :is(th.table__column:last-child,[role=row]>[role=presentation]:last-of-type>.table__column){border-start-end-radius:min(32px,var(--radius-2xl));border-end-end-radius:min(32px,var(--radius-2xl))}.table-root--secondary .table__body{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table-root--secondary .table__body tr:first-child td:first-child,.table-root--secondary .table__body tr:first-child td:last-child,.table-root--secondary .table__body tr:last-child td:first-child,.table-root--secondary .table__body tr:last-child td:last-child{border-radius:0}.table-root--secondary .table__body:not(tbody){border-radius:0;overflow:visible}.table-root--secondary .table__row .table__cell{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row .table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table-root--secondary .table__row .table__cell{background-color:#0000}@media(hover:hover){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--default) 50%,transparent)}}}.table__content{border-collapse:separate;--tw-border-spacing-x:0;--tw-border-spacing-y:0;width:100%;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.table-root--primary .table__content{overflow:clip}.table__header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator)}@supports (color:color-mix(in lab,red,red)){.table__header{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__header{background-color:var(--surface-secondary)}.table__column{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);position:relative}.table__column:after{content:"";pointer-events:none;height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .5);background-color:var(--separator);inset-inline-end:calc(var(--spacing) * 0);position:absolute;top:50%}.table__column:last-child:not(:only-child):after{content:none}.table__column[data-allows-sorting=true]{cursor:var(--cursor-interactive)}@media(hover:hover){.table__column[data-allows-sorting=true]:hover,.table__column[data-allows-sorting=true][data-hovered=true]{color:var(--foreground)}}.table__column:focus-visible,.table__column[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}[role=row]>[role=presentation]:last-of-type:not(:only-of-type)>.table__column:after{content:none}.table__sortable-column-header{justify-content:space-between;align-items:center;display:flex}.table__sortable-column-indicator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out)}.table__sortable-column-indicator[data-direction=descending]{rotate:180deg}.table__body tr:first-child td:first-child{border-start-start-radius:min(32px,var(--radius-2xl))}.table__body tr:first-child td:last-child{border-start-end-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:first-child{border-end-start-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:last-child{border-end-end-radius:min(32px,var(--radius-2xl))}.table__body:not(tbody){border-radius:min(32px,var(--radius-2xl));height:100%;position:relative;overflow:clip}.table__row{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator);height:100%;position:relative}@supports (color:color-mix(in lab,red,red)){.table__row{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__row:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 40%,transparent)}}}.table__row[data-selected=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row[data-selected=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 10%,transparent)}}.table__row[aria-disabled=true],.table__row[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.table__row:focus-visible,.table__row[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.table__row[data-dragging=true]{opacity:.5}.table__row[data-drop-target=true] .table__cell{background-color:var(--accent-soft)}.table__cell{background-color:var(--surface);height:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);vertical-align:middle;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table__cell:focus-visible,.table__cell[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true]) :is(.table__cell,.table__column){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):only-child,.table__row:is(:focus-visible,[data-focus-visible=true])>:only-child :is(.table__cell,.table__column){border-radius:calc(var(--radius) * 1);--tw-shadow:inset 0 0 0 2px var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):first-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:first-child:not(:only-child) :is(.table__cell,.table__column){border-top-left-radius:calc(var(--radius) * 1);border-bottom-left-radius:calc(var(--radius) * 1);--tw-shadow:inset 2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):last-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:last-child:not(:only-child) :is(.table__cell,.table__column){border-top-right-radius:calc(var(--radius) * 1);border-bottom-right-radius:calc(var(--radius) * 1);--tw-shadow:inset -2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):not(:first-child):not(:last-child):not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:not(:first-child):not(:last-child):not(:only-child) :is(.table__cell,.table__column){--tw-shadow:inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__cell[data-tree-column]{padding-inline-start:calc(1rem * var(--table-row-level,1))}.table__footer{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);align-items:center;display:flex}.table__resizable-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;position:relative;overflow:auto}.table__column-resizer{height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;border-radius:calc(var(--radius) * .5);background-color:var(--separator);box-sizing:content-box;--tw-translate-x: 50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:col-resize;touch-action:none;padding-inline:calc(var(--spacing) * 2);--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-clip:content-box;border-style:none;outline-style:none;position:absolute;top:50%}.table__column-resizer[data-hovered=true],.table__column-resizer:hover,.table__column-resizer[data-resizing=true]{height:100%;width:calc(var(--spacing) * .5);background-color:var(--accent)}.table__column-resizer[data-focus-visible=true],.table__column-resizer:focus-visible{height:100%;width:calc(var(--spacing) * .5);background-color:var(--focus)}.table__column:has(.table__column-resizer):after{content:none}.table__load-more td,.table__load-more [role=rowheader]{padding-block:calc(var(--spacing) * 3);text-align:center}:is(.table__load-more td,.table__load-more [role=rowheader])>*{margin-inline:auto}.table__load-more-content{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 2);display:flex}.alert{justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 4);background-color:var(--surface);width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex}.alert__content{flex-direction:column;flex-grow:1;align-items:flex-start;height:100%;display:flex}.alert__indicator{padding:var(--spacing);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:flex}.alert__indicator [data-slot=alert-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.alert__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.alert__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.alert--default .alert__indicator,.alert--default .alert__title{color:var(--foreground)}.alert--accent .alert__indicator,.alert--accent .alert__title{color:var(--accent-soft-foreground)}.alert--success .alert__indicator,.alert--success .alert__title{color:var(--success-soft-foreground)}.alert--warning .alert__indicator,.alert--warning .alert__title{color:var(--warning-soft-foreground)}.alert--danger .alert__indicator,.alert--danger .alert__title{color:var(--danger-soft-foreground)}.empty-state{padding:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.skeleton{pointer-events:none;border-radius:calc(var(--radius) * .5);background-color:var(--surface-tertiary);position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.skeleton{background-color:color-mix(in oklab,var(--surface-tertiary) 70%,transparent)}}.skeleton--shimmer:after{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-gradient-position:to right;animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}@supports (background-image:linear-gradient(in lab,red,red)){.skeleton--shimmer:after{--tw-gradient-position:to right in oklab}}.skeleton--shimmer:after{background-image:linear-gradient(var(--tw-gradient-stops));--tw-gradient-from:transparent;--tw-gradient-via:var(--surface-tertiary);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));--tw-gradient-to:transparent;--tw-content:"";content:var(--tw-content)}.skeleton--shimmer:has(.skeleton):after{content:none}.skeleton--shimmer:has(.skeleton):before{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-content:"";content:var(--tw-content);z-index:10;pointer-events:none;mix-blend-mode:overlay;background:linear-gradient(90deg,#0000,#ffffff80,#0000);animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}.skeleton--shimmer:has(.skeleton) .skeleton:after{content:none}.skeleton--pulse{animation:var(--animate-pulse)}.meter{gap:var(--spacing);--meter-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.meter [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.meter .meter__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.meter .meter__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.meter .meter__fill{border-radius:calc(var(--radius) * .5);background-color:var(--meter-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]) [data-slot=label]{opacity:1}.meter--sm .meter__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.meter--sm .meter__fill{border-radius:calc(var(--radius) * .25)}.meter--lg .meter__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.meter--lg .meter__fill{border-radius:calc(var(--radius) * .75)}.meter--default{--meter-fill:var(--default-foreground)}.meter--accent{--meter-fill:var(--accent)}.meter--success{--meter-fill:var(--success)}.meter--warning{--meter-fill:var(--warning)}.meter--danger{--meter-fill:var(--danger)}.progress-bar{gap:var(--spacing);--progress-bar-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.progress-bar [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.progress-bar .progress-bar__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.progress-bar .progress-bar__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.progress-bar .progress-bar__fill{border-radius:calc(var(--radius) * .5);background-color:var(--progress-bar-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-bar:not([aria-valuenow]) .progress-bar__fill{width:40%;animation:1.5s cubic-bezier(.65,0,.35,1) infinite progress-bar-indeterminate}.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]) [data-slot=label]{opacity:1}@keyframes progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(350%)}}.progress-bar--sm .progress-bar__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.progress-bar--sm .progress-bar__fill{border-radius:calc(var(--radius) * .25)}.progress-bar--lg .progress-bar__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.progress-bar--lg .progress-bar__fill{border-radius:calc(var(--radius) * .75)}.progress-bar--default{--progress-bar-fill:var(--default-foreground)}.progress-bar--accent{--progress-bar-fill:var(--accent)}.progress-bar--success{--progress-bar-fill:var(--success)}.progress-bar--warning{--progress-bar-fill:var(--warning)}.progress-bar--danger{--progress-bar-fill:var(--danger)}.progress-circle{--progress-circle-stroke:var(--accent);--progress-circle-track-stroke:var(--default);justify-content:center;align-items:center;display:inline-flex}.progress-circle .progress-circle__track{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.progress-circle .progress-circle__track-circle{stroke:var(--progress-circle-track-stroke)}.progress-circle .progress-circle__fill-circle{stroke:var(--progress-circle-stroke);transition:stroke-dashoffset .3s var(--ease-out)}.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-circle:not([aria-valuenow]) .progress-circle__track{animation:1s linear infinite progress-circle-spin}.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-circle:disabled,.progress-circle[data-disabled=true],.progress-circle[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@keyframes progress-circle-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.progress-circle--sm .progress-circle__track{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.progress-circle--lg .progress-circle__track{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.progress-circle--default{--progress-circle-stroke:var(--default-foreground)}.progress-circle--accent{--progress-circle-stroke:var(--accent)}.progress-circle--success{--progress-circle-stroke:var(--success)}.progress-circle--warning{--progress-circle-stroke:var(--warning)}.progress-circle--danger{--progress-circle-stroke:var(--danger)}.spinner{pointer-events:none;width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);flex-shrink:0;animation:.75s linear infinite spin;display:inline-flex}.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *),.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.spinner--sm{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.spinner--lg{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.spinner--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.spinner--current{color:inherit}.spinner--accent{color:var(--accent)}.spinner--danger{color:var(--danger)}.spinner--success{color:var(--success)}.spinner--warning{color:var(--warning)}.toast-region{pointer-events:none;z-index:50;--tw-outline-style:none;outline-style:none;width:calc(100vw - 2rem);position:fixed}@media(min-width:40rem){.toast-region{width:auto;min-width:var(--toast-width)}}.toast-region{display:block}.toast-region--bottom{bottom:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--bottom-start{bottom:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--bottom-end{right:calc(var(--spacing) * 4);bottom:calc(var(--spacing) * 4)}.toast-region--top{top:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--top-start{top:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--top-end{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4)}.toast-region:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast{pointer-events:auto;justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 1.5);background-color:var(--surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex;position:absolute;left:0;right:0}.toast--bottom,.toast--bottom-start,.toast--bottom-end{bottom:0}.toast--top,.toast--top-start,.toast--top-end{top:0}.toast:not([data-frontmost=true]){pointer-events:none;height:var(--front-height);overflow:hidden}.toast:not([data-frontmost=true]) .toast__close-button{pointer-events:none;opacity:0;outline:none}.toast[data-hidden=true]{pointer-events:none;opacity:0;display:flex}.toast:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast--bottom,.toast--bottom-start,.toast--bottom-end{view-transition-class:toast-bottom}.toast--top,.toast--top-start,.toast--top-end{view-transition-class:toast-top}.toast__content{flex-direction:column;flex-grow:1;align-self:center;align-items:flex-start;height:100%;display:flex}.toast__indicator{padding:var(--spacing);color:var(--overlay-foreground);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.toast__indicator [data-slot=toast-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__indicator [data-slot=spinner],.toast__indicator [data-slot=spinner-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--overlay-foreground)}.toast__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.toast__close-button{pointer-events:none;top:calc(var(--spacing) * -1);right:calc(var(--spacing) * -1);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);border-color:var(--border);background-color:var(--default);opacity:0;position:absolute}@media(min-width:40rem){.toast__close-button{border-style:var(--tw-border-style);background-color:var(--overlay);border-width:1px}}.toast__close-button{transition:opacity .15s var(--ease-smooth)}.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(min-width:40rem){.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}}@media(hover:hover){.toast__close-button:hover,.toast__close-button[data-hovered=true]{background-color:var(--default)}}.toast[data-frontmost=true]:hover .toast__close-button{pointer-events:auto;opacity:1}.toast__action{margin-top:calc(var(--spacing) * 2)}@media(min-width:40rem){.toast__action{margin-top:0}}.toast--accent .toast__title{color:var(--accent-soft-foreground)}.toast--success .toast__title,.toast--success .toast__indicator{color:var(--success-soft-foreground)}.toast--warning .toast__title,.toast--warning .toast__indicator{color:var(--warning-soft-foreground)}.toast--danger .toast__title,.toast--danger .toast__indicator{color:var(--danger-soft-foreground)}::view-transition-old(*){will-change:translate,opacity}::view-transition-new(*){will-change:translate,opacity}::view-transition-new(.toast-bottom):only-child{animation:.35s toast-slide-bottom-in}::view-transition-old(.toast-bottom):only-child{animation:.35s forwards toast-slide-bottom-out}::view-transition-new(.toast-top):only-child{animation:.35s toast-slide-top-in}::view-transition-old(.toast-top):only-child{animation:.35s forwards toast-slide-top-out}@keyframes toast-slide-bottom-in{0%{opacity:0;translate:0 100%}}@keyframes toast-slide-bottom-out{to{opacity:0;translate:0 100%}}@keyframes toast-slide-top-in{0%{opacity:0;translate:0 -100%}}@keyframes toast-slide-top-out{to{opacity:0;translate:0 -100%}}.checkbox-group{flex-direction:column;display:flex}.checkbox-group [data-slot=checkbox]{margin-top:calc(var(--spacing) * 4)}.checkbox{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.checkbox>[data-slot=description],.checkbox>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.checkbox [data-slot=label]{-webkit-user-select:none;user-select:none}.checkbox .checkbox__content [data-slot=label]{cursor:var(--cursor-interactive)}.checkbox[data-disabled=true],.checkbox[data-disabled=true] [data-slot=description],.checkbox[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.checkbox[data-selected=true],.checkbox[data-indeterminate=true]) .checkbox__indicator{border-color:var(--accent-foreground)}.checkbox [data-slot=checkbox-default-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);stroke-width:2.5px;color:var(--accent-foreground);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.2s;transition-duration:.2s}.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox[data-selected=true] [data-slot=checkbox-default-indicator--checkmark]{transition:stroke-dashoffset .15s linear 15ms}.checkbox[data-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[data-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark]{color:var(--danger-foreground)}.checkbox[data-indeterminate=true] [data-slot=checkbox-default-indicator--indeterminate]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.checkbox[data-indeterminate=true][data-invalid=true] [data-slot=checkbox-default-indicator--indeterminate],.checkbox[data-indeterminate=true][aria-invalid=true] [data-slot=checkbox-default-indicator--indeterminate]{color:var(--danger-foreground)}.checkbox__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .75);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative;overflow:hidden}.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox__control{cursor:var(--cursor-interactive)}.checkbox__control:before{pointer-events:none;z-index:0;transform-origin:50%;--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);border-radius:calc(var(--radius) * .75);background-color:var(--accent);opacity:0;--tw-content:"";content:var(--tw-content);transition:scale .1s var(--ease-linear),opacity .2s var(--ease-linear),background-color .2s var(--ease-out);position:absolute;top:0;right:0;bottom:0;left:0}@media(prefers-reduced-motion:reduce){.checkbox__control:before:not(:is()){transition-property:none}}.checkbox:focus-visible .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-focus-visible=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-focus-visible=true] .checkbox__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control{border-color:var(--field-border-hover)}:is(.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control):before{background-color:var(--accent-hover)}.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control{color:var(--accent-foreground);border-color:#0000}:is(.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.checkbox[data-indeterminate=true] .checkbox__control{background-color:var(--accent);color:var(--accent-foreground)}.checkbox:active[data-indeterminate=true] .checkbox__control,.checkbox[data-pressed=true][data-indeterminate=true] .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-pressed=true])[data-indeterminate=true] .checkbox__control{background-color:var(--accent-hover)}.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-visible,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focused=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-visible=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-within,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground);border-color:#0000}:is(.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);background-color:var(--danger);opacity:1}.checkbox[data-indeterminate=true][aria-invalid=true] .checkbox__control,.checkbox[data-indeterminate=true][data-invalid=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground)}.checkbox__indicator{z-index:10;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);justify-content:center;align-items:center;display:flex;position:relative}.checkbox__indicator svg{width:100%;height:100%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.checkbox--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.checkbox--secondary .checkbox__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--checkbox-control-bg);--checkbox-control-bg:var(--default)}.checkbox:hover :is(.checkbox--secondary .checkbox__control),.checkbox:has([data-slot=checkbox-content][data-hovered=true]) :is(.checkbox--secondary .checkbox__control),.checkbox [data-slot=checkbox-content][data-hovered=true] :is(.checkbox--secondary .checkbox__control){border-color:var(--field-border-hover)}.checkbox__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.checkbox--secondary:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{background-color:var(--checkbox-control-bg)}:is(.checkbox--secondary[aria-checked=true] .checkbox__control,.checkbox--secondary[data-selected=true] .checkbox__control):before,.checkbox--secondary[data-indeterminate=true] .checkbox__control,.checkbox--secondary[data-indeterminate=true] .checkbox__control:before{background-color:var(--accent)}.fieldset{gap:calc(var(--spacing) * 6);flex-direction:column;flex:1 1 0;display:flex}.fieldset__legend{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.fieldset__field_group{width:100%}:where(.fieldset__field_group>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.fieldset__actions{align-items:center;gap:calc(var(--spacing) * 2);padding-top:var(--spacing);display:flex}.input-otp{align-items:center;gap:calc(var(--spacing) * 2);display:flex;position:relative}.input-otp[data-disabled=true]{cursor:not-allowed;opacity:.5}.input-otp__group{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.input-otp__slot{height:calc(var(--spacing) * 10);width:calc(var(--spacing) * 9.5);border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:var(--field-radius,calc(var(--radius) * 1.5));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;flex:1;justify-content:center;align-items:center;display:flex;position:relative}.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-otp__slot:hover,.input-otp__slot[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-otp__slot[data-active=true]{z-index:10;background-color:var(--field-focus);--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.input-otp__slot[data-filled=true]{background-color:var(--field-focus)}.input-otp__slot[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input-otp__slot[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-otp__slot[data-invalid=true]:focus,.input-otp__slot[data-invalid=true]:focus-visible,.input-otp__slot[data-invalid=true][data-focused=true],.input-otp__slot[data-invalid=true][data-focus-visible=true],.input-otp__slot[data-invalid=true]:focus-within,.input-otp__slot[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-otp__slot[data-invalid=true]{background-color:var(--field-focus)}.input-otp__slot-value{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-tracking:-.27px;letter-spacing:-.27px;animation:slot-value-in .25s var(--ease-smooth) both;transform-origin:bottom}.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.input-otp__caret{height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .5);background-color:var(--field-placeholder,var(--muted));width:2px;animation:1.2s ease-out infinite caret-blink;position:absolute}.input-otp__separator{border-radius:calc(var(--radius) * .5);background-color:var(--separator);flex-shrink:0;width:6px;height:2px}.input-otp--secondary .input-otp__slot{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-otp-slot-bg);--input-otp-slot-bg:var(--default);--input-otp-slot-bg-hover:var(--default-hover);--input-otp-slot-bg-focus:var(--default)}@media(hover:hover){.input-otp--secondary .input-otp__slot:hover,.input-otp--secondary .input-otp__slot[data-hovered=true]{background-color:var(--input-otp-slot-bg-hover)}}.input-otp--secondary .input-otp__slot[data-active=true],.input-otp--secondary .input-otp__slot[data-filled=true]{background-color:var(--input-otp-slot-bg-focus)}@keyframes slot-value-in{0%{opacity:0;transform:translateY(8px)scale(.8)}to{opacity:1;transform:translateY(0)scale(1)}}.input{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input{border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input:hover:not(:focus):not(:focus-visible),.input[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input:focus,.input[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input[data-invalid=true]:focus,.input[data-invalid=true]:focus-visible,.input[data-invalid=true][data-focused=true],.input[data-invalid=true][data-focus-visible=true],.input[data-invalid=true]:focus-within,.input[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input[data-invalid=true]{background-color:var(--field-focus)}.input:disabled,.input[data-disabled=true],.input[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-bg);--input-bg:var(--default);--input-bg-hover:var(--default-hover);--input-bg-focus:var(--default)}@media(hover:hover){.input--secondary:hover:not(:focus):not(:focus-visible),.input--secondary[data-hovered=true]:not([data-focus-visible=true]):not([data-focused=true]){background-color:var(--input-bg-hover)}}.input--secondary:focus,.input--secondary[data-focused=true]{background-color:var(--input-bg-focus)}.input--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input--secondary[data-invalid=true]:focus,.input--secondary[data-invalid=true]:focus-visible,.input--secondary[data-invalid=true][data-focused=true],.input--secondary[data-invalid=true][data-focus-visible=true],.input--secondary[data-invalid=true]:focus-within,.input--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input--secondary[data-invalid=true]{background-color:var(--input-bg-focus)}.input--full-width{width:100%}.input-group{min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);outline-style:none;align-items:center;display:inline-flex}.input-group:has([data-slot=input-group-textarea]){align-items:flex-start;height:auto}.input-group{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-group:hover:not(:focus-within),.input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-group:has([data-slot=input-group-input]:focus),.input-group:has([data-slot=input-group-textarea]:focus){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group[data-invalid=true]:focus,.input-group[data-invalid=true]:focus-visible,.input-group[data-invalid=true][data-focused=true],.input-group[data-invalid=true][data-focus-visible=true],.input-group[data-invalid=true]:focus-within,.input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.input-group[data-disabled=true],.input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.input-group:has([data-slot=input-group-input]:-webkit-autofill),.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.input-group__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}.input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input-group:has([data-slot=input-group-prefix]) .input-group__input{border-top-left-radius:0;border-bottom-left-radius:0;padding-left:0}.input-group:has([data-slot=input-group-suffix]) .input-group__input{border-top-right-radius:0;border-bottom-right-radius:0;padding-right:0}.input-group__input:focus,.input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.input-group__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input[data-slot=input-group-textarea]{resize:vertical;min-height:38px}.input-group__prefix{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-right-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-left:none;border-top-right-radius:0;border-bottom-right-radius:0;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__prefix{align-items:flex-start;padding-top:.5rem}.input-group__prefix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group__suffix{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-left-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-right:none;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__suffix{align-items:flex-start;padding-top:.5rem}.input-group__suffix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-group-bg);--input-group-bg:var(--default);--input-group-bg-hover:var(--default-hover);--input-group-bg-focus:var(--default)}@media(hover:hover){.input-group--secondary:hover:not(:focus-within),.input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--input-group-bg-hover)}}.input-group--secondary:has([data-slot=input-group-input]:focus),.input-group--secondary:has([data-slot=input-group-textarea]:focus){background-color:var(--input-group-bg-focus)}.input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group--secondary[data-invalid=true]:focus,.input-group--secondary[data-invalid=true]:focus-visible,.input-group--secondary[data-invalid=true][data-focused=true],.input-group--secondary[data-invalid=true][data-focus-visible=true],.input-group--secondary[data-invalid=true]:focus-within,.input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--input-group-bg-focus)}.input-group--secondary [data-slot=input-group-input],.input-group--secondary [data-slot=input-group-textarea]{background-color:#0000}.input-group--full-width{width:100%}.number-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.number-field[data-invalid=true],.number-field[aria-invalid=true]) [data-slot=description]{display:none}.number-field [data-slot=label]{width:fit-content}.number-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;grid-template-columns:40px 1fr 40px;align-items:center;display:grid;overflow:hidden}.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.number-field__group:hover:not(:focus-within),.number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.number-field__group[data-focus-within=true],.number-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field__group[data-invalid=true]:focus,.number-field__group[data-invalid=true]:focus-visible,.number-field__group[data-invalid=true][data-focused=true],.number-field__group[data-invalid=true][data-focus-visible=true],.number-field__group[data-invalid=true]:focus-within,.number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.number-field__group[data-disabled=true],.number-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.number-field__group:has([data-slot=number-field-input]:-webkit-autofill),.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.number-field__input{border-style:var(--tw-border-style);min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none}@media(min-width:40rem){.number-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.number-field__group:has([slot=decrement]) .number-field__input{border-top-left-radius:0;border-bottom-left-radius:0}.number-field__group:has([slot=increment]) .number-field__input{border-top-right-radius:0;border-bottom-right-radius:0}.number-field__input:focus,.number-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.number-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__increment-button,.number-field__decrement-button{height:100%;width:calc(var(--spacing) * 10);color:var(--field-foreground,var(--foreground));--tw-outline-style:none;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth);background-color:#0000;border-style:solid;border-radius:0;outline-style:none;justify-content:center;align-items:center;display:flex}:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.number-field__increment-button,.number-field__decrement-button{cursor:var(--cursor-interactive)}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:var(--field-foreground,var(--foreground))}@supports (color:color-mix(in lab,red,red)){:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:color-mix(in oklab,var(--field-foreground,var(--foreground)) 10%,transparent)}}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{transform:scale(.97)}:is(.number-field__increment-button,.number-field__decrement-button):disabled,:is(.number-field__increment-button,.number-field__decrement-button)[data-disabled=true],:is(.number-field__increment-button,.number-field__decrement-button)[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-increment-button-icon],:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-decrement-button-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.number-field__increment-button{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--field-placeholder,var(--muted))}@supports (color:color-mix(in lab,red,red)){.number-field__increment-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field__decrement-button{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--field-placeholder,var(--muted));border-top-right-radius:0;border-bottom-right-radius:0}@supports (color:color-mix(in lab,red,red)){.number-field__decrement-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field--secondary .number-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--number-field-group-bg);--number-field-group-bg:var(--default);--number-field-group-bg-hover:var(--default-hover);--number-field-group-bg-focus:var(--default)}@media(hover:hover){.number-field--secondary .number-field__group:hover:not(:focus-within),.number-field--secondary .number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--number-field-group-bg-hover)}}.number-field--secondary .number-field__group:focus-within,.number-field--secondary .number-field__group[data-focus-within=true]{background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field--secondary .number-field__group[data-invalid=true]:focus,.number-field--secondary .number-field__group[data-invalid=true]:focus-visible,.number-field--secondary .number-field__group[data-invalid=true][data-focused=true],.number-field--secondary .number-field__group[data-invalid=true][data-focus-visible=true],.number-field--secondary .number-field__group[data-invalid=true]:focus-within,.number-field--secondary .number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field--secondary .number-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group [data-slot=number-field-input]{background-color:#0000}.number-field--full-width,.number-field__group--full-width{width:100%}.radio-group{flex-direction:column;display:flex}.radio-group[data-orientation=vertical] [data-slot=radio]{margin-top:calc(var(--spacing) * 4)}.radio-group[data-orientation=horizontal]{gap:calc(var(--spacing) * 4);flex-flow:wrap}.radio-group--secondary .radio__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--radio-control-bg);--radio-control-bg:var(--default);--radio-control-bg-hover:var(--default-hover)}.radio:has([data-slot=radio-content][data-hovered=true]) :is(.radio-group--secondary .radio__control),.radio [data-slot=radio-content][data-hovered=true] :is(.radio-group--secondary .radio__control){border-color:var(--field-border-hover)}.radio:not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg-hover)}.radio{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.radio [data-slot=label]{-webkit-user-select:none;user-select:none}.radio .radio__content [data-slot=label]{cursor:var(--cursor-interactive)}.radio>[data-slot=description],.radio>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=description],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.radio__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.radio__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.radio__control{cursor:var(--cursor-interactive)}.radio:has([data-slot=radio-content][data-focus-visible=true]) .radio__control,.radio [data-slot=radio-content][data-focus-visible=true] .radio__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.radio:has([data-slot=radio-content][data-hovered=true]) .radio__control,.radio [data-slot=radio-content][data-hovered=true] .radio__control{border-color:var(--field-border-hover)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) .radio__control .radio__indicator:empty:before{background-color:var(--field-hover)}.radio:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio [data-slot=radio-content][data-pressed=true] .radio__control{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.radio[data-selected] .radio__control,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__control,.radio:has(input:checked) .radio__control{background-color:var(--accent);border-color:#0000}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__control,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__control{background-color:var(--accent-hover)}.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-visible,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focused=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-within,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-visible,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focused=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-within,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio__indicator{pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.radio__indicator:empty:before{content:"";border-radius:calc(var(--radius) * 1);background-color:var(--field-background,var(--default));width:100%;height:100%;transition:scale .2s var(--ease-out),background-color .2s var(--ease-out);scale:1}@media(prefers-reduced-motion:reduce){.radio__indicator:empty:before:not(:is()){transition-property:none}}.radio[data-selected] .radio__indicator:empty:before,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked) .radio__indicator:empty:before{background-color:var(--accent-foreground);scale:.4286}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before{scale:.5714}.radio--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textfield{gap:var(--spacing);flex-direction:column;display:flex}:is(.textfield[data-invalid=true],.textfield[aria-invalid=true]) [data-slot=description]{display:none}.textfield--full-width,.textfield--full-width [data-slot=input],.textfield--full-width [data-slot=textarea]{width:100%}.search-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.search-field[data-invalid=true],.search-field[aria-invalid=true]) [data-slot=description]{display:none}.search-field [data-slot=label]{width:fit-content}.search-field[data-empty=true] [data-slot=search-field-clear-button]{pointer-events:none;opacity:0}.search-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;position:relative;overflow:hidden}.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.search-field__group:hover:not(:focus-within),.search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.search-field__group[data-focus-within=true],.search-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field__group[data-invalid=true]:focus,.search-field__group[data-invalid=true]:focus-visible,.search-field__group[data-invalid=true][data-focused=true],.search-field__group[data-invalid=true][data-focus-visible=true],.search-field__group[data-invalid=true]:focus-within,.search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.search-field__group[data-disabled=true],.search-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.search-field__group:has([data-slot=search-field-input]:-webkit-autofill),.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.search-field__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}@media(min-width:40rem){.search-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.search-field__input::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__input::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__group:has([data-slot=search-field-search-icon]) .search-field__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.search-field__group:has([slot=clear]) .search-field__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.search-field__input:focus,.search-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.search-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__search-icon{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);flex-shrink:0}.search-field__clear-button{margin-right:calc(var(--spacing) * 2);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0}.search-field__clear-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.search-field--secondary .search-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--search-field-group-bg);--search-field-group-bg:var(--default);--search-field-group-bg-hover:var(--default-hover);--search-field-group-bg-focus:var(--default)}@media(hover:hover){.search-field--secondary .search-field__group:hover:not(:focus-within),.search-field--secondary .search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--search-field-group-bg-hover)}}.search-field--secondary .search-field__group:focus-within,.search-field--secondary .search-field__group[data-focus-within=true]{background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field--secondary .search-field__group[data-invalid=true]:focus,.search-field--secondary .search-field__group[data-invalid=true]:focus-visible,.search-field--secondary .search-field__group[data-invalid=true][data-focused=true],.search-field--secondary .search-field__group[data-invalid=true][data-focus-visible=true],.search-field--secondary .search-field__group[data-invalid=true]:focus-within,.search-field--secondary .search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field--secondary .search-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group [data-slot=search-field-input]{background-color:#0000}.search-field--full-width,.search-field__group--full-width{width:100%}.textarea{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.textarea::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.textarea{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.textarea{border-width:var(--border-width-field);border-color:var(--field-border);min-height:38px;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *),.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.textarea:hover:not(:focus):not(:focus-visible),.textarea[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.textarea:focus,.textarea[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.textarea[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea[data-invalid=true]:focus,.textarea[data-invalid=true]:focus-visible,.textarea[data-invalid=true][data-focused=true],.textarea[data-invalid=true][data-focus-visible=true],.textarea[data-invalid=true]:focus-within,.textarea[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea[data-invalid=true]{background-color:var(--field-focus)}.textarea:disabled,.textarea[data-disabled=true],.textarea[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textarea--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--textarea-bg);--textarea-bg:var(--default);--textarea-bg-hover:var(--default-hover);--textarea-bg-focus:var(--default)}@media(hover:hover){.textarea--secondary:hover:not(:focus):not(:focus-visible),.textarea--secondary[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--textarea-bg-hover)}}.textarea--secondary:focus,.textarea--secondary[data-focused=true]{background-color:var(--textarea-bg-focus)}.textarea--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea--secondary[data-invalid=true]:focus,.textarea--secondary[data-invalid=true]:focus-visible,.textarea--secondary[data-invalid=true][data-focused=true],.textarea--secondary[data-invalid=true][data-focus-visible=true],.textarea--secondary[data-invalid=true]:focus-within,.textarea--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea--secondary[data-invalid=true]{background-color:var(--textarea-bg-focus)}.textarea--full-width{width:100%}.calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.calendar--week-view .calendar__cell,.calendar--day-view .calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.calendar--day-view .calendar__grid{flex-direction:column;display:flex}.calendar--day-view .calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-header>tr{display:contents}.calendar--day-view .calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-body>tr{display:contents}.calendar--day-view .calendar__grid-body>tr:first-child>td{margin-top:0}.calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .calendar__nav-button{pointer-events:none;opacity:0}.calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 2);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.calendar__nav-button:hover,.calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.calendar__nav-button:active,.calendar__nav-button[data-pressed=true]{transform:scale(.95)}.calendar__nav-button:focus-visible,.calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__nav-button:disabled,.calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar__grid[aria-readonly=true] .calendar__cell{pointer-events:none}.calendar__grid-header,.calendar__grid-header>tr,.calendar__grid-body,.calendar__grid-body>tr{display:contents}.calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.calendar__grid-row{display:contents}.calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.calendar__cell{aspect-ratio:1;border-radius:calc(var(--radius) * 3);text-align:center;width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;will-change:scale;transition:transform .25s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__cell{cursor:var(--cursor-interactive)}.calendar__cell:focus-visible:not(:focus),.calendar__cell[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__cell[data-today=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.calendar__cell[data-today=true]:hover:not([data-selected=true]),.calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true]){background-color:var(--accent-soft-hover)}}.calendar__cell[data-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}.calendar__cell:active,.calendar__cell[data-pressed=true]{background-color:var(--default);transform:scale(.95)}:is(.calendar__cell:active,.calendar__cell[data-pressed=true])[data-selected=true]{background-color:var(--accent-hover)}@media(hover:hover){.calendar__cell:hover:not([data-selected=true]),.calendar__cell[data-hovered=true]:not([data-selected=true]){background-color:var(--default)}}.calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.calendar__cell[data-selected=true][data-outside-month=true]{background-color:var(--default)}.calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__cell:disabled:not([data-outside-month=true]),.calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.calendar__cell-indicator{background-color:var(--accent-foreground)}.range-calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.range-calendar--week-view .range-calendar__cell,.range-calendar--day-view .range-calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.range-calendar--day-view .range-calendar__grid{flex-direction:column;display:flex}.range-calendar--day-view .range-calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-header>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-body>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body>tr:first-child>td{margin-top:0}.range-calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.range-calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .range-calendar__nav-button{pointer-events:none;opacity:0}.range-calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.range-calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.range-calendar__nav-button:hover,.range-calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.range-calendar__nav-button:active,.range-calendar__nav-button[data-pressed=true]{transform:scale(.95)}.range-calendar__nav-button:focus-visible,.range-calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__nav-button:disabled,.range-calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.range-calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar__grid[aria-readonly=true] .range-calendar__cell{pointer-events:none}.range-calendar__grid-header,.range-calendar__grid-header>tr,.range-calendar__grid-body,.range-calendar__grid-body>tr{display:contents}.range-calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.range-calendar__grid-row{display:contents}.range-calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.range-calendar__cell{z-index:1;border-radius:calc(var(--radius) * 3);--tw-outline-style:none;cursor:var(--cursor-interactive);will-change:background-color,border-color;transition:box-shadow .1s var(--ease-out),border-color .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;margin-block:2px;margin-inline:0;padding:0;position:relative}.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell .range-calendar__cell-button{aspect-ratio:1;border-radius:calc(var(--radius) * 3);width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);-webkit-tap-highlight-color:transparent;will-change:scale;transition:scale .2s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]{z-index:2}:is(.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]) .range-calendar__cell-button{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__cell[data-today=true] .range-calendar__cell-button{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){:is(.range-calendar__cell[data-today=true]:hover:not([data-selected=true]),.range-calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--accent-soft-hover)}}.range-calendar__cell[data-selected=true]:not([data-outside-month=true]){background-color:var(--accent-soft);border-radius:0}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*){border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*)[data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*){border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*)[data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){z-index:2}:is(.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true])) .range-calendar__cell-button{background-color:var(--accent);color:var(--accent-foreground)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]){border-top-left-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){border-top-right-radius:calc(var(--radius) * 3);border-bottom-right-radius:calc(var(--radius) * 3)}:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true]) .range-calendar__cell-button{scale:.9}:is(:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-start=true],:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-end=true]) .range-calendar__cell-button{background-color:var(--accent-hover)}@media(hover:hover){:is(.range-calendar__cell:hover:not([data-selected=true]),.range-calendar__cell[data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--default)}}.range-calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:color-mix(in oklab,var(--default) 20%,transparent)}}.range-calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__cell:disabled:not([data-outside-month=true]),.range-calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true]{border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true]{border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.range-calendar__cell-indicator{background-color:var(--accent-foreground)}.calendar:has(.calendar-year-picker__year-grid),.range-calendar:has(.calendar-year-picker__year-grid){position:relative}.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]{will-change:opacity;transition:opacity .15s var(--ease-out),visibility 0s linear}:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]{pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s var(--ease-out),visibility 0s linear .15s}:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger{justify-content:flex-start;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1);--tw-outline-style:none;cursor:var(--cursor-interactive);touch-action:manipulation;outline-style:none;flex:1;display:flex}.calendar-year-picker__trigger:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar-year-picker__trigger-heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition:color .15s var(--ease-out)}.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger-indicator{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--accent-soft-foreground);transition:transform .15s var(--ease-out)}.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-indicator{transform:rotate(90deg)}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-heading{color:var(--accent-soft-foreground)}.calendar-year-picker__year-grid{pointer-events:none;scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);align-content:flex-start;gap:var(--spacing);padding:var(--spacing);opacity:0;will-change:opacity;grid-template-columns:repeat(3,1fr);display:grid;position:absolute;left:0;right:0;overflow-y:auto}.calendar-year-picker__year-grid[data-open=true]{pointer-events:auto;opacity:1;transition:opacity .2s var(--ease-out) 50ms}.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);padding-inline:calc(var(--spacing) * 2.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{cursor:var(--cursor-interactive)}@media(hover:hover)and (pointer:fine){.calendar-year-picker__year-cell:is(:hover,[data-hovered=true]):not([data-selected=true]){background-color:var(--default);color:var(--default-foreground)}}.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}@media(hover:hover)and (pointer:fine){:is(.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-hover)}}.calendar-year-picker__year-cell:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.date-field[data-invalid=true],.date-field[aria-invalid=true]) [data-slot=description]{display:none}.date-field [data-slot=label]{width:fit-content}.date-field--full-width{width:100%}.time-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.time-field[data-invalid=true],.time-field[aria-invalid=true]) [data-slot=description]{display:none}.time-field [data-slot=label]{width:fit-content}.time-field--full-width{width:100%}.date-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.date-input-group:hover:not(:focus-within),.date-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.date-input-group[data-focus-within=true]:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])),.date-input-group:focus-within:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.date-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group[data-invalid=true]:focus,.date-input-group[data-invalid=true]:focus-visible,.date-input-group[data-invalid=true][data-focused=true],.date-input-group[data-invalid=true][data-focus-visible=true],.date-input-group[data-invalid=true]:focus-within,.date-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.date-input-group[data-disabled=true],.date-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-input-group__input{cursor:text;border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;gap:1px;display:flex}@media(min-width:40rem){.date-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.date-input-group:has([data-slot=date-input-group-prefix]) .date-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.date-input-group:has([data-slot=date-input-group-suffix]) .date-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=start]{flex:none;padding-right:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=end]{padding-left:0}.date-input-group__input:focus,.date-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.date-input-group__input-container{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;flex:1;align-items:center;width:fit-content;display:flex;overflow:auto clip}.date-input-group__segment{border-radius:calc(var(--radius) * .75);padding-inline:calc(var(--spacing) * .5);text-align:end;text-wrap:nowrap;--tw-outline-style:none;outline-style:none;display:inline-block}.date-input-group__segment[data-type=literal]{color:var(--muted);padding:0}.date-input-group__segment[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.date-input-group__segment:focus,.date-input-group__segment[data-focused=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.date-input-group__segment[data-disabled=true]{opacity:.5}.date-input-group__segment[data-invalid=true]{color:var(--danger)}.date-input-group__segment[data-invalid=true]:focus,.date-input-group__segment[data-invalid=true][data-focused=true]{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.date-input-group__prefix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group__suffix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--date-input-group-bg);--date-input-group-bg:var(--default);--date-input-group-bg-hover:var(--default-hover);--date-input-group-bg-focus:var(--default)}@media(hover:hover){.date-input-group--secondary:hover:not(:focus-within),.date-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--date-input-group-bg-hover)}}.date-input-group--secondary:focus-within,.date-input-group--secondary[data-focus-within=true]{background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group--secondary[data-invalid=true]:focus,.date-input-group--secondary[data-invalid=true]:focus-visible,.date-input-group--secondary[data-invalid=true][data-focused=true],.date-input-group--secondary[data-invalid=true][data-focus-visible=true],.date-input-group--secondary[data-invalid=true]:focus-within,.date-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary [data-slot=date-input-group-input]{background-color:#0000}.date-input-group--full-width{width:100%}.date-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-picker .date-input-group__suffix,.date-picker .date-input-group__prefix{pointer-events:auto}.date-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__trigger:focus-visible:not(:focus),.date-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-picker__trigger:disabled,.date-picker__trigger[data-disabled=true],.date-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-picker__popover:focus-visible:not(:focus),.date-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-picker__popover[data-exiting=true],.date-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.date-range-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-range-picker .date-input-group__suffix,.date-range-picker .date-input-group__prefix{pointer-events:auto}.date-range-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__trigger:focus-visible:not(:focus),.date-range-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-range-picker__trigger:disabled,.date-range-picker__trigger[data-disabled=true],.date-range-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-range-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-range-picker__range-separator{padding-inline:var(--spacing);color:var(--field-placeholder,var(--muted));-webkit-user-select:none;user-select:none}.date-range-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-range-picker__popover:focus-visible:not(:focus),.date-range-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-range-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-range-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-range-picker__popover[data-exiting=true],.date-range-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.card{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 4);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:column;display:flex;position:relative;overflow:visible}.card__header{flex-direction:column;display:flex}.card__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.card__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);color:var(--muted)}.card__content{gap:var(--spacing);flex-direction:column;flex:1;display:flex}.card__footer{flex-direction:row;align-items:center;display:flex}.card--transparent{--tw-border-style:none;--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000;border-style:none}.card--default{background-color:var(--surface)}.card--secondary{background-color:var(--surface-secondary)}.card--tertiary{background-color:var(--surface-tertiary)}.header{width:100%;padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 1.5);padding-bottom:var(--spacing);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted)}.separator{border-radius:calc(var(--radius) * .5);border-top-style:var(--tw-border-style);border-top-width:0;border-bottom-style:var(--tw-border-style);background-color:var(--separator);border-bottom-width:0;flex-shrink:0;width:100%;height:1px}.separator--horizontal{width:100%;height:1px}.separator--vertical{height:auto;min-height:calc(var(--spacing) * 2);align-self:stretch;width:1px}.separator--default{background-color:var(--separator)}.separator--secondary{background-color:var(--separator-secondary)}.separator--tertiary{background-color:var(--separator-tertiary)}.separator__container{align-items:center;gap:calc(var(--spacing) * 3);display:flex}.separator__container--horizontal{flex-direction:row;width:100%}.separator__container--vertical{flex-direction:column;justify-content:center;height:100%}.separator__line{flex-grow:1;flex-shrink:0}.separator__content{text-align:center;white-space:nowrap;color:var(--muted);justify-content:center;align-items:center;display:inline-flex}.separator__content--horizontal,.separator__content--vertical{text-align:center}.surface{color:var(--foreground);position:relative}.surface--transparent{background-color:#0000}.surface--default{background-color:var(--surface);color:var(--surface-foreground)}.surface--secondary{background-color:var(--surface-secondary);color:var(--surface-secondary-foreground)}.surface--tertiary{background-color:var(--surface-tertiary);color:var(--surface-tertiary-foreground)}.avatar{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);background-color:var(--default);flex-shrink:0;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}.avatar__fallback{background-color:var(--default);width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);justify-content:center;align-items:center;display:flex}.avatar__image{aspect-ratio:1;width:100%;height:100%;transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s;position:absolute;top:0;right:0;bottom:0;left:0}.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *),.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.avatar--sm{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2)}.avatar--lg{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12);border-radius:calc(var(--radius) * 3)}.avatar--lg .avatar__fallback{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.avatar__fallback--accent{color:var(--accent-soft-foreground)}.avatar__fallback--default{color:var(--default-soft-foreground)}.avatar__fallback--success{color:var(--success-soft-foreground)}.avatar__fallback--warning{color:var(--warning-soft-foreground)}.avatar__fallback--danger{color:var(--danger-soft-foreground)}.avatar--soft{background-color:#0000}.avatar--soft .avatar__fallback--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.avatar--soft .avatar__fallback--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.avatar--soft .avatar__fallback--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.avatar--soft .avatar__fallback--default{background-color:var(--default-soft);color:var(--default-soft-foreground)}.avatar--soft .avatar__fallback--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.alert-dialog__trigger:focus-visible:not(:focus),.alert-dialog__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.alert-dialog__trigger:disabled,.alert-dialog__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.alert-dialog__trigger:active,.alert-dialog__trigger[data-pressed=true]{transform:scale(.97)}.alert-dialog__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.alert-dialog__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.alert-dialog__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]{will-change:opacity}:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__backdrop--transparent{background-color:#0000}.alert-dialog__backdrop--opaque{background-color:var(--backdrop)}.alert-dialog__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.alert-dialog__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.alert-dialog__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.alert-dialog__container{pointer-events:none}.alert-dialog__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.alert-dialog__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.alert-dialog__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.alert-dialog__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.alert-dialog__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]{will-change:opacity,transform}:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;min-height:0;max-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative;overflow:clip}.alert-dialog__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.alert-dialog__dialog[data-placement=auto]{margin-block:auto}}.alert-dialog__dialog[data-placement=center]{margin-block:auto}.alert-dialog__dialog[data-placement=bottom]{margin-top:auto}.alert-dialog__dialog[data-placement=top]{margin-top:0}.alert-dialog__dialog--xs{max-width:var(--container-xs)}.alert-dialog__dialog--sm{max-width:var(--container-sm)}.alert-dialog__dialog--md{max-width:var(--container-md)}.alert-dialog__dialog--lg{max-width:var(--container-lg)}.alert-dialog__dialog--cover{width:100%;height:100%;min-height:100%}.alert-dialog__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.alert-dialog__header>.modal__icon{margin-bottom:0}.alert-dialog__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.alert-dialog__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.alert-dialog__icon [data-slot=alert-dialog-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.alert-dialog__icon--default{background-color:var(--default);color:var(--foreground)}.alert-dialog__icon--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.alert-dialog__icon--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.alert-dialog__icon--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.alert-dialog__icon--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.alert-dialog__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.alert-dialog__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.alert-dialog__header+.alert-dialog__body{margin-top:calc(var(--spacing) * 2)}.alert-dialog__header+.alert-dialog__footer,.alert-dialog__body+.alert-dialog__footer{margin-top:calc(var(--spacing) * 5)}.drawer__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.drawer__trigger:focus-visible:not(:focus),.drawer__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.drawer__trigger:disabled,.drawer__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.drawer__trigger:active,.drawer__trigger[data-pressed=true]{transform:scale(.97)}.drawer__backdrop{z-index:50;height:var(--visual-viewport-height);opacity:1;width:100%;transition:opacity .25s cubic-bezier(.32,.72,0,1);position:fixed;top:0;right:0;bottom:0;left:0}.drawer__backdrop[data-entering=true]{opacity:0}.drawer__backdrop[data-exiting=true]{opacity:0;transition-duration:.2s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.drawer__backdrop[data-exiting=true],.drawer__backdrop[data-entering=true]{will-change:opacity}@media(prefers-reduced-motion:reduce){.drawer__backdrop{transition:none}}.drawer__backdrop--transparent{background-color:#0000}.drawer__backdrop--opaque{background-color:var(--backdrop)}.drawer__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.drawer__content{pointer-events:none;z-index:50;height:var(--visual-viewport-height);width:100%;min-width:0;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.drawer__content--bottom{align-items:flex-end}.drawer__content--top{align-items:flex-start}.drawer__content--left{justify-content:flex-start}.drawer__content--right{justify-content:flex-end}.drawer__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;padding:calc(var(--spacing) * 6);pointer-events:auto;--drawer-enter-duration:.25s;--drawer-exit-duration:.2s;--drawer-enter-ease:cubic-bezier(.32, .72, 0, 1);--drawer-exit-ease:cubic-bezier(.32, .72, 0, 1);will-change:translate;transition:translate var(--drawer-enter-duration) var(--drawer-enter-ease);outline-style:none;flex-direction:column;display:flex;position:relative}@media(prefers-reduced-motion:reduce){.drawer__dialog{transition:none}}.drawer__dialog[data-placement=bottom]{border-top-left-radius:min(32px,var(--radius-2xl));border-top-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=top]{border-bottom-left-radius:min(32px,var(--radius-2xl));border-bottom-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=left]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=left]{width:calc(var(--spacing) * 96)}}.drawer__dialog[data-placement=right]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=right]{width:calc(var(--spacing) * 96)}}[data-exiting=true] .drawer__dialog{transition-duration:var(--drawer-exit-duration);transition-timing-function:var(--drawer-exit-ease)}.drawer__content--left .drawer__dialog,.drawer__content--right .drawer__dialog,.drawer__content--top .drawer__dialog,.drawer__content--bottom .drawer__dialog{translate:0}.drawer__content--left[data-entering=true] .drawer__dialog,.drawer__content--left[data-exiting=true] .drawer__dialog{translate:-100%}.drawer__content--right[data-entering=true] .drawer__dialog,.drawer__content--right[data-exiting=true] .drawer__dialog{translate:100%}.drawer__content--top[data-entering=true] .drawer__dialog,.drawer__content--top[data-exiting=true] .drawer__dialog{translate:0 -100%}.drawer__content--bottom[data-entering=true] .drawer__dialog,.drawer__content--bottom[data-exiting=true] .drawer__dialog{translate:0 100%}.drawer__dialog--top{padding-bottom:calc(var(--spacing) * 2)}.drawer__dialog--top .drawer__handle{padding-bottom:0}.drawer__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.drawer__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.drawer__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.drawer__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.drawer__handle{padding-bottom:calc(var(--spacing) * 2);justify-content:center;align-items:center;display:flex}.drawer__handle>[data-slot=drawer-handle-bar]{height:var(--spacing);width:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * .25);background-color:var(--separator)}.drawer__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.drawer__header+.drawer__body{margin-top:calc(var(--spacing) * 2)}.drawer__header+.drawer__footer,.drawer__body+.drawer__footer{margin-top:calc(var(--spacing) * 5)}.drawer__handle+.drawer__header,.drawer__handle+.drawer__body{margin-top:0}.modal__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.modal__trigger:focus-visible:not(:focus),.modal__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.modal__trigger:disabled,.modal__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.modal__trigger:active,.modal__trigger[data-pressed=true]{transform:scale(.97)}.modal__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.modal__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.modal__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]{will-change:opacity}:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__backdrop--transparent{background-color:#0000}.modal__backdrop--opaque{background-color:var(--backdrop)}.modal__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.modal__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.modal__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.modal__container{pointer-events:none}.modal__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.modal__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.modal__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.modal__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.modal__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-exiting=true],.modal__container[data-entering=true]{will-change:opacity,transform}:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__container--scroll-outside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);pointer-events:auto;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__container--full{padding:0}@media(min-width:40rem){.modal__container--full{padding:0}}.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% ;--tw-enter-scale:1}@media(min-width:40rem){.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% }}.modal__container--full[data-exiting=true]{--tw-exit-scale:1}.modal__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative}.modal__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.modal__dialog[data-placement=auto]{margin-block:auto}}.modal__dialog[data-placement=center]{margin-block:auto}.modal__dialog[data-placement=bottom]{margin-top:auto}.modal__dialog[data-placement=top]{margin-top:0}.modal__dialog--scroll-inside{min-height:0;max-height:100%;overflow:clip}.modal__dialog--scroll-outside{flex-shrink:0;height:auto;min-height:0}.modal__dialog--xs{max-width:var(--container-xs)}.modal__dialog--sm{max-width:var(--container-sm)}.modal__dialog--md{max-width:var(--container-md)}.modal__dialog--lg{max-width:var(--container-lg)}.modal__dialog--cover{width:100%;height:100%;min-height:100%}.modal__dialog--full{--tw-shadow:0 0 #0000;width:100%;height:100%;min-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:0}.modal__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.modal__header>.modal__icon{margin-bottom:0}.modal__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.modal__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.modal__body{min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow:visible}.modal__body--scroll-inside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__body--scroll-outside{overflow-y:visible}.modal__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.modal__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.modal__header+.modal__body{margin-top:calc(var(--spacing) * 2)}.modal__header+.modal__footer,.modal__body+.modal__footer{margin-top:calc(var(--spacing) * 5)}.popover{transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0}.popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.popover[data-exiting=true],.popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.popover__dialog{padding:calc(var(--spacing) * 4);--tw-outline-style:none;outline-style:none}.popover__heading{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.popover__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.popover__trigger{cursor:var(--cursor-interactive)}.popover__trigger:focus-visible:not(:focus),.popover__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.popover__trigger:disabled,.popover__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tooltip{max-width:var(--container-xs);transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);padding:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));word-break:break-all;border-radius:min(32px,var(--radius-xl));box-shadow:var(--shadow-overlay)}.tooltip[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.tooltip[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.tooltip[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.tooltip[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.tooltip[data-exiting=true],.tooltip[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.tooltip [data-slot=overlay-arrow]{stroke:var(--border)}@supports (color:color-mix(in lab,red,red)){.tooltip [data-slot=overlay-arrow]{stroke:color-mix(in oklab,var(--border) 40%,transparent)}}.tooltip [data-slot=overlay-arrow]{fill:var(--overlay)}.tooltip[data-placement=bottom] [data-slot=overlay-arrow]{rotate:180deg}.tooltip[data-placement=left] [data-slot=overlay-arrow]{rotate:-90deg}.tooltip[data-placement=right] [data-slot=overlay-arrow]{rotate:90deg}.tooltip__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tooltip__trigger:focus-visible:not(:focus),.tooltip__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.combo-box{gap:var(--spacing);flex-direction:column;display:flex}:is(.combo-box[data-invalid=true],.combo-box[aria-invalid=true]) [data-slot=description]{display:none}.combo-box [data-slot=label]{width:fit-content}.combo-box [data-slot=input]{flex:1;min-width:0}.combo-box [data-slot=input]:has(+.combo-box__trigger){padding-inline-end:calc(var(--spacing) * 7)}.combo-box [data-slot=input]:focus,.combo-box [data-slot=input][data-focus]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.combo-box [data-slot=input]:disabled,.combo-box [data-slot=input][data-disabled],.combo-box [data-slot=input][aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.combo-box__input-group{isolation:isolate;align-items:center;display:inline-flex;position:relative}.combo-box__trigger{--tw-translate-y: -50% ;height:100%;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:pointer;color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;-webkit-tap-highlight-color:transparent;--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-color:#0000;border-style:none;outline-style:none;flex-shrink:0;justify-content:center;align-items:center;padding-inline-end:calc(var(--spacing) * 2);transition-duration:.15s;display:flex;position:absolute;top:50%}@media(hover:hover){.combo-box__trigger:hover,.combo-box__trigger[data-hovered=true]{color:var(--field-foreground,var(--foreground))}}.combo-box__trigger:focus-visible:not(:focus),.combo-box__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-radius:.25rem;outline-style:none}.combo-box__trigger[data-pressed=true]{opacity:.7}.combo-box__trigger:disabled,.combo-box__trigger[data-disabled],.combo-box__trigger[aria-disabled=true]{cursor:not-allowed;opacity:.5}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;transition-duration:.15s}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.combo-box__trigger[data-open=true] [data-slot=combo-box-trigger-default-icon]{rotate:180deg}.combo-box__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.combo-box__popover:focus-visible:not(:focus),.combo-box__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.combo-box__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.combo-box__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.combo-box__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.combo-box__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.combo-box__popover[data-exiting=true],.combo-box__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.combo-box__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.combo-box__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.combo-box__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.combo-box__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.combo-box__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.combo-box__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.combo-box__popover [data-slot=list-box-item] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.combo-box--full-width,.combo-box__input-group--full-width{width:100%}.select{gap:var(--spacing);flex-direction:column;display:flex}:is(.select[data-invalid=true],.select[aria-invalid=true]) [data-slot=description]{display:none}.select [data-slot=label]{width:fit-content}.select__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.select__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.select__trigger:has(.select__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.select__trigger:hover,.select__trigger[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.select__trigger:focus-visible:not(:focus),.select__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-visible,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focused=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-visible=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-within,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{background-color:var(--field-focus)}.select__trigger:disabled,.select__trigger[data-disabled=true],.select__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.select--secondary .select__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--select-trigger-bg);--select-trigger-bg:var(--default);--select-trigger-bg-hover:var(--default-hover);--select-trigger-bg-focus:var(--default)}@media(hover:hover){.select--secondary .select__trigger:hover,.select--secondary .select__trigger[data-hovered=true]{background-color:var(--select-trigger-bg-hover)}}.select--secondary .select__trigger:focus-visible:not(:focus),.select--secondary .select__trigger[data-focus-visible=true],.select[data-invalid=true] :is(.select--secondary .select__trigger),.select[aria-invalid=true] :is(.select--secondary .select__trigger){background-color:var(--select-trigger-bg-focus)}.select__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.select__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.select__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.select__value [data-slot=list-box-item-indicator]{display:none}.select__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.select__indicator[data-open=true]{rotate:180deg}.select__indicator[data-slot=select-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.select__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.select__popover:focus-visible:not(:focus),.select__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.select__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.select__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.select__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.select__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.select__popover[data-exiting=true],.select__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.select__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.select__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.select__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.select__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.select__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.select__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.select--full-width,.select__trigger--full-width{width:100%}.autocomplete{gap:var(--spacing);flex-direction:column;display:flex}.autocomplete__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.autocomplete__trigger:has(.autocomplete__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.autocomplete__trigger:focus-visible:not(:focus),.autocomplete__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-visible,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focused=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-visible=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-within,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{background-color:var(--field-focus)}.autocomplete__trigger:disabled,.autocomplete__trigger[data-disabled=true],.autocomplete__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.autocomplete--secondary .autocomplete__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--autocomplete-trigger-bg);--autocomplete-trigger-bg:var(--default);--autocomplete-trigger-bg-hover:var(--default-hover);--autocomplete-trigger-bg-focus:var(--default)}@media(hover:hover){.autocomplete--secondary .autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete--secondary .autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--autocomplete-trigger-bg-hover)}}.autocomplete--secondary .autocomplete__trigger:focus-visible:not(:focus),.autocomplete--secondary .autocomplete__trigger[data-focus-visible=true],.autocomplete[data-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger),.autocomplete[aria-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger){background-color:var(--autocomplete-trigger-bg-focus)}.autocomplete__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.autocomplete__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.autocomplete__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.autocomplete__value [data-slot=list-box-item-indicator]{display:none}.autocomplete__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;cursor:var(--cursor-interactive);flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.autocomplete__indicator[data-open=true]{rotate:180deg}.autocomplete__indicator[data-slot=autocomplete-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.autocomplete__popover{width:var(--trigger-width);max-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);overscroll-behavior:contain;background-color:var(--overlay);padding:0;padding-top:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);overflow:hidden}.autocomplete__popover:focus-visible:not(:focus),.autocomplete__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.32, .72, 0, 1);--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.25s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.autocomplete__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.autocomplete__popover[data-exiting=true],.autocomplete__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.autocomplete__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.autocomplete__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.autocomplete__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.autocomplete__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.autocomplete__popover [data-slot=list-box]{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);max-height:320px;padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none;overflow-y:auto}.autocomplete__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.autocomplete__popover [data-slot=search-field]{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);--tw-outline-style:none;outline-style:none}.autocomplete__popover [data-slot=empty-state]{text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--overlay-foreground)}@supports (color:color-mix(in lab,red,red)){.autocomplete__popover [data-slot=empty-state]{color:color-mix(in oklab,var(--overlay-foreground) 60%,transparent)}}.autocomplete__popover-dialog,.autocomplete__popover-dialog:focus,.autocomplete__popover-dialog:focus-visible,.autocomplete__popover-dialog[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete--full-width,.autocomplete__trigger--full-width{width:100%}.autocomplete__clear-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);color:var(--muted);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);cursor:var(--cursor-interactive);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);background-color:#0000;flex-shrink:0;justify-content:center;align-self:center;align-items:center;margin-inline-end:0;display:inline-flex;position:relative}.autocomplete__clear-button:not([data-empty=true]){transition:opacity .15s var(--ease-smooth)}.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__clear-button[data-empty=true]{pointer-events:none;opacity:0}.autocomplete__clear-button [data-slot=autocomplete-clear-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(hover:hover){.autocomplete__clear-button:hover,.autocomplete__clear-button[data-hovered=true]{background-color:var(--default-hover)}}.autocomplete__clear-button:active,.autocomplete__clear-button[data-pressed=true]{transform:scale(.93)}.kbd{height:calc(var(--spacing) * 6);align-items:center;display:inline-flex}:where(.kbd>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * .5) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-x-reverse)))}.kbd{border-radius:calc(var(--radius) * 1);background-color:var(--default);padding-inline:calc(var(--spacing) * 2);text-align:center;font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;color:var(--muted)}:where(.kbd:where(:dir(rtl),[dir=rtl],[dir=rtl] *)>:not(:last-child)){--tw-space-x-reverse:1}.kbd{word-spacing:-.25rem}.kbd__abbr{justify-content:center;align-items:center;width:100%;height:100%;text-decoration:none;display:flex}.kbd__content{justify-content:center;align-items:center;display:flex}.kbd--light{background-color:#0000}.typography,.typography-prose{color:var(--foreground)}.typography-prose h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose p{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography-prose a{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--link);text-underline-offset:4px;text-decoration-line:underline}.typography-prose blockquote{margin-top:calc(var(--spacing) * 4);border-left-style:var(--tw-border-style);border-left-width:4px;border-color:var(--border);padding-left:calc(var(--spacing) * 4);color:var(--muted);font-style:italic}.typography-prose ul{margin-block:calc(var(--spacing) * 4);list-style-type:disc}:where(.typography-prose ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ul{padding-left:calc(var(--spacing) * 6)}.typography-prose ol{margin-block:calc(var(--spacing) * 4);list-style-type:decimal}:where(.typography-prose ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ol{padding-left:calc(var(--spacing) * 6)}.typography-prose li{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose hr{margin-block:calc(var(--spacing) * 8);border-color:var(--separator)}.typography-prose pre{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);background-color:var(--default);padding:calc(var(--spacing) * 4);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);overflow-x:auto}.typography-prose strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--foreground)}.typography-prose em{font-style:italic}.typography-prose img{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5)}.typography--h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--body{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography--body-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.typography--body-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.typography--code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography--align-start{text-align:left}.typography--align-start:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:right}.typography--align-center{text-align:center}.typography--align-end{text-align:right}.typography--align-end:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:left}.typography--align-justify{text-align:justify}.typography--color-default{color:var(--foreground)}.typography--color-muted{color:var(--muted)}.typography--truncate{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.typography--weight-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.typography--weight-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.typography--weight-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.typography--weight-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.scroll-shadow{--scroll-shadow-size:40px;--scroll-shadow-scrollbar-size:10px;position:relative}.scroll-shadow--vertical{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-y:auto}.scroll-shadow--horizontal{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-x:auto}.scroll-shadow--fade.scroll-shadow--vertical:where([data-top-scroll=true],[data-bottom-scroll=true],[data-top-bottom-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,100% 0;mask-repeat:no-repeat;mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%;-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,100% 0;-webkit-mask-repeat:no-repeat;-webkit-mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%}.scroll-shadow--fade.scroll-shadow--vertical[data-top-scroll=true]{--scroll-linear-gradient:0deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-bottom-scroll=true]{--scroll-linear-gradient:180deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-top-bottom-scroll=true]{--scroll-linear-gradient:#000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal:where([data-left-scroll=true],[data-right-scroll=true],[data-left-right-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,0 100%;mask-repeat:no-repeat;mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,0 100%;-webkit-mask-repeat:no-repeat;-webkit-mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size)}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-scroll=true]{--scroll-linear-gradient:270deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-right-scroll=true]{--scroll-linear-gradient:90deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-right-scroll=true]{--scroll-linear-gradient:to right, #000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--hide-scrollbar{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;--scroll-shadow-scrollbar-size:0px}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{inset-inline:0}.inset-y-0{inset-block:0}.top-0{top:0}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.-right-3{right:calc(var(--spacing) * -3)}.right-0{right:0}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:0}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-0{left:0}.left-1\/2{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[1\]{z-index:1}.z-\[2\]{z-index:2}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing) * -1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:var(--spacing)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-12{height:calc(var(--spacing) * 12)}.h-48{height:calc(var(--spacing) * 48)}.h-\[90px\]{height:90px}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:0}.min-h-full{min-height:100%}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-16{width:calc(var(--spacing) * 16)}.w-28{width:calc(var(--spacing) * 28)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-\[17rem\]{width:17rem}.w-\[calc\(100\%-2rem\)\]{width:calc(100% - 2rem)}.w-\[n\%\]{width:n%}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-44{max-width:calc(var(--spacing) * 44)}.max-w-\[1800px\]{max-width:1800px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-\[140px\]{min-width:140px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing) * 5);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-ew-resize{cursor:ew-resize}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y:pan-y;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--otari-line\)\]>:not(:last-child)){border-color:var(--otari-line)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:calc(var(--radius) * 1)}.rounded-md{border-radius:calc(var(--radius) * .75)}.rounded-xl{border-radius:calc(var(--radius) * 1.5)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-\[\#c2843a\]{border-color:#c2843a}.border-\[var\(--otari-brand\)\]{border-color:var(--otari-brand)}.border-\[var\(--otari-line\)\]{border-color:var(--otari-line)}.border-amber-200{border-color:var(--color-amber-200)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-red-500{border-left-color:var(--color-red-500)}.bg-\[var\(--otari-bg\)\]{background-color:var(--otari-bg)}.bg-\[var\(--otari-brand\)\],.bg-\[var\(--otari-brand\)\]\/10{background-color:var(--otari-brand)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--otari-brand\)\]\/10{background-color:color-mix(in oklab,var(--otari-brand) 10%,transparent)}}.bg-\[var\(--otari-brand-tint\)\]{background-color:var(--otari-brand-tint)}.bg-\[var\(--otari-line\)\]{background-color:var(--otari-line)}.bg-\[var\(--otari-surface\)\]{background-color:var(--otari-surface)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-500{background-color:var(--color-green-500)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1{padding-bottom:var(--spacing)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#b45309\]{color:#b45309}.text-\[var\(--otari-brand-dark\)\]{color:var(--otari-brand-dark)}.text-\[var\(--otari-ink\)\]{color:var(--otari-ink)}.text-\[var\(--otari-muted\)\]{color:var(--otari-muted)}.text-amber-400{color:var(--color-amber-400)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-emerald-700{color:var(--color-emerald-700)}.text-green-700{color:var(--color-green-700)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.accent-\[var\(--otari-brand\)\]{accent-color:var(--otari-brand)}.opacity-0{opacity:0}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.running{animation-play-state:running}.zoom-out{--tw-exit-scale:0}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-focus-visible\:ring-2:is(:where(.group):focus-visible *){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-focus-visible\:ring-\[var\(--otari-brand\)\]:is(:where(.group):focus-visible *){--tw-ring-color:var(--otari-brand)}.group-data-\[focus-visible\]\:outline-2:is(:where(.group)[data-focus-visible] *){outline-style:var(--tw-outline-style);outline-width:2px}.group-data-\[focus-visible\]\:outline-\[var\(--otari-brand\)\]:is(:where(.group)[data-focus-visible] *){outline-color:var(--otari-brand)}@media(hover:hover){.hover\:border-\[var\(--otari-brand\)\]:hover{border-color:var(--otari-brand)}.hover\:bg-\[var\(--otari-bg\)\]:hover{background-color:var(--otari-bg)}.hover\:bg-\[var\(--otari-brand\)\]:hover,.hover\:bg-\[var\(--otari-brand\)\]\/20:hover{background-color:var(--otari-brand)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--otari-brand\)\]\/20:hover{background-color:color-mix(in oklab,var(--otari-brand) 20%,transparent)}}.hover\:bg-\[var\(--otari-line\)\]:hover{background-color:var(--otari-line)}.hover\:text-\[var\(--otari-brand\)\]:hover{color:var(--otari-brand)}.hover\:text-\[var\(--otari-brand-dark\)\]:hover{color:var(--otari-brand-dark)}.hover\:text-\[var\(--otari-ink\)\]:hover{color:var(--otari-ink)}.hover\:text-amber-950:hover{color:var(--color-amber-950)}.hover\:text-red-700:hover{color:var(--color-red-700)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:not-sr-only:focus{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.focus\:absolute:focus{position:absolute}.focus\:top-3:focus{top:calc(var(--spacing) * 3)}.focus\:left-3:focus{left:calc(var(--spacing) * 3)}.focus\:z-50:focus{z-index:50}.focus\:rounded-lg:focus{border-radius:calc(var(--radius) * 1)}.focus\:border:focus{border-style:var(--tw-border-style);border-width:1px}.focus\:border-\[var\(--otari-brand\)\]:focus{border-color:var(--otari-brand)}.focus\:bg-\[var\(--otari-surface\)\]:focus{background-color:var(--otari-surface)}.focus\:px-4:focus{padding-inline:calc(var(--spacing) * 4)}.focus\:py-2:focus{padding-block:calc(var(--spacing) * 2)}.focus\:text-sm:focus{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.focus\:font-medium:focus{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.focus\:text-\[var\(--otari-brand-dark\)\]:focus{color:var(--otari-brand-dark)}.focus\:shadow-md:focus{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:bg-\[var\(--otari-brand\)\]:focus-visible{background-color:var(--otari-brand)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[var\(--otari-brand\)\]:focus-visible{--tw-ring-color:var(--otari-brand)}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-start-1{grid-column-start:1}.sm\:col-start-2{grid-column-start:2}.sm\:col-start-3{grid-column-start:3}.sm\:inline{display:inline}.sm\:w-28{width:calc(var(--spacing) * 28)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[minmax\(0\,1fr\)_16rem_10rem\]{grid-template-columns:minmax(0,1fr) 16rem 10rem}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-self-end{justify-self:flex-end}.sm\:justify-self-start{justify-self:flex-start}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}@media(min-width:48rem){.md\:flex{display:flex}.md\:hidden{display:none}.md\:px-6{padding-inline:calc(var(--spacing) * 6)}.md\:py-6{padding-block:calc(var(--spacing) * 6)}}@media(min-width:64rem){.lg\:sticky{position:sticky}.lg\:top-4{top:calc(var(--spacing) * 4)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_360px\]{grid-template-columns:minmax(0,1fr) 360px}.lg\:items-start{align-items:flex-start}}@media(min-width:80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--otari-brand:#4e8295;--otari-brand-dark:#3c6678;--otari-brand-soft:#a8c4ce;--otari-brand-tint:#eaf1f3;--otari-ink:#14242c;--otari-muted:#5b6b73;--otari-line:#dbe5e8;--otari-surface:#fff;--otari-bg:#f6f9fa;--otari-code-ink:#e8eef0}.otari-table.table-root{background-color:var(--otari-surface);border:1px solid var(--otari-line);border-radius:.75rem;padding:0;overflow:hidden}.otari-table .table__header{background-color:var(--otari-brand-tint);border-bottom:1px solid var(--otari-line)}.otari-table .table__column,.otari-table [role=row]>[role=presentation]:first-of-type>.table__column,.otari-table [role=row]>[role=presentation]:last-of-type>.table__column{color:var(--otari-ink);background-color:#0000;border-radius:0;font-weight:600}.otari-table .table__column:after{content:none}.otari-table .table__row .table__cell{border-color:var(--otari-line)}.otari-table .table__row:hover .table__cell{background-color:var(--otari-bg)}.otari-table .otari-detail-row>td{border-bottom:1px solid var(--otari-line);background-color:var(--otari-bg);padding:0}.otari-table .otari-detail-opening .table__cell{background-color:var(--otari-brand-tint)}.otari-detail-reveal{grid-template-rows:0fr;animation:.18s ease-out forwards otari-detail-open;display:grid}.otari-detail-reveal>div{overflow:hidden}@keyframes otari-detail-open{0%{opacity:.5;grid-template-rows:0fr}to{opacity:1;grid-template-rows:1fr}}.otari-bulk-bar{animation:.16s ease-out otari-bulk-bar-in}@keyframes otari-bulk-bar-in{0%{opacity:0;transform:translate(-50%,.5rem)}to{opacity:1;transform:translate(-50%)}}@media(prefers-reduced-motion:reduce){.otari-detail-reveal{grid-template-rows:1fr;animation:none}.otari-bulk-bar{animation:none}}.otari-markdown{color:var(--otari-ink);font-size:.875rem;line-height:1.65}.otari-markdown>:first-child{margin-top:0}.otari-markdown h1,.otari-markdown h2,.otari-markdown h3,.otari-markdown h4{color:var(--otari-ink);font-weight:600;line-height:1.3}.otari-markdown h1{margin:2rem 0 .75rem;font-size:1.5rem}.otari-markdown h2{border-bottom:1px solid var(--otari-line);margin:2rem 0 .5rem;padding-bottom:.3rem;font-size:1.25rem}.otari-markdown h3{margin:1.5rem 0 .5rem;font-size:1.05rem}.otari-markdown h4{margin:1.25rem 0 .25rem;font-size:.95rem}.otari-markdown p{margin:.75rem 0}.otari-markdown a{color:var(--otari-brand-dark);text-underline-offset:2px;text-decoration:underline}.otari-markdown a:hover{text-decoration-thickness:2px}.otari-markdown ul,.otari-markdown ol{margin:.75rem 0;padding-left:1.5rem}.otari-markdown ul{list-style:outside}.otari-markdown ol{list-style:decimal}.otari-markdown li,.otari-markdown li>ul,.otari-markdown li>ol{margin:.25rem 0}.otari-markdown code{background-color:var(--otari-brand-tint);color:var(--otari-brand-dark);border-radius:.35rem;padding:.1rem .35rem;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,monospace;font-size:.85em}.otari-markdown pre{background-color:var(--otari-ink);border-radius:.6rem;margin:1rem 0;padding:.85rem 1rem;overflow-x:auto}.otari-markdown pre code{color:var(--otari-code-ink);background-color:#0000;border-radius:0;padding:0;font-size:.82rem;line-height:1.55}.otari-markdown blockquote{border-left:3px solid var(--otari-brand);color:var(--otari-muted);margin:1rem 0;padding:.25rem 0 .25rem 1rem}.otari-markdown hr{border:0;border-top:1px solid var(--otari-line);margin:1.5rem 0}.otari-markdown-scroll{max-width:100%;margin:1rem 0;overflow-x:auto}.otari-markdown table{border-collapse:collapse;font-size:.85rem}.otari-markdown th,.otari-markdown td{border:1px solid var(--otari-line);text-align:left;vertical-align:top;padding:.4rem .7rem}.otari-markdown th{background-color:var(--otari-brand-tint);color:var(--otari-ink);font-weight:600}.otari-markdown tbody tr:hover td,.otari-markdown tr:hover td{background-color:var(--otari-bg)}html,body,#root{height:100%}body{background-color:var(--otari-bg);color:var(--otari-ink);margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}@keyframes caret-blink{0%,70%,to{opacity:1}20%,50%{opacity:0}}@keyframes skeleton{to{transform:translate(200%)}} diff --git a/src/gateway/static/dashboard/assets/index-Bi2hajrg.js b/src/gateway/static/dashboard/assets/index-MlRogoGm.js similarity index 96% rename from src/gateway/static/dashboard/assets/index-Bi2hajrg.js rename to src/gateway/static/dashboard/assets/index-MlRogoGm.js index e491f16fc..a0593a392 100644 --- a/src/gateway/static/dashboard/assets/index-Bi2hajrg.js +++ b/src/gateway/static/dashboard/assets/index-MlRogoGm.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-C5gSmqNJ.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/FilterChips-Dqy1SR3R.js","assets/heroui-BI50yK5B.js","assets/recharts-C4kRDmvS.js","assets/tableSelection-9hV37uhu.js","assets/ConfirmDialog-ChuHp-Qm.js","assets/DataTable-Bmn_eYSV.js","assets/TablePagination-8CBn4us4.js","assets/AliasesPage-D7ZKXX3I.js","assets/Field-Dwp6u3t8.js","assets/UserComboBox-a9wxf8eF.js","assets/BudgetsPage-DanpEezo.js","assets/DocsPage-DkHyFdGF.js","assets/KeysPage-D4g9XrFY.js","assets/ModelScopeControl-DNcVzk1f.js","assets/ModelsPage-r0TNjwml.js","assets/OverviewPage-WmIAewmo.js","assets/charts-DIsd9m--.js","assets/ProvidersPage-BRQCYCYu.js","assets/SettingsPage-DjaTcy-f.js","assets/ToolsGuardrailsPage-B4MIR_ke.js","assets/UsagePage-CGU7s9AT.js","assets/UsersPage-CUF9BhT-.js"])))=>i.map(i=>d[i]); -var Ie=Object.defineProperty;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>qe(e,typeof t!="symbol"?t+"":t,r);import{u as g,j as n,a as p,b as x,k as ne,Q as Re,c as Oe}from"./tanstack-query-1t81HyiD.js";import{d as Me,r as o,N as Z,L as Fe,O as Ue,H as Ke,e as Be,f as j,h as $e}from"./react-dgEcD0HR.js";import{B as C,C as U,L as xe,I as ye,a as ze,b as Qe,d as I,S as Ve,c as T,T as We,e as He}from"./heroui-BI50yK5B.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ge=Me();const Je="modulepreload",Ye=function(e){return"/"+e},ue={},P=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let u=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(r.map(y=>{if(y=Ye(y),y in ue)return;ue[y]=!0;const h=y.endsWith(".css"),b=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Je,h||(m.as="script"),m.crossOrigin="",m.href=y,f&&m.setAttribute("nonce",f),document.head.appendChild(m),h)return new Promise((N,M)=>{m.addEventListener("load",N),m.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};class L extends Error{constructor(r,s){super(s);ce(this,"status");this.name="ApiError",this.status=r}}let K=null;function de(e){K=e}async function ee(e){try{const t=await e.json();if(typeof t.detail=="string")return t.detail;if(t.detail!=null)return JSON.stringify(t.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Xe(e){let t;try{t=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(t.status===401||t.status===403)return!1;if(!t.ok)throw new L(t.status,await ee(t));return!0}async function Ze(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function c(e,t={}){const r=new Headers(t.headers);r.set("Accept","application/json"),t.body!=null&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let s;try{s=await fetch(e,{...t,headers:r})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(s.status===401||s.status===403)throw K==null||K(),new L(s.status,await ee(s));if(!s.ok)throw new L(s.status,await ee(s));if(s.status!==204)return await s.json()}const te="otari.dashboard.hasSession",ve=o.createContext(null);function et(){try{return window.localStorage.getItem(te)==="1"}catch{return!1}}function tt({children:e}){const t=g(),[r,s]=o.useState(et),a=o.useCallback(()=>{Ze(),s(!1),t.clear();try{window.localStorage.removeItem(te)}catch{}},[t]),i=o.useCallback(()=>{t.clear(),s(!0);try{window.localStorage.setItem(te,"1")}catch{}},[t]);o.useEffect(()=>(de(a),()=>de(null)),[a]);const u=o.useMemo(()=>({isAuthenticated:r,login:i,logout:a}),[r,i,a]);return n.jsx(ve.Provider,{value:u,children:e})}function re(){const e=o.useContext(ve);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function nt(e){return e instanceof L&&e.status===0}function rt(){const e=g(),[t,r]=o.useState(!1);return o.useEffect(()=>{const s=e.getQueryCache(),a=()=>s.getAll().some(i=>i.state.status==="error"&&nt(i.state.error));return r(a()),s.subscribe(()=>r(a()))},[e]),t}function st(){return rt()?n.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const $=3600,_=86400,at=365*_,dn=[{key:"1h",label:"Last hour",seconds:$,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"90d",label:"90d",seconds:90*_,bucket:"day"},{key:"12mo",label:"12mo",seconds:at,bucket:"day"}],mn="30d",fn=[{key:"1h",label:"1h",seconds:$,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"all",label:"All",seconds:null,bucket:"day"}],hn="24h",xn="custom";function yn(e,t){return e.find(r=>r.key===t)}function it(e,t=Date.now()){return new Date(t-e*1e3).toISOString()}function ot(e){return(e==="hour"?$:_)*1e3}function vn(e,t,r=Date.now()){const s=new Date(e).getTime();return(t?new Date(t).getTime():r)-s<=_*1e3?"hour":"day"}function gn(e,t,r,s){if(e.length===0)return null;const a=Math.max(0,Math.min(t,r)),i=Math.min(e.length-1,Math.max(t,r)),u=new Date(e[a]).getTime(),d=new Date(e[i]).getTime()+ot(s);return{startIso:new Date(u).toISOString(),endIso:new Date(d).toISOString()}}function pn(e,t,r){const s=e.length;if(s===0)return{startIndex:0,endIndex:0};const a=e.map(d=>new Date(d).getTime());let i=0;if(t){const d=new Date(t).getTime();for(let f=0;fc("/v1/models"),staleTime:6e4})}function dt(){return p({queryKey:[ct],queryFn:()=>c("/dashboard-build.json"),refetchInterval:ut,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function jn(){return p({queryKey:[ae],queryFn:()=>c("/v1/models/discoverable"),staleTime:5*6e4})}function Sn(){return p({queryKey:[ie],queryFn:()=>c("/v1/providers"),staleTime:5*6e4})}function kn(){return p({queryKey:["provider-catalog"],queryFn:()=>c("/v1/providers/catalog"),staleTime:1/0})}function En(e){return p({queryKey:["provider-catalog",e],queryFn:()=>c(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Pn(){return p({queryKey:[oe],queryFn:()=>c("/v1/providers/health"),staleTime:me,refetchInterval:me})}function Nn(){const e=g();return x({mutationFn:()=>c("/v1/providers/health?refresh=true"),onSuccess:t=>e.setQueryData([oe],t)})}function Cn(){return p({queryKey:[be],queryFn:()=>c("/v1/provider-credentials"),staleTime:6e4})}function Q(e){e.invalidateQueries({queryKey:[be]}),e.invalidateQueries({queryKey:[ie]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]}),e.invalidateQueries({queryKey:[oe]})}function Tn(){const e=g();return x({mutationFn:t=>c("/v1/provider-credentials",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>Q(e)})}function _n(){const e=g();return x({mutationFn:({instance:t,body:r})=>c(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>Q(e)})}function Ln(){const e=g();return x({mutationFn:t=>c(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>Q(e)})}function Dn(){const e=g();return x({mutationFn:()=>c("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>Q(e)})}function An(){return x({mutationFn:e=>c(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function In(){return x({mutationFn:e=>c("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function qn(){return p({queryKey:[lt],queryFn:()=>c("/v1/models/metadata"),staleTime:10*6e4})}function Rn(){return p({queryKey:[se],queryFn:()=>c("/v1/aliases"),staleTime:6e4})}function On(){const e=g();return x({mutationFn:t=>c("/v1/aliases",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function Mn(){const e=g();return x({mutationFn:({name:t,userId:r})=>{const s=r==null?"":`?user_id=${encodeURIComponent(r)}`;return c(`/v1/aliases/${encodeURIComponent(t)}${s}`,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function mt(){return p({queryKey:[ge],queryFn:()=>c("/v1/settings"),staleTime:6e4})}function ft(){const e=g();return x({mutationFn:t=>c("/v1/settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([ge],t),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]})}})}function Fn(){return x({mutationFn:()=>c("/v1/settings/master-key/rotate",{method:"POST"})})}function Un(){return p({queryKey:[pe],queryFn:()=>c("/v1/tool-settings"),staleTime:6e4})}function Kn(){const e=g();return x({mutationFn:t=>c("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([pe],t)}})}function Bn(){return x({mutationFn:({service:e,url:t})=>c(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:t})})})}const H=1e3,ht=100;async function xt(){const e=[];for(let t=0;tc("/v1/pricing",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]})}})}function Qn(){const e=g();return x({mutationFn:t=>c(`/v1/pricing/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]})}})}function Vn(){return x({mutationFn:()=>c("/v1/pricing/refresh",{method:"POST"})})}function Wn(){const e=g();return x({mutationFn:()=>c("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ie]})}})}function Hn(){return x({mutationFn:()=>c("/v1/pricing/refresh/reject",{method:"POST"})})}const G=1e3,yt=100;async function vt(){const e=[];for(let t=0;tc("/v1/keys",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Yn(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/keys/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Xn(){const e=g();return x({mutationFn:t=>c(`/v1/keys/${encodeURIComponent(t)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Zn(){const e=g();return x({mutationFn:t=>c(`/v1/keys/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}const J=1e3,gt=100;async function pt(){const e=[];for(let t=0;tc(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function nr(){const e=g();return x({mutationFn:t=>c("/v1/budgets",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function rr(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/budgets/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function sr(){const e=g();return x({mutationFn:t=>c(`/v1/budgets/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}const Y=1e3,bt=100;async function wt(){const e=[];for(let t=0;tc("/v1/users",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>le(e)})}function or(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/users/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>le(e)})}function lr(){const e=g();return x({mutationFn:t=>c(`/v1/users/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{le(e),e.invalidateQueries({queryKey:[q]})}})}function V(e){const t=new URLSearchParams;return e.start_date&&t.set("start_date",e.start_date),e.end_date&&t.set("end_date",e.end_date),e.status&&t.set("status",e.status),e.model&&t.set("model",e.model),e.endpoint&&t.set("endpoint",e.endpoint),e.user_id&&t.set("user_id",e.user_id),e.api_key_id&&t.set("api_key_id",e.api_key_id),e.source&&t.set("source",e.source),e.priced!==void 0&&t.set("priced",String(e.priced)),e.counts_toward_budget!==void 0&&t.set("counts_toward_budget",String(e.counts_toward_budget)),t}function cr(e,t,r){return p({queryKey:[O,"list",e,t,r],queryFn:()=>{const s=V(e);return s.set("skip",String(t*r)),s.set("limit",String(r)),c(`/v1/usage?${s.toString()}`)},placeholderData:ne,staleTime:1e4})}function ur(e,t=!0){return p({queryKey:[O,"count",e],queryFn:()=>c(`/v1/usage/count?${V(e).toString()}`),enabled:t,placeholderData:ne,staleTime:1e4})}const jt=6e4;function St(e,t=!0){return p({queryKey:[O,"count","failures",e],queryFn:()=>{const r={status:"error",source:"gateway",start_date:it(e)};return c(`/v1/usage/count?${V(r).toString()}`)},enabled:t,refetchInterval:jt,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function dr(){const e=g();return x({mutationFn:t=>c("/v1/usage",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]})}})}function mr(){const e=g();return x({mutationFn:t=>c("/v1/usage/set-price",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]})}})}function fr(e,t,r=!0){return p({queryKey:[O,"summary",e,t],queryFn:()=>{const s=V(e);return s.set("bucket",t),c(`/v1/usage/summary?${s.toString()}`)},enabled:r,placeholderData:ne,staleTime:3e4})}function hr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function xr(e){if(e==null)return"$0.00";const t=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}function yr(e){if(e==null)return"—";if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){const t=Math.round(e/1e3);return t>=1e3?"1M":`${t}K`}return String(e)}const kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function vr(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})/.exec(e);if(!t)return e;const r=Number(t[2])-1;return r<0||r>11?t[1]:`${kt[r]} ${t[1]}`}const Et=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function gr(e){return Et.format(e)}function pr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Pt(e){return`${(e*100).toFixed(1)}%`}function br(e,t){return t===void 0||t===0?null:(e-t)/t}function Nt(e,t=Date.now()){if(!e)return"never";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const s=Math.round((t-r.getTime())/1e3),a=s<0,i=Math.abs(s),u=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let d=i,f="second";for(const[h,b]of u){if(f=h,d0?"▲":e<0?"▼":"•";return n.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t," ",Pt(Math.abs(e))," vs prev"]})}function Ct(e){return e instanceof L||e instanceof Error?e.message:"Something went wrong."}function Tt({error:e}){return e?n.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:Ct(e)}):null}function _t({tone:e="info",children:t}){const r=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return n.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${r}`,children:t})}function Sr({title:e,description:t,action:r}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),r?n.jsx("div",{className:"flex flex-wrap gap-2",children:r}):null]})}function Lt(e){const[t,r]=o.useState(()=>Date.now());return o.useEffect(()=>{let s;const a=()=>{s===void 0&&(s=setInterval(()=>r(Date.now()),e))},i=()=>{s!==void 0&&(clearInterval(s),s=void 0)},u=()=>{r(Date.now()),document.visibilityState==="visible"?a():i()};return u(),document.addEventListener("visibilitychange",u),()=>{i(),document.removeEventListener("visibilitychange",u)}},[e]),t}function kr({onRefresh:e,isFetching:t=!1,updatedAt:r,label:s="Refresh"}){const a=Lt(15e3),i=r?Nt(new Date(r).toISOString(),a):null;return n.jsxs("span",{className:"inline-flex items-center gap-2",children:[i?n.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Updated ",i]}):null,n.jsx(C,{variant:"outline",size:"sm",isIconOnly:!0,isDisabled:t,onPress:e,"aria-label":s,children:n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`h-4 w-4 ${t?"animate-spin":""}`,"aria-hidden":"true",children:[n.jsx("path",{d:"M20 11a8 8 0 1 0-.5 4",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M20 4v5h-5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function Er({title:e,description:t,actionLabel:r,onAction:s,isActionDisabled:a,children:i}){return n.jsx(I,{children:n.jsxs(I.Content,{className:"flex flex-col gap-4 p-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),i,r&&s?n.jsx("div",{children:n.jsx(C,{variant:"primary",isDisabled:a,onPress:s,children:r})}):null]})})}function Pr({label:e="Loading…"}){return n.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 px-4 py-10 text-sm text-[var(--otari-muted)]",children:[n.jsx(Ve,{size:"sm"}),n.jsx("span",{children:e})]})}function Nr({children:e,confirmLabel:t,onConfirm:r,isPending:s}){const[a,i]=o.useState(!1);return a?n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(C,{size:"sm",variant:"danger",isDisabled:s,onPress:r,children:t}),n.jsx(C,{size:"sm",variant:"ghost",isDisabled:s,onPress:()=>i(!1),children:"Cancel"})]}):n.jsx(C,{size:"sm",variant:"danger-soft",onPress:()=>i(!0),children:e})}const Dt="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Cr({id:e,label:t,ariaLabel:r,value:s,onChange:a,options:i,children:u,disabled:d}){const f=o.useId(),y=e??(t?f:void 0),h=n.jsx("select",{id:y,"aria-label":t?void 0:r,value:s,disabled:d,onChange:b=>a(b.target.value),className:Dt,children:i?i.map(b=>n.jsx("option",{value:b.value,children:b.label},b.value)):u});return t?n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),h]}):h}function Tr({label:e,value:t,onChange:r,options:s,placeholder:a,maxVisible:i=50,allowsCustom:u=!1}){const d=m=>{var N;return((N=s.find(M=>M.value===m))==null?void 0:N.label)??m},[f,y]=o.useState(()=>d(t));o.useEffect(()=>{y(d(t))},[t]);const h=f.trim().toLowerCase(),b=s.filter(m=>!h||m.value.toLowerCase().includes(h)||m.label.toLowerCase().includes(h)).slice(0,i);return n.jsxs(U.Root,{allowsEmptyCollection:!0,allowsCustomValue:u,menuTrigger:"focus",inputValue:f,onInputChange:m=>{y(m),u?r(m.trim()):m.trim()===""&&r("")},onSelectionChange:m=>{m!=null&&r(String(m))},className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),n.jsxs(U.InputGroup,{children:[n.jsx(ye,{placeholder:a,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),n.jsx(U.Trigger,{})]}),n.jsx(U.Popover,{children:n.jsx(ze,{items:b,className:"max-h-72 overflow-auto",children:m=>n.jsx(Qe,{id:m.value,textValue:m.label,children:m.label})})})]})}function At(){var f,y;const e=mt(),t=ft(),[r,s]=o.useState(!1),i=((f=e.data)==null?void 0:f.require_pricing)===!0&&e.data.default_pricing===!1&&!r,d=((y=St($,i).data)==null?void 0:y.total)??0;return i?n.jsx("div",{className:"shrink-0 px-6 pt-3",children:n.jsx(_t,{tone:"warning",children:n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("span",{children:["Requests are rejected until pricing is set (",n.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away.",d>0?n.jsxs(n.Fragment,{children:[" ",n.jsxs("strong",{className:"font-semibold",children:[d.toLocaleString()," ",d===1?"request":"requests"," failed in the last hour."]})," ",n.jsx(Fe,{to:"/activity?status=error&range=1h&source=gateway",className:"underline underline-offset-2",children:"View failed requests"})]}):null]}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(C,{size:"sm",variant:"primary",isDisabled:t.isPending,onPress:()=>t.mutate({default_pricing:!0}),children:t.isPending?"Enabling…":"Enable default pricing"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Dismiss"})]})]})})}):null}function It(){const{data:e}=dt(),t=o.useRef(null);return e&&t.current===null&&(t.current=e.build),e!=null&&t.current!=null&&e.build!==t.current}function qt(){const e=It(),[t,r]=o.useState(!1);return!e||t?null:n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:n.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),n.jsx(C,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>r(!0),children:"Later"})]})})}const je=200,Se=480,X=240,Rt=60,ke="otari.dashboard.sidebarWidth",Ee="otari.dashboard.sidebarCollapsed",he=16,Pe="(max-width: 767px)",B=e=>Math.min(Se,Math.max(je,e));function Ot(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(Pe).matches}const Mt='a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ft(e){return e?Array.from(e.querySelectorAll(Mt)).filter(t=>t.offsetParent!==null||t===document.activeElement):[]}function Ut(){if(typeof window>"u")return X;try{const e=window.localStorage.getItem(ke),t=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(t)?X:B(t)}catch{return X}}function Kt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ee)==="1"}catch{return!1}}const Bt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],$t=[{to:"/",section:"home",label:"Overview",end:!0,icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),n.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),n.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),n.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),n.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function zt(){const{logout:e}=re(),t=o.useRef(null),r=o.useRef(null),s=o.useRef(null),[a,i]=o.useState(Ut),[u,d]=o.useState(Kt),[f,y]=o.useState(!1),[h,b]=o.useState(Ot),[m,N]=o.useState(!1);o.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const l=window.matchMedia(Pe),v=w=>{b(w.matches),w.matches||N(!1)};return typeof l.addEventListener=="function"?(l.addEventListener("change",v),()=>l.removeEventListener("change",v)):(l.addListener(v),()=>l.removeListener(v))},[]),o.useEffect(()=>{if(!m)return;const l=v=>{v.key==="Escape"&&N(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[m]),o.useEffect(()=>{var l,v,w;h&&(m?(l=t.current)==null||l.focus():(v=t.current)!=null&&v.contains(document.activeElement)&&((w=s.current)==null||w.focus()))},[h,m]);const M=o.useCallback(l=>{if(l.key!=="Tab")return;const v=Ft(t.current);if(v.length===0)return;const w=v[0],k=v[v.length-1],F=document.activeElement;l.shiftKey&&(F===w||F===t.current)?(l.preventDefault(),k.focus()):!l.shiftKey&&F===k&&(l.preventDefault(),w.focus())},[]);o.useEffect(()=>{const l=window.setTimeout(()=>{try{window.localStorage.setItem(ke,String(Math.round(a)))}catch{}},200);return()=>window.clearTimeout(l)},[a]),o.useEffect(()=>{try{window.localStorage.setItem(Ee,u?"1":"0")}catch{}},[u]);const Ce=o.useCallback(l=>{l.preventDefault(),l.currentTarget.setPointerCapture(l.pointerId),y(!0)},[]),Te=o.useCallback(l=>{var w;if(!l.currentTarget.hasPointerCapture(l.pointerId))return;const v=((w=t.current)==null?void 0:w.getBoundingClientRect().left)??0;i(B(l.clientX-v))},[]),_e=o.useCallback(l=>{l.currentTarget.hasPointerCapture(l.pointerId)&&l.currentTarget.releasePointerCapture(l.pointerId),y(!1)},[]),Le=o.useCallback(l=>{var v;l.preventDefault(),(v=r.current)==null||v.focus()},[]),De=o.useCallback(l=>{l.key==="ArrowLeft"?(l.preventDefault(),i(v=>B(v-he))):l.key==="ArrowRight"&&(l.preventDefault(),i(v=>B(v+he)))},[]),Ae=u?Rt:a,S=h?!1:u,W=h&&m?!0:void 0;return n.jsxs("div",{className:T("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[n.jsx("button",{type:"button",inert:W,onClick:Le,className:"sr-only focus:not-sr-only focus:absolute focus:top-3 focus:left-3 focus:z-50 focus:rounded-lg focus:border focus:border-[var(--otari-brand)] focus:bg-[var(--otari-surface)] focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-[var(--otari-brand-dark)] focus:shadow-md focus:outline-none",children:"Skip to main content"}),n.jsxs("header",{inert:W,className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("button",{type:"button",ref:s,onClick:()=>N(l=>!l),"aria-label":m?"Close navigation":"Open navigation","aria-expanded":m,"aria-controls":"app-sidebar",className:"-ml-1 flex h-8 w-8 items-center justify-center rounded-lg text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)] md:hidden",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5",children:n.jsx("path",{d:"M4 6h16M4 12h16M4 18h16",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),n.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),n.jsx(C,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),n.jsx(qt,{}),n.jsx(st,{}),n.jsx(At,{}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[h&&m?n.jsx("div",{"aria-hidden":"true",onClick:()=>N(!1),className:"fixed inset-0 z-30 bg-black/40 md:hidden"}):null,n.jsxs("aside",{ref:t,id:"app-sidebar",role:h?"dialog":void 0,"aria-modal":h&&m?!0:void 0,"aria-label":h?"Navigation":void 0,tabIndex:h?-1:void 0,inert:h&&!m?!0:void 0,onKeyDown:h&&m?M:void 0,style:h?void 0:{width:Ae},className:T("flex flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)] focus:outline-none",h?T("fixed inset-y-0 left-0 z-40 w-[17rem] shadow-xl transition-transform duration-200",m?"translate-x-0":"-translate-x-full"):T("relative shrink-0",!f&&"transition-[width] duration-150")),children:[n.jsx("button",{type:"button",onClick:()=>d(l=>!l),"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-pressed":u,title:u?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 hidden h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)] md:flex",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:T("h-3.5 w-3.5 transition-transform",u&&"rotate-180"),children:n.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("nav",{className:T("flex flex-col py-4",S?"px-2":"px-3"),children:Bt.map((l,v)=>{const w=$t.filter(k=>k.section===l.key);return w.length===0?null:n.jsxs("div",{className:v>0?"mt-4":void 0,children:[!S&&l.label?n.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:l.label}):null,v>0&&(S||!l.label)?n.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,n.jsx("div",{className:"flex flex-col gap-1",children:w.map(k=>n.jsxs(Z,{to:k.to,end:k.end,onClick:()=>N(!1),"aria-label":S?k.label:void 0,title:S?k.label:void 0,className:({isActive:F})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"justify-center px-0":"gap-3 px-3",F?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,S?null:k.label]},k.to))})]},l.key)})}),n.jsxs("div",{className:"mt-auto flex flex-col gap-1 pb-3",children:[n.jsxs(Z,{to:"/docs",onClick:()=>N(!1),"aria-label":S?"User guide":void 0,title:S?"User guide":void 0,className:({isActive:l})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"mx-2 justify-center px-0":"mx-3 gap-3 px-3",l?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[n.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.5V18c4 0 6.5.5 8 2 1.5-1.5 4-2 8-2V4.5c-4 0-6.5.5-8 2z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 6.5V20",strokeLinecap:"round"})]}),S?null:"User guide"]}),n.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai: the hosted Otari gateway",className:T("flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",S?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),S?null:n.jsxs("span",{className:"flex-1",children:["otari.ai ",n.jsx("span",{"aria-hidden":!0,children:"↗"})]})]})]}),u||h?null:n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(a),"aria-valuemin":je,"aria-valuemax":Se,tabIndex:0,onPointerDown:Ce,onPointerMove:Te,onPointerUp:_e,onKeyDown:De,className:T("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),n.jsx("main",{ref:r,id:"main-content",tabIndex:-1,inert:W,className:"flex-1 overflow-y-auto focus:outline-none",children:n.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-4 py-5 md:px-6 md:py-6",children:n.jsx(Ue,{})})})]})]})}function Qt(){const{login:e}=re(),[t,r]=o.useState(""),[s,a]=o.useState(null),[i,u]=o.useState(!1),d=async()=>{const f=t.trim();if(!(!f||i)){u(!0),a(null);try{await Xe(f)?e():a(new Error("Invalid master key."))}catch(y){a(y)}finally{u(!1)}}};return n.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:n.jsx(I,{className:"w-full max-w-md",children:n.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),n.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),d()},children:[n.jsxs(We,{value:t,onChange:f=>{r(f),s&&a(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),n.jsx(ye,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),n.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[n.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),n.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",n.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",n.jsx("code",{children:"Your master key:"})," (for example, run"," ",n.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),n.jsx(Tt,{error:s}),n.jsx(C,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!t.trim()||i,children:i?"Signing in…":"Sign in"})]}),n.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),n.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:n.jsx(He,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const Vt=o.lazy(async()=>({default:(await P(async()=>{const{ActivityPage:e}=await import("./ActivityPage-C5gSmqNJ.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))).ActivityPage})),Wt=o.lazy(async()=>({default:(await P(async()=>{const{AliasesPage:e}=await import("./AliasesPage-D7ZKXX3I.js");return{AliasesPage:e}},__vite__mapDeps([10,1,2,6,4,7,8,11,12]))).AliasesPage})),Ht=o.lazy(async()=>({default:(await P(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-DanpEezo.js");return{BudgetsPage:e}},__vite__mapDeps([13,1,2,6,4,7,8,11]))).BudgetsPage})),Gt=o.lazy(async()=>({default:(await P(async()=>{const{DocsPage:e}=await import("./DocsPage-DkHyFdGF.js");return{DocsPage:e}},__vite__mapDeps([14,1,2,4]))).DocsPage})),Jt=o.lazy(async()=>({default:(await P(async()=>{const{KeysPage:e}=await import("./KeysPage-D4g9XrFY.js");return{KeysPage:e}},__vite__mapDeps([15,1,2,6,4,7,8,11,16,12]))).KeysPage})),Yt=o.lazy(async()=>({default:(await P(async()=>{const{ModelsPage:e}=await import("./ModelsPage-r0TNjwml.js");return{ModelsPage:e}},__vite__mapDeps([17,1,2,6,4,8,9]))).ModelsPage})),Xt=o.lazy(async()=>({default:(await P(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-WmIAewmo.js");return{OverviewIndex:e}},__vite__mapDeps([18,1,2,19,5,4,8]))).OverviewIndex})),Zt=o.lazy(async()=>({default:(await P(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-BRQCYCYu.js");return{ProvidersPage:e}},__vite__mapDeps([20,1,2,11,4,8]))).ProvidersPage})),en=o.lazy(async()=>({default:(await P(async()=>{const{SettingsPage:e}=await import("./SettingsPage-DjaTcy-f.js");return{SettingsPage:e}},__vite__mapDeps([21,1,2,4]))).SettingsPage})),tn=o.lazy(async()=>({default:(await P(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-B4MIR_ke.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([22,1,2,4]))).ToolsGuardrailsPage})),nn=o.lazy(async()=>({default:(await P(async()=>{const{UsagePage:e}=await import("./UsagePage-CGU7s9AT.js");return{UsagePage:e}},__vite__mapDeps([23,1,2,3,4,5,6,19,7,8,9]))).UsagePage})),rn=o.lazy(async()=>({default:(await P(async()=>{const{UsersPage:e}=await import("./UsersPage-CUF9BhT-.js");return{UsersPage:e}},__vite__mapDeps([24,1,2,6,4,7,8,11,16]))).UsersPage}));function E(e){return n.jsx(o.Suspense,{fallback:n.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function sn(){const{isAuthenticated:e}=re();return e?n.jsx(Ke,{children:n.jsx(Be,{children:n.jsxs(j,{element:n.jsx(zt,{}),children:[n.jsx(j,{index:!0,element:E(n.jsx(Xt,{}))}),n.jsx(j,{path:"providers",element:E(n.jsx(Zt,{}))}),n.jsx(j,{path:"keys",element:E(n.jsx(Jt,{}))}),n.jsx(j,{path:"users",element:E(n.jsx(rn,{}))}),n.jsx(j,{path:"budgets",element:E(n.jsx(Ht,{}))}),n.jsx(j,{path:"activity",element:E(n.jsx(Vt,{}))}),n.jsx(j,{path:"usage",element:E(n.jsx(nn,{}))}),n.jsx(j,{path:"models",element:E(n.jsx(Yt,{}))}),n.jsx(j,{path:"aliases",element:E(n.jsx(Wt,{}))}),n.jsx(j,{path:"tools",element:E(n.jsx(tn,{}))}),n.jsx(j,{path:"settings",element:E(n.jsx(en,{}))}),n.jsx(j,{path:"docs",element:E(n.jsx(Gt,{}))}),n.jsx(j,{path:"*",element:n.jsx($e,{to:"/",replace:!0})})]})})}):n.jsx(Qt,{})}function an({children:e}){const[t]=o.useState(()=>new Re({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(r,s)=>s instanceof L&&(s.status===401||s.status===403)?!1:r<2}}}));return n.jsx(Oe,{client:t,children:n.jsx(tt,{children:e})})}const Ne=document.getElementById("root");if(!Ne)throw new Error("Root element #root not found");Ge.createRoot(Ne).render(n.jsx(o.StrictMode,{children:n.jsx(an,{children:n.jsx(sn,{})})}));export{hr as $,hn as A,Zn as B,xn as C,Jn as D,Tt as E,Cr as F,wn as G,$n as H,_t as I,qn as J,zn as K,yr as L,Qn as M,Ct as N,vr as O,Sr as P,mt as Q,kr as R,xr as S,Sn as T,Pr as U,Pn as V,br as W,wr as X,at as Y,gr as Z,jr as _,Gn as a,Pt as a0,Nt as a1,Cn as a2,Ln as a3,An as a4,ft as a5,_n as a6,Nn as a7,Tn as a8,En as a9,kn as aa,In as ab,Vn as ac,Wn as ad,Hn as ae,Fn as af,Dn as ag,Un as ah,Kn as ai,Bn as aj,mn as ak,dn as al,pr as am,bn as an,ot as ao,pn as ap,gn as aq,lr as ar,ir as as,cr as b,ur as c,fr as d,vn as e,yn as f,dr as g,mr as h,fn as i,Tr as j,it as k,jn as l,Rn as m,Mn as n,Nr as o,On as p,er as q,nr as r,rr as s,sr as t,ar as u,or as v,Er as w,tr as x,Yn as y,Xn as z}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-CGtQFYkj.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/FilterChips-CxOVvh-O.js","assets/heroui-BI50yK5B.js","assets/recharts-C4kRDmvS.js","assets/tableSelection-9hV37uhu.js","assets/ConfirmDialog-P_P4TNFr.js","assets/DataTable-Bmn_eYSV.js","assets/TablePagination-BHTN5PVb.js","assets/AliasesPage-BW4Ki1y6.js","assets/Field-Dwp6u3t8.js","assets/UserComboBox-a9wxf8eF.js","assets/BudgetsPage-B98xbp9L.js","assets/DocsPage-CQXolIdY.js","assets/KeysPage-BBEXGo7q.js","assets/ModelScopeControl-Bmks7cWc.js","assets/ModelsPage-XwbqKUgz.js","assets/OverviewPage-XfWqfHJ2.js","assets/charts-DIsd9m--.js","assets/ProvidersPage-HN_Zodtk.js","assets/SettingsPage-Csgj1pAU.js","assets/ToolsGuardrailsPage-DPdRTl_b.js","assets/UsagePage-BAefkQlH.js","assets/UsersPage-Lrd1SvIH.js"])))=>i.map(i=>d[i]); +var Ie=Object.defineProperty;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>qe(e,typeof t!="symbol"?t+"":t,r);import{u as g,j as n,a as p,b as x,k as ne,Q as Re,c as Oe}from"./tanstack-query-1t81HyiD.js";import{d as Me,r as o,N as Z,L as Fe,O as Ue,H as Ke,e as Be,f as j,h as $e}from"./react-dgEcD0HR.js";import{B as C,C as U,L as xe,I as ye,a as ze,b as Qe,d as I,S as Ve,c as T,T as We,e as He}from"./heroui-BI50yK5B.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ge=Me();const Je="modulepreload",Ye=function(e){return"/"+e},ue={},P=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let u=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(r.map(y=>{if(y=Ye(y),y in ue)return;ue[y]=!0;const h=y.endsWith(".css"),b=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Je,h||(m.as="script"),m.crossOrigin="",m.href=y,f&&m.setAttribute("nonce",f),document.head.appendChild(m),h)return new Promise((N,M)=>{m.addEventListener("load",N),m.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};class L extends Error{constructor(r,s){super(s);ce(this,"status");this.name="ApiError",this.status=r}}let K=null;function de(e){K=e}async function ee(e){try{const t=await e.json();if(typeof t.detail=="string")return t.detail;if(t.detail!=null)return JSON.stringify(t.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Xe(e){let t;try{t=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(t.status===401||t.status===403)return!1;if(!t.ok)throw new L(t.status,await ee(t));return!0}async function Ze(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function c(e,t={}){const r=new Headers(t.headers);r.set("Accept","application/json"),t.body!=null&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let s;try{s=await fetch(e,{...t,headers:r})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(s.status===401||s.status===403)throw K==null||K(),new L(s.status,await ee(s));if(!s.ok)throw new L(s.status,await ee(s));if(s.status!==204)return await s.json()}const te="otari.dashboard.hasSession",ve=o.createContext(null);function et(){try{return window.localStorage.getItem(te)==="1"}catch{return!1}}function tt({children:e}){const t=g(),[r,s]=o.useState(et),a=o.useCallback(()=>{Ze(),s(!1),t.clear();try{window.localStorage.removeItem(te)}catch{}},[t]),i=o.useCallback(()=>{t.clear(),s(!0);try{window.localStorage.setItem(te,"1")}catch{}},[t]);o.useEffect(()=>(de(a),()=>de(null)),[a]);const u=o.useMemo(()=>({isAuthenticated:r,login:i,logout:a}),[r,i,a]);return n.jsx(ve.Provider,{value:u,children:e})}function re(){const e=o.useContext(ve);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function nt(e){return e instanceof L&&e.status===0}function rt(){const e=g(),[t,r]=o.useState(!1);return o.useEffect(()=>{const s=e.getQueryCache(),a=()=>s.getAll().some(i=>i.state.status==="error"&&nt(i.state.error));return r(a()),s.subscribe(()=>r(a()))},[e]),t}function st(){return rt()?n.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const $=3600,_=86400,at=365*_,dn=[{key:"1h",label:"Last hour",seconds:$,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"90d",label:"90d",seconds:90*_,bucket:"day"},{key:"12mo",label:"12mo",seconds:at,bucket:"day"}],mn="30d",fn=[{key:"1h",label:"1h",seconds:$,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"all",label:"All",seconds:null,bucket:"day"}],hn="24h",xn="custom";function yn(e,t){return e.find(r=>r.key===t)}function it(e,t=Date.now()){return new Date(t-e*1e3).toISOString()}function ot(e){return(e==="hour"?$:_)*1e3}function vn(e,t,r=Date.now()){const s=new Date(e).getTime();return(t?new Date(t).getTime():r)-s<=_*1e3?"hour":"day"}function gn(e,t,r,s){if(e.length===0)return null;const a=Math.max(0,Math.min(t,r)),i=Math.min(e.length-1,Math.max(t,r)),u=new Date(e[a]).getTime(),d=new Date(e[i]).getTime()+ot(s);return{startIso:new Date(u).toISOString(),endIso:new Date(d).toISOString()}}function pn(e,t,r){const s=e.length;if(s===0)return{startIndex:0,endIndex:0};const a=e.map(d=>new Date(d).getTime());let i=0;if(t){const d=new Date(t).getTime();for(let f=0;fc("/v1/models"),staleTime:6e4})}function dt(){return p({queryKey:[ct],queryFn:()=>c("/dashboard-build.json"),refetchInterval:ut,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function jn(){return p({queryKey:[ae],queryFn:()=>c("/v1/models/discoverable"),staleTime:5*6e4})}function Sn(){return p({queryKey:[ie],queryFn:()=>c("/v1/providers"),staleTime:5*6e4})}function kn(){return p({queryKey:["provider-catalog"],queryFn:()=>c("/v1/providers/catalog"),staleTime:1/0})}function En(e){return p({queryKey:["provider-catalog",e],queryFn:()=>c(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Pn(){return p({queryKey:[oe],queryFn:()=>c("/v1/providers/health"),staleTime:me,refetchInterval:me})}function Nn(){const e=g();return x({mutationFn:()=>c("/v1/providers/health?refresh=true"),onSuccess:t=>e.setQueryData([oe],t)})}function Cn(){return p({queryKey:[be],queryFn:()=>c("/v1/provider-credentials"),staleTime:6e4})}function Q(e){e.invalidateQueries({queryKey:[be]}),e.invalidateQueries({queryKey:[ie]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]}),e.invalidateQueries({queryKey:[oe]})}function Tn(){const e=g();return x({mutationFn:t=>c("/v1/provider-credentials",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>Q(e)})}function _n(){const e=g();return x({mutationFn:({instance:t,body:r})=>c(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>Q(e)})}function Ln(){const e=g();return x({mutationFn:t=>c(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>Q(e)})}function Dn(){const e=g();return x({mutationFn:()=>c("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>Q(e)})}function An(){return x({mutationFn:e=>c(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function In(){return x({mutationFn:e=>c("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function qn(){return p({queryKey:[lt],queryFn:()=>c("/v1/models/metadata"),staleTime:10*6e4})}function Rn(){return p({queryKey:[se],queryFn:()=>c("/v1/aliases"),staleTime:6e4})}function On(){const e=g();return x({mutationFn:t=>c("/v1/aliases",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function Mn(){const e=g();return x({mutationFn:({name:t,userId:r})=>{const s=r==null?"":`?user_id=${encodeURIComponent(r)}`;return c(`/v1/aliases/${encodeURIComponent(t)}${s}`,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function mt(){return p({queryKey:[ge],queryFn:()=>c("/v1/settings"),staleTime:6e4})}function ft(){const e=g();return x({mutationFn:t=>c("/v1/settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([ge],t),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]})}})}function Fn(){return x({mutationFn:()=>c("/v1/settings/master-key/rotate",{method:"POST"})})}function Un(){return p({queryKey:[pe],queryFn:()=>c("/v1/tool-settings"),staleTime:6e4})}function Kn(){const e=g();return x({mutationFn:t=>c("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([pe],t)}})}function Bn(){return x({mutationFn:({service:e,url:t})=>c(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:t})})})}const H=1e3,ht=100;async function xt(){const e=[];for(let t=0;tc("/v1/pricing",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]})}})}function Qn(){const e=g();return x({mutationFn:t=>c(`/v1/pricing/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]})}})}function Vn(){return x({mutationFn:()=>c("/v1/pricing/refresh",{method:"POST"})})}function Wn(){const e=g();return x({mutationFn:()=>c("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ie]})}})}function Hn(){return x({mutationFn:()=>c("/v1/pricing/refresh/reject",{method:"POST"})})}const G=1e3,yt=100;async function vt(){const e=[];for(let t=0;tc("/v1/keys",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Yn(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/keys/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Xn(){const e=g();return x({mutationFn:t=>c(`/v1/keys/${encodeURIComponent(t)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Zn(){const e=g();return x({mutationFn:t=>c(`/v1/keys/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}const J=1e3,gt=100;async function pt(){const e=[];for(let t=0;tc(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function nr(){const e=g();return x({mutationFn:t=>c("/v1/budgets",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function rr(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/budgets/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function sr(){const e=g();return x({mutationFn:t=>c(`/v1/budgets/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}const Y=1e3,bt=100;async function wt(){const e=[];for(let t=0;tc("/v1/users",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>le(e)})}function or(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/users/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>le(e)})}function lr(){const e=g();return x({mutationFn:t=>c(`/v1/users/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{le(e),e.invalidateQueries({queryKey:[q]})}})}function V(e){const t=new URLSearchParams;return e.start_date&&t.set("start_date",e.start_date),e.end_date&&t.set("end_date",e.end_date),e.status&&t.set("status",e.status),e.model&&t.set("model",e.model),e.endpoint&&t.set("endpoint",e.endpoint),e.user_id&&t.set("user_id",e.user_id),e.api_key_id&&t.set("api_key_id",e.api_key_id),e.source&&t.set("source",e.source),e.priced!==void 0&&t.set("priced",String(e.priced)),e.counts_toward_budget!==void 0&&t.set("counts_toward_budget",String(e.counts_toward_budget)),t}function cr(e,t,r){return p({queryKey:[O,"list",e,t,r],queryFn:()=>{const s=V(e);return s.set("skip",String(t*r)),s.set("limit",String(r)),c(`/v1/usage?${s.toString()}`)},placeholderData:ne,staleTime:1e4})}function ur(e,t=!0){return p({queryKey:[O,"count",e],queryFn:()=>c(`/v1/usage/count?${V(e).toString()}`),enabled:t,placeholderData:ne,staleTime:1e4})}const jt=6e4;function St(e,t=!0){return p({queryKey:[O,"count","failures",e],queryFn:()=>{const r={status:"error",source:"gateway",start_date:it(e)};return c(`/v1/usage/count?${V(r).toString()}`)},enabled:t,refetchInterval:jt,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function dr(){const e=g();return x({mutationFn:t=>c("/v1/usage",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]})}})}function mr(){const e=g();return x({mutationFn:t=>c("/v1/usage/set-price",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]})}})}function fr(e,t,r=!0){return p({queryKey:[O,"summary",e,t],queryFn:()=>{const s=V(e);return s.set("bucket",t),c(`/v1/usage/summary?${s.toString()}`)},enabled:r,placeholderData:ne,staleTime:3e4})}function hr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function xr(e){if(e==null)return"$0.00";const t=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}function yr(e){if(e==null)return"—";if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){const t=Math.round(e/1e3);return t>=1e3?"1M":`${t}K`}return String(e)}const kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function vr(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})/.exec(e);if(!t)return e;const r=Number(t[2])-1;return r<0||r>11?t[1]:`${kt[r]} ${t[1]}`}const Et=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function gr(e){return Et.format(e)}function pr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Pt(e){return`${(e*100).toFixed(1)}%`}function br(e,t){return t===void 0||t===0?null:(e-t)/t}function Nt(e,t=Date.now()){if(!e)return"never";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const s=Math.round((t-r.getTime())/1e3),a=s<0,i=Math.abs(s),u=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let d=i,f="second";for(const[h,b]of u){if(f=h,d0?"▲":e<0?"▼":"•";return n.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t," ",Pt(Math.abs(e))," vs prev"]})}function Ct(e){return e instanceof L||e instanceof Error?e.message:"Something went wrong."}function Tt({error:e}){return e?n.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:Ct(e)}):null}function _t({tone:e="info",children:t}){const r=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return n.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${r}`,children:t})}function Sr({title:e,description:t,action:r}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),r?n.jsx("div",{className:"flex flex-wrap gap-2",children:r}):null]})}function Lt(e){const[t,r]=o.useState(()=>Date.now());return o.useEffect(()=>{let s;const a=()=>{s===void 0&&(s=setInterval(()=>r(Date.now()),e))},i=()=>{s!==void 0&&(clearInterval(s),s=void 0)},u=()=>{r(Date.now()),document.visibilityState==="visible"?a():i()};return u(),document.addEventListener("visibilitychange",u),()=>{i(),document.removeEventListener("visibilitychange",u)}},[e]),t}function kr({onRefresh:e,isFetching:t=!1,updatedAt:r,label:s="Refresh"}){const a=Lt(15e3),i=r?Nt(new Date(r).toISOString(),a):null;return n.jsxs("span",{className:"inline-flex items-center gap-2",children:[i?n.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Updated ",i]}):null,n.jsx(C,{variant:"outline",size:"sm",isIconOnly:!0,isDisabled:t,onPress:e,"aria-label":s,children:n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`h-4 w-4 ${t?"animate-spin":""}`,"aria-hidden":"true",children:[n.jsx("path",{d:"M20 11a8 8 0 1 0-.5 4",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M20 4v5h-5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function Er({title:e,description:t,actionLabel:r,onAction:s,isActionDisabled:a,children:i}){return n.jsx(I,{children:n.jsxs(I.Content,{className:"flex flex-col gap-4 p-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),i,r&&s?n.jsx("div",{children:n.jsx(C,{variant:"primary",isDisabled:a,onPress:s,children:r})}):null]})})}function Pr({label:e="Loading…"}){return n.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 px-4 py-10 text-sm text-[var(--otari-muted)]",children:[n.jsx(Ve,{size:"sm"}),n.jsx("span",{children:e})]})}function Nr({children:e,confirmLabel:t,onConfirm:r,isPending:s}){const[a,i]=o.useState(!1);return a?n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(C,{size:"sm",variant:"danger",isDisabled:s,onPress:r,children:t}),n.jsx(C,{size:"sm",variant:"ghost",isDisabled:s,onPress:()=>i(!1),children:"Cancel"})]}):n.jsx(C,{size:"sm",variant:"danger-soft",onPress:()=>i(!0),children:e})}const Dt="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Cr({id:e,label:t,ariaLabel:r,value:s,onChange:a,options:i,children:u,disabled:d}){const f=o.useId(),y=e??(t?f:void 0),h=n.jsx("select",{id:y,"aria-label":t?void 0:r,value:s,disabled:d,onChange:b=>a(b.target.value),className:Dt,children:i?i.map(b=>n.jsx("option",{value:b.value,children:b.label},b.value)):u});return t?n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),h]}):h}function Tr({label:e,value:t,onChange:r,options:s,placeholder:a,maxVisible:i=50,allowsCustom:u=!1}){const d=m=>{var N;return((N=s.find(M=>M.value===m))==null?void 0:N.label)??m},[f,y]=o.useState(()=>d(t));o.useEffect(()=>{y(d(t))},[t]);const h=f.trim().toLowerCase(),b=s.filter(m=>!h||m.value.toLowerCase().includes(h)||m.label.toLowerCase().includes(h)).slice(0,i);return n.jsxs(U.Root,{allowsEmptyCollection:!0,allowsCustomValue:u,menuTrigger:"focus",inputValue:f,onInputChange:m=>{y(m),u?r(m.trim()):m.trim()===""&&r("")},onSelectionChange:m=>{m!=null&&r(String(m))},className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),n.jsxs(U.InputGroup,{children:[n.jsx(ye,{placeholder:a,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),n.jsx(U.Trigger,{})]}),n.jsx(U.Popover,{children:n.jsx(ze,{items:b,className:"max-h-72 overflow-auto",children:m=>n.jsx(Qe,{id:m.value,textValue:m.label,children:m.label})})})]})}function At(){var f,y;const e=mt(),t=ft(),[r,s]=o.useState(!1),i=((f=e.data)==null?void 0:f.require_pricing)===!0&&e.data.default_pricing===!1&&!r,d=((y=St($,i).data)==null?void 0:y.total)??0;return i?n.jsx("div",{className:"shrink-0 px-6 pt-3",children:n.jsx(_t,{tone:"warning",children:n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("span",{children:["Requests are rejected until pricing is set (",n.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away.",d>0?n.jsxs(n.Fragment,{children:[" ",n.jsxs("strong",{className:"font-semibold",children:[d.toLocaleString()," ",d===1?"request":"requests"," failed in the last hour."]})," ",n.jsx(Fe,{to:"/activity?status=error&range=1h&source=gateway",className:"underline underline-offset-2",children:"View failed requests"})]}):null]}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(C,{size:"sm",variant:"primary",isDisabled:t.isPending,onPress:()=>t.mutate({default_pricing:!0}),children:t.isPending?"Enabling…":"Enable default pricing"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Dismiss"})]})]})})}):null}function It(){const{data:e}=dt(),t=o.useRef(null);return e&&t.current===null&&(t.current=e.build),e!=null&&t.current!=null&&e.build!==t.current}function qt(){const e=It(),[t,r]=o.useState(!1);return!e||t?null:n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:n.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),n.jsx(C,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>r(!0),children:"Later"})]})})}const je=200,Se=480,X=240,Rt=60,ke="otari.dashboard.sidebarWidth",Ee="otari.dashboard.sidebarCollapsed",he=16,Pe="(max-width: 767px)",B=e=>Math.min(Se,Math.max(je,e));function Ot(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(Pe).matches}const Mt='a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ft(e){return e?Array.from(e.querySelectorAll(Mt)).filter(t=>t.offsetParent!==null||t===document.activeElement):[]}function Ut(){if(typeof window>"u")return X;try{const e=window.localStorage.getItem(ke),t=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(t)?X:B(t)}catch{return X}}function Kt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ee)==="1"}catch{return!1}}const Bt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],$t=[{to:"/",section:"home",label:"Overview",end:!0,icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),n.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),n.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),n.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),n.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function zt(){const{logout:e}=re(),t=o.useRef(null),r=o.useRef(null),s=o.useRef(null),[a,i]=o.useState(Ut),[u,d]=o.useState(Kt),[f,y]=o.useState(!1),[h,b]=o.useState(Ot),[m,N]=o.useState(!1);o.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const l=window.matchMedia(Pe),v=w=>{b(w.matches),w.matches||N(!1)};return typeof l.addEventListener=="function"?(l.addEventListener("change",v),()=>l.removeEventListener("change",v)):(l.addListener(v),()=>l.removeListener(v))},[]),o.useEffect(()=>{if(!m)return;const l=v=>{v.key==="Escape"&&N(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[m]),o.useEffect(()=>{var l,v,w;h&&(m?(l=t.current)==null||l.focus():(v=t.current)!=null&&v.contains(document.activeElement)&&((w=s.current)==null||w.focus()))},[h,m]);const M=o.useCallback(l=>{if(l.key!=="Tab")return;const v=Ft(t.current);if(v.length===0)return;const w=v[0],k=v[v.length-1],F=document.activeElement;l.shiftKey&&(F===w||F===t.current)?(l.preventDefault(),k.focus()):!l.shiftKey&&F===k&&(l.preventDefault(),w.focus())},[]);o.useEffect(()=>{const l=window.setTimeout(()=>{try{window.localStorage.setItem(ke,String(Math.round(a)))}catch{}},200);return()=>window.clearTimeout(l)},[a]),o.useEffect(()=>{try{window.localStorage.setItem(Ee,u?"1":"0")}catch{}},[u]);const Ce=o.useCallback(l=>{l.preventDefault(),l.currentTarget.setPointerCapture(l.pointerId),y(!0)},[]),Te=o.useCallback(l=>{var w;if(!l.currentTarget.hasPointerCapture(l.pointerId))return;const v=((w=t.current)==null?void 0:w.getBoundingClientRect().left)??0;i(B(l.clientX-v))},[]),_e=o.useCallback(l=>{l.currentTarget.hasPointerCapture(l.pointerId)&&l.currentTarget.releasePointerCapture(l.pointerId),y(!1)},[]),Le=o.useCallback(l=>{var v;l.preventDefault(),(v=r.current)==null||v.focus()},[]),De=o.useCallback(l=>{l.key==="ArrowLeft"?(l.preventDefault(),i(v=>B(v-he))):l.key==="ArrowRight"&&(l.preventDefault(),i(v=>B(v+he)))},[]),Ae=u?Rt:a,S=h?!1:u,W=h&&m?!0:void 0;return n.jsxs("div",{className:T("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[n.jsx("button",{type:"button",inert:W,onClick:Le,className:"sr-only focus:not-sr-only focus:absolute focus:top-3 focus:left-3 focus:z-50 focus:rounded-lg focus:border focus:border-[var(--otari-brand)] focus:bg-[var(--otari-surface)] focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-[var(--otari-brand-dark)] focus:shadow-md focus:outline-none",children:"Skip to main content"}),n.jsxs("header",{inert:W,className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("button",{type:"button",ref:s,onClick:()=>N(l=>!l),"aria-label":m?"Close navigation":"Open navigation","aria-expanded":m,"aria-controls":"app-sidebar",className:"-ml-1 flex h-8 w-8 items-center justify-center rounded-lg text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)] md:hidden",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5",children:n.jsx("path",{d:"M4 6h16M4 12h16M4 18h16",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),n.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),n.jsx(C,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),n.jsx(qt,{}),n.jsx(st,{}),n.jsx(At,{}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[h&&m?n.jsx("div",{"aria-hidden":"true",onClick:()=>N(!1),className:"fixed inset-0 z-30 bg-black/40 md:hidden"}):null,n.jsxs("aside",{ref:t,id:"app-sidebar",role:h?"dialog":void 0,"aria-modal":h&&m?!0:void 0,"aria-label":h?"Navigation":void 0,tabIndex:h?-1:void 0,inert:h&&!m?!0:void 0,onKeyDown:h&&m?M:void 0,style:h?void 0:{width:Ae},className:T("flex flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)] focus:outline-none",h?T("fixed inset-y-0 left-0 z-40 w-[17rem] shadow-xl transition-transform duration-200",m?"translate-x-0":"-translate-x-full"):T("relative shrink-0",!f&&"transition-[width] duration-150")),children:[n.jsx("button",{type:"button",onClick:()=>d(l=>!l),"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-pressed":u,title:u?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 hidden h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)] md:flex",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:T("h-3.5 w-3.5 transition-transform",u&&"rotate-180"),children:n.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("nav",{className:T("flex flex-col py-4",S?"px-2":"px-3"),children:Bt.map((l,v)=>{const w=$t.filter(k=>k.section===l.key);return w.length===0?null:n.jsxs("div",{className:v>0?"mt-4":void 0,children:[!S&&l.label?n.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:l.label}):null,v>0&&(S||!l.label)?n.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,n.jsx("div",{className:"flex flex-col gap-1",children:w.map(k=>n.jsxs(Z,{to:k.to,end:k.end,onClick:()=>N(!1),"aria-label":S?k.label:void 0,title:S?k.label:void 0,className:({isActive:F})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"justify-center px-0":"gap-3 px-3",F?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,S?null:k.label]},k.to))})]},l.key)})}),n.jsxs("div",{className:"mt-auto flex flex-col gap-1 pb-3",children:[n.jsxs(Z,{to:"/docs",onClick:()=>N(!1),"aria-label":S?"User guide":void 0,title:S?"User guide":void 0,className:({isActive:l})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"mx-2 justify-center px-0":"mx-3 gap-3 px-3",l?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[n.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.5V18c4 0 6.5.5 8 2 1.5-1.5 4-2 8-2V4.5c-4 0-6.5.5-8 2z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 6.5V20",strokeLinecap:"round"})]}),S?null:"User guide"]}),n.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai: the hosted Otari gateway",className:T("flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",S?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),S?null:n.jsxs("span",{className:"flex-1",children:["otari.ai ",n.jsx("span",{"aria-hidden":!0,children:"↗"})]})]})]}),u||h?null:n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(a),"aria-valuemin":je,"aria-valuemax":Se,tabIndex:0,onPointerDown:Ce,onPointerMove:Te,onPointerUp:_e,onKeyDown:De,className:T("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),n.jsx("main",{ref:r,id:"main-content",tabIndex:-1,inert:W,className:"flex-1 overflow-y-auto focus:outline-none",children:n.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-4 py-5 md:px-6 md:py-6",children:n.jsx(Ue,{})})})]})]})}function Qt(){const{login:e}=re(),[t,r]=o.useState(""),[s,a]=o.useState(null),[i,u]=o.useState(!1),d=async()=>{const f=t.trim();if(!(!f||i)){u(!0),a(null);try{await Xe(f)?e():a(new Error("Invalid master key."))}catch(y){a(y)}finally{u(!1)}}};return n.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:n.jsx(I,{className:"w-full max-w-md",children:n.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),n.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),d()},children:[n.jsxs(We,{value:t,onChange:f=>{r(f),s&&a(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),n.jsx(ye,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),n.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[n.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),n.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",n.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",n.jsx("code",{children:"Your master key:"})," (for example, run"," ",n.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),n.jsx(Tt,{error:s}),n.jsx(C,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!t.trim()||i,children:i?"Signing in…":"Sign in"})]}),n.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),n.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:n.jsx(He,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const Vt=o.lazy(async()=>({default:(await P(async()=>{const{ActivityPage:e}=await import("./ActivityPage-CGtQFYkj.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))).ActivityPage})),Wt=o.lazy(async()=>({default:(await P(async()=>{const{AliasesPage:e}=await import("./AliasesPage-BW4Ki1y6.js");return{AliasesPage:e}},__vite__mapDeps([10,1,2,6,4,7,8,11,12]))).AliasesPage})),Ht=o.lazy(async()=>({default:(await P(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-B98xbp9L.js");return{BudgetsPage:e}},__vite__mapDeps([13,1,2,6,4,7,8,11]))).BudgetsPage})),Gt=o.lazy(async()=>({default:(await P(async()=>{const{DocsPage:e}=await import("./DocsPage-CQXolIdY.js");return{DocsPage:e}},__vite__mapDeps([14,1,2,4]))).DocsPage})),Jt=o.lazy(async()=>({default:(await P(async()=>{const{KeysPage:e}=await import("./KeysPage-BBEXGo7q.js");return{KeysPage:e}},__vite__mapDeps([15,1,2,6,4,7,8,11,16,12]))).KeysPage})),Yt=o.lazy(async()=>({default:(await P(async()=>{const{ModelsPage:e}=await import("./ModelsPage-XwbqKUgz.js");return{ModelsPage:e}},__vite__mapDeps([17,1,2,6,4,8,9]))).ModelsPage})),Xt=o.lazy(async()=>({default:(await P(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-XfWqfHJ2.js");return{OverviewIndex:e}},__vite__mapDeps([18,1,2,19,5,4,8]))).OverviewIndex})),Zt=o.lazy(async()=>({default:(await P(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-HN_Zodtk.js");return{ProvidersPage:e}},__vite__mapDeps([20,1,2,11,4,8]))).ProvidersPage})),en=o.lazy(async()=>({default:(await P(async()=>{const{SettingsPage:e}=await import("./SettingsPage-Csgj1pAU.js");return{SettingsPage:e}},__vite__mapDeps([21,1,2,4]))).SettingsPage})),tn=o.lazy(async()=>({default:(await P(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-DPdRTl_b.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([22,1,2,4]))).ToolsGuardrailsPage})),nn=o.lazy(async()=>({default:(await P(async()=>{const{UsagePage:e}=await import("./UsagePage-BAefkQlH.js");return{UsagePage:e}},__vite__mapDeps([23,1,2,3,4,5,6,19,7,8,9]))).UsagePage})),rn=o.lazy(async()=>({default:(await P(async()=>{const{UsersPage:e}=await import("./UsersPage-Lrd1SvIH.js");return{UsersPage:e}},__vite__mapDeps([24,1,2,6,4,7,8,11,16]))).UsersPage}));function E(e){return n.jsx(o.Suspense,{fallback:n.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function sn(){const{isAuthenticated:e}=re();return e?n.jsx(Ke,{children:n.jsx(Be,{children:n.jsxs(j,{element:n.jsx(zt,{}),children:[n.jsx(j,{index:!0,element:E(n.jsx(Xt,{}))}),n.jsx(j,{path:"providers",element:E(n.jsx(Zt,{}))}),n.jsx(j,{path:"keys",element:E(n.jsx(Jt,{}))}),n.jsx(j,{path:"users",element:E(n.jsx(rn,{}))}),n.jsx(j,{path:"budgets",element:E(n.jsx(Ht,{}))}),n.jsx(j,{path:"activity",element:E(n.jsx(Vt,{}))}),n.jsx(j,{path:"usage",element:E(n.jsx(nn,{}))}),n.jsx(j,{path:"models",element:E(n.jsx(Yt,{}))}),n.jsx(j,{path:"aliases",element:E(n.jsx(Wt,{}))}),n.jsx(j,{path:"tools",element:E(n.jsx(tn,{}))}),n.jsx(j,{path:"settings",element:E(n.jsx(en,{}))}),n.jsx(j,{path:"docs",element:E(n.jsx(Gt,{}))}),n.jsx(j,{path:"*",element:n.jsx($e,{to:"/",replace:!0})})]})})}):n.jsx(Qt,{})}function an({children:e}){const[t]=o.useState(()=>new Re({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(r,s)=>s instanceof L&&(s.status===401||s.status===403)?!1:r<2}}}));return n.jsx(Oe,{client:t,children:n.jsx(tt,{children:e})})}const Ne=document.getElementById("root");if(!Ne)throw new Error("Root element #root not found");Ge.createRoot(Ne).render(n.jsx(o.StrictMode,{children:n.jsx(an,{children:n.jsx(sn,{})})}));export{hr as $,hn as A,Zn as B,xn as C,Jn as D,Tt as E,Cr as F,wn as G,$n as H,_t as I,qn as J,zn as K,yr as L,Qn as M,Ct as N,vr as O,Sr as P,mt as Q,kr as R,xr as S,Sn as T,Pr as U,Pn as V,br as W,wr as X,at as Y,gr as Z,jr as _,Gn as a,Pt as a0,Nt as a1,Cn as a2,Ln as a3,An as a4,ft as a5,_n as a6,Nn as a7,Tn as a8,En as a9,kn as aa,In as ab,Vn as ac,Wn as ad,Hn as ae,Fn as af,Dn as ag,Un as ah,Kn as ai,Bn as aj,mn as ak,dn as al,pr as am,bn as an,ot as ao,pn as ap,gn as aq,lr as ar,ir as as,cr as b,ur as c,fr as d,vn as e,yn as f,dr as g,mr as h,fn as i,Tr as j,it as k,jn as l,Rn as m,Mn as n,Nr as o,On as p,er as q,nr as r,rr as s,sr as t,ar as u,or as v,Er as w,tr as x,Yn as y,Xn as z}; diff --git a/src/gateway/static/dashboard/index.html b/src/gateway/static/dashboard/index.html index 5db4e6b37..3b09a04d9 100644 --- a/src/gateway/static/dashboard/index.html +++ b/src/gateway/static/dashboard/index.html @@ -19,11 +19,11 @@ insets to sit out of the way. --> Otari Dashboard - + - +
diff --git a/web/src/api/types.ts b/web/src/api/types.ts index dc16dadef..2ec4df077 100644 --- a/web/src/api/types.ts +++ b/web/src/api/types.ts @@ -530,6 +530,9 @@ export interface UsageSummary { by_model: UsageGroupRow[]; by_user: UsageGroupRow[]; by_api_key: UsageGroupRow[]; + // Provenance breakdown. Optional because it postdates the other groupings, so + // an older gateway serving a newer dashboard omits it; read it defensively. + by_source?: UsageGroupRow[]; series: UsageSeriesPoint[]; } diff --git a/web/src/pages/ActivityPage.test.tsx b/web/src/pages/ActivityPage.test.tsx index 48e44097a..aa07ea115 100644 --- a/web/src/pages/ActivityPage.test.tsx +++ b/web/src/pages/ActivityPage.test.tsx @@ -87,6 +87,13 @@ function mockApi(opts: { rows?: UsageEntry[]; total?: number } = {}) { by_model: models.map((m) => ({ key: m, cost: 0, tokens: 0, requests: 0, is_other: false })), by_user: [], by_api_key: [], + by_source: Array.from(new Set(rows.map((r) => r.source))).map((s) => ({ + key: s, + cost: 0, + tokens: 0, + requests: 0, + is_other: false, + })), series: [], }); } @@ -263,6 +270,156 @@ describe("ActivityPage", () => { await waitFor(() => expect(listCalls(calls).at(-1)).toContain("priced=false")); }); + it("offers the sources seen in the window and sends the picked one to the API", async () => { + const { calls } = mockApi({ + rows: [entry(), entry({ id: "imp", model: "claude-sonnet-4", source: "claude_code", counts_toward_budget: false })], + }); + const user = userEvent.setup(); + renderPage(); + await screen.findByText("gpt-4o"); + + // Options come from the log itself (the summary's provenance breakdown), with + // friendly labels for the sources the page knows about. + const select = screen.getByLabelText("Source"); + await waitFor(() => expect(within(select).getByRole("option", { name: "Claude Code" })).toBeInTheDocument()); + expect(within(select).getByRole("option", { name: "Gateway" })).toBeInTheDocument(); + + await user.selectOptions(select, "claude_code"); + await waitFor(() => expect(listCalls(calls).at(-1)).toContain("source=claude_code")); + }); + + it("keeps a drill-down source listed even when the window holds none of its rows", async () => { + // The select must show the filter that is actually applied, or the operator + // sees a chip they cannot find in the picker. + mockApi({ rows: [entry({ source: "gateway" })] }); + renderPage(, "/activity?source=codex"); + await screen.findByText("gpt-4o"); + + const select = screen.getByLabelText("Source"); + expect(within(select).getByRole("option", { name: "Codex" })).toBeInTheDocument(); + expect(select).toHaveValue("codex"); + }); + + it("shows a row's token composition rather than one uninformative total", async () => { + // A cached agent request: the total is ~98% cache read, so the total alone + // makes every row look alike. The bar carries the split. + mockApi({ + rows: [ + entry({ + prompt_tokens: 100_000, + completion_tokens: 500, + total_tokens: 100_500, + cache_read_tokens: 98_000, + cache_write_tokens: 1_500, + billing_meters: { + total_input_tokens: 100_000, + fresh_input_tokens: 500, + cache_read_tokens: 98_000, + cache_write_tokens: 1_500, + cache_write_1h_tokens: 0, + completion_tokens: 500, + }, + }), + ], + }); + renderPage(); + + const row = (await screen.findByText("gpt-4o")).closest("tr")!; + expect(within(row).getByText("100,500")).toBeInTheDocument(); + const bar = within(row).getByRole("img", { name: /Token composition/ }); + expect(bar).toHaveAccessibleName( + "Token composition: Fresh input 500, Cache read 98,000, Cache write 1,500, Output 500", + ); + + // Four segments, widest being the cache read, so the shape is what the eye + // compares between rows. + const widths = [...bar.querySelectorAll("rect")].map((r) => Number(r.getAttribute("width"))); + expect(widths).toHaveLength(4); + expect(Math.max(...widths)).toBeCloseTo((98_000 / 100_500) * 100, 5); + expect(widths.reduce((a, b) => a + b, 0)).toBeCloseTo(100, 5); + }); + + it("splits an unmetered row from its raw columns, and shows no bar without usage", async () => { + // An unpriced row carries no billing meters, so the composition falls back to + // the raw columns (cache read counted inside the prompt). + mockApi({ + rows: [ + entry({ + id: "unpriced", + model: "unpriced-model", + prompt_tokens: 1_000, + completion_tokens: 200, + total_tokens: 1_200, + cache_read_tokens: 400, + billing_meters: null, + cost: null, + }), + entry({ id: "failed", model: "failed-model", status: "error", prompt_tokens: null, completion_tokens: null, total_tokens: null }), + ], + }); + renderPage(); + + const unpriced = (await screen.findByText("unpriced-model")).closest("tr")!; + expect(within(unpriced).getByRole("img", { name: /Token composition/ })).toHaveAccessibleName( + "Token composition: Fresh input 600, Cache read 400, Output 200", + ); + + // A request that failed before the provider reported usage has nothing to + // compose, so the cell stays an em-dash instead of drawing an empty bar. + const failed = screen.getByText("failed-model").closest("tr")!; + expect(within(failed).queryByRole("img", { name: /Token composition/ })).not.toBeInTheDocument(); + expect(within(failed).getByText("—")).toBeInTheDocument(); + }); + + it("opens a bookmarked deep page on that page", async () => { + // The URL is the source of truth for `page`, but the mount effect used to + // re-anchor the rolling window a few milliseconds later, which changed the + // filter set and reset the page: every shared `?page=3` link opened on page 1. + const { calls } = mockApi({ rows: Array.from({ length: 50 }, (_, i) => entry({ id: `r${i}` })), total: 500 }); + renderPage(, "/activity?page=2"); + + await screen.findAllByText("gpt-4o"); + expect(await screen.findByText("101–150 of 500")).toBeInTheDocument(); + expect(listCalls(calls).every((url) => url.includes("skip=100"))).toBe(true); + }); + + it("keeps the current page when refreshing", async () => { + // Refresh used to re-anchor the rolling window, which changed the filter set, + // which reset the page: pressing it on page 3 dropped you back to page 1. + const { calls } = mockApi({ rows: Array.from({ length: 50 }, (_, i) => entry({ id: `r${i}` })), total: 500 }); + const user = userEvent.setup(); + renderPage(, "/activity?page=2"); + await screen.findAllByText("gpt-4o"); + expect(await screen.findByText("101–150 of 500")).toBeInTheDocument(); + + const before = listCalls(calls).length; + const button = screen.getByRole("button", { name: "Refresh" }); + await waitFor(() => expect(button).toBeEnabled()); + await user.click(button); + + // The list is refetched, and every fetch stays on the third page's offset. + await waitFor(() => expect(listCalls(calls).length).toBeGreaterThan(before)); + expect(listCalls(calls).every((url) => url.includes("skip=100"))).toBe(true); + expect(screen.getByText("101–150 of 500")).toBeInTheDocument(); + }); + + it("re-anchors a rolling window when its preset is re-picked", async () => { + // Refresh no longer moves the window, so re-selecting the active preset is the + // gesture that advances a rolling range to "now". + const { calls } = mockApi({ rows: [entry()] }); + const user = userEvent.setup(); + renderPage(); + await screen.findByText("gpt-4o"); + + const startOf = (url: string): string | null => new URL(url, "http://x").searchParams.get("start_date"); + const before = startOf(listCalls(calls).at(-1)!); + expect(before).not.toBeNull(); + + await user.click(screen.getByRole("button", { name: "24h" })); + + await waitFor(() => expect(startOf(listCalls(calls).at(-1)!)).not.toBe(before)); + }); + it("distinguishes filtered-empty from never-used", async () => { const user = userEvent.setup(); mockApi({ rows: [], total: 0 }); diff --git a/web/src/pages/ActivityPage.tsx b/web/src/pages/ActivityPage.tsx index 262e9ccd7..b82a22608 100644 --- a/web/src/pages/ActivityPage.tsx +++ b/web/src/pages/ActivityPage.tsx @@ -170,6 +170,105 @@ function sourceLabel(source: string): string { return SOURCE_LABELS[source] ?? source; } +// ---------- token composition ---------- +// +// One total is the least useful number on the row: on a cached agent workload it +// is ~98% cache read, so every row shows a large, similar-looking figure. The +// composition is what varies, so the column renders the split. + +interface TokenComposition { + // Input tokens billed at the full input rate (the prompt minus whatever was + // served from, or written to, the cache). + fresh: number; + cacheRead: number; + cacheWrite: number; + output: number; + total: number; +} + +function positive(value: unknown): number { + return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : 0; +} + +// Split a row's tokens into fresh input / cache read / cache write / output, or +// null when the row carries no usage at all (an error before the provider replied). +// +// `billing_meters` is preferred because it is the *normalized* view: providers +// disagree on whether cache reads and writes are counted inside `prompt_tokens` +// (OpenAI: yes, Anthropic: no), and the row does not record which convention its +// numbers follow, so the raw columns alone cannot be split reliably. The writers +// resolve that when they price a row, so meters are present for any priced row. +// Failing that, assume the subset convention and clamp, which is exact whenever +// there is no cache usage to misattribute. +function tokenComposition(entry: UsageEntry): TokenComposition | null { + const meters = entry.billing_meters ?? null; + const totalInput = meters ? positive(meters.total_input_tokens) : positive(entry.prompt_tokens); + const cacheRead = meters ? positive(meters.cache_read_tokens) : positive(entry.cache_read_tokens); + const cacheWrite = meters ? positive(meters.cache_write_tokens) : positive(entry.cache_write_tokens); + const output = meters ? positive(meters.completion_tokens) : positive(entry.completion_tokens); + const fresh = Math.max(0, totalInput - cacheRead - cacheWrite); + const total = fresh + cacheRead + cacheWrite + output; + return total > 0 ? { fresh, cacheRead, cacheWrite, output, total } : null; +} + +// Segment order runs input side first (fresh, then the two cache buckets), then +// output. Shading is one hue at four lightnesses, ordered so the dearest tokens +// read darkest: nothing is encoded by hue, and the tooltip / accessible name +// carry every number, so the bar adds a shape to scan and removes no information. +const TOKEN_SEGMENTS: { key: keyof Omit; label: string; fill: string }[] = [ + { key: "fresh", label: "Fresh input", fill: "var(--otari-brand)" }, + { key: "cacheRead", label: "Cache read", fill: "var(--otari-line)" }, + { key: "cacheWrite", label: "Cache write", fill: "var(--otari-brand-soft)" }, + { key: "output", label: "Output", fill: "var(--otari-brand-dark)" }, +]; + +// The total plus a thin stacked bar of its composition. Widths are SVG rect +// attributes in a 100-unit viewBox (a dynamic Tailwind `w-[n%]` would not survive +// the JIT scanner, and inline styles are out). +// +// The number shown is the sum of the segments, so the cell is internally +// consistent and reads as "tokens billed". For an additive-convention row that is +// higher than the raw `total_tokens` column (which excludes the cache buckets); +// the raw fields stay visible, unchanged, in the detail panel. +function TokenBar({ entry }: { entry: UsageEntry }) { + const composition = tokenComposition(entry); + if (composition === null) { + return {formatTokens(entry.total_tokens)}; + } + const parts = TOKEN_SEGMENTS.map((segment) => ({ ...segment, value: composition[segment.key] })); + const summary = parts + .filter((part) => part.value > 0) + .map((part) => `${part.label} ${part.value.toLocaleString()}`) + .join(", "); + + let offset = 0; + const rects = parts.map((part) => { + const width = (part.value / composition.total) * 100; + const rect = { ...part, x: offset, width }; + offset += width; + return rect; + }); + + return ( + + {composition.total.toLocaleString()} + + {rects + .filter((rect) => rect.width > 0) + .map((rect) => ( + + ))} + + + ); +} + export async function copyToClipboard( text: string, clipboard: Pick | undefined = navigator.clipboard, @@ -265,8 +364,8 @@ export function ActivityPage() { const userFilter = url.get("user_id"); const apiKeyFilter = url.get("api_key_id"); const pricedFilter = url.get("priced"); - // Provenance. No select of its own: it arrives from a drill-down (the pricing - // alarm links here scoped to gateway traffic) and is visible/clearable as a chip. + // Provenance: gateway traffic vs an imported agent source. Set by its own select, + // or by a drill-down (the pricing alarm links here scoped to gateway traffic). const sourceFilter = url.get("source"); const page = Math.max(0, url.getNumber("page")); // Snap URL-supplied sizes to the nearest offered option: selection latency @@ -280,16 +379,31 @@ export function ActivityPage() { ); // Snapshot the window so a rolling preset does not recompute "now" every render - // (which would churn the query key). Re-anchored when the range changes or on refresh. + // (which would churn the query key). Re-anchored when the range selection changes, + // and by re-picking the active preset (see `pickPreset`). + // + // Both re-anchor effects skip their first run. The `useState` initializers have + // already snapshotted the window, so re-anchoring on mount only moves `start` by + // the milliseconds since, which changes `filters`, which trips the page reset + // below: a bookmarked or shared `?page=3` URL would silently open on page 1. + const selectionKey = `${range}|${startParam}|${endParam}`; const [win, setWin] = useState(() => resolveWindow(range, startParam, endParam)); + const prevSelectionKey = useRef(selectionKey); useEffect(() => { + if (prevSelectionKey.current === selectionKey) return; + prevSelectionKey.current = selectionKey; setWin(resolveWindow(range, startParam, endParam)); - }, [range, startParam, endParam]); + }, [selectionKey, range, startParam, endParam]); // The preset extent (ignoring any brushed bounds) that the timeline histogram - // spans. Snapshotted like `win`, re-anchored when the preset changes. + // spans. Snapshotted like `win`, re-anchored when the preset changes: a brushed + // sub-window must leave the extent alone, or zooming in would drag the frame + // (and refetch the histogram) along with it. const [extentWin, setExtentWin] = useState(() => resolveExtentWindow(range)); + const prevRange = useRef(range); useEffect(() => { + if (prevRange.current === range) return; + prevRange.current = range; setExtentWin(resolveExtentWindow(range)); }, [range]); @@ -344,6 +458,31 @@ export function ActivityPage() { modelSummary.data?.by_model?.filter((r) => !r.is_other && r.key !== null).map((r) => r.key as string) ?? []; const keyOptions = (keys.data ?? []).map((k) => ({ value: k.id, label: k.key_name ?? `${k.id.slice(0, 8)}…` })); + // Source options, mirroring the model suggestions: sources with usage in the + // window, with the source filter itself omitted so switching from one source to + // another does not require clearing first. While neither this nor the model + // filter is set the two filter sets are equal, so the queries collapse into one. + const sourceSuggestFilters: UsageFilters = useMemo( + () => ({ + start_date: win.start, + end_date: win.end, + status: statusFilter || undefined, + model: modelFilter.trim() || undefined, + user_id: userFilter || undefined, + api_key_id: apiKeyFilter || undefined, + }), + [win, statusFilter, modelFilter, userFilter, apiKeyFilter], + ); + const sourceSummary = useUsageSummary(sourceSuggestFilters, "day"); + // A drill-down can name a source with no rows in the window; keep it listed so + // the select shows the filter that is actually applied. + const sourceOptions = useMemo(() => { + const seen = (sourceSummary.data?.by_source ?? []) + .filter((r) => !r.is_other && r.key !== null) + .map((r) => r.key as string); + return sourceFilter && !seen.includes(sourceFilter) ? [sourceFilter, ...seen] : seen; + }, [sourceSummary.data, sourceFilter]); + // The timeline histogram spans the whole preset *extent* (the rolling preset // window, independent of any brushed sub-window), so the brush always has // context to zoom back out into. For the unbounded "All", `extentWin` carries an @@ -496,21 +635,36 @@ export function ActivityPage() { ); }; - // Refetch every window-scoped query (see the UsagePage refresh note): the - // model typeahead summary would otherwise stay on cached data whenever the - // re-anchored window resolves to the same query key. + // Refresh means "same view, newer rows", so it deliberately does *not* re-anchor + // a rolling preset's window. Re-anchoring recomputed "now", which changed + // `filters`, which tripped the page reset below: pressing refresh on page 12 + // dropped the operator back onto page 1, making deep browsing unusable. The + // window is instead re-anchored when the range selection changes (see + // `pickPreset`). Every window-scoped query is refetched explicitly (see the + // UsagePage refresh note), since the keys are unchanged by design here. const refresh = () => { - setWin(resolveWindow(range, startParam, endParam)); - setExtentWin(resolveExtentWindow(range)); void usage.refetch(); void count.refetch(); void contextSummary.refetch(); void modelSummary.refetch(); + void sourceSummary.refetch(); }; // A rolling preset clears any explicit bounds; a timeline selection sets them // (the preset key is left as-is, since it still names the extent). - const pickPreset = (preset: RangePreset) => url.patch({ range: preset.key, start_date: "", end_date: "" }); + const pickPreset = (preset: RangePreset) => { + // Re-picking the preset that is already active is the explicit "re-anchor to + // now" gesture. It leaves the URL untouched, so the effect that snapshots the + // window never fires; do it here instead. (Going *to* a different preset, or + // off an explicit range, changes the URL and that effect handles it, so + // re-anchoring here as well would fire a second query for the same view.) + if (preset.key === range && !startParam && !endParam) { + setWin(resolveWindow(preset.key, "", "")); + setExtentWin(resolveExtentWindow(preset.key)); + return; + } + url.patch({ range: preset.key, start_date: "", end_date: "" }); + }; const pickCustom = (startIso: string, endIso: string) => url.patch({ start_date: startIso, end_date: endIso }); // Memoized on keyLabels (the only per-render input) so DataTable's per-row @@ -531,7 +685,7 @@ export function ActivityPage() { { id: "user", header: "User", cell: (e) => e.user_id ?? "—" }, { id: "model", header: "Model", isRowHeader: true, cell: (e) => e.model }, { id: "api_key", header: "API key", cell: (e) => {apiKeyLabel(e.api_key_id)} }, - { id: "tokens", header: "Tokens", align: "end", cell: (e) => formatTokens(e.total_tokens) }, + { id: "tokens", header: "Tokens", align: "end", cell: (e) => }, { id: "cost", header: "Cost", align: "end", cell: (e) => formatUSD(e.cost) }, { id: "latency", header: "Total time", align: "end", cell: (e) => formatLatency(e.latency_ms) }, { id: "status", header: "Status", cell: (e) => }, @@ -577,6 +731,14 @@ export function ActivityPage() { ))} + url.patch({ source: value })}> + + {sourceOptions.map((source) => ( + + ))} + Date: Sun, 2 Aug 2026 17:19:08 +0000 Subject: [PATCH 2/9] fix(dashboard): make the token bar's dominant segment actually visible Review of #474 caught that the palette put the palest fill on the segment that dominates the workload this bar exists for. `--otari-line` is the hairline/track token; used as a data fill it sits at 1.21:1 against the bar's own track, so the canonical 98%-cache-read row rendered as a near-empty pill: the exact opposite of the point. Shading is now assigned for legibility rather than by price, so the weakest fill is 1.98:1 (cache write, the rarest bucket) and every adjacent pair is at least 1.88:1. A cache-heavy row now reads as a filled mid-tone bar and a fresh-input row as a dark one, which is the distinction being drawn. The bar also grows from 4px to 6px, and `--otari-brand-soft` darkens to suit its one use. The source-suggestion query is no longer unconditional. With no source picked, the model-suggestion summary is already computed without one, so its provenance breakdown is that same full list; only a picked source needs a query of its own. That drops the third summary request that a model filter used to add, and stops the page relying on two filter sets hashing alike to collapse. Co-Authored-By: Claude Opus 5 (1M context) --- .../dashboard/assets/ActivityPage-CGtQFYkj.js | 1 - .../dashboard/assets/ActivityPage-Dd5_lVjd.js | 1 + ...ge-BW4Ki1y6.js => AliasesPage-BXueJgS_.js} | 2 +- ...ge-B98xbp9L.js => BudgetsPage-BQktAQRZ.js} | 2 +- ...-P_P4TNFr.js => ConfirmDialog-BXAKoq6j.js} | 2 +- ...sPage-CQXolIdY.js => DocsPage-xJDqWRaA.js} | 2 +- ...ps-CxOVvh-O.js => FilterChips-EkMEVflY.js} | 2 +- ...sPage-BBEXGo7q.js => KeysPage-DVB0fG8n.js} | 2 +- ...s7cWc.js => ModelScopeControl-CuclfKO5.js} | 2 +- ...age-XwbqKUgz.js => ModelsPage-D-sOtTsj.js} | 2 +- ...e-XfWqfHJ2.js => OverviewPage-BluitD8r.js} | 2 +- ...-HN_Zodtk.js => ProvidersPage-Bf-7xbup.js} | 2 +- ...e-Csgj1pAU.js => SettingsPage-OsrEeYZu.js} | 2 +- ...HTN5PVb.js => TablePagination-DSU6cRH7.js} | 2 +- ...l_b.js => ToolsGuardrailsPage-CSxGfHtw.js} | 2 +- ...Page-BAefkQlH.js => UsagePage-CtRIjZgb.js} | 2 +- ...Page-Lrd1SvIH.js => UsersPage-T4PK8YrW.js} | 2 +- .../{index-MlRogoGm.js => index-BCvb90M0.js} | 4 +- ...{index-BqdGY8GQ.css => index-Bu_MKbvb.css} | 2 +- src/gateway/static/dashboard/index.html | 4 +- web/src/api/types.ts | 5 ++- web/src/pages/ActivityPage.tsx | 40 +++++++++++-------- web/src/styles/globals.css | 7 +++- 23 files changed, 53 insertions(+), 41 deletions(-) delete mode 100644 src/gateway/static/dashboard/assets/ActivityPage-CGtQFYkj.js create mode 100644 src/gateway/static/dashboard/assets/ActivityPage-Dd5_lVjd.js rename src/gateway/static/dashboard/assets/{AliasesPage-BW4Ki1y6.js => AliasesPage-BXueJgS_.js} (98%) rename src/gateway/static/dashboard/assets/{BudgetsPage-B98xbp9L.js => BudgetsPage-BQktAQRZ.js} (99%) rename src/gateway/static/dashboard/assets/{ConfirmDialog-P_P4TNFr.js => ConfirmDialog-BXAKoq6j.js} (92%) rename src/gateway/static/dashboard/assets/{DocsPage-CQXolIdY.js => DocsPage-xJDqWRaA.js} (99%) rename src/gateway/static/dashboard/assets/{FilterChips-CxOVvh-O.js => FilterChips-EkMEVflY.js} (99%) rename src/gateway/static/dashboard/assets/{KeysPage-BBEXGo7q.js => KeysPage-DVB0fG8n.js} (98%) rename src/gateway/static/dashboard/assets/{ModelScopeControl-Bmks7cWc.js => ModelScopeControl-CuclfKO5.js} (98%) rename src/gateway/static/dashboard/assets/{ModelsPage-XwbqKUgz.js => ModelsPage-D-sOtTsj.js} (99%) rename src/gateway/static/dashboard/assets/{OverviewPage-XfWqfHJ2.js => OverviewPage-BluitD8r.js} (99%) rename src/gateway/static/dashboard/assets/{ProvidersPage-HN_Zodtk.js => ProvidersPage-Bf-7xbup.js} (99%) rename src/gateway/static/dashboard/assets/{SettingsPage-Csgj1pAU.js => SettingsPage-OsrEeYZu.js} (99%) rename src/gateway/static/dashboard/assets/{TablePagination-BHTN5PVb.js => TablePagination-DSU6cRH7.js} (98%) rename src/gateway/static/dashboard/assets/{ToolsGuardrailsPage-DPdRTl_b.js => ToolsGuardrailsPage-CSxGfHtw.js} (99%) rename src/gateway/static/dashboard/assets/{UsagePage-BAefkQlH.js => UsagePage-CtRIjZgb.js} (98%) rename src/gateway/static/dashboard/assets/{UsersPage-Lrd1SvIH.js => UsersPage-T4PK8YrW.js} (98%) rename src/gateway/static/dashboard/assets/{index-MlRogoGm.js => index-BCvb90M0.js} (96%) rename src/gateway/static/dashboard/assets/{index-BqdGY8GQ.css => index-Bu_MKbvb.css} (99%) diff --git a/src/gateway/static/dashboard/assets/ActivityPage-CGtQFYkj.js b/src/gateway/static/dashboard/assets/ActivityPage-CGtQFYkj.js deleted file mode 100644 index 2717ad6a9..000000000 --- a/src/gateway/static/dashboard/assets/ActivityPage-CGtQFYkj.js +++ /dev/null @@ -1 +0,0 @@ -import{j as s}from"./tanstack-query-1t81HyiD.js";import{u as st,r as c}from"./react-dgEcD0HR.js";import{u as at,a as rt,b as nt,c as Ce,d as Q,f as N,e as lt,A as K,g as ot,h as it,P as ct,E as dt,C as Ae,i as C,R as ut,F as X,j as ee,k as Ee,Y as mt}from"./index-MlRogoGm.js";import{A as pt,F as ht}from"./FilterChips-CxOVvh-O.js";import{u as gt,r as ft,B as xt}from"./tableSelection-9hV37uhu.js";import{C as _t}from"./ConfirmDialog-P_P4TNFr.js";import{D as bt}from"./DataTable-Bmn_eYSV.js";import{T as vt,S as kt,P as yt}from"./TablePagination-BHTN5PVb.js";import{B as te}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function St(t){const[r,i]=st(),a=c.useCallback(l=>r.get(l)??t[l],[r,t]),o=c.useCallback(l=>{const d=Number.parseInt(r.get(l)??"",10);if(!Number.isNaN(d))return d;const u=Number.parseInt(t[l],10);return Number.isNaN(u)?0:u},[r,t]),x=c.useCallback(l=>{i(d=>{const u=new URLSearchParams(d);for(const[p,g]of Object.entries(l)){const v=String(g);v===""||v===t[p]?u.delete(p):u.set(p,v)}return u},{replace:!0})},[i,t]);return{get:a,getNumber:o,patch:x}}const jt=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return t===null?"—":jt.format(t)}function y(t){return t===null?"—":t.toLocaleString()}function Fe(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function wt(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleString()}function Ct(t){const r=new Date(t).getTime();if(Number.isNaN(r))return t;const i=Math.max(0,Math.round((Date.now()-r)/1e3));if(i<60)return`${i}s ago`;const a=Math.round(i/60);if(a<60)return`${a}m ago`;const o=Math.round(a/60);return o<24?`${o}h ago`:`${Math.round(o/24)}d ago`}const Nt=t=>t.id,Pt=t=>t.status==="error"?"bg-red-50":void 0,Ne=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],Pe=[{label:"All",value:""},{label:"Priced",value:"true"},{label:"Unpriced",value:"false"}],At=50,Et={range:K,start_date:"",end_date:"",status:"",model:"",user_id:"",api_key_id:"",priced:"",source:"",page:"0",size:String(At)};function $(t,r,i){if(r||i)return{start:r||void 0,end:i||void 0};if(t===Ae)return{};const a=N(C,t)??N(C,K),o=(a==null?void 0:a.seconds)??null;return{start:o==null?void 0:Ee(o),end:void 0}}function se(t){const r=$(t,"","");if(r.start)return r;const i=N(C,t);return(i==null?void 0:i.seconds)==null?{start:Ee(mt)}:r}function Ft({status:t}){const r=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return s.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r}`,children:t})}const Mt={gateway:"Gateway",claude_code:"Claude Code",codex:"Codex"};function ae(t){return Mt[t]??t}function k(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function Tt(t){const r=t.billing_meters??null,i=k(r?r.total_input_tokens:t.prompt_tokens),a=k(r?r.cache_read_tokens:t.cache_read_tokens),o=k(r?r.cache_write_tokens:t.cache_write_tokens),x=k(r?r.completion_tokens:t.completion_tokens),l=Math.max(0,i-a-o),d=l+a+o+x;return d>0?{fresh:l,cacheRead:a,cacheWrite:o,output:x,total:d}:null}const Dt=[{key:"fresh",label:"Fresh input",fill:"var(--otari-brand)"},{key:"cacheRead",label:"Cache read",fill:"var(--otari-line)"},{key:"cacheWrite",label:"Cache write",fill:"var(--otari-brand-soft)"},{key:"output",label:"Output",fill:"var(--otari-brand-dark)"}];function Ot({entry:t}){const r=Tt(t);if(r===null)return s.jsx("span",{className:"tabular-nums",children:y(t.total_tokens)});const i=Dt.map(l=>({...l,value:r[l.key]})),a=i.filter(l=>l.value>0).map(l=>`${l.label} ${l.value.toLocaleString()}`).join(", ");let o=0;const x=i.map(l=>{const d=l.value/r.total*100,u={...l,x:o,width:d};return o+=d,u});return s.jsxs("span",{className:"inline-flex flex-col items-end gap-1",title:a,children:[s.jsx("span",{className:"tabular-nums",children:r.total.toLocaleString()}),s.jsx("svg",{viewBox:"0 0 100 4",preserveAspectRatio:"none",role:"img","aria-label":`Token composition: ${a}`,className:"h-1 w-16 overflow-hidden rounded-full bg-[var(--otari-bg)]",children:x.filter(l=>l.width>0).map(l=>s.jsx("rect",{x:l.x,y:0,width:l.width,height:4,fill:l.fill},l.key))})]})}function h({label:t,children:r}){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),s.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:r})]})}function It({entry:t}){var r;return s.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"}),s.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"This request failed. Inspect gateway logs for details."})]}):null,s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(h,{label:"Provider",children:t.provider??"—"}),s.jsx(h,{label:"Endpoint",children:t.endpoint}),s.jsx(h,{label:"Source",children:ae(t.source)}),t.source_label?s.jsx(h,{label:"Session",children:t.source_label}):null,s.jsx(h,{label:"User",children:t.user_id??"—"}),s.jsx(h,{label:"API key",children:t.api_key_id??"—"}),s.jsx(h,{label:"Prompt tokens",children:y(t.prompt_tokens)}),s.jsx(h,{label:"Completion tokens",children:y(t.completion_tokens)}),s.jsx(h,{label:"Total tokens",children:y(t.total_tokens)}),s.jsx(h,{label:"Cost",children:U(t.cost)}),s.jsx(h,{label:"Cache read tokens",children:y(t.cache_read_tokens)}),s.jsx(h,{label:"Cache write tokens",children:y(t.cache_write_tokens)}),s.jsx(h,{label:"1h cache writes",children:y(t.cache_write_1h_tokens??null)}),s.jsx(h,{label:"Total time",children:Fe(t.latency_ms)}),s.jsx(h,{label:"Request ID",children:t.id})]}),(r=t.pricing_breakdown)!=null&&r.length?s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(i=>s.jsxs(h,{label:i.meter.replaceAll("_"," "),children:[y(i.units)," at ",U(i.rate_per_million)," / 1M, ",U(i.cost)]},i.meter))})]}):null]})}function Vt(){var ke,ye,Se,je,we;const t=at(),r=rt(),i=c.useMemo(()=>{const e=new Map;for(const n of r.data??[])e.set(n.id,n.key_name??`${n.id.slice(0,8)}…`);return e},[r.data]),a=St(Et),o=a.get("range"),x=a.get("start_date"),l=a.get("end_date"),d=a.get("status"),u=a.get("model"),p=a.get("user_id"),g=a.get("api_key_id"),v=a.get("priced"),f=a.get("source"),re=Math.max(0,a.getNumber("page")),ne=a.getNumber("size"),B=yt.reduce((e,n)=>Math.abs(n-ne)$(o,x,l)),oe=c.useRef(M);c.useEffect(()=>{oe.current!==M&&(oe.current=M,le($(o,x,l)))},[M,o,x,l]);const[T,ie]=c.useState(()=>se(o)),ce=c.useRef(o);c.useEffect(()=>{ce.current!==o&&(ce.current=o,ie(se(o)))},[o]);const D=v==="true"?!0:v==="false"?!1:void 0,b=c.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,model:u.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0,source:f||void 0,priced:D}),[m,d,u,p,g,f,D]),_=gt(),O=JSON.stringify(b),de=c.useRef(O);c.useEffect(()=>{de.current!==O&&(de.current=O,a.patch({page:0}),_.clear())},[O,a,_]);const S=nt(b,re,B),P=Ce(b),Me=c.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,user_id:p||void 0,api_key_id:g||void 0,source:f||void 0}),[m,d,p,g,f]),ue=Q(Me,"day"),q=((ye=(ke=ue.data)==null?void 0:ke.by_model)==null?void 0:ye.filter(e=>!e.is_other&&e.key!==null).map(e=>e.key))??[],me=(r.data??[]).map(e=>({value:e.id,label:e.key_name??`${e.id.slice(0,8)}…`})),Te=c.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,model:u.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0}),[m,d,u,p,g]),z=Q(Te,"day"),De=c.useMemo(()=>{var n;const e=(((n=z.data)==null?void 0:n.by_source)??[]).filter(w=>!w.is_other&&w.key!==null).map(w=>w.key);return f&&!e.includes(f)?[f,...e]:e},[z.data,f]),A=N(C,o)??N(C,K),E=!!(m.start&&T.start&&new Date(m.start).getTime()({start_date:E?m.start:T.start,end_date:E?m.end:void 0,status:d||void 0,model:u.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0,source:f||void 0,priced:D}),[E,m,T,d,u,p,g,f,D]),W=Q(Ie,pe),Re=(((Se=W.data)==null?void 0:Se.series)??[]).map(e=>({bucketStart:e.bucket_start,requests:e.requests})),j=S.data??[],Le=P.isSuccess&&!P.isPlaceholderData?((je=P.data)==null?void 0:je.total)??0:null,Y=N(C,o),Ue=!!(x||l)||o!==K&&(Y==null?void 0:Y.seconds)!=null,$e=!!(d||u.trim()||p||g||v||f||Ue),I=(e,n)=>{var w;return((w=e.find(tt=>tt.value===n))==null?void 0:w.label)??n},he=(t.data??[]).map(e=>({value:e.user_id,label:e.alias?`${e.alias} (${e.user_id})`:e.user_id})),Ke=()=>a.patch({status:"",priced:"",model:"",user_id:"",api_key_id:"",source:""}),Be=[...d?[{key:"status",label:"Status",value:I(Ne,d),onClear:()=>a.patch({status:""})}]:[],...v?[{key:"priced",label:"Priced",value:I(Pe,v),onClear:()=>a.patch({priced:""})}]:[],...p?[{key:"user",label:"User",value:I(he,p),onClear:()=>a.patch({user_id:""})}]:[],...u.trim()?[{key:"model",label:"Model",value:u.trim(),onClear:()=>a.patch({model:""})}]:[],...g?[{key:"key",label:"API key",value:I(me,g),onClear:()=>a.patch({api_key_id:""})}]:[],...f?[{key:"source",label:"Source",value:ae(f),onClear:()=>a.patch({source:""})}]:[]],G=c.useMemo(()=>j.filter(e=>!e.counts_toward_budget).map(e=>e.id),[j]),qe=c.useMemo(()=>j.filter(e=>e.counts_toward_budget).map(e=>e.id),[j]),ge=ft(_.selectedKeys,G),F=ge.length,fe=_.allMatching||F>0,ze=c.useMemo(()=>({...b,counts_toward_budget:!1}),[b]),xe=Ce(ze,fe),R=xe.isSuccess?((we=xe.data)==null?void 0:we.total)??null:null,We=G.length>0&&F===G.length&&R!=null&&R>F,L=_.allMatching?R??F:F,H=ot(),V=it(),[Ye,Z]=c.useState(!1),[Ge,J]=c.useState(!1),[He,_e]=c.useState(null),Ve=c.useCallback(e=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[s.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Request detail"}),s.jsx(te,{size:"sm",variant:"ghost",onPress:()=>_e(null),children:"Close"})]}),s.jsx(It,{entry:e})]}),[]),be=()=>_.allMatching?{by_filter:!0,model:b.model,user_id:b.user_id,api_key_id:b.api_key_id,status:b.status,start_date:b.start_date,end_date:b.end_date,priced:b.priced}:{ids:ge},Ze=()=>{H.mutate(be(),{onSuccess:()=>{Z(!1),_.clear()}})},Je=e=>{V.mutate({...be(),...e},{onSuccess:()=>{J(!1),_.clear()}})},Qe=()=>{S.refetch(),P.refetch(),W.refetch(),ue.refetch(),z.refetch()},ve=e=>{if(e.key===o&&!x&&!l){le($(e.key,"","")),ie(se(e.key));return}a.patch({range:e.key,start_date:"",end_date:""})},Xe=(e,n)=>a.patch({start_date:e,end_date:n}),et=c.useMemo(()=>{const e=n=>n===null?"—":i.get(n)??`${n.slice(0,8)}…`;return[{id:"time",header:"Time",cell:n=>s.jsx("span",{title:wt(n.timestamp),className:"text-[var(--otari-muted)]",children:Ct(n.timestamp)})},{id:"user",header:"User",cell:n=>n.user_id??"—"},{id:"model",header:"Model",isRowHeader:!0,cell:n=>n.model},{id:"api_key",header:"API key",cell:n=>s.jsx("span",{className:"text-[var(--otari-muted)]",children:e(n.api_key_id)})},{id:"tokens",header:"Tokens",align:"end",cell:n=>s.jsx(Ot,{entry:n})},{id:"cost",header:"Cost",align:"end",cell:n=>U(n.cost)},{id:"latency",header:"Total time",align:"end",cell:n=>Fe(n.latency_ms)},{id:"status",header:"Status",cell:n=>s.jsx(Ft,{status:n.status})}]},[i]);return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(ct,{title:"Activity",description:"A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored."}),s.jsx(dt,{error:S.error??P.error}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(pt,{presets:C,extentKey:Oe,onPreset:ve,onSelectRange:Xe,onSelectFull:()=>A?ve(A):void 0,series:Re,bucket:pe,windowStart:m.start,windowEnd:m.end,loading:W.isLoading,ariaLabel:"Activity request volume over the selected window",action:s.jsx(ut,{onRefresh:Qe,isFetching:S.isFetching,updatedAt:S.dataUpdatedAt})}),s.jsxs(ht,{chips:Be,onClearAll:Ke,children:[s.jsx(X,{id:"filter-status",label:"Status",value:d,onChange:e=>a.patch({status:e}),children:Ne.map(e=>s.jsx("option",{value:e.value,children:e.label},e.value))}),s.jsx(X,{id:"filter-priced",label:"Priced?",value:v,onChange:e=>a.patch({priced:e}),children:Pe.map(e=>s.jsx("option",{value:e.value,children:e.label},e.value))}),s.jsxs(X,{id:"filter-source",label:"Source",value:f,onChange:e=>a.patch({source:e}),children:[s.jsx("option",{value:"",children:"All"}),De.map(e=>s.jsx("option",{value:e,children:ae(e)},e))]}),s.jsx(ee,{label:"API key",value:g,onChange:e=>a.patch({api_key_id:e}),placeholder:"All keys",options:me}),s.jsx(ee,{label:"User",value:p,onChange:e=>a.patch({user_id:e}),placeholder:"All users",options:he}),s.jsx(ee,{label:"Model",value:u,onChange:e=>a.patch({model:e}),allowsCustom:!0,placeholder:"Any model",options:(u&&!q.includes(u)?[u,...q]:q).map(e=>({value:e,label:e}))})]})]}),fe?s.jsxs(xt,{selectedCount:L,allMatching:_.allMatching,matchingTotal:R,canSelectAllMatching:We,onSelectAllMatching:_.enableAllMatching,onClear:_.clear,children:[s.jsx(te,{size:"sm",variant:"primary",onPress:()=>J(!0),children:"Set price"}),s.jsx(te,{size:"sm",variant:"danger",onPress:()=>Z(!0),children:"Delete"})]}):null,s.jsx(bt,{ariaLabel:"Activity log",columns:et,rows:j,getRowKey:Nt,isLoading:S.isLoading,emptyContent:$e?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:_.selectedKeys,onSelectionChange:_.onSelectionChange,disabledKeys:qe,onRowAction:e=>_e(n=>n===e?null:e),rowClassName:Pt,detailKey:He,renderDetail:Ve}),s.jsx(vt,{page:re,pageSize:B,total:Le,rowsOnPage:j.length,onPageChange:e=>a.patch({page:e}),onPageSizeChange:e=>a.patch({size:e,page:0}),isFetching:S.isFetching,hasNextFallback:j.length===B}),s.jsx(_t,{isOpen:Ye,onOpenChange:Z,heading:"Delete usage rows",body:`Delete ${L.toLocaleString()} imported ${L===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:H.isPending,error:H.error,onConfirm:Ze}),s.jsx(kt,{isOpen:Ge,onOpenChange:J,targetCount:L,isPending:V.isPending,error:V.error,onSubmit:Je})]})}export{Vt as ActivityPage}; diff --git a/src/gateway/static/dashboard/assets/ActivityPage-Dd5_lVjd.js b/src/gateway/static/dashboard/assets/ActivityPage-Dd5_lVjd.js new file mode 100644 index 000000000..b11104b4f --- /dev/null +++ b/src/gateway/static/dashboard/assets/ActivityPage-Dd5_lVjd.js @@ -0,0 +1 @@ +import{j as s}from"./tanstack-query-1t81HyiD.js";import{u as rt,r as c}from"./react-dgEcD0HR.js";import{u as nt,a as ot,b as lt,c as Pe,d as J,f as C,e as it,A as $,g as ct,h as dt,P as ut,E as mt,C as Fe,i as w,R as pt,F as Q,j as X,k as Me,Y as ht}from"./index-BCvb90M0.js";import{A as gt,F as ft}from"./FilterChips-EkMEVflY.js";import{u as xt,r as _t,B as bt}from"./tableSelection-9hV37uhu.js";import{C as vt}from"./ConfirmDialog-BXAKoq6j.js";import{D as kt}from"./DataTable-Bmn_eYSV.js";import{T as yt,S as St,P as jt}from"./TablePagination-DSU6cRH7.js";import{B as ee}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function wt(t){const[r,i]=rt(),a=c.useCallback(o=>r.get(o)??t[o],[r,t]),l=c.useCallback(o=>{const d=Number.parseInt(r.get(o)??"",10);if(!Number.isNaN(d))return d;const u=Number.parseInt(t[o],10);return Number.isNaN(u)?0:u},[r,t]),x=c.useCallback(o=>{i(d=>{const u=new URLSearchParams(d);for(const[p,f]of Object.entries(o)){const v=String(f);v===""||v===t[p]?u.delete(p):u.set(p,v)}return u},{replace:!0})},[i,t]);return{get:a,getNumber:l,patch:x}}const Ct=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function L(t){return t===null?"—":Ct.format(t)}function y(t){return t===null?"—":t.toLocaleString()}function Te(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function Nt(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleString()}function Pt(t){const r=new Date(t).getTime();if(Number.isNaN(r))return t;const i=Math.max(0,Math.round((Date.now()-r)/1e3));if(i<60)return`${i}s ago`;const a=Math.round(i/60);if(a<60)return`${a}m ago`;const l=Math.round(a/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}const At=t=>t.id,Et=t=>t.status==="error"?"bg-red-50":void 0,Ae=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],Ee=[{label:"All",value:""},{label:"Priced",value:"true"},{label:"Unpriced",value:"false"}],Ft=50,Mt={range:$,start_date:"",end_date:"",status:"",model:"",user_id:"",api_key_id:"",priced:"",source:"",page:"0",size:String(Ft)};function U(t,r,i){if(r||i)return{start:r||void 0,end:i||void 0};if(t===Fe)return{};const a=C(w,t)??C(w,$),l=(a==null?void 0:a.seconds)??null;return{start:l==null?void 0:Me(l),end:void 0}}function te(t){const r=U(t,"","");if(r.start)return r;const i=C(w,t);return(i==null?void 0:i.seconds)==null?{start:Me(ht)}:r}function Tt({status:t}){const r=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return s.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r}`,children:t})}const Dt={gateway:"Gateway",claude_code:"Claude Code",codex:"Codex"};function se(t){return Dt[t]??t}function k(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function Ot(t){const r=t.billing_meters??null,i=k(r?r.total_input_tokens:t.prompt_tokens),a=k(r?r.cache_read_tokens:t.cache_read_tokens),l=k(r?r.cache_write_tokens:t.cache_write_tokens),x=k(r?r.completion_tokens:t.completion_tokens),o=Math.max(0,i-a-l),d=o+a+l+x;return d>0?{fresh:o,cacheRead:a,cacheWrite:l,output:x,total:d}:null}const It=[{key:"fresh",label:"Fresh input",fill:"var(--otari-ink)"},{key:"cacheRead",label:"Cache read",fill:"var(--otari-brand)"},{key:"cacheWrite",label:"Cache write",fill:"var(--otari-brand-soft)"},{key:"output",label:"Output",fill:"var(--otari-brand-dark)"}];function Rt({entry:t}){const r=Ot(t);if(r===null)return s.jsx("span",{className:"tabular-nums",children:y(t.total_tokens)});const i=It.map(o=>({...o,value:r[o.key]})),a=i.filter(o=>o.value>0).map(o=>`${o.label} ${o.value.toLocaleString()}`).join(", ");let l=0;const x=i.map(o=>{const d=o.value/r.total*100,u={...o,x:l,width:d};return l+=d,u});return s.jsxs("span",{className:"inline-flex flex-col items-end gap-1",title:a,children:[s.jsx("span",{className:"tabular-nums",children:r.total.toLocaleString()}),s.jsx("svg",{viewBox:"0 0 100 4",preserveAspectRatio:"none",role:"img","aria-label":`Token composition: ${a}`,className:"h-1.5 w-20 overflow-hidden rounded-full bg-[var(--otari-brand-tint)]",children:x.filter(o=>o.width>0).map(o=>s.jsx("rect",{x:o.x,y:0,width:o.width,height:4,fill:o.fill},o.key))})]})}function g({label:t,children:r}){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),s.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:r})]})}function Lt({entry:t}){var r;return s.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"}),s.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"This request failed. Inspect gateway logs for details."})]}):null,s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(g,{label:"Provider",children:t.provider??"—"}),s.jsx(g,{label:"Endpoint",children:t.endpoint}),s.jsx(g,{label:"Source",children:se(t.source)}),t.source_label?s.jsx(g,{label:"Session",children:t.source_label}):null,s.jsx(g,{label:"User",children:t.user_id??"—"}),s.jsx(g,{label:"API key",children:t.api_key_id??"—"}),s.jsx(g,{label:"Prompt tokens",children:y(t.prompt_tokens)}),s.jsx(g,{label:"Completion tokens",children:y(t.completion_tokens)}),s.jsx(g,{label:"Total tokens",children:y(t.total_tokens)}),s.jsx(g,{label:"Cost",children:L(t.cost)}),s.jsx(g,{label:"Cache read tokens",children:y(t.cache_read_tokens)}),s.jsx(g,{label:"Cache write tokens",children:y(t.cache_write_tokens)}),s.jsx(g,{label:"1h cache writes",children:y(t.cache_write_1h_tokens??null)}),s.jsx(g,{label:"Total time",children:Te(t.latency_ms)}),s.jsx(g,{label:"Request ID",children:t.id})]}),(r=t.pricing_breakdown)!=null&&r.length?s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(i=>s.jsxs(g,{label:i.meter.replaceAll("_"," "),children:[y(i.units)," at ",L(i.rate_per_million)," / 1M, ",L(i.cost)]},i.meter))})]}):null]})}function Jt(){var ke,ye,Se,je,we,Ce;const t=nt(),r=ot(),i=c.useMemo(()=>{const e=new Map;for(const n of r.data??[])e.set(n.id,n.key_name??`${n.id.slice(0,8)}…`);return e},[r.data]),a=wt(Mt),l=a.get("range"),x=a.get("start_date"),o=a.get("end_date"),d=a.get("status"),u=a.get("model"),p=a.get("user_id"),f=a.get("api_key_id"),v=a.get("priced"),h=a.get("source"),ae=Math.max(0,a.getNumber("page")),re=a.getNumber("size"),B=jt.reduce((e,n)=>Math.abs(n-re)U(l,x,o)),oe=c.useRef(F);c.useEffect(()=>{oe.current!==F&&(oe.current=F,ne(U(l,x,o)))},[F,l,x,o]);const[M,le]=c.useState(()=>te(l)),ie=c.useRef(l);c.useEffect(()=>{ie.current!==l&&(ie.current=l,le(te(l)))},[l]);const T=v==="true"?!0:v==="false"?!1:void 0,b=c.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,model:u.trim()||void 0,user_id:p||void 0,api_key_id:f||void 0,source:h||void 0,priced:T}),[m,d,u,p,f,h,T]),_=xt(),D=JSON.stringify(b),ce=c.useRef(D);c.useEffect(()=>{ce.current!==D&&(ce.current=D,a.patch({page:0}),_.clear())},[D,a,_]);const S=lt(b,ae,B),N=Pe(b),De=c.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,user_id:p||void 0,api_key_id:f||void 0,source:h||void 0}),[m,d,p,f,h]),K=J(De,"day"),q=((ye=(ke=K.data)==null?void 0:ke.by_model)==null?void 0:ye.filter(e=>!e.is_other&&e.key!==null).map(e=>e.key))??[],de=(r.data??[]).map(e=>({value:e.id,label:e.key_name??`${e.id.slice(0,8)}…`})),Oe=c.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,model:u.trim()||void 0,user_id:p||void 0,api_key_id:f||void 0}),[m,d,u,p,f]),ue=J(Oe,"day",!!h),me=(Se=h?ue.data:K.data)==null?void 0:Se.by_source,Ie=c.useMemo(()=>{const e=(me??[]).filter(n=>!n.is_other&&n.key!==null).map(n=>n.key);return h&&!e.includes(h)?[h,...e]:e},[me,h]),P=C(w,l)??C(w,$),A=!!(m.start&&M.start&&new Date(m.start).getTime()({start_date:A?m.start:M.start,end_date:A?m.end:void 0,status:d||void 0,model:u.trim()||void 0,user_id:p||void 0,api_key_id:f||void 0,source:h||void 0,priced:T}),[A,m,M,d,u,p,f,h,T]),z=J(Le,pe),Ue=(((je=z.data)==null?void 0:je.series)??[]).map(e=>({bucketStart:e.bucket_start,requests:e.requests})),j=S.data??[],$e=N.isSuccess&&!N.isPlaceholderData?((we=N.data)==null?void 0:we.total)??0:null,W=C(w,l),Be=!!(x||o)||l!==$&&(W==null?void 0:W.seconds)!=null,Ke=!!(d||u.trim()||p||f||v||h||Be),O=(e,n)=>{var Ne;return((Ne=e.find(at=>at.value===n))==null?void 0:Ne.label)??n},he=(t.data??[]).map(e=>({value:e.user_id,label:e.alias?`${e.alias} (${e.user_id})`:e.user_id})),qe=()=>a.patch({status:"",priced:"",model:"",user_id:"",api_key_id:"",source:""}),ze=[...d?[{key:"status",label:"Status",value:O(Ae,d),onClear:()=>a.patch({status:""})}]:[],...v?[{key:"priced",label:"Priced",value:O(Ee,v),onClear:()=>a.patch({priced:""})}]:[],...p?[{key:"user",label:"User",value:O(he,p),onClear:()=>a.patch({user_id:""})}]:[],...u.trim()?[{key:"model",label:"Model",value:u.trim(),onClear:()=>a.patch({model:""})}]:[],...f?[{key:"key",label:"API key",value:O(de,f),onClear:()=>a.patch({api_key_id:""})}]:[],...h?[{key:"source",label:"Source",value:se(h),onClear:()=>a.patch({source:""})}]:[]],Y=c.useMemo(()=>j.filter(e=>!e.counts_toward_budget).map(e=>e.id),[j]),We=c.useMemo(()=>j.filter(e=>e.counts_toward_budget).map(e=>e.id),[j]),ge=_t(_.selectedKeys,Y),E=ge.length,fe=_.allMatching||E>0,Ye=c.useMemo(()=>({...b,counts_toward_budget:!1}),[b]),xe=Pe(Ye,fe),I=xe.isSuccess?((Ce=xe.data)==null?void 0:Ce.total)??null:null,Ge=Y.length>0&&E===Y.length&&I!=null&&I>E,R=_.allMatching?I??E:E,G=ct(),H=dt(),[He,V]=c.useState(!1),[Ve,Z]=c.useState(!1),[Ze,_e]=c.useState(null),Je=c.useCallback(e=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[s.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Request detail"}),s.jsx(ee,{size:"sm",variant:"ghost",onPress:()=>_e(null),children:"Close"})]}),s.jsx(Lt,{entry:e})]}),[]),be=()=>_.allMatching?{by_filter:!0,model:b.model,user_id:b.user_id,api_key_id:b.api_key_id,status:b.status,start_date:b.start_date,end_date:b.end_date,priced:b.priced}:{ids:ge},Qe=()=>{G.mutate(be(),{onSuccess:()=>{V(!1),_.clear()}})},Xe=e=>{H.mutate({...be(),...e},{onSuccess:()=>{Z(!1),_.clear()}})},et=()=>{S.refetch(),N.refetch(),z.refetch(),K.refetch(),ue.refetch()},ve=e=>{if(e.key===l&&!x&&!o){ne(U(e.key,"","")),le(te(e.key));return}a.patch({range:e.key,start_date:"",end_date:""})},tt=(e,n)=>a.patch({start_date:e,end_date:n}),st=c.useMemo(()=>{const e=n=>n===null?"—":i.get(n)??`${n.slice(0,8)}…`;return[{id:"time",header:"Time",cell:n=>s.jsx("span",{title:Nt(n.timestamp),className:"text-[var(--otari-muted)]",children:Pt(n.timestamp)})},{id:"user",header:"User",cell:n=>n.user_id??"—"},{id:"model",header:"Model",isRowHeader:!0,cell:n=>n.model},{id:"api_key",header:"API key",cell:n=>s.jsx("span",{className:"text-[var(--otari-muted)]",children:e(n.api_key_id)})},{id:"tokens",header:"Tokens",align:"end",cell:n=>s.jsx(Rt,{entry:n})},{id:"cost",header:"Cost",align:"end",cell:n=>L(n.cost)},{id:"latency",header:"Total time",align:"end",cell:n=>Te(n.latency_ms)},{id:"status",header:"Status",cell:n=>s.jsx(Tt,{status:n.status})}]},[i]);return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(ut,{title:"Activity",description:"A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored."}),s.jsx(mt,{error:S.error??N.error}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(gt,{presets:w,extentKey:Re,onPreset:ve,onSelectRange:tt,onSelectFull:()=>P?ve(P):void 0,series:Ue,bucket:pe,windowStart:m.start,windowEnd:m.end,loading:z.isLoading,ariaLabel:"Activity request volume over the selected window",action:s.jsx(pt,{onRefresh:et,isFetching:S.isFetching,updatedAt:S.dataUpdatedAt})}),s.jsxs(ft,{chips:ze,onClearAll:qe,children:[s.jsx(Q,{id:"filter-status",label:"Status",value:d,onChange:e=>a.patch({status:e}),children:Ae.map(e=>s.jsx("option",{value:e.value,children:e.label},e.value))}),s.jsx(Q,{id:"filter-priced",label:"Priced?",value:v,onChange:e=>a.patch({priced:e}),children:Ee.map(e=>s.jsx("option",{value:e.value,children:e.label},e.value))}),s.jsxs(Q,{id:"filter-source",label:"Source",value:h,onChange:e=>a.patch({source:e}),children:[s.jsx("option",{value:"",children:"All"}),Ie.map(e=>s.jsx("option",{value:e,children:se(e)},e))]}),s.jsx(X,{label:"API key",value:f,onChange:e=>a.patch({api_key_id:e}),placeholder:"All keys",options:de}),s.jsx(X,{label:"User",value:p,onChange:e=>a.patch({user_id:e}),placeholder:"All users",options:he}),s.jsx(X,{label:"Model",value:u,onChange:e=>a.patch({model:e}),allowsCustom:!0,placeholder:"Any model",options:(u&&!q.includes(u)?[u,...q]:q).map(e=>({value:e,label:e}))})]})]}),fe?s.jsxs(bt,{selectedCount:R,allMatching:_.allMatching,matchingTotal:I,canSelectAllMatching:Ge,onSelectAllMatching:_.enableAllMatching,onClear:_.clear,children:[s.jsx(ee,{size:"sm",variant:"primary",onPress:()=>Z(!0),children:"Set price"}),s.jsx(ee,{size:"sm",variant:"danger",onPress:()=>V(!0),children:"Delete"})]}):null,s.jsx(kt,{ariaLabel:"Activity log",columns:st,rows:j,getRowKey:At,isLoading:S.isLoading,emptyContent:Ke?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:_.selectedKeys,onSelectionChange:_.onSelectionChange,disabledKeys:We,onRowAction:e=>_e(n=>n===e?null:e),rowClassName:Et,detailKey:Ze,renderDetail:Je}),s.jsx(yt,{page:ae,pageSize:B,total:$e,rowsOnPage:j.length,onPageChange:e=>a.patch({page:e}),onPageSizeChange:e=>a.patch({size:e,page:0}),isFetching:S.isFetching,hasNextFallback:j.length===B}),s.jsx(vt,{isOpen:He,onOpenChange:V,heading:"Delete usage rows",body:`Delete ${R.toLocaleString()} imported ${R===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:G.isPending,error:G.error,onConfirm:Qe}),s.jsx(St,{isOpen:Ve,onOpenChange:Z,targetCount:R,isPending:H.isPending,error:H.error,onSubmit:Xe})]})}export{Jt as ActivityPage}; diff --git a/src/gateway/static/dashboard/assets/AliasesPage-BW4Ki1y6.js b/src/gateway/static/dashboard/assets/AliasesPage-BXueJgS_.js similarity index 98% rename from src/gateway/static/dashboard/assets/AliasesPage-BW4Ki1y6.js rename to src/gateway/static/dashboard/assets/AliasesPage-BXueJgS_.js index ac62569fc..06ac58e15 100644 --- a/src/gateway/static/dashboard/assets/AliasesPage-BW4Ki1y6.js +++ b/src/gateway/static/dashboard/assets/AliasesPage-BXueJgS_.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as L}from"./react-dgEcD0HR.js";import{l as T,m as I,n as M,o as R,P as K,E as w,p as P,u as F}from"./index-MlRogoGm.js";import{u as O,r as $,B as U}from"./tableSelection-9hV37uhu.js";import{C as q}from"./ConfirmDialog-P_P4TNFr.js";import{D as H}from"./DataTable-Bmn_eYSV.js";import{F as V}from"./Field-Dwp6u3t8.js";import{C as k,L as z,I as G,a as J,b as W,f as X,B as j,d as A}from"./heroui-BI50yK5B.js";import{U as Q}from"./UserComboBox-a9wxf8eF.js";const Y=50;function B({label:t,value:a,onChange:n,description:r,placeholder:c="provider:model",autoFocus:l,isRequired:d}){const o=T(),{visible:m,total:h,failed:x}=u.useMemo(()=>{var N;const i=a.trim().toLowerCase(),v=((N=o.data)==null?void 0:N.providers)??[],C=v.flatMap(f=>f.models),p=i?C.filter(f=>f.key.toLowerCase().includes(i)):C;return{visible:p.slice(0,Y),total:p.length,failed:v.filter(f=>!f.ok)}},[o.data,a]),g=o.isLoading?"Loading models from your providers…":x.length>0?`Could not list models for ${x.map(v=>v.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:h>m.length?`Showing ${m.length} of ${h} matches. Keep typing to narrow them.`:r;return e.jsxs(k.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:a,onInputChange:n,onSelectionChange:i=>{i!=null&&n(String(i))},isRequired:d,className:"flex max-w-md flex-col gap-1",children:[e.jsx(z,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(k.InputGroup,{children:[e.jsx(G,{placeholder:c,autoFocus:l}),e.jsx(k.Trigger,{})]}),e.jsx(k.Popover,{children:e.jsx(J,{items:m,className:"max-h-72 overflow-auto",children:i=>e.jsx(W,{id:i.key,textValue:i.key,children:i.key})})}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:g}):null]})}const S=t=>JSON.stringify([t.user_id,t.name]);function Z({userId:t,onChange:a}){const n=F(),r=t!==null,c=(l,d)=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>a(l?"":null),className:r===l?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:d});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Applies to"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"A global alias resolves for every caller. A user-scoped one resolves only for that user, and takes precedence over a global alias of the same name."})]}),e.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[c(!1,"Every caller"),c(!0,"One user")]}),r?e.jsx(Q,{label:"User",value:t??"",onChange:a,users:n.data??[],placeholder:"Pick a user…",description:"Only this user resolves the alias.",unknownHint:e.jsx("span",{className:"text-red-700",children:"No such user. Pick an existing one."})}):null]})}function ee({alias:t,onClose:a}){const n=P(),[r,c]=u.useState(t.target),l=r.trim()!==""&&r.trim()!==t.target,d=()=>{l&&n.mutate({name:t.name,target:r.trim(),user_id:t.user_id},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name}),t.user_id?e.jsxs(e.Fragment,{children:[" for user ",e.jsx("code",{children:t.user_id})]}):null]}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["The alias name and who it applies to (",t.user_id?e.jsx("code",{children:t.user_id}):"every caller",") are the key and cannot be changed here. Delete and recreate to change either."]})]}),e.jsx(B,{label:"Target",value:r,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!l||n.isPending,onPress:d,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function se({onClose:t,initialTarget:a=""}){const n=P(),[r,c]=u.useState(""),[l,d]=u.useState(a),[o,m]=u.useState(null),h=/[:/]/.test(r),x=o===null||o.trim()!=="",g=r.trim()!==""&&l.trim()!==""&&!h&&x,i=()=>{g&&n.mutate({name:r.trim(),target:l.trim(),user_id:o===null?null:o.trim()},{onSuccess:t})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(V,{label:"Alias name",value:r,onChange:c,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:h?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(B,{label:"Target",value:l,onChange:d,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsx(Z,{userId:o,onChange:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!g||n.isPending,onPress:i,children:n.isPending?"Creating…":"Create alias"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function me(){const t=I(),a=M(),[n]=L(),r=n.get("target")??"",[c,l]=u.useState(r!==""),[d,o]=u.useState(null),m=O(),[h,x]=u.useState(!1),[g,i]=u.useState(void 0),[v,C]=u.useState(!1),p=[...t.data??[]].sort((s,b)=>s.name.localeCompare(b.name)||(s.user_id??"").localeCompare(b.user_id??"")),N=p.filter(s=>s.source==="stored").map(S),f=p.filter(s=>s.source!=="stored").map(S),y=$(m.selectedKeys,N),D=new Map(p.map(s=>[S(s),s])),_=async()=>{C(!0),i(void 0);try{for(const s of y){const b=D.get(s);b!==void 0&&await a.mutateAsync({name:b.name,userId:b.user_id})}m.clear(),x(!1)}catch(s){i(s)}finally{C(!1)}},E=u.useMemo(()=>[{id:"alias",header:"Alias",isRowHeader:!0,cell:s=>e.jsx("span",{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name})},{id:"target",header:"Target",cell:s=>e.jsx("span",{className:"break-all text-[var(--otari-muted)]",children:s.target})},{id:"scope",header:"Applies to",cell:s=>s.user_id?e.jsx("code",{className:"break-all text-xs text-[var(--otari-ink)]",children:s.user_id}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Every caller"})},{id:"source",header:"Source",cell:s=>e.jsx(X,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})},{id:"actions",header:"Actions",align:"end",cell:s=>s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{l(!1),o(s)},children:"Edit"}),e.jsx(R,{confirmLabel:"Delete",isPending:a.isPending,onConfirm:()=>a.mutate({name:s.name,userId:s.user_id}),children:"Delete"})]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})}],[a.isPending,a.mutate]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(K,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:c||d?null:e.jsx(j,{variant:"primary",onPress:()=>{o(null),l(!0)},children:"New alias"})}),e.jsx(w,{error:t.error}),c?e.jsx(se,{initialTarget:r,onClose:()=>l(!1)}):null,d?e.jsx(ee,{alias:d,onClose:()=>o(null)}):null,a.error?e.jsx(w,{error:a.error}):null,y.length>0?e.jsx(U,{selectedCount:y.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:m.clear,children:e.jsx(j,{size:"sm",variant:"danger",onPress:()=>x(!0),children:"Delete"})}):null,e.jsx(H,{ariaLabel:"Aliases",columns:E,rows:p,getRowKey:S,isLoading:t.isLoading,emptyContent:"No aliases yet. Create one to give a model a friendly name.",selectionMode:"multiple",selectedKeys:m.selectedKeys,onSelectionChange:m.onSelectionChange,disabledKeys:f}),e.jsx(q,{isOpen:h,onOpenChange:x,heading:"Delete aliases",body:`Delete ${y.length} stored ${y.length===1?"alias":"aliases"}? Callers using ${y.length===1?"it":"them"} will get a model-not-found error.`,confirmLabel:"Delete",isPending:v,error:g,onConfirm:_})]})}export{me as AliasesPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as L}from"./react-dgEcD0HR.js";import{l as T,m as I,n as M,o as R,P as K,E as w,p as P,u as F}from"./index-BCvb90M0.js";import{u as O,r as $,B as U}from"./tableSelection-9hV37uhu.js";import{C as q}from"./ConfirmDialog-BXAKoq6j.js";import{D as H}from"./DataTable-Bmn_eYSV.js";import{F as V}from"./Field-Dwp6u3t8.js";import{C as k,L as z,I as G,a as J,b as W,f as X,B as j,d as A}from"./heroui-BI50yK5B.js";import{U as Q}from"./UserComboBox-a9wxf8eF.js";const Y=50;function B({label:t,value:a,onChange:n,description:r,placeholder:c="provider:model",autoFocus:l,isRequired:d}){const o=T(),{visible:m,total:h,failed:x}=u.useMemo(()=>{var N;const i=a.trim().toLowerCase(),v=((N=o.data)==null?void 0:N.providers)??[],C=v.flatMap(f=>f.models),p=i?C.filter(f=>f.key.toLowerCase().includes(i)):C;return{visible:p.slice(0,Y),total:p.length,failed:v.filter(f=>!f.ok)}},[o.data,a]),g=o.isLoading?"Loading models from your providers…":x.length>0?`Could not list models for ${x.map(v=>v.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:h>m.length?`Showing ${m.length} of ${h} matches. Keep typing to narrow them.`:r;return e.jsxs(k.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:a,onInputChange:n,onSelectionChange:i=>{i!=null&&n(String(i))},isRequired:d,className:"flex max-w-md flex-col gap-1",children:[e.jsx(z,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(k.InputGroup,{children:[e.jsx(G,{placeholder:c,autoFocus:l}),e.jsx(k.Trigger,{})]}),e.jsx(k.Popover,{children:e.jsx(J,{items:m,className:"max-h-72 overflow-auto",children:i=>e.jsx(W,{id:i.key,textValue:i.key,children:i.key})})}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:g}):null]})}const S=t=>JSON.stringify([t.user_id,t.name]);function Z({userId:t,onChange:a}){const n=F(),r=t!==null,c=(l,d)=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>a(l?"":null),className:r===l?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:d});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Applies to"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"A global alias resolves for every caller. A user-scoped one resolves only for that user, and takes precedence over a global alias of the same name."})]}),e.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[c(!1,"Every caller"),c(!0,"One user")]}),r?e.jsx(Q,{label:"User",value:t??"",onChange:a,users:n.data??[],placeholder:"Pick a user…",description:"Only this user resolves the alias.",unknownHint:e.jsx("span",{className:"text-red-700",children:"No such user. Pick an existing one."})}):null]})}function ee({alias:t,onClose:a}){const n=P(),[r,c]=u.useState(t.target),l=r.trim()!==""&&r.trim()!==t.target,d=()=>{l&&n.mutate({name:t.name,target:r.trim(),user_id:t.user_id},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name}),t.user_id?e.jsxs(e.Fragment,{children:[" for user ",e.jsx("code",{children:t.user_id})]}):null]}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["The alias name and who it applies to (",t.user_id?e.jsx("code",{children:t.user_id}):"every caller",") are the key and cannot be changed here. Delete and recreate to change either."]})]}),e.jsx(B,{label:"Target",value:r,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!l||n.isPending,onPress:d,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function se({onClose:t,initialTarget:a=""}){const n=P(),[r,c]=u.useState(""),[l,d]=u.useState(a),[o,m]=u.useState(null),h=/[:/]/.test(r),x=o===null||o.trim()!=="",g=r.trim()!==""&&l.trim()!==""&&!h&&x,i=()=>{g&&n.mutate({name:r.trim(),target:l.trim(),user_id:o===null?null:o.trim()},{onSuccess:t})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(V,{label:"Alias name",value:r,onChange:c,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:h?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(B,{label:"Target",value:l,onChange:d,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsx(Z,{userId:o,onChange:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!g||n.isPending,onPress:i,children:n.isPending?"Creating…":"Create alias"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function me(){const t=I(),a=M(),[n]=L(),r=n.get("target")??"",[c,l]=u.useState(r!==""),[d,o]=u.useState(null),m=O(),[h,x]=u.useState(!1),[g,i]=u.useState(void 0),[v,C]=u.useState(!1),p=[...t.data??[]].sort((s,b)=>s.name.localeCompare(b.name)||(s.user_id??"").localeCompare(b.user_id??"")),N=p.filter(s=>s.source==="stored").map(S),f=p.filter(s=>s.source!=="stored").map(S),y=$(m.selectedKeys,N),D=new Map(p.map(s=>[S(s),s])),_=async()=>{C(!0),i(void 0);try{for(const s of y){const b=D.get(s);b!==void 0&&await a.mutateAsync({name:b.name,userId:b.user_id})}m.clear(),x(!1)}catch(s){i(s)}finally{C(!1)}},E=u.useMemo(()=>[{id:"alias",header:"Alias",isRowHeader:!0,cell:s=>e.jsx("span",{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name})},{id:"target",header:"Target",cell:s=>e.jsx("span",{className:"break-all text-[var(--otari-muted)]",children:s.target})},{id:"scope",header:"Applies to",cell:s=>s.user_id?e.jsx("code",{className:"break-all text-xs text-[var(--otari-ink)]",children:s.user_id}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Every caller"})},{id:"source",header:"Source",cell:s=>e.jsx(X,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})},{id:"actions",header:"Actions",align:"end",cell:s=>s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{l(!1),o(s)},children:"Edit"}),e.jsx(R,{confirmLabel:"Delete",isPending:a.isPending,onConfirm:()=>a.mutate({name:s.name,userId:s.user_id}),children:"Delete"})]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})}],[a.isPending,a.mutate]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(K,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:c||d?null:e.jsx(j,{variant:"primary",onPress:()=>{o(null),l(!0)},children:"New alias"})}),e.jsx(w,{error:t.error}),c?e.jsx(se,{initialTarget:r,onClose:()=>l(!1)}):null,d?e.jsx(ee,{alias:d,onClose:()=>o(null)}):null,a.error?e.jsx(w,{error:a.error}):null,y.length>0?e.jsx(U,{selectedCount:y.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:m.clear,children:e.jsx(j,{size:"sm",variant:"danger",onPress:()=>x(!0),children:"Delete"})}):null,e.jsx(H,{ariaLabel:"Aliases",columns:E,rows:p,getRowKey:S,isLoading:t.isLoading,emptyContent:"No aliases yet. Create one to give a model a friendly name.",selectionMode:"multiple",selectedKeys:m.selectedKeys,onSelectionChange:m.onSelectionChange,disabledKeys:f}),e.jsx(q,{isOpen:h,onOpenChange:x,heading:"Delete aliases",body:`Delete ${y.length} stored ${y.length===1?"alias":"aliases"}? Callers using ${y.length===1?"it":"them"} will get a model-not-found error.`,confirmLabel:"Delete",isPending:v,error:g,onConfirm:_})]})}export{me as AliasesPage}; diff --git a/src/gateway/static/dashboard/assets/BudgetsPage-B98xbp9L.js b/src/gateway/static/dashboard/assets/BudgetsPage-BQktAQRZ.js similarity index 99% rename from src/gateway/static/dashboard/assets/BudgetsPage-B98xbp9L.js rename to src/gateway/static/dashboard/assets/BudgetsPage-BQktAQRZ.js index 0e18e98b1..9add738f4 100644 --- a/src/gateway/static/dashboard/assets/BudgetsPage-B98xbp9L.js +++ b/src/gateway/static/dashboard/assets/BudgetsPage-BQktAQRZ.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{q as ae,u as re,r as le,s as ie,t as oe,v as de,P as ue,E as T,I as ce,w as me,x as xe}from"./index-MlRogoGm.js";import{u as ge,r as he,B as pe}from"./tableSelection-9hV37uhu.js";import{C as fe}from"./ConfirmDialog-P_P4TNFr.js";import{D as be}from"./DataTable-Bmn_eYSV.js";import{F as z}from"./Field-Dwp6u3t8.js";import{C as E,I as je,a as ve,b as ye,B as x,d as k,S as Ne}from"./heroui-BI50yK5B.js";const Se=50;function _e({value:t,onChange:r,users:a,label:o,description:l}){const[g,h]=i.useState(""),d=i.useMemo(()=>a.filter(s=>!s.user_id.startsWith("apikey-")).map(s=>({id:s.user_id,label:s.alias?`${s.user_id} (${s.alias})`:s.user_id})),[a]),p=i.useMemo(()=>{const s=g.trim().toLowerCase();return d.filter(u=>!t.includes(u.id)).filter(u=>!s||u.id.toLowerCase().includes(s)||u.label.toLowerCase().includes(s)).slice(0,Se)},[d,t,g]),c=s=>{t.includes(s)||r([...t,s]),h("")},m=s=>r(t.filter(u=>u!==s));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:o}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[s,e.jsx("button",{type:"button","aria-label":`Remove ${s}`,onClick:()=>m(s),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},s))}):null,d.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:h,selectedKey:null,onSelectionChange:s=>{s!=null&&c(String(s))},className:"flex flex-col gap-1",children:[e.jsxs(E.InputGroup,{children:[e.jsx(je,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(ve,{items:p,className:"max-h-72 overflow-auto",children:s=>e.jsx(ye,{id:s.id,textValue:s.label,children:s.label})})})]})]})}const Ce=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function D(t){return Ce.format(t)}const j=86400,q=3600,O=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function we(t){if(t===null)return"No reset";const r=O.find(a=>a.seconds===t);return r?r.label:t%j===0?`Every ${t/j} days`:t%q===0?`Every ${t/q} hours`:`Every ${t}s`}function W(t){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function De(t){const r=t.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function Y(t){return t!==null&&t%j===0?String(t/j):""}function Be({value:t,onChange:r,onInvalidChange:a}){const o=O.some(s=>s.seconds===t),[l,g]=i.useState(!o),[h,d]=i.useState(()=>Y(t)),p=h.trim(),c=Number(p),m=p!==""&&(!Number.isSafeInteger(c)||c<=0);return i.useEffect(()=>{a==null||a(m)},[m,a]),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.map(s=>e.jsx(x,{size:"sm",variant:!l&&t===s.seconds?"primary":"outline",onPress:()=>{g(!1),d(Y(s.seconds)),r(s.seconds)},children:s.label},s.label)),e.jsx(x,{size:"sm",variant:l?"primary":"outline",onPress:()=>g(!0),children:"Custom"})]}),l?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(z,{label:"Every N days",value:h,onChange:s=>{d(s);const u=Number(s.trim());r(s.trim()===""||!Number.isSafeInteger(u)||u<=0?null:u*j)},placeholder:"14",description:m?e.jsx("span",{className:"text-red-700",children:"Enter a whole number of days."}):"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function G({title:t,submitLabel:r,initial:a,error:o,isPending:l,onSubmit:g,onClose:h,assignUsers:d}){const[p,c]=i.useState(a.name??""),[m,s]=i.useState(a.max_budget===null?"":String(a.max_budget)),[u,b]=i.useState(a.budget_duration_sec),[S,v]=i.useState(!1),[B,P]=i.useState([]),f=De(m),A=!l&&f.valid&&!S,C=()=>{A&&g({name:p.trim()||null,max_budget:f.value,budget_duration_sec:u},B)};return e.jsx(k,{children:e.jsxs(k.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(T,{error:o}),e.jsx(z,{label:"Name (optional)",value:p,onChange:c,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(z,{label:"Spending limit (USD)",value:m,onChange:s,placeholder:"100.00",description:f.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(Be,{value:u,onChange:b,onInvalidChange:v}),d?e.jsx(_e,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:B,onChange:P,users:d}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:!A,onPress:C,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:h,children:"Cancel"})]})]})})}function Pe({budget:t}){if(t.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=t.total_spend;if(t.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[D(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=t.max_budget*t.user_count,o=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:D(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",D(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(o,l?100:2)}%`}})})]})}function Ae({budgetId:t}){const r=xe(t);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(Ne,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:o.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:D(o.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:W(o.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:W(o.next_reset_at)})]},o.id))})]})})}function Ee({label:t,isPending:r,onConfirm:a}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:t}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}const ke=t=>t.budget_id;function Q(t){return t.split("-")[0]}function $(t){return t.name??Q(t.budget_id)}function Te(){const t=ae(),r=re(),a=le(),o=ie(),l=oe(),g=de(),[h,d]=i.useState(!1),[p,c]=i.useState(null),[m,s]=i.useState(null),[u,b]=i.useState(null),[S,v]=i.useState(null),[B,P]=i.useState(!1),f=ge(),[A,C]=i.useState(!1),[X,F]=i.useState(void 0),[J,H]=i.useState(!1),w=t.data??[],K=t.isLoading,y=w.find(n=>n.budget_id===p)??null,U=w.find(n=>n.budget_id===m)??null,L=!K&&w.length===0&&!h,Z=w.map(n=>n.budget_id),_=he(f.selectedKeys,Z),ee=async()=>{H(!0),F(void 0);try{for(const n of _)await l.mutateAsync(n);f.clear(),C(!1)}catch(n){F(n)}finally{H(!1)}},te=i.useMemo(()=>[{id:"budget",header:"Budget",isRowHeader:!0,cell:n=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:Q(n.budget_id)})]})},{id:"limit",header:"Limit (per user)",cell:n=>n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):D(n.max_budget)},{id:"reset",header:"Reset",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:we(n.budget_duration_sec)})},{id:"users",header:"Users",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:n.user_count})},{id:"usage",header:"Usage",cell:n=>e.jsx(Pe,{budget:n})},{id:"actions",header:"Actions",align:"end",cell:n=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(N=>N===n.budget_id?null:n.budget_id),children:m===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{d(!1),c(n.budget_id)},children:"Edit"}),e.jsx(Ee,{label:$(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})}],[m,l.isPending,l.mutate]),V=async(n,N)=>{P(!0),b(null);const I=await Promise.allSettled(N.map(M=>g.mutateAsync({id:M,body:{budget_id:n}})));P(!1);const R=I.flatMap((M,ne)=>M.status==="rejected"?[N[ne]]:[]);if(R.length>0){v({budgetId:n,userIds:R}),b(new Error(`Budget created, but could not assign it to: ${R.join(", ")}. Retry to try again.`));return}v(null),d(!1)},se=(n,N)=>{if(S){V(S.budgetId,S.userIds);return}b(null),a.mutate(n,{onSuccess:async I=>{if(N.length>0){await V(I.budget_id,N);return}d(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ue,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:h||L?null:e.jsx(x,{variant:"primary",onPress:()=>{c(null),b(null),v(null),d(!0)},children:"Create budget"})}),e.jsx(T,{error:t.error??a.error??o.error??l.error??g.error}),e.jsx(ce,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),L?e.jsx(me,{title:"No budgets yet",description:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit.",actionLabel:"Create your first budget",onAction:()=>{c(null),b(null),v(null),d(!0)}}):null,h?e.jsx(G,{title:"Create budget",submitLabel:S?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??u,isPending:a.isPending||B,assignUsers:r.data??[],onSubmit:se,onClose:()=>{b(null),v(null),d(!1)}}):null,y?e.jsx(G,{title:`Edit budget ${$(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:o.error,isPending:o.isPending,onSubmit:n=>o.mutate({id:y.budget_id,body:n},{onSuccess:()=>c(null)}),onClose:()=>c(null)},y.budget_id):null,_.length>0?e.jsx(pe,{selectedCount:_.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:f.clear,children:e.jsx(x,{size:"sm",variant:"danger",onPress:()=>C(!0),children:"Delete"})}):null,L?null:e.jsx(be,{ariaLabel:"Budgets",columns:te,rows:w,getRowKey:ke,isLoading:K,emptyContent:"No budgets yet. Create one to cap spending.",selectionMode:"multiple",selectedKeys:f.selectedKeys,onSelectionChange:f.onSelectionChange}),U?e.jsx(k,{children:e.jsxs(k.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsxs("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:["Reset history — ",$(U)]}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(null),children:"Close"})]}),e.jsx(Ae,{budgetId:U.budget_id})]})}):null,e.jsx(fe,{isOpen:A,onOpenChange:C,heading:"Delete budgets",body:`Delete ${_.length} ${_.length===1?"budget":"budgets"}? Users on ${_.length===1?"it":"them"} will no longer be capped.`,confirmLabel:"Delete",isPending:J,error:X,onConfirm:ee})]})}export{Te as BudgetsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{q as ae,u as re,r as le,s as ie,t as oe,v as de,P as ue,E as T,I as ce,w as me,x as xe}from"./index-BCvb90M0.js";import{u as ge,r as he,B as pe}from"./tableSelection-9hV37uhu.js";import{C as fe}from"./ConfirmDialog-BXAKoq6j.js";import{D as be}from"./DataTable-Bmn_eYSV.js";import{F as z}from"./Field-Dwp6u3t8.js";import{C as E,I as je,a as ve,b as ye,B as x,d as k,S as Ne}from"./heroui-BI50yK5B.js";const Se=50;function _e({value:t,onChange:r,users:a,label:o,description:l}){const[g,h]=i.useState(""),d=i.useMemo(()=>a.filter(s=>!s.user_id.startsWith("apikey-")).map(s=>({id:s.user_id,label:s.alias?`${s.user_id} (${s.alias})`:s.user_id})),[a]),p=i.useMemo(()=>{const s=g.trim().toLowerCase();return d.filter(u=>!t.includes(u.id)).filter(u=>!s||u.id.toLowerCase().includes(s)||u.label.toLowerCase().includes(s)).slice(0,Se)},[d,t,g]),c=s=>{t.includes(s)||r([...t,s]),h("")},m=s=>r(t.filter(u=>u!==s));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:o}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[s,e.jsx("button",{type:"button","aria-label":`Remove ${s}`,onClick:()=>m(s),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},s))}):null,d.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:h,selectedKey:null,onSelectionChange:s=>{s!=null&&c(String(s))},className:"flex flex-col gap-1",children:[e.jsxs(E.InputGroup,{children:[e.jsx(je,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(ve,{items:p,className:"max-h-72 overflow-auto",children:s=>e.jsx(ye,{id:s.id,textValue:s.label,children:s.label})})})]})]})}const Ce=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function D(t){return Ce.format(t)}const j=86400,q=3600,O=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function we(t){if(t===null)return"No reset";const r=O.find(a=>a.seconds===t);return r?r.label:t%j===0?`Every ${t/j} days`:t%q===0?`Every ${t/q} hours`:`Every ${t}s`}function W(t){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function De(t){const r=t.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function Y(t){return t!==null&&t%j===0?String(t/j):""}function Be({value:t,onChange:r,onInvalidChange:a}){const o=O.some(s=>s.seconds===t),[l,g]=i.useState(!o),[h,d]=i.useState(()=>Y(t)),p=h.trim(),c=Number(p),m=p!==""&&(!Number.isSafeInteger(c)||c<=0);return i.useEffect(()=>{a==null||a(m)},[m,a]),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.map(s=>e.jsx(x,{size:"sm",variant:!l&&t===s.seconds?"primary":"outline",onPress:()=>{g(!1),d(Y(s.seconds)),r(s.seconds)},children:s.label},s.label)),e.jsx(x,{size:"sm",variant:l?"primary":"outline",onPress:()=>g(!0),children:"Custom"})]}),l?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(z,{label:"Every N days",value:h,onChange:s=>{d(s);const u=Number(s.trim());r(s.trim()===""||!Number.isSafeInteger(u)||u<=0?null:u*j)},placeholder:"14",description:m?e.jsx("span",{className:"text-red-700",children:"Enter a whole number of days."}):"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function G({title:t,submitLabel:r,initial:a,error:o,isPending:l,onSubmit:g,onClose:h,assignUsers:d}){const[p,c]=i.useState(a.name??""),[m,s]=i.useState(a.max_budget===null?"":String(a.max_budget)),[u,b]=i.useState(a.budget_duration_sec),[S,v]=i.useState(!1),[B,P]=i.useState([]),f=De(m),A=!l&&f.valid&&!S,C=()=>{A&&g({name:p.trim()||null,max_budget:f.value,budget_duration_sec:u},B)};return e.jsx(k,{children:e.jsxs(k.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(T,{error:o}),e.jsx(z,{label:"Name (optional)",value:p,onChange:c,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(z,{label:"Spending limit (USD)",value:m,onChange:s,placeholder:"100.00",description:f.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(Be,{value:u,onChange:b,onInvalidChange:v}),d?e.jsx(_e,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:B,onChange:P,users:d}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:!A,onPress:C,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:h,children:"Cancel"})]})]})})}function Pe({budget:t}){if(t.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=t.total_spend;if(t.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[D(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=t.max_budget*t.user_count,o=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:D(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",D(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(o,l?100:2)}%`}})})]})}function Ae({budgetId:t}){const r=xe(t);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(Ne,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:o.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:D(o.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:W(o.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:W(o.next_reset_at)})]},o.id))})]})})}function Ee({label:t,isPending:r,onConfirm:a}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:t}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}const ke=t=>t.budget_id;function Q(t){return t.split("-")[0]}function $(t){return t.name??Q(t.budget_id)}function Te(){const t=ae(),r=re(),a=le(),o=ie(),l=oe(),g=de(),[h,d]=i.useState(!1),[p,c]=i.useState(null),[m,s]=i.useState(null),[u,b]=i.useState(null),[S,v]=i.useState(null),[B,P]=i.useState(!1),f=ge(),[A,C]=i.useState(!1),[X,F]=i.useState(void 0),[J,H]=i.useState(!1),w=t.data??[],K=t.isLoading,y=w.find(n=>n.budget_id===p)??null,U=w.find(n=>n.budget_id===m)??null,L=!K&&w.length===0&&!h,Z=w.map(n=>n.budget_id),_=he(f.selectedKeys,Z),ee=async()=>{H(!0),F(void 0);try{for(const n of _)await l.mutateAsync(n);f.clear(),C(!1)}catch(n){F(n)}finally{H(!1)}},te=i.useMemo(()=>[{id:"budget",header:"Budget",isRowHeader:!0,cell:n=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:Q(n.budget_id)})]})},{id:"limit",header:"Limit (per user)",cell:n=>n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):D(n.max_budget)},{id:"reset",header:"Reset",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:we(n.budget_duration_sec)})},{id:"users",header:"Users",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:n.user_count})},{id:"usage",header:"Usage",cell:n=>e.jsx(Pe,{budget:n})},{id:"actions",header:"Actions",align:"end",cell:n=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(N=>N===n.budget_id?null:n.budget_id),children:m===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{d(!1),c(n.budget_id)},children:"Edit"}),e.jsx(Ee,{label:$(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})}],[m,l.isPending,l.mutate]),V=async(n,N)=>{P(!0),b(null);const I=await Promise.allSettled(N.map(M=>g.mutateAsync({id:M,body:{budget_id:n}})));P(!1);const R=I.flatMap((M,ne)=>M.status==="rejected"?[N[ne]]:[]);if(R.length>0){v({budgetId:n,userIds:R}),b(new Error(`Budget created, but could not assign it to: ${R.join(", ")}. Retry to try again.`));return}v(null),d(!1)},se=(n,N)=>{if(S){V(S.budgetId,S.userIds);return}b(null),a.mutate(n,{onSuccess:async I=>{if(N.length>0){await V(I.budget_id,N);return}d(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ue,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:h||L?null:e.jsx(x,{variant:"primary",onPress:()=>{c(null),b(null),v(null),d(!0)},children:"Create budget"})}),e.jsx(T,{error:t.error??a.error??o.error??l.error??g.error}),e.jsx(ce,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),L?e.jsx(me,{title:"No budgets yet",description:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit.",actionLabel:"Create your first budget",onAction:()=>{c(null),b(null),v(null),d(!0)}}):null,h?e.jsx(G,{title:"Create budget",submitLabel:S?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??u,isPending:a.isPending||B,assignUsers:r.data??[],onSubmit:se,onClose:()=>{b(null),v(null),d(!1)}}):null,y?e.jsx(G,{title:`Edit budget ${$(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:o.error,isPending:o.isPending,onSubmit:n=>o.mutate({id:y.budget_id,body:n},{onSuccess:()=>c(null)}),onClose:()=>c(null)},y.budget_id):null,_.length>0?e.jsx(pe,{selectedCount:_.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:f.clear,children:e.jsx(x,{size:"sm",variant:"danger",onPress:()=>C(!0),children:"Delete"})}):null,L?null:e.jsx(be,{ariaLabel:"Budgets",columns:te,rows:w,getRowKey:ke,isLoading:K,emptyContent:"No budgets yet. Create one to cap spending.",selectionMode:"multiple",selectedKeys:f.selectedKeys,onSelectionChange:f.onSelectionChange}),U?e.jsx(k,{children:e.jsxs(k.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsxs("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:["Reset history — ",$(U)]}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(null),children:"Close"})]}),e.jsx(Ae,{budgetId:U.budget_id})]})}):null,e.jsx(fe,{isOpen:A,onOpenChange:C,heading:"Delete budgets",body:`Delete ${_.length} ${_.length===1?"budget":"budgets"}? Users on ${_.length===1?"it":"them"} will no longer be capped.`,confirmLabel:"Delete",isPending:J,error:X,onConfirm:ee})]})}export{Te as BudgetsPage}; diff --git a/src/gateway/static/dashboard/assets/ConfirmDialog-P_P4TNFr.js b/src/gateway/static/dashboard/assets/ConfirmDialog-BXAKoq6j.js similarity index 92% rename from src/gateway/static/dashboard/assets/ConfirmDialog-P_P4TNFr.js rename to src/gateway/static/dashboard/assets/ConfirmDialog-BXAKoq6j.js index 81d367bd9..62bab615c 100644 --- a/src/gateway/static/dashboard/assets/ConfirmDialog-P_P4TNFr.js +++ b/src/gateway/static/dashboard/assets/ConfirmDialog-BXAKoq6j.js @@ -1 +1 @@ -import{j as r}from"./tanstack-query-1t81HyiD.js";import{E as j}from"./index-MlRogoGm.js";import{A as e,B as l}from"./heroui-BI50yK5B.js";function p({isOpen:s,onOpenChange:a,heading:n,body:o,confirmLabel:t,confirmVariant:c="danger",isPending:i,error:d,onConfirm:x}){return r.jsx(e,{isOpen:s,onOpenChange:a,children:s?r.jsx(e.Backdrop,{children:r.jsx(e.Container,{placement:"center",size:"md",children:r.jsxs(e.Dialog,{children:[r.jsx(e.Header,{children:r.jsx(e.Heading,{children:n})}),r.jsxs(e.Body,{className:"flex flex-col gap-4",children:[r.jsx("div",{className:"text-sm text-[var(--otari-muted)]",children:o}),r.jsx(j,{error:d})]}),r.jsxs(e.Footer,{children:[r.jsx(l,{variant:"ghost",isDisabled:i,onPress:()=>a(!1),children:"Cancel"}),r.jsx(l,{variant:c,isPending:i,onPress:x,children:t})]})]})})}):null})}export{p as C}; +import{j as r}from"./tanstack-query-1t81HyiD.js";import{E as j}from"./index-BCvb90M0.js";import{A as e,B as l}from"./heroui-BI50yK5B.js";function p({isOpen:s,onOpenChange:a,heading:n,body:o,confirmLabel:t,confirmVariant:c="danger",isPending:i,error:d,onConfirm:x}){return r.jsx(e,{isOpen:s,onOpenChange:a,children:s?r.jsx(e.Backdrop,{children:r.jsx(e.Container,{placement:"center",size:"md",children:r.jsxs(e.Dialog,{children:[r.jsx(e.Header,{children:r.jsx(e.Heading,{children:n})}),r.jsxs(e.Body,{className:"flex flex-col gap-4",children:[r.jsx("div",{className:"text-sm text-[var(--otari-muted)]",children:o}),r.jsx(j,{error:d})]}),r.jsxs(e.Footer,{children:[r.jsx(l,{variant:"ghost",isDisabled:i,onPress:()=>a(!1),children:"Cancel"}),r.jsx(l,{variant:c,isPending:i,onPress:x,children:t})]})]})})}):null})}export{p as C}; diff --git a/src/gateway/static/dashboard/assets/DocsPage-CQXolIdY.js b/src/gateway/static/dashboard/assets/DocsPage-xJDqWRaA.js similarity index 99% rename from src/gateway/static/dashboard/assets/DocsPage-CQXolIdY.js rename to src/gateway/static/dashboard/assets/DocsPage-xJDqWRaA.js index 6dea971e4..f802cc969 100644 --- a/src/gateway/static/dashboard/assets/DocsPage-CQXolIdY.js +++ b/src/gateway/static/dashboard/assets/DocsPage-xJDqWRaA.js @@ -1,4 +1,4 @@ -import{j as re}from"./tanstack-query-1t81HyiD.js";import{P as gi}from"./index-MlRogoGm.js";import{d as ct}from"./heroui-BI50yK5B.js";import{g as nr}from"./react-dgEcD0HR.js";function yi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi={};function ht(e,t){return(bi.jsx?xi:ki).test(e)}const wi=/[ \t\n\f\r]/g;function Si(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(wi,"")===""}class Ke{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function tr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ke(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ci=0;const L=Te(),Y=Te(),Dn=Te(),E=Te(),$=Te(),Ie=Te(),te=Te();function Te(){return 2**++Ci}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:Ie,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ai.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Di);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Ti,zi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function zi(e){return"-"+e.toLowerCase()}function Di(e){return e.charAt(1).toUpperCase()}const Li=tr([rr,Ei,or,ar,sr],"html"),qn=tr([rr,Ii,or,ar,sr],"svg");function _i(e){return e.join(" ").trim()}var De={},mn,dt;function Ri(){if(dt)return mn;dt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=` +import{j as re}from"./tanstack-query-1t81HyiD.js";import{P as gi}from"./index-BCvb90M0.js";import{d as ct}from"./heroui-BI50yK5B.js";import{g as nr}from"./react-dgEcD0HR.js";function yi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi={};function ht(e,t){return(bi.jsx?xi:ki).test(e)}const wi=/[ \t\n\f\r]/g;function Si(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(wi,"")===""}class Ke{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function tr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ke(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ci=0;const L=Te(),Y=Te(),Dn=Te(),E=Te(),$=Te(),Ie=Te(),te=Te();function Te(){return 2**++Ci}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:Ie,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ai.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Di);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Ti,zi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function zi(e){return"-"+e.toLowerCase()}function Di(e){return e.charAt(1).toUpperCase()}const Li=tr([rr,Ei,or,ar,sr],"html"),qn=tr([rr,Ii,or,ar,sr],"svg");function _i(e){return e.join(" ").trim()}var De={},mn,dt;function Ri(){if(dt)return mn;dt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=` `,u="/",h="*",c="",p="comment",f="declaration";function g(S,y){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];y=y||{};var I=1,C=1;function R(D){var T=D.match(t);T&&(I+=T.length);var U=D.lastIndexOf(s);C=~U?D.length-U:C+D.length}function F(){var D={line:I,column:C};return function(T){return T.position=new b(D),j(),T}}function b(D){this.start=D,this.end={line:I,column:C},this.source=y.source}b.prototype.content=S;function M(D){var T=new Error(y.source+":"+I+":"+C+": "+D);if(T.reason=D,T.filename=y.source,T.line=I,T.column=C,T.source=S,!y.silent)throw T}function H(D){var T=D.exec(S);if(T){var U=T[0];return R(U),S=S.slice(U.length),T}}function j(){H(n)}function k(D){var T;for(D=D||[];T=A();)T!==!1&&D.push(T);return D}function A(){var D=F();if(!(u!=S.charAt(0)||h!=S.charAt(1))){for(var T=2;c!=S.charAt(T)&&(h!=S.charAt(T)||u!=S.charAt(T+1));)++T;if(T+=2,c===S.charAt(T-1))return M("End of comment missing");var U=S.slice(2,T-2);return C+=2,R(U),S=S.slice(T),C+=2,D({type:p,comment:U})}}function P(){var D=F(),T=H(r);if(T){if(A(),!H(i))return M("property missing ':'");var U=H(o),K=D({type:f,property:w(T[0].replace(e,c)),value:U?w(U[0].replace(e,c)):c});return H(l),K}}function q(){var D=[];k(D);for(var T;T=P();)T!==!1&&(D.push(T),k(D));return D}return j(),q()}function w(S){return S?S.replace(a,c):c}return mn=g,mn}var gt;function Fi(){if(gt)return De;gt=1;var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(De,"__esModule",{value:!0}),De.default=n;const t=e(Ri());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),a=typeof i=="function";return l.forEach(s=>{if(s.type!=="declaration")return;const{property:u,value:h}=s;a?i(u,h,s):h&&(o=o||{},o[u]=h)}),o}return De}var Be={},yt;function Oi(){if(yt)return Be;yt=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(u){return!u||n.test(u)||e.test(u)},l=function(u,h){return h.toUpperCase()},a=function(u,h){return"".concat(h,"-")},s=function(u,h){return h===void 0&&(h={}),o(u)?u:(u=u.toLowerCase(),h.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(t,l))};return Be.camelCase=s,Be}var je,kt;function Mi(){if(kt)return je;kt=1;var e=je&&je.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Fi()),n=Oi();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(a,s){a&&s&&(l[(0,n.camelCase)(a,o)]=s)}),l}return r.default=r,je=r,je}var Ni=Mi();const Bi=nr(Ni),ur=cr("end"),Un=cr("start");function cr(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ji(e){const t=Un(e),n=ur(e);if(t&&n)return{start:t,end:n}}function Ue(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xt(e.position):"start"in e||"end"in e?xt(e):"line"in e||"column"in e?_n(e):""}function _n(e){return bt(e&&e.line)+":"+bt(e&&e.column)}function xt(e){return _n(e&&e.start)+"-"+_n(e&&e.end)}function bt(e){return e&&typeof e=="number"?e:1}class G extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?o.ruleId=r:(o.source=r.slice(0,s),o.ruleId=r.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){const s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ue(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}G.prototype.file="";G.prototype.name="";G.prototype.reason="";G.prototype.message="";G.prototype.stack="";G.prototype.column=void 0;G.prototype.line=void 0;G.prototype.ancestors=void 0;G.prototype.cause=void 0;G.prototype.fatal=void 0;G.prototype.place=void 0;G.prototype.ruleId=void 0;G.prototype.source=void 0;const Vn={}.hasOwnProperty,Hi=new Map,qi=/[A-Z]/g,Ui=new Set(["table","tbody","thead","tfoot","tr"]),Vi=new Set(["td","th"]),hr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $i(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Zi(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ji(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qn:Li,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=fr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function fr(e,t,n){if(t.type==="element")return Wi(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Yi(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Qi(e,t,n);if(t.type==="mdxjsEsm")return Ki(e,t);if(t.type==="root")return Xi(e,t,n);if(t.type==="text")return Gi(e,t)}function Wi(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=qn,e.schema=i),e.ancestors.push(t);const o=mr(e,t.tagName,!1),l=el(e,t);let a=Wn(e,t);return Ui.has(t.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!Si(s):!0})),pr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Yi(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}We(e,t.position)}function Ki(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);We(e,t.position)}function Qi(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=qn,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:mr(e,t.name,!0),l=nl(e,t),a=Wn(e,t);return pr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Xi(e,t,n){const r={};return $n(r,Wn(e,t)),e.create(t,e.Fragment,r,n)}function Gi(e,t){return t.value}function pr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $n(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ji(e,t,n){return r;function r(i,o,l,a){const u=Array.isArray(l.children)?n:t;return a?u(o,l,a):u(o,l)}}function Zi(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),s=Un(r);return t(i,o,l,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function el(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Vn.call(t.properties,i)){const o=tl(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&Vi.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function nl(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else We(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else We(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Wn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Hi;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(ie(e,e.length,0,t),e):t}const Ct={}.hasOwnProperty;function gr(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ce(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const J=be(/[A-Za-z]/),X=be(/[\dA-Za-z]/),hl=be(/[#-'*+\--9=?A-Z^-~]/);function rn(e){return e!==null&&(e<32||e===127)}const Rn=be(/\d/),fl=be(/[\dA-Fa-f]/),pl=be(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function W(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}const sn=be(new RegExp("\\p{P}|\\p{S}","u")),ve=be(/\s/);function be(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fe(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function B(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(s){return O(s)?(e.enter(n),a(s)):t(s)}function a(s){return O(s)&&o++l))return;const M=t.events.length;let H=M,j,k;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(j){k=t.events[H][1].end;break}j=!0}for(y(r),b=M;bC;){const F=n[R];t.containerState=F[1],F[0].exit.call(t,e)}n.length=C}function I(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function kl(e,t,n){return B(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _e(e){if(e===null||W(e)||ve(e))return 1;if(sn(e))return 2}function un(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};It(c,-s),It(p,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:s>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=le(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=le(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=le(u,un(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=le(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,u=le(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,ie(e,r-1,n-r+3,u),n=r+u.length-h-2;break}}for(n=-1;++n0&&O(b)?B(e,I,"linePrefix",o+1)(b):I(b)}function I(b){return b===null||z(b)?e.check(vt,w,R)(b):(e.enter("codeFlowValue"),C(b))}function C(b){return b===null||z(b)?(e.exit("codeFlowValue"),I(b)):(e.consume(b),C)}function R(b){return e.exit("codeFenced"),t(b)}function F(b,M,H){let j=0;return k;function k(T){return b.enter("lineEnding"),b.consume(T),b.exit("lineEnding"),A}function A(T){return b.enter("codeFencedFence"),O(T)?B(b,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):P(T)}function P(T){return T===a?(b.enter("codeFencedFenceSequence"),q(T)):H(T)}function q(T){return T===a?(j++,b.consume(T),q):j>=l?(b.exit("codeFencedFenceSequence"),O(T)?B(b,D,"whitespace")(T):D(T)):H(T)}function D(T){return T===null||z(T)?(b.exit("codeFencedFence"),M(T)):H(T)}}}function zl(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const gn={name:"codeIndented",tokenize:Ll},Dl={partial:!0,tokenize:_l};function Ll(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),B(e,o,"linePrefix",5)(u)}function o(u){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?s(u):z(u)?e.attempt(Dl,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||z(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),t(u)}}function _l(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):B(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):z(l)?i(l):n(l)}}const Rl={name:"codeText",previous:Ol,resolve:Fl,tokenize:Ml};function Fl(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&He(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),He(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),He(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Sr(e,t,n,r,i,o,l,a,s){const u=s||Number.POSITIVE_INFINITY;let h=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||rn(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||z(y)?n(y):(e.consume(y),y===92?g:f)}function g(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function w(y){return!h&&(y===null||y===41||W(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):h999||f===null||f===91||f===93&&!s||f===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===null||f===91||f===93||z(f)||a++>999?(e.exit("chunkString"),h(f)):(e.consume(f),s||(s=!O(f)),f===92?p:c)}function p(f){return f===91||f===92||f===93?(e.consume(f),a++,c):c(f)}}function Er(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,s):n(p)}function s(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),s(l)):p===null?n(p):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),B(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===l||p===null||z(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:h)}function c(p){return p===l||p===92?(e.consume(p),h):h(p)}}function Ve(e,t){let n;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):O(i)?B(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const $l={name:"definition",tokenize:Yl},Wl={partial:!0,tokenize:Kl};function Yl(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),l(f)}function l(f){return Cr.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=ce(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),s):n(f)}function s(f){return W(f)?Ve(e,u)(f):u(f)}function u(f){return Sr(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function h(f){return e.attempt(Wl,c,c)(f)}function c(f){return O(f)?B(e,p,"whitespace")(f):p(f)}function p(f){return f===null||z(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function Kl(e,t,n){return r;function r(a){return W(a)?Ve(e,i)(a):n(a)}function i(a){return Er(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return O(a)?B(e,l,"whitespace")(a):l(a)}function l(a){return a===null||z(a)?t(a):n(a)}}const Ql={name:"hardBreakEscape",tokenize:Xl};function Xl(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return z(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Gl={name:"headingAtx",resolve:Jl,tokenize:Zl};function Jl(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ie(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Zl(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),o(h)}function o(h){return e.enter("atxHeadingSequence"),l(h)}function l(h){return h===35&&r++<6?(e.consume(h),l):h===null||W(h)?(e.exit("atxHeadingSequence"),a(h)):n(h)}function a(h){return h===35?(e.enter("atxHeadingSequence"),s(h)):h===null||z(h)?(e.exit("atxHeading"),t(h)):O(h)?B(e,a,"whitespace")(h):(e.enter("atxHeadingText"),u(h))}function s(h){return h===35?(e.consume(h),s):(e.exit("atxHeadingSequence"),a(h))}function u(h){return h===null||h===35||W(h)?(e.exit("atxHeadingText"),a(h)):(e.consume(h),u)}}const eo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],At=["pre","script","style","textarea"],no={concrete:!0,name:"htmlFlow",resolveTo:io,tokenize:lo},to={partial:!0,tokenize:ao},ro={partial:!0,tokenize:oo};function io(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function lo(e,t,n){const r=this;let i,o,l,a,s;return u;function u(d){return h(d)}function h(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,w):d===63?(e.consume(d),i=3,r.interrupt?t:m):J(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function p(d){return d===45?(e.consume(d),i=2,f):d===91?(e.consume(d),i=5,a=0,g):J(d)?(e.consume(d),i=4,r.interrupt?t:m):n(d)}function f(d){return d===45?(e.consume(d),r.interrupt?t:m):n(d)}function g(d){const se="CDATA[";return d===se.charCodeAt(a++)?(e.consume(d),a===se.length?r.interrupt?t:P:g):n(d)}function w(d){return J(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function S(d){if(d===null||d===47||d===62||W(d)){const se=d===47,we=l.toLowerCase();return!se&&!o&&At.includes(we)?(i=1,r.interrupt?t(d):P(d)):eo.includes(l.toLowerCase())?(i=6,se?(e.consume(d),y):r.interrupt?t(d):P(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(d):o?I(d):C(d))}return d===45||X(d)?(e.consume(d),l+=String.fromCharCode(d),S):n(d)}function y(d){return d===62?(e.consume(d),r.interrupt?t:P):n(d)}function I(d){return O(d)?(e.consume(d),I):k(d)}function C(d){return d===47?(e.consume(d),k):d===58||d===95||J(d)?(e.consume(d),R):O(d)?(e.consume(d),C):k(d)}function R(d){return d===45||d===46||d===58||d===95||X(d)?(e.consume(d),R):F(d)}function F(d){return d===61?(e.consume(d),b):O(d)?(e.consume(d),F):C(d)}function b(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),s=d,M):O(d)?(e.consume(d),b):H(d)}function M(d){return d===s?(e.consume(d),s=null,j):d===null||z(d)?n(d):(e.consume(d),M)}function H(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||W(d)?F(d):(e.consume(d),H)}function j(d){return d===47||d===62||O(d)?C(d):n(d)}function k(d){return d===62?(e.consume(d),A):n(d)}function A(d){return d===null||z(d)?P(d):O(d)?(e.consume(d),A):n(d)}function P(d){return d===45&&i===2?(e.consume(d),U):d===60&&i===1?(e.consume(d),K):d===62&&i===4?(e.consume(d),ae):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),pe):z(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(to,me,q)(d)):d===null||z(d)?(e.exit("htmlFlowData"),q(d)):(e.consume(d),P)}function q(d){return e.check(ro,D,me)(d)}function D(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),T}function T(d){return d===null||z(d)?q(d):(e.enter("htmlFlowData"),P(d))}function U(d){return d===45?(e.consume(d),m):P(d)}function K(d){return d===47?(e.consume(d),l="",oe):P(d)}function oe(d){if(d===62){const se=l.toLowerCase();return At.includes(se)?(e.consume(d),ae):P(d)}return J(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),oe):P(d)}function pe(d){return d===93?(e.consume(d),m):P(d)}function m(d){return d===62?(e.consume(d),ae):d===45&&i===2?(e.consume(d),m):P(d)}function ae(d){return d===null||z(d)?(e.exit("htmlFlowData"),me(d)):(e.consume(d),ae)}function me(d){return e.exit("htmlFlow"),t(d)}}function oo(e,t,n){const r=this;return i;function i(l){return z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ao(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Qe,t,n)}}const so={name:"htmlText",tokenize:uo};function uo(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),s}function s(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),F):m===63?(e.consume(m),C):J(m)?(e.consume(m),H):n(m)}function u(m){return m===45?(e.consume(m),h):m===91?(e.consume(m),o=0,g):J(m)?(e.consume(m),I):n(m)}function h(m){return m===45?(e.consume(m),f):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):z(m)?(l=c,K(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),f):c(m)}function f(m){return m===62?U(m):m===45?p(m):c(m)}function g(m){const ae="CDATA[";return m===ae.charCodeAt(o++)?(e.consume(m),o===ae.length?w:g):n(m)}function w(m){return m===null?n(m):m===93?(e.consume(m),S):z(m)?(l=w,K(m)):(e.consume(m),w)}function S(m){return m===93?(e.consume(m),y):w(m)}function y(m){return m===62?U(m):m===93?(e.consume(m),y):w(m)}function I(m){return m===null||m===62?U(m):z(m)?(l=I,K(m)):(e.consume(m),I)}function C(m){return m===null?n(m):m===63?(e.consume(m),R):z(m)?(l=C,K(m)):(e.consume(m),C)}function R(m){return m===62?U(m):C(m)}function F(m){return J(m)?(e.consume(m),b):n(m)}function b(m){return m===45||X(m)?(e.consume(m),b):M(m)}function M(m){return z(m)?(l=M,K(m)):O(m)?(e.consume(m),M):U(m)}function H(m){return m===45||X(m)?(e.consume(m),H):m===47||m===62||W(m)?j(m):n(m)}function j(m){return m===47?(e.consume(m),U):m===58||m===95||J(m)?(e.consume(m),k):z(m)?(l=j,K(m)):O(m)?(e.consume(m),j):U(m)}function k(m){return m===45||m===46||m===58||m===95||X(m)?(e.consume(m),k):A(m)}function A(m){return m===61?(e.consume(m),P):z(m)?(l=A,K(m)):O(m)?(e.consume(m),A):j(m)}function P(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,q):z(m)?(l=P,K(m)):O(m)?(e.consume(m),P):(e.consume(m),D)}function q(m){return m===i?(e.consume(m),i=void 0,T):m===null?n(m):z(m)?(l=q,K(m)):(e.consume(m),q)}function D(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||W(m)?j(m):(e.consume(m),D)}function T(m){return m===47||m===62||W(m)?j(m):n(m)}function U(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function K(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),oe}function oe(m){return O(m)?B(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):pe(m)}function pe(m){return e.enter("htmlTextData"),l(m)}}const Qn={name:"labelEnd",resolveAll:po,resolveTo:mo,tokenize:go},co={tokenize:yo},ho={tokenize:ko},fo={tokenize:xo};function po(e){let t=-1;const n=[];for(;++t=3&&(u===null||z(u))?(e.exit("thematicBreak"),t(u)):n(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),O(u)?B(e,a,"whitespace")(u):a(u))}}const Z={continuation:{tokenize:Po},exit:Do,name:"list",tokenize:Ao},vo={partial:!0,tokenize:Lo},To={partial:!0,tokenize:zo};function Ao(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(f){const g=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Rn(f)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(tn,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(f)}return n(f)}function s(f){return Rn(f)&&++l<10?(e.consume(f),s):(!r.interrupt||l<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Qe,r.interrupt?n:h,e.attempt(vo,p,c))}function h(f){return r.containerState.initialBlankLine=!0,o++,p(f)}function c(f){return O(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Po(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Qe,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,B(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!O(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(To,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,B(e,e.attempt(Z,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function zo(e,t,n){const r=this;return B(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function Do(e){e.exit(this.containerState.type)}function Lo(e,t,n){const r=this;return B(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!O(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Pt={name:"setextUnderline",resolveTo:_o,tokenize:Ro};function _o(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Ro(e,t,n){const r=this;let i;return o;function o(u){let h=r.events.length,c;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){c=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),O(u)?B(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||z(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Fo={tokenize:Oo};function Oo(e){const t=this,n=e.attempt(Qe,r,e.attempt(this.parser.constructs.flowInitial,i,B(e,e.attempt(this.parser.constructs.flow,i,e.attempt(jl,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Mo={resolveAll:vr()},No=Ir("string"),Bo=Ir("text");function Ir(e){return{resolveAll:vr(e==="text"?jo:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(h){return u(h)?o(h):a(h)}function a(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),s}function s(h){return u(h)?(n.exit("data"),o(h)):(n.consume(h),s)}function u(h){if(h===null)return!0;const c=i[h];let p=-1;if(c)for(;++p-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Zo(e,t){let n=-1;const r=[];let i;for(;++n0){const ue=_.tokenStack[_.tokenStack.length-1];(ue[1]||Dt).call(_,void 0,ue[0])}for(v.position={start:xe(x.length>0?x[0][1].start:{line:1,column:1,offset:0}),end:xe(x.length>0?x[x.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++Ve.bucketStart),X=x.map(e=>({x:e.bucketStart,requests:e.requests})),r=x.length,H=oe(C,S),z=()=>{if(r===0)return[0,1];const{startIndex:e,endIndex:s}=ce(w,C,S);return[e,s+1]},[T,Z]=p.useState(z),y=p.useRef(T),v=e=>{y.current=e,Z(e)},N=p.useRef(!1);p.useEffect(()=>{N.current||v(z())},[C,S,r,w[0],w[r-1]]);const b=([e,s])=>{if(N.current=!1,r===0)return;const i=Math.max(0,Math.min(r-1,Math.floor(e+1e-6))),a=Math.max(i,Math.min(r-1,Math.ceil(s-1e-6)-1));if(i===0&&a===r-1){j(),v([0,r]);return}const n=de(w,i,a,l);n&&g(n.startIso,n.endIso)},k=o.findIndex(e=>e.key===m),B=k>=0?o[k].seconds:r*le(l)/1e3,A=k>=0?o[k+1]:o.find(e=>e.seconds===null||B!==null&&e.seconds>B),[d,u]=T,P=d<=.01&&u>=r-.01,L=e=>{const s=Math.max(1,Math.min(r,e)),i=(d+u)/2;let a=i-s/2,n=i+s/2;a<0&&(n-=a,a=0),n>r&&(a-=n-r,n=r);const f=[Math.max(0,a),Math.min(r,n)];v(f),b(f)},V=()=>{if(P){A&&c(A);return}L((u-d)*2)},G=()=>L((u-d)/2),J=(e,s)=>{const[i,a]=y.current,n=e===0?[Math.max(0,Math.min(a-1,Math.round(i)+s)),a]:[i,Math.min(r,Math.max(i+1,Math.round(a)+s))];v(n),b(n)},Q=e=>{var n,f;const s=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:0;if(s===0)return;const i=(f=(n=e.target).getAttribute)==null?void 0:f.call(n,"aria-label"),a=F.indexOf(i);a<0||(e.preventDefault(),e.stopPropagation(),J(a,s))},R=p.useRef(null),h=p.useRef(null),Y=e=>{if(!h.current||!R.current)return;const s=R.current.getBoundingClientRect().width;if(s<=0)return;const i=(e.clientX-h.current.x)/s*r,a=h.current.sel[1]-h.current.sel[0],n=Math.max(0,Math.min(r-a,h.current.sel[0]+i));v([n,n+a])},ee=e=>{const[s,i]=y.current,a=i-s,n=Math.max(0,Math.min(r-a,Math.round(s)+e)),f=[n,n+a];v(f),b(f)},te=e=>{if(P)return;const[s,i]=y.current,a=Math.max(1,Math.round(i-s)),n=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:e.key==="PageUp"?a:e.key==="PageDown"?-a:e.key==="Home"?-r:e.key==="End"?r:0;n!==0&&(e.preventDefault(),ee(n))},I=r?Math.min(d,u)/r*100:0,E=r?Math.max(d,u)/r*100:100,D=!P,re=Math.max(1,Math.round(u-d)),U=Math.max(0,r-re),q=Math.min(Math.max(0,Math.round(Math.min(d,u))),U);return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.map(e=>t.jsx(M,{size:"sm",variant:m===e.key?"primary":"outline",onPress:()=>c(e),children:e.label},e.key)),t.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[t.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",H," · UTC"]}),O]})]}),t.jsxs("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-2",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[t.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:["Requests / ",l==="hour"?"hour":"day"]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"hidden text-[11px] text-[var(--otari-muted)] sm:inline",children:"drag the edges to zoom · the bottom strip to pan"}),t.jsx(M,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom in",isDisabled:r===0,onPress:G,children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:t.jsx("path",{d:"M12 5v14M5 12h14",strokeLinecap:"round"})})}),t.jsx(M,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom out",isDisabled:r===0||P&&!A,onPress:V,children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:t.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})})}),D?t.jsx(M,{size:"sm",variant:"ghost",onPress:()=>b([0,r]),children:"Reset"}):null]})]}),K&&r===0?t.jsx("div",{className:"flex h-[90px] items-center justify-center",children:t.jsx(ae,{size:"sm"})}):r===0?t.jsx("div",{className:"flex h-[90px] items-center justify-center text-xs text-[var(--otari-muted)]",children:"No activity in this range."}):t.jsxs("div",{ref:R,className:"relative w-full",children:[t.jsx("div",{role:"img","aria-label":_,className:"w-full touch-pan-y select-none",children:t.jsx(ue,{width:"100%",height:90,children:t.jsxs(me,{data:X,margin:{top:4,right:0,left:0,bottom:0},children:[t.jsx(xe,{dataKey:"x",tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:40,tickFormatter:e=>$(e,l),tick:{fontSize:10,fill:"var(--otari-muted)"}}),t.jsx(he,{cursor:{fill:"var(--otari-line)",opacity:.35},content:t.jsx(be,{bucket:l})}),t.jsx(fe,{dataKey:"requests",fill:pe,radius:[2,2,0,0],isAnimationActive:!1})]})})}),D?t.jsxs(t.Fragment,{children:[t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-0 bg-[var(--otari-bg)] opacity-70",style:{width:`${I}%`}}),t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 right-0 bg-[var(--otari-bg)] opacity-70",style:{width:`${100-E}%`}})]}):null,t.jsx("div",{role:"slider","aria-label":"Pan the selected window","aria-valuemin":0,"aria-valuemax":U,"aria-valuenow":q,"aria-valuetext":`Window starting at ${$(w[Math.min(q,r-1)]??w[0],l)}`,"aria-disabled":!D,tabIndex:0,className:"absolute bottom-0 z-[1] cursor-grab touch-none rounded bg-[var(--otari-brand)]/10 outline-none hover:bg-[var(--otari-brand)]/20 focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)] active:cursor-grabbing",style:{left:`${I}%`,width:`${Math.max(0,E-I)}%`,height:ve},onKeyDown:te,onPointerDown:e=>{e.stopPropagation(),e.preventDefault(),N.current=!0,h.current={x:e.clientX,sel:[Math.min(d,u),Math.max(d,u)]},e.currentTarget.setPointerCapture(e.pointerId)},onPointerMove:Y,onPointerUp:e=>{e.currentTarget.releasePointerCapture(e.pointerId),h.current=null,b(y.current)},onPointerCancel:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),h.current=null,b(y.current)}}),t.jsx("div",{className:"pointer-events-none absolute inset-0 z-[2]",onKeyDownCapture:Q,children:t.jsx(ne,{"aria-label":"Selected time range",minValue:0,maxValue:r,step:1/ge,value:T,onChange:e=>{N.current=!0,Array.isArray(e)&&e.length===2&&v([e[0],e[1]])},onChangeEnd:e=>{Array.isArray(e)&&e.length===2&&b([e[0],e[1]])},className:"pointer-events-none h-full w-full",children:t.jsxs(se,{className:"pointer-events-none relative h-full w-full",children:[t.jsx(W,{index:0}),t.jsx(W,{index:1})]})})})]})]})]})}function Ce({chips:o,children:m,onClearAll:c}){const[g,j]=p.useState(!1),x=p.useId();return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(M,{size:"sm",variant:"outline",onPress:()=>j(l=>!l),"aria-expanded":g,"aria-controls":x,children:g?"Done":"Add filter"}),o.map(l=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] py-0.5 pl-2.5 pr-1 text-xs text-[var(--otari-brand-dark)]",children:[t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[l.label,":"]}),t.jsx("span",{className:"font-medium",children:l.value}),t.jsx("button",{type:"button",onClick:l.onClear,"aria-label":`Remove ${l.label} filter`,className:"ml-0.5 inline-flex h-4 w-4 items-center justify-center rounded-full text-[var(--otari-muted)] outline-none hover:bg-[var(--otari-line)] hover:text-[var(--otari-ink)] focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)]",children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"h-3 w-3","aria-hidden":"true",children:t.jsx("path",{d:"M6 6l12 12M18 6L6 18",strokeLinecap:"round"})})})]},l.key)),o.length>0&&c?t.jsx(M,{size:"sm",variant:"ghost",onPress:c,children:"Clear all"}):null]}),t.jsx("div",{id:x,className:g?"flex flex-wrap items-end gap-3":"hidden",children:m})]})}export{Pe as A,Ce as F}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as p}from"./react-dgEcD0HR.js";import{B as M,S as ae,$ as ne,h as se,i as ie}from"./heroui-BI50yK5B.js";import{an as oe,ao as le,ap as ce,aq as de}from"./index-BCvb90M0.js";import{R as ue,B as me,X as xe,T as he,a as fe}from"./recharts-C4kRDmvS.js";const pe="var(--otari-brand)",ge=10,ve=22;function $(o,m){const c=new Date(o);return Number.isNaN(c.getTime())?o:m==="hour"?c.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):c.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function be({active:o,label:m,payload:c,bucket:g}){var x;const j=(x=c==null?void 0:c[0])==null?void 0:x.value;return!o||typeof j!="number"||typeof m!="string"?null:t.jsxs("div",{className:"rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-xs shadow-sm",children:[t.jsxs("div",{className:"text-[var(--otari-muted)]",children:[$(m,g)," · UTC"]}),t.jsxs("div",{className:"font-medium tabular-nums text-[var(--otari-ink)]",children:[j.toLocaleString()," requests"]})]})}const je="group top-1/2 h-full w-3 cursor-ew-resize outline-none",F=["Window start","Window end"];function W({index:o}){return t.jsxs(ie,{index:o,"aria-label":F[o],className:`${je} pointer-events-auto`,children:[t.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-1/2 w-0.5 -translate-x-1/2 bg-[var(--otari-brand)]"}),t.jsx("span",{"aria-hidden":!0,className:"absolute left-1/2 top-1/2 h-6 w-2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-surface)] shadow-sm group-focus-visible:ring-2 group-focus-visible:ring-[var(--otari-brand)]"})]})}function Pe({presets:o,extentKey:m,onPreset:c,onSelectRange:g,onSelectFull:j,series:x,bucket:l,windowStart:C,windowEnd:S,loading:K=!1,ariaLabel:_="Request volume over the selected window",action:O}){const w=x.map(e=>e.bucketStart),X=x.map(e=>({x:e.bucketStart,requests:e.requests})),r=x.length,H=oe(C,S),z=()=>{if(r===0)return[0,1];const{startIndex:e,endIndex:s}=ce(w,C,S);return[e,s+1]},[T,Z]=p.useState(z),y=p.useRef(T),v=e=>{y.current=e,Z(e)},N=p.useRef(!1);p.useEffect(()=>{N.current||v(z())},[C,S,r,w[0],w[r-1]]);const b=([e,s])=>{if(N.current=!1,r===0)return;const i=Math.max(0,Math.min(r-1,Math.floor(e+1e-6))),a=Math.max(i,Math.min(r-1,Math.ceil(s-1e-6)-1));if(i===0&&a===r-1){j(),v([0,r]);return}const n=de(w,i,a,l);n&&g(n.startIso,n.endIso)},k=o.findIndex(e=>e.key===m),B=k>=0?o[k].seconds:r*le(l)/1e3,A=k>=0?o[k+1]:o.find(e=>e.seconds===null||B!==null&&e.seconds>B),[d,u]=T,P=d<=.01&&u>=r-.01,L=e=>{const s=Math.max(1,Math.min(r,e)),i=(d+u)/2;let a=i-s/2,n=i+s/2;a<0&&(n-=a,a=0),n>r&&(a-=n-r,n=r);const f=[Math.max(0,a),Math.min(r,n)];v(f),b(f)},V=()=>{if(P){A&&c(A);return}L((u-d)*2)},G=()=>L((u-d)/2),J=(e,s)=>{const[i,a]=y.current,n=e===0?[Math.max(0,Math.min(a-1,Math.round(i)+s)),a]:[i,Math.min(r,Math.max(i+1,Math.round(a)+s))];v(n),b(n)},Q=e=>{var n,f;const s=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:0;if(s===0)return;const i=(f=(n=e.target).getAttribute)==null?void 0:f.call(n,"aria-label"),a=F.indexOf(i);a<0||(e.preventDefault(),e.stopPropagation(),J(a,s))},R=p.useRef(null),h=p.useRef(null),Y=e=>{if(!h.current||!R.current)return;const s=R.current.getBoundingClientRect().width;if(s<=0)return;const i=(e.clientX-h.current.x)/s*r,a=h.current.sel[1]-h.current.sel[0],n=Math.max(0,Math.min(r-a,h.current.sel[0]+i));v([n,n+a])},ee=e=>{const[s,i]=y.current,a=i-s,n=Math.max(0,Math.min(r-a,Math.round(s)+e)),f=[n,n+a];v(f),b(f)},te=e=>{if(P)return;const[s,i]=y.current,a=Math.max(1,Math.round(i-s)),n=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:e.key==="PageUp"?a:e.key==="PageDown"?-a:e.key==="Home"?-r:e.key==="End"?r:0;n!==0&&(e.preventDefault(),ee(n))},I=r?Math.min(d,u)/r*100:0,E=r?Math.max(d,u)/r*100:100,D=!P,re=Math.max(1,Math.round(u-d)),U=Math.max(0,r-re),q=Math.min(Math.max(0,Math.round(Math.min(d,u))),U);return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.map(e=>t.jsx(M,{size:"sm",variant:m===e.key?"primary":"outline",onPress:()=>c(e),children:e.label},e.key)),t.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[t.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",H," · UTC"]}),O]})]}),t.jsxs("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-2",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[t.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:["Requests / ",l==="hour"?"hour":"day"]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"hidden text-[11px] text-[var(--otari-muted)] sm:inline",children:"drag the edges to zoom · the bottom strip to pan"}),t.jsx(M,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom in",isDisabled:r===0,onPress:G,children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:t.jsx("path",{d:"M12 5v14M5 12h14",strokeLinecap:"round"})})}),t.jsx(M,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom out",isDisabled:r===0||P&&!A,onPress:V,children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:t.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})})}),D?t.jsx(M,{size:"sm",variant:"ghost",onPress:()=>b([0,r]),children:"Reset"}):null]})]}),K&&r===0?t.jsx("div",{className:"flex h-[90px] items-center justify-center",children:t.jsx(ae,{size:"sm"})}):r===0?t.jsx("div",{className:"flex h-[90px] items-center justify-center text-xs text-[var(--otari-muted)]",children:"No activity in this range."}):t.jsxs("div",{ref:R,className:"relative w-full",children:[t.jsx("div",{role:"img","aria-label":_,className:"w-full touch-pan-y select-none",children:t.jsx(ue,{width:"100%",height:90,children:t.jsxs(me,{data:X,margin:{top:4,right:0,left:0,bottom:0},children:[t.jsx(xe,{dataKey:"x",tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:40,tickFormatter:e=>$(e,l),tick:{fontSize:10,fill:"var(--otari-muted)"}}),t.jsx(he,{cursor:{fill:"var(--otari-line)",opacity:.35},content:t.jsx(be,{bucket:l})}),t.jsx(fe,{dataKey:"requests",fill:pe,radius:[2,2,0,0],isAnimationActive:!1})]})})}),D?t.jsxs(t.Fragment,{children:[t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-0 bg-[var(--otari-bg)] opacity-70",style:{width:`${I}%`}}),t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 right-0 bg-[var(--otari-bg)] opacity-70",style:{width:`${100-E}%`}})]}):null,t.jsx("div",{role:"slider","aria-label":"Pan the selected window","aria-valuemin":0,"aria-valuemax":U,"aria-valuenow":q,"aria-valuetext":`Window starting at ${$(w[Math.min(q,r-1)]??w[0],l)}`,"aria-disabled":!D,tabIndex:0,className:"absolute bottom-0 z-[1] cursor-grab touch-none rounded bg-[var(--otari-brand)]/10 outline-none hover:bg-[var(--otari-brand)]/20 focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)] active:cursor-grabbing",style:{left:`${I}%`,width:`${Math.max(0,E-I)}%`,height:ve},onKeyDown:te,onPointerDown:e=>{e.stopPropagation(),e.preventDefault(),N.current=!0,h.current={x:e.clientX,sel:[Math.min(d,u),Math.max(d,u)]},e.currentTarget.setPointerCapture(e.pointerId)},onPointerMove:Y,onPointerUp:e=>{e.currentTarget.releasePointerCapture(e.pointerId),h.current=null,b(y.current)},onPointerCancel:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),h.current=null,b(y.current)}}),t.jsx("div",{className:"pointer-events-none absolute inset-0 z-[2]",onKeyDownCapture:Q,children:t.jsx(ne,{"aria-label":"Selected time range",minValue:0,maxValue:r,step:1/ge,value:T,onChange:e=>{N.current=!0,Array.isArray(e)&&e.length===2&&v([e[0],e[1]])},onChangeEnd:e=>{Array.isArray(e)&&e.length===2&&b([e[0],e[1]])},className:"pointer-events-none h-full w-full",children:t.jsxs(se,{className:"pointer-events-none relative h-full w-full",children:[t.jsx(W,{index:0}),t.jsx(W,{index:1})]})})})]})]})]})}function Ce({chips:o,children:m,onClearAll:c}){const[g,j]=p.useState(!1),x=p.useId();return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(M,{size:"sm",variant:"outline",onPress:()=>j(l=>!l),"aria-expanded":g,"aria-controls":x,children:g?"Done":"Add filter"}),o.map(l=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] py-0.5 pl-2.5 pr-1 text-xs text-[var(--otari-brand-dark)]",children:[t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[l.label,":"]}),t.jsx("span",{className:"font-medium",children:l.value}),t.jsx("button",{type:"button",onClick:l.onClear,"aria-label":`Remove ${l.label} filter`,className:"ml-0.5 inline-flex h-4 w-4 items-center justify-center rounded-full text-[var(--otari-muted)] outline-none hover:bg-[var(--otari-line)] hover:text-[var(--otari-ink)] focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)]",children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"h-3 w-3","aria-hidden":"true",children:t.jsx("path",{d:"M6 6l12 12M18 6L6 18",strokeLinecap:"round"})})})]},l.key)),o.length>0&&c?t.jsx(M,{size:"sm",variant:"ghost",onPress:c,children:"Clear all"}):null]}),t.jsx("div",{id:x,className:g?"flex flex-wrap items-end gap-3":"hidden",children:m})]})}export{Pe as A,Ce as F}; diff --git a/src/gateway/static/dashboard/assets/KeysPage-BBEXGo7q.js b/src/gateway/static/dashboard/assets/KeysPage-DVB0fG8n.js similarity index 98% rename from src/gateway/static/dashboard/assets/KeysPage-BBEXGo7q.js rename to src/gateway/static/dashboard/assets/KeysPage-DVB0fG8n.js index c58fd6230..39aa3688f 100644 --- a/src/gateway/static/dashboard/assets/KeysPage-BBEXGo7q.js +++ b/src/gateway/static/dashboard/assets/KeysPage-DVB0fG8n.js @@ -1,4 +1,4 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{a as J,y as U,z as Q,B as X,P as Z,E as O,w as ee,D as te,u as V,I as se}from"./index-MlRogoGm.js";import{u as ae,r as ne,B as re}from"./tableSelection-9hV37uhu.js";import{C as ie}from"./ConfirmDialog-P_P4TNFr.js";import{D as le}from"./DataTable-Bmn_eYSV.js";import{F as A}from"./Field-Dwp6u3t8.js";import{a as F,M as q}from"./ModelScopeControl-Bmks7cWc.js";import{U as oe}from"./UserComboBox-a9wxf8eF.js";import{f as P,B as f,d as D}from"./heroui-BI50yK5B.js";function $(t){if(!t)return"—";const a=new Date(t);return Number.isNaN(a.getTime())?"—":a.toLocaleDateString()}function ce(t){if(!t)return null;const a=new Date(t).getTime();if(Number.isNaN(a))return null;const n=Math.round((a-Date.now())/1e3),r=Math.abs(n),d=[["day",86400],["hour",3600],["minute",60]],o=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[l,x]of d)if(r>=x)return o.format(Math.round(n/x),l);return o.format(n,"second")}function de(t){if(!t.expires_at)return!1;const a=new Date(t.expires_at).getTime();return!Number.isNaN(a)&&aString(r).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}T${n(a.getHours())}:${n(a.getMinutes())}`}const me=t=>(t??"").startsWith("apikey-"),M=t=>t.key_name??t.id,xe=t=>t.id;function K({label:t,value:a,multiline:n=!1,fieldRef:r}){const d=i.useRef(null),o=r??d,[l,x]=i.useState(!1),[g,p]=i.useState(!1),c=async()=>{var m,y,h;(m=o.current)==null||m.focus(),(y=o.current)==null||y.select();try{if((h=navigator.clipboard)!=null&&h.writeText){await navigator.clipboard.writeText(a),x(!0),p(!1),window.setTimeout(()=>x(!1),2e3);return}}catch{}p(!0)},u="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(f,{size:"sm",variant:"outline",onPress:c,children:l?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:o,readOnly:!0,rows:a.split(` +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{a as J,y as U,z as Q,B as X,P as Z,E as O,w as ee,D as te,u as V,I as se}from"./index-BCvb90M0.js";import{u as ae,r as ne,B as re}from"./tableSelection-9hV37uhu.js";import{C as ie}from"./ConfirmDialog-BXAKoq6j.js";import{D as le}from"./DataTable-Bmn_eYSV.js";import{F as A}from"./Field-Dwp6u3t8.js";import{a as F,M as q}from"./ModelScopeControl-CuclfKO5.js";import{U as oe}from"./UserComboBox-a9wxf8eF.js";import{f as P,B as f,d as D}from"./heroui-BI50yK5B.js";function $(t){if(!t)return"—";const a=new Date(t);return Number.isNaN(a.getTime())?"—":a.toLocaleDateString()}function ce(t){if(!t)return null;const a=new Date(t).getTime();if(Number.isNaN(a))return null;const n=Math.round((a-Date.now())/1e3),r=Math.abs(n),d=[["day",86400],["hour",3600],["minute",60]],o=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[l,x]of d)if(r>=x)return o.format(Math.round(n/x),l);return o.format(n,"second")}function de(t){if(!t.expires_at)return!1;const a=new Date(t.expires_at).getTime();return!Number.isNaN(a)&&aString(r).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}T${n(a.getHours())}:${n(a.getMinutes())}`}const me=t=>(t??"").startsWith("apikey-"),M=t=>t.key_name??t.id,xe=t=>t.id;function K({label:t,value:a,multiline:n=!1,fieldRef:r}){const d=i.useRef(null),o=r??d,[l,x]=i.useState(!1),[g,p]=i.useState(!1),c=async()=>{var m,y,h;(m=o.current)==null||m.focus(),(y=o.current)==null||y.select();try{if((h=navigator.clipboard)!=null&&h.writeText){await navigator.clipboard.writeText(a),x(!0),p(!1),window.setTimeout(()=>x(!1),2e3);return}}catch{}p(!0)},u="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(f,{size:"sm",variant:"outline",onPress:c,children:l?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:o,readOnly:!0,rows:a.split(` `).length,value:a,onFocus:m=>m.currentTarget.select(),className:`${u} resize-none whitespace-pre`}):e.jsx("input",{ref:o,readOnly:!0,value:a,onFocus:m=>m.currentTarget.select(),className:u}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-green-700",children:l?"Copied to clipboard.":""}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function he({title:t,result:a,onClose:n}){const r=i.useRef(null),d=i.useRef(null),o=typeof window<"u"?window.location.origin:"",l=a.key;i.useEffect(()=>{var c,u;(c=d.current)==null||c.focus(),(u=d.current)==null||u.select()},[]);const x=c=>{var h;if(c.key!=="Tab")return;const u=(h=r.current)==null?void 0:h.querySelectorAll('button, input, textarea, a[href], [tabindex]:not([tabindex="-1"])');if(!u||u.length===0)return;const m=u[0],y=u[u.length-1];c.shiftKey&&document.activeElement===m?(c.preventDefault(),y.focus()):!c.shiftKey&&document.activeElement===y&&(c.preventDefault(),m.focus())},g=[`curl ${o}/v1/chat/completions \\`,` -H "Otari-Key: ${l}" \\`,' -H "Content-Type: application/json" \\',` -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'`].join(` `),p=["from openai import OpenAI","",`client = OpenAI(base_url="${o}/v1", api_key="${l}")`,"resp = client.chat.completions.create(",' model="your-model",',' messages=[{"role": "user", "content": "Hello"}],',")","print(resp.choices[0].message.content)"].join(` `);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:x,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(se,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",F(a.allowed_models).text,"."]}),e.jsx(K,{label:"Secret key",value:l,fieldRef:d}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(K,{label:"curl",value:g,multiline:!0}),e.jsx(K,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(f,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function H({trigger:t,message:a,confirmLabel:n,isPending:r,onConfirm:d}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:a}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(f,{size:"sm",variant:"danger",isDisabled:r,onPress:d,children:n}),e.jsx(f,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(f,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:t})}function W({userId:t,users:a}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const r=a.find(l=>l.user_id===n);if(!r)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:d}=F(r.allowed_models),o=r.allowed_models&&r.allowed_models.length>0?r.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:d.toLowerCase()}),o?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:o}),")"]}):null,". This key inherits that, or narrows within it."]})}function Y({checked:t,onChange:a}){return e.jsxs("label",{className:"flex items-start gap-2 rounded-lg border border-[var(--otari-line)] p-3 text-sm",children:[e.jsx("input",{type:"checkbox",checked:t,onChange:n=>a(n.target.checked),className:"mt-0.5 h-4 w-4 accent-[var(--otari-brand)]","aria-label":"Exempt this key from budget"}),e.jsxs("span",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:"Exempt from budget"}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Requests on this key are logged with their cost but never counted toward the owner's budget or spend, and never blocked by it."})]})]})}function fe({onClose:t,onCreated:a}){const n=te(),r=V(),[d,o]=i.useState(""),[l,x]=i.useState(""),[g,p]=i.useState(!1),[c,u]=i.useState(""),[m,y]=i.useState(null),[h,N]=i.useState(!1),[v,I]=i.useState(!0),C=l!==""&&new Date(l).getTime(){if(n.isPending||!v||w)return;const b={key_name:d.trim()||null,user_id:c.trim(),expires_at:l?new Date(l).toISOString():null,allowed_models:m,exclude_from_budget:h};n.mutate(b,{onSuccess:j=>{a(j),t()}})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(A,{label:"Expires (optional)",value:l,onChange:x,type:"datetime-local",description:C?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(oe,{value:c,onChange:u,users:r.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(b=>!b),children:g?"Hide advanced":"Advanced"}),g?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(W,{userId:c,users:r.data??[]}),e.jsx(q,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(b,j)=>{y(b),I(j)}}),e.jsx(Y,{checked:h,onChange:N})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!v||w,onPress:S,children:n.isPending?"Creating…":"Create key"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ge({apiKey:t,onClose:a}){const n=U(),r=V(),[d,o]=i.useState(t.key_name??""),[l,x]=i.useState(ue(t.expires_at)),[g,p]=i.useState(t.allowed_models),[c,u]=i.useState(t.exclude_from_budget),[m,y]=i.useState(!0),h=()=>{n.isPending||!m||n.mutate({id:t.id,body:{key_name:d.trim()||null,expires_at:l?new Date(l).toISOString():null,allowed_models:g,exclude_from_budget:c}},{onSuccess:a})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot"}),e.jsx(A,{label:"Expires",value:l,onChange:x,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(W,{userId:t.user_id,users:r.data??[]}):null,e.jsx(q,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(N,v)=>{p(N),y(v)}}),e.jsx(Y,{checked:c,onChange:u}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!m,onPress:h,children:n.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function pe({apiKey:t}){return t.is_active?de(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function ye({allowed:t}){const{text:a,tone:n}=F(t),r=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",d=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${r}`,title:d,children:a})}function Ae(){const t=J(),a=U(),n=Q(),r=X(),[d,o]=i.useState(!1),[l,x]=i.useState(null),[g,p]=i.useState(null),c=t.data??[],u=t.isLoading,m=c.find(s=>s.id===l)??null,y=!u&&c.length===0&&!d,h=ae(),[N,v]=i.useState(!1),[I,C]=i.useState(void 0),[w,S]=i.useState(!1),b=c.map(s=>s.id),j=ne(h.selectedKeys,b),E=c.filter(s=>j.includes(s.id)),z=i.useCallback((s,k)=>a.mutate({id:s.id,body:{is_active:k}}),[a.mutate]),L=i.useCallback(s=>n.mutate(s.id,{onSuccess:k=>p({title:`New secret for ${M(s)}`,result:k})}),[n.mutate]),R=async(s,k,T)=>{S(!0),C(void 0);try{for(const B of s)await k(B);h.clear(),T==null||T()}catch(B){C(B)}finally{S(!1)}},G=i.useMemo(()=>[{id:"name",header:"Name",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:s.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx(ye,{allowed:s.allowed_models}),s.exclude_from_budget?e.jsx("span",{className:"inline-flex items-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] px-2 py-0.5 text-xs font-medium text-[var(--otari-brand-dark)]",title:"Requests on this key are logged with cost but never counted toward budget",children:"Budget-exempt"}):null]})]})},{id:"status",header:"Status",cell:s=>e.jsx(pe,{apiKey:s})},{id:"owner",header:"Owner",cell:s=>me(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.user_id??"—"})},{id:"key",header:"Key",cell:s=>e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.key_prefix?`${s.key_prefix}…`:"—"})},{id:"created",header:"Created",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:$(s.created_at)})},{id:"last_used",header:"Last used",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:ce(s.last_used_at)??"never"})},{id:"expires",header:"Expires",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.expires_at?new Date(s.expires_at).toLocaleString():void 0,children:s.expires_at?$(s.expires_at):"never"})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:a.isPending,onPress:()=>z(s,!s.is_active),children:s.is_active?"Disable":"Enable"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{o(!1),x(s.id)},children:"Edit"}),e.jsx(H,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:M(s)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>L(s)}),s.is_active?null:e.jsx(H,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:r.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:M(s)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>r.mutate(s.id)})]})}],[a.isPending,n.isPending,r.isPending,r.mutate,z,L]),_=E.filter(s=>!s.is_active);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:d?null:e.jsx(f,{variant:"primary",onPress:()=>{x(null),o(!0)},children:"Create key"})}),e.jsx(O,{error:t.error??a.error??n.error??r.error}),y?e.jsx(ee,{title:"No API keys yet",description:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe.",actionLabel:"Create your first key",onAction:()=>{x(null),o(!0)}}):null,d?e.jsx(fe,{onClose:()=>o(!1),onCreated:s=>p({title:"API key created",result:s})}):null,m?e.jsx(ge,{apiKey:m,onClose:()=>x(null)},m.id):null,j.length>0?e.jsxs(re,{selectedCount:j.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:h.clear,children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{is_active:!1}})),children:"Disable"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{exclude_from_budget:!0}})),children:"Budget-exempt"}),e.jsx(f,{size:"sm",variant:"danger",isDisabled:_.length===0,onPress:()=>v(!0),children:"Delete"})]}):null,y?null:e.jsx(le,{ariaLabel:"API keys",columns:G,rows:c,getRowKey:xe,isLoading:u,emptyContent:"No API keys yet. Create one to authenticate a caller.",selectionMode:"multiple",selectedKeys:h.selectedKeys,onSelectionChange:h.onSelectionChange}),e.jsx(ie,{isOpen:N,onOpenChange:v,heading:"Delete API keys",body:`Permanently delete ${_.length} disabled ${_.length===1?"key":"keys"}? This removes them and unlinks their usage history. Cannot be undone. Active keys in the selection are skipped; disable them first.`,confirmLabel:"Delete permanently",isPending:w,error:I,onConfirm:()=>void R(_,s=>r.mutateAsync(s.id),()=>v(!1))}),g?e.jsx(he,{title:g.title,result:g.result,onClose:()=>{p(null),n.reset()}}):null]})}export{Ae as KeysPage}; diff --git a/src/gateway/static/dashboard/assets/ModelScopeControl-Bmks7cWc.js b/src/gateway/static/dashboard/assets/ModelScopeControl-CuclfKO5.js similarity index 98% rename from src/gateway/static/dashboard/assets/ModelScopeControl-Bmks7cWc.js rename to src/gateway/static/dashboard/assets/ModelScopeControl-CuclfKO5.js index f68a33b25..f3a2039e7 100644 --- a/src/gateway/static/dashboard/assets/ModelScopeControl-Bmks7cWc.js +++ b/src/gateway/static/dashboard/assets/ModelScopeControl-CuclfKO5.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{T as A,l as $,m as T}from"./index-MlRogoGm.js";import{C as d,I as P,a as R,b as V}from"./heroui-BI50yK5B.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function W({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=T(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(P,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(R,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function X(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{W as M,X as a}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{T as A,l as $,m as T}from"./index-BCvb90M0.js";import{C as d,I as P,a as R,b as V}from"./heroui-BI50yK5B.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function W({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=T(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(P,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(R,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function X(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{W as M,X as a}; diff --git a/src/gateway/static/dashboard/assets/ModelsPage-XwbqKUgz.js b/src/gateway/static/dashboard/assets/ModelsPage-D-sOtTsj.js similarity index 99% rename from src/gateway/static/dashboard/assets/ModelsPage-XwbqKUgz.js rename to src/gateway/static/dashboard/assets/ModelsPage-D-sOtTsj.js index b8f6170a2..5703466f6 100644 --- a/src/gateway/static/dashboard/assets/ModelsPage-XwbqKUgz.js +++ b/src/gateway/static/dashboard/assets/ModelsPage-D-sOtTsj.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as gt,u as vt,r as c}from"./react-dgEcD0HR.js";import{G as _t,H as bt,l as jt,J as yt,K as je,P as Pt,E as Nt,F as K,I as St,L as ae,M as Re,o as we,N as be,O as Ct,Q as kt,S as E}from"./index-MlRogoGm.js";import{u as Mt,r as Wt,B as It}from"./tableSelection-9hV37uhu.js";import{D as Tt}from"./DataTable-Bmn_eYSV.js";import{T as Lt,S as $t}from"./TablePagination-BHTN5PVb.js";import{B as $,d as se,f as V}from"./heroui-BI50yK5B.js";function Oe(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function At(t,i=Date.now()){const r=new Map;for(const n of t){const l=r.get(n.model_key)??[];l.push(n),r.set(n.model_key,l)}const s=[];for(const n of r.values()){const l=[...n].sort((p,u)=>Date.parse(p.effective_at)-Date.parse(u.effective_at)),m=[...l].reverse().find(p=>Date.parse(p.effective_at)<=i);s.push(m??l[0])}return s.sort((n,l)=>n.model_key.localeCompare(l.model_key))}const Et="otari",De=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],Ot=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Fe={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Dt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],Ft=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Kt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],Bt=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Rt=1440*60*1e3,wt=t=>t.key;function Ke(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function Be(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,l)=>l.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ce(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function z(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function Y(t){return t.trim()===""?null:Number(t)}function ze(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Ve(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(l=>l.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(z))})}function Ye(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function b({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function qe({tiers:t,onChange:i}){const r=(n,l,m)=>{i(t.map(p=>p.id===n?{...p,[l]:m}:p))},s=()=>{const n=t.reduce((l,m)=>Math.max(l,m.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx($,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:l=>r(n.id,"minInputTokens",l.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(b,{value:n.input,onChange:l=>r(n.id,"input",l),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(b,{value:n.output,onChange:l=>r(n.id,"output",l),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(b,{value:n.cacheRead,onChange:l=>r(n.id,"cacheRead",l),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(b,{value:n.cacheWrite,onChange:l=>r(n.id,"cacheWrite",l),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(b,{value:n.cacheWrite1h,onChange:l=>r(n.id,"cacheWrite1h",l),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(l=>l.id!==n.id)),children:"Remove"})]},n.id))]})}function zt({source:t}){return t==="configured"?e.jsx(V,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(V,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function oe({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Vt(){const t=kt();return t.data?t.data.default_pricing?e.jsx(oe,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(oe,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function I({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function le({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Yt({row:t}){const i=je(),r=Re(),[s,n]=c.useState(!1),[l,m]=c.useState(""),[p,u]=c.useState(""),[P,j]=c.useState(""),[k,T]=c.useState(""),[y,h]=c.useState(""),[N,O]=c.useState([]),S=()=>{m(t.inputPrice==null?"":String(t.inputPrice)),u(t.outputPrice==null?"":String(t.outputPrice)),j(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),T(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),h(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),O(ze(t.pricingTiers)),n(!0)},X=ce(l)&&ce(p)&&z(P)&&z(k)&&z(y)&&Ve(N),W=()=>{X&&i.mutate({model_key:t.key,input_price_per_million:Number(l),output_price_per_million:Number(p),cache_read_price_per_million:Y(P),cache_write_price_per_million:Y(k),cache_write_1h_price_per_million:Y(y),pricing_tiers:Ye(N)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(b,{value:l,onChange:m,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(b,{value:p,onChange:u,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(b,{value:P,onChange:j,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(b,{value:k,onChange:T,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(b,{value:y,onChange:h,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(qe,{tiers:N,onChange:O}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:"sm",variant:"primary",isDisabled:i.isPending||!X,onPress:W,children:"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:be(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(I,{label:"Input",value:t.inputPrice==null?"—":`${E(t.inputPrice)} / 1M`}),e.jsx(I,{label:"Output",value:t.outputPrice==null?"—":`${E(t.outputPrice)} / 1M`}),e.jsx(I,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${E(t.cacheReadPrice)} / 1M`}),e.jsx(I,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${E(t.cacheWritePrice)} / 1M`}),e.jsx(I,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${E(t.cacheWrite1hPrice)} / 1M`}),e.jsx(I,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx($,{size:"sm",variant:"outline",onPress:S,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(we,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error)}):null]})]})}function qt({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const l=(i==null?void 0:i.input_modalities)??[],m=(i==null?void 0:i.output_modalities)??[],p=Ot.filter(({key:u})=>i==null?void 0:i[u]);return e.jsx(se,{children:e.jsxs(se.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(V,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(le,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Yt,{row:t},t.key),e.jsx($,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(le,{title:"Specs",children:[e.jsx(I,{label:"Context window",value:ae(t.contextWindow)}),e.jsx(I,{label:"Max output",value:ae((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(I,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(I,{label:"Released",value:Ct(i==null?void 0:i.release_date)}),e.jsx(I,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(le,{title:"Modalities",children:l.length===0&&m.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),l.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),m.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]})]})}),e.jsx(le,{title:"Capabilities",children:p.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(({key:u,label:P})=>e.jsx(V,{size:"sm",color:"default",children:P},u))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Ht=15;function Ut({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}const He="otari.dashboard.modelsSort",_e={col:"model",dir:"asc"},Gt=["model","released","input","output"];function Jt(){if(typeof window>"u")return _e;try{const t=window.localStorage.getItem(He);if(!t)return _e;const i=JSON.parse(t);if(Gt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return _e}function Qt({row:t,onClose:i}){const r=je(),s=Re(),[n,l]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[m,p]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[u,P]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[j,k]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[T,y]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[h,N]=c.useState(ze(t.pricingTiers)),O=ce(n)&&ce(m)&&z(u)&&z(j)&&z(T)&&Ve(h),S=()=>{O&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(m),cache_read_price_per_million:Y(u),cache_write_price_per_million:Y(j),cache_write_1h_price_per_million:Y(T),pricing_tiers:Ye(h)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(b,{value:n,onChange:l,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(b,{value:m,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(b,{value:u,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(b,{value:j,onChange:k,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(b,{value:T,onChange:y,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx($,{size:"sm",variant:"primary",isDisabled:r.isPending||!O,onPress:S,children:r.isPending?"Saving…":"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(we,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error??s.error)}):null]}),e.jsx(qe,{tiers:h,onChange:N})]})}function Xt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:l}){const m=(p,u)=>e.jsx("button",{type:"button","aria-label":`Edit ${u} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:P=>{P.stopPropagation(),l()},children:p==null?"—":E(p)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[m(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),m(i,n)]})}function Zt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${E(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${E(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${E(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function ei({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,l)=>n.min_input_tokens-l.min_input_tokens).map(n=>ae(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function ti({rows:t,isLoading:i,empty:r,sortDescriptor:s,onSortChange:n,selectedKey:l,onSelect:m,onEditPricing:p,comparisonContextTokens:u,selectedKeys:P,onSelectionChange:j}){const k=c.useMemo(()=>{const y=u==null?"Base":`at ${ae(u)}`;return[{id:"model",header:"Model",isRowHeader:!0,allowsSorting:!0,cell:h=>e.jsxs("span",{className:"font-medium break-all",children:[h.model,e.jsx("span",{className:"sr-only",children:h.key})]})},{id:"provider",header:"Provider",cell:h=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:h.provider})},{id:"input",header:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[`${y} in / out $ / 1M`,e.jsx(Vt,{})]}),align:"end",allowsSorting:!0,cell:h=>{const N=Be(h,u);return e.jsx(Xt,{primary:N.inputPrice,secondary:N.outputPrice,rowKey:h.key,primaryLabel:"input",secondaryLabel:"output",onEdit:()=>p(h.key)})}},{id:"caching",header:`Caching ${u==null?"policy":y}`,align:"end",cell:h=>e.jsx(Zt,{rates:Be(h,u),rowKey:h.key,onEdit:()=>p(h.key)})},{id:"policy",header:"Pricing policy",align:"end",cell:h=>e.jsx(ei,{row:h,onEdit:()=>p(h.key)})}]},[u,p]),T=c.useCallback(y=>y.key===l?"bg-[var(--otari-brand-tint)]":void 0,[l]);return e.jsx(Tt,{ariaLabel:"Models",columns:k,rows:t,getRowKey:wt,isLoading:i,emptyContent:r,selectionMode:"multiple",selectedKeys:P,onSelectionChange:j,sortDescriptor:s,onSortChange:n,onRowAction:m,rowClassName:T})}function ii({providers:t}){if(t.length===0)return null;const i=t.filter(l=>!l.discovery_unsupported),r=t.filter(l=>l.discovery_unsupported),s=l=>l.map(m=>m.provider).join(", "),n=l=>l.length===1;return e.jsxs(St,{tone:"warning",children:[i.length>0?e.jsxs("span",{className:"block",children:["Could not list ",s(i),". Check ",n(i)?"that provider's":"those providers'"," ","credentials in config.yml; ",n(i)?"its":"their"," models are missing from the list below."]}):null,r.length>0?e.jsxs("span",{className:"block",children:[s(r)," ",n(r)?"does":"do"," not offer model discovery, so"," ",n(r)?"its":"their"," models are missing from the list below."," ",n(r)?"The provider":"They"," may still serve requests; declare the model ids"," ",n(r)?"it serves":"they serve"," under the ",e.jsx("code",{children:"models:"})," key in config.yml to list them here."]}):null]})}function pi(){var Te,Le,$e;const t=gt(),[i]=vt(),r=_t(),s=bt(),n=jt(),l=yt(),m=je(),[p,u]=c.useState(""),[P,j]=c.useState(0),[k,T]=c.useState(Ht),[y,h]=c.useState(null),[N,O]=c.useState(null),[S,X]=c.useState(Jt),W=Mt(),[Ue,ue]=c.useState(!1),[Ge,ye]=c.useState(!1),[Je,Pe]=c.useState(void 0);c.useEffect(()=>{try{window.localStorage.setItem(He,JSON.stringify(S))}catch{}},[S]);const[D,Ne]=c.useState(i.get("provider")||"all"),[B,Qe]=c.useState("all"),[q,Xe]=c.useState("all"),[H,Ze]=c.useState("all"),[de,et]=c.useState("0"),[Z,tt]=c.useState(""),[ee,it]=c.useState("all"),[pe,rt]=c.useState(""),F=((Te=l.data)==null?void 0:Te.models)??{},nt=((Le=l.data)==null?void 0:Le.available)??!1,Se=c.useMemo(()=>{var a;return new Set((((a=n.data)==null?void 0:a.providers)??[]).flatMap(x=>x.models.map(o=>o.key)))},[n.data]),lt=a=>{u(a),j(0)},R=a=>x=>{a(x),j(0)},te=c.useMemo(()=>{var M,v,_,A,L,w,Ae;const a=new Map(At(s.data??[]).map(d=>[d.model_key,d])),x=[],o=new Set,g=(d,ve,Ee,f)=>{if(o.has(d))return;o.add(d);const C=a.get(d);x.push({key:d,model:Ke(ve,Ee),provider:Ee,isDiscovered:Se.has(d),contextWindow:(f==null?void 0:f.contextWindow)??null,inputPrice:C?C.input_price_per_million:(f==null?void 0:f.inputPrice)??null,outputPrice:C?C.output_price_per_million:(f==null?void 0:f.outputPrice)??null,cacheReadPrice:C?C.cache_read_price_per_million:(f==null?void 0:f.cacheReadPrice)??null,cacheWritePrice:C?C.cache_write_price_per_million:(f==null?void 0:f.cacheWritePrice)??null,cacheWrite1hPrice:C?C.cache_write_1h_price_per_million??null:(f==null?void 0:f.cacheWrite1hPrice)??null,pricingTiers:C?C.pricing_tiers??[]:(f==null?void 0:f.pricingTiers)??[],source:C?"configured":(f==null?void 0:f.source)??"none"})};for(const d of((M=r.data)==null?void 0:M.data)??[]){if(d.owned_by===Et)continue;const ve=d.pricing_source==="default"?"default":d.pricing?"configured":"none";g(d.id,d.id,d.owned_by||Oe(d.id),{key:d.id,model:d.id,provider:d.owned_by,contextWindow:d.context_window,inputPrice:((v=d.pricing)==null?void 0:v.input_price_per_million)??null,outputPrice:((_=d.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:((A=d.pricing)==null?void 0:A.cache_read_price_per_million)??null,cacheWritePrice:((L=d.pricing)==null?void 0:L.cache_write_price_per_million)??null,cacheWrite1hPrice:((w=d.pricing)==null?void 0:w.cache_write_1h_price_per_million)??null,pricingTiers:((Ae=d.pricing)==null?void 0:Ae.pricing_tiers)??[],source:ve})}for(const d of a.keys())g(d,d,Oe(d));return x},[r.data,s.data,Se]),Ce=c.useMemo(()=>new Map(te.map(a=>[a.key,a])),[te]),ie=c.useMemo(()=>{var o,g,M;const a=te.map(v=>{var _,A;return{...v,contextWindow:v.contextWindow??((_=F[v.key])==null?void 0:_.context_window)??null,releaseDate:((A=F[v.key])==null?void 0:A.release_date)??null}}),x=new Set(a.map(v=>v.key));for(const v of((o=n.data)==null?void 0:o.providers)??[])for(const _ of v.models)x.has(_.key)||(x.add(_.key),a.push({key:_.key,model:Ke(_.key,v.provider),provider:v.provider,isDiscovered:!0,contextWindow:((g=F[_.key])==null?void 0:g.context_window)??null,releaseDate:((M=F[_.key])==null?void 0:M.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return a},[te,n.data,F]),at=((($e=n.data)==null?void 0:$e.providers)??[]).filter(a=>!a.ok),re=c.useMemo(()=>{const a=Array.from(new Set(ie.map(x=>x.provider))).sort((x,o)=>x.localeCompare(o));return[{value:"all",label:"All providers"},...a.map(x=>({value:x,label:x}))]},[ie]);c.useEffect(()=>{D==="all"||re.length<=1||re.some(a=>a.value===D)||Ne("all")},[re,D]);const U=p.trim().toLowerCase(),he=Number(de)||0,me=Z===""?Number.POSITIVE_INFINITY:Number(Z),st=pe===""?null:Number(pe),xe=ee==="all"?null:Date.now()-Number(ee)*Rt,G=c.useMemo(()=>{const a=o=>{if(U&&!o.key.toLowerCase().includes(U)&&!o.provider.toLowerCase().includes(U)||D!=="all"&&o.provider!==D||B==="configured"&&o.source!=="configured"||B==="default"&&o.source!=="default"||B==="priced"&&o.inputPrice==null||B==="unpriced"&&o.inputPrice!=null||q==="discovered"&&!o.isDiscovered||q==="custom"&&o.isDiscovered)return!1;if(H!=="all"){const g=De.find(v=>v.value===H),M=F[o.key];if(!g||!M||!g.test(M))return!1}if(he>0&&(o.contextWindow==null||o.contextWindowme))return!1;if(xe!=null){const g=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(g)||g{const M=S.dir==="asc"?1:-1;if(S.col==="model")return o.model.localeCompare(g.model)*M;if(S.col==="released"){const L=o.releaseDate??null,w=g.releaseDate??null;return!L&&!w?o.model.localeCompare(g.model):L?w?(Lw?1:0)*M||o.model.localeCompare(g.model):-1:1}const v=L=>S.col==="input"?L.inputPrice:L.outputPrice,_=v(o),A=v(g);return _==null&&A==null?o.model.localeCompare(g.model):_==null?1:A==null?-1:(_-A)*M||o.model.localeCompare(g.model)};return ie.filter(a).sort(x)},[ie,U,D,B,q,H,he,me,xe,F,S]),J=G.length,ct=Math.max(1,Math.ceil(J/k)),ke=Math.min(P,ct-1),Me=ke*k,fe=G.slice(Me,Me+k),ot={column:S.col,direction:S.dir==="asc"?"ascending":"descending"},ut=a=>{X({col:String(a.column),dir:a.direction==="ascending"?"asc":"desc"}),j(0)},dt=c.useCallback(a=>h(x=>x===a?null:a),[]),ge=fe.map(a=>a.key),Q=Wt(W.selectedKeys,ge),pt=ge.length>0&&Q.length===ge.length&&J>Q.length,ht=W.allMatching?G.map(a=>a.key):Q,We=W.allMatching?J:Q.length,Ie=y?G.find(a=>a.key===y)??Ce.get(y)??null:null,mt=async a=>{ye(!0),Pe(void 0);try{for(const x of ht)await m.mutateAsync({model_key:x,input_price_per_million:a.input_price_per_million,output_price_per_million:a.output_price_per_million,cache_read_price_per_million:a.cache_read_price_per_million??null,cache_write_price_per_million:a.cache_write_price_per_million??null,cache_write_1h_price_per_million:null,pricing_tiers:[]});W.clear(),ue(!1)}catch(x){Pe(x)}finally{ye(!1)}},xt=r.isLoading||s.isLoading||n.isLoading,ft=U!==""||D!=="all"||B!=="all"||q!=="all"||H!=="all"||de!=="0"||Z!==""||ee!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",ne=N?G.find(a=>a.key===N)??Ce.get(N)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Pt,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(Nt,{error:r.error??s.error??n.error??l.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${ne?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ut,{value:p,onChange:lt,placeholder:"Search models…"}),e.jsx(K,{ariaLabel:"Filter by provider",value:D,onChange:R(Ne),options:re}),e.jsx(K,{ariaLabel:"Filter by pricing",value:B,onChange:R(Qe),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(K,{ariaLabel:"Filter by source",value:q,onChange:R(Xe),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(K,{ariaLabel:"Filter by capability",value:H,onChange:R(Ze),options:[{value:"all",label:"Any capability"},...De.map(a=>({value:a.value,label:a.label}))]}),e.jsx(K,{ariaLabel:"Minimum context window",value:de,onChange:R(et),options:Dt}),e.jsx(K,{ariaLabel:"Maximum input price",value:Z,onChange:R(tt),options:Ft}),e.jsx(K,{ariaLabel:"Compare prices at context",value:pe,onChange:rt,options:Kt}),e.jsx(K,{ariaLabel:"Filter by release date",value:ee,onChange:R(it),options:Bt})]}),e.jsx(ii,{providers:at}),Q.length>0?e.jsx(It,{selectedCount:We,allMatching:W.allMatching,matchingTotal:J,canSelectAllMatching:pt,onSelectAllMatching:W.enableAllMatching,onClear:W.clear,children:e.jsx($,{size:"sm",variant:"primary",onPress:()=>ue(!0),children:"Set pricing"})}):null,e.jsx(ti,{rows:fe,isLoading:xt,empty:ft,sortDescriptor:ot,onSortChange:ut,selectedKey:N,onSelect:O,onEditPricing:dt,comparisonContextTokens:st,selectedKeys:W.selectedKeys,onSelectionChange:W.onSelectionChange}),Ie?e.jsx(se,{children:e.jsxs(se.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Edit pricing"}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>h(null),children:"Close"})]}),e.jsx(Qt,{row:Ie,onClose:()=>h(null)})]})}):null,e.jsx(Lt,{page:ke,pageSize:k,total:J,rowsOnPage:fe.length,onPageChange:j,onPageSizeChange:a=>{T(a),j(0)},pageSizeOptions:[15,25,50]})]}),ne?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(qt,{row:ne,metadata:F[ne.key],metadataAvailable:nt,onMakeAlias:a=>t(`/aliases?target=${encodeURIComponent(a)}`),onClose:()=>O(null)})}):null]}),e.jsx($t,{isOpen:Ue,onOpenChange:ue,targetCount:We,isPending:Ge,error:Je,onSubmit:mt,title:"Set pricing",description:a=>`Apply these per-1M rates to ${a.toLocaleString()} selected ${a===1?"model":"models"}. This replaces each model's price; pricing tiers and the 1h cache rate are cleared. Edit a single model for tiers.`})]})}export{pi as ModelsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as gt,u as vt,r as c}from"./react-dgEcD0HR.js";import{G as _t,H as bt,l as jt,J as yt,K as je,P as Pt,E as Nt,F as K,I as St,L as ae,M as Re,o as we,N as be,O as Ct,Q as kt,S as E}from"./index-BCvb90M0.js";import{u as Mt,r as Wt,B as It}from"./tableSelection-9hV37uhu.js";import{D as Tt}from"./DataTable-Bmn_eYSV.js";import{T as Lt,S as $t}from"./TablePagination-DSU6cRH7.js";import{B as $,d as se,f as V}from"./heroui-BI50yK5B.js";function Oe(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function At(t,i=Date.now()){const r=new Map;for(const n of t){const l=r.get(n.model_key)??[];l.push(n),r.set(n.model_key,l)}const s=[];for(const n of r.values()){const l=[...n].sort((p,u)=>Date.parse(p.effective_at)-Date.parse(u.effective_at)),m=[...l].reverse().find(p=>Date.parse(p.effective_at)<=i);s.push(m??l[0])}return s.sort((n,l)=>n.model_key.localeCompare(l.model_key))}const Et="otari",De=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],Ot=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Fe={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Dt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],Ft=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Kt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],Bt=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Rt=1440*60*1e3,wt=t=>t.key;function Ke(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function Be(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,l)=>l.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ce(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function z(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function Y(t){return t.trim()===""?null:Number(t)}function ze(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Ve(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(l=>l.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(z))})}function Ye(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function b({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function qe({tiers:t,onChange:i}){const r=(n,l,m)=>{i(t.map(p=>p.id===n?{...p,[l]:m}:p))},s=()=>{const n=t.reduce((l,m)=>Math.max(l,m.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx($,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:l=>r(n.id,"minInputTokens",l.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(b,{value:n.input,onChange:l=>r(n.id,"input",l),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(b,{value:n.output,onChange:l=>r(n.id,"output",l),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(b,{value:n.cacheRead,onChange:l=>r(n.id,"cacheRead",l),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(b,{value:n.cacheWrite,onChange:l=>r(n.id,"cacheWrite",l),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(b,{value:n.cacheWrite1h,onChange:l=>r(n.id,"cacheWrite1h",l),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(l=>l.id!==n.id)),children:"Remove"})]},n.id))]})}function zt({source:t}){return t==="configured"?e.jsx(V,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(V,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function oe({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Vt(){const t=kt();return t.data?t.data.default_pricing?e.jsx(oe,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(oe,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function I({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function le({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Yt({row:t}){const i=je(),r=Re(),[s,n]=c.useState(!1),[l,m]=c.useState(""),[p,u]=c.useState(""),[P,j]=c.useState(""),[k,T]=c.useState(""),[y,h]=c.useState(""),[N,O]=c.useState([]),S=()=>{m(t.inputPrice==null?"":String(t.inputPrice)),u(t.outputPrice==null?"":String(t.outputPrice)),j(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),T(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),h(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),O(ze(t.pricingTiers)),n(!0)},X=ce(l)&&ce(p)&&z(P)&&z(k)&&z(y)&&Ve(N),W=()=>{X&&i.mutate({model_key:t.key,input_price_per_million:Number(l),output_price_per_million:Number(p),cache_read_price_per_million:Y(P),cache_write_price_per_million:Y(k),cache_write_1h_price_per_million:Y(y),pricing_tiers:Ye(N)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(b,{value:l,onChange:m,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(b,{value:p,onChange:u,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(b,{value:P,onChange:j,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(b,{value:k,onChange:T,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(b,{value:y,onChange:h,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(qe,{tiers:N,onChange:O}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:"sm",variant:"primary",isDisabled:i.isPending||!X,onPress:W,children:"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:be(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(I,{label:"Input",value:t.inputPrice==null?"—":`${E(t.inputPrice)} / 1M`}),e.jsx(I,{label:"Output",value:t.outputPrice==null?"—":`${E(t.outputPrice)} / 1M`}),e.jsx(I,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${E(t.cacheReadPrice)} / 1M`}),e.jsx(I,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${E(t.cacheWritePrice)} / 1M`}),e.jsx(I,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${E(t.cacheWrite1hPrice)} / 1M`}),e.jsx(I,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx($,{size:"sm",variant:"outline",onPress:S,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(we,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error)}):null]})]})}function qt({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const l=(i==null?void 0:i.input_modalities)??[],m=(i==null?void 0:i.output_modalities)??[],p=Ot.filter(({key:u})=>i==null?void 0:i[u]);return e.jsx(se,{children:e.jsxs(se.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(V,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(le,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Yt,{row:t},t.key),e.jsx($,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(le,{title:"Specs",children:[e.jsx(I,{label:"Context window",value:ae(t.contextWindow)}),e.jsx(I,{label:"Max output",value:ae((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(I,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(I,{label:"Released",value:Ct(i==null?void 0:i.release_date)}),e.jsx(I,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(le,{title:"Modalities",children:l.length===0&&m.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),l.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),m.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]})]})}),e.jsx(le,{title:"Capabilities",children:p.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(({key:u,label:P})=>e.jsx(V,{size:"sm",color:"default",children:P},u))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Ht=15;function Ut({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}const He="otari.dashboard.modelsSort",_e={col:"model",dir:"asc"},Gt=["model","released","input","output"];function Jt(){if(typeof window>"u")return _e;try{const t=window.localStorage.getItem(He);if(!t)return _e;const i=JSON.parse(t);if(Gt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return _e}function Qt({row:t,onClose:i}){const r=je(),s=Re(),[n,l]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[m,p]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[u,P]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[j,k]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[T,y]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[h,N]=c.useState(ze(t.pricingTiers)),O=ce(n)&&ce(m)&&z(u)&&z(j)&&z(T)&&Ve(h),S=()=>{O&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(m),cache_read_price_per_million:Y(u),cache_write_price_per_million:Y(j),cache_write_1h_price_per_million:Y(T),pricing_tiers:Ye(h)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(b,{value:n,onChange:l,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(b,{value:m,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(b,{value:u,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(b,{value:j,onChange:k,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(b,{value:T,onChange:y,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx($,{size:"sm",variant:"primary",isDisabled:r.isPending||!O,onPress:S,children:r.isPending?"Saving…":"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(we,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error??s.error)}):null]}),e.jsx(qe,{tiers:h,onChange:N})]})}function Xt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:l}){const m=(p,u)=>e.jsx("button",{type:"button","aria-label":`Edit ${u} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:P=>{P.stopPropagation(),l()},children:p==null?"—":E(p)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[m(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),m(i,n)]})}function Zt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${E(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${E(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${E(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function ei({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,l)=>n.min_input_tokens-l.min_input_tokens).map(n=>ae(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function ti({rows:t,isLoading:i,empty:r,sortDescriptor:s,onSortChange:n,selectedKey:l,onSelect:m,onEditPricing:p,comparisonContextTokens:u,selectedKeys:P,onSelectionChange:j}){const k=c.useMemo(()=>{const y=u==null?"Base":`at ${ae(u)}`;return[{id:"model",header:"Model",isRowHeader:!0,allowsSorting:!0,cell:h=>e.jsxs("span",{className:"font-medium break-all",children:[h.model,e.jsx("span",{className:"sr-only",children:h.key})]})},{id:"provider",header:"Provider",cell:h=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:h.provider})},{id:"input",header:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[`${y} in / out $ / 1M`,e.jsx(Vt,{})]}),align:"end",allowsSorting:!0,cell:h=>{const N=Be(h,u);return e.jsx(Xt,{primary:N.inputPrice,secondary:N.outputPrice,rowKey:h.key,primaryLabel:"input",secondaryLabel:"output",onEdit:()=>p(h.key)})}},{id:"caching",header:`Caching ${u==null?"policy":y}`,align:"end",cell:h=>e.jsx(Zt,{rates:Be(h,u),rowKey:h.key,onEdit:()=>p(h.key)})},{id:"policy",header:"Pricing policy",align:"end",cell:h=>e.jsx(ei,{row:h,onEdit:()=>p(h.key)})}]},[u,p]),T=c.useCallback(y=>y.key===l?"bg-[var(--otari-brand-tint)]":void 0,[l]);return e.jsx(Tt,{ariaLabel:"Models",columns:k,rows:t,getRowKey:wt,isLoading:i,emptyContent:r,selectionMode:"multiple",selectedKeys:P,onSelectionChange:j,sortDescriptor:s,onSortChange:n,onRowAction:m,rowClassName:T})}function ii({providers:t}){if(t.length===0)return null;const i=t.filter(l=>!l.discovery_unsupported),r=t.filter(l=>l.discovery_unsupported),s=l=>l.map(m=>m.provider).join(", "),n=l=>l.length===1;return e.jsxs(St,{tone:"warning",children:[i.length>0?e.jsxs("span",{className:"block",children:["Could not list ",s(i),". Check ",n(i)?"that provider's":"those providers'"," ","credentials in config.yml; ",n(i)?"its":"their"," models are missing from the list below."]}):null,r.length>0?e.jsxs("span",{className:"block",children:[s(r)," ",n(r)?"does":"do"," not offer model discovery, so"," ",n(r)?"its":"their"," models are missing from the list below."," ",n(r)?"The provider":"They"," may still serve requests; declare the model ids"," ",n(r)?"it serves":"they serve"," under the ",e.jsx("code",{children:"models:"})," key in config.yml to list them here."]}):null]})}function pi(){var Te,Le,$e;const t=gt(),[i]=vt(),r=_t(),s=bt(),n=jt(),l=yt(),m=je(),[p,u]=c.useState(""),[P,j]=c.useState(0),[k,T]=c.useState(Ht),[y,h]=c.useState(null),[N,O]=c.useState(null),[S,X]=c.useState(Jt),W=Mt(),[Ue,ue]=c.useState(!1),[Ge,ye]=c.useState(!1),[Je,Pe]=c.useState(void 0);c.useEffect(()=>{try{window.localStorage.setItem(He,JSON.stringify(S))}catch{}},[S]);const[D,Ne]=c.useState(i.get("provider")||"all"),[B,Qe]=c.useState("all"),[q,Xe]=c.useState("all"),[H,Ze]=c.useState("all"),[de,et]=c.useState("0"),[Z,tt]=c.useState(""),[ee,it]=c.useState("all"),[pe,rt]=c.useState(""),F=((Te=l.data)==null?void 0:Te.models)??{},nt=((Le=l.data)==null?void 0:Le.available)??!1,Se=c.useMemo(()=>{var a;return new Set((((a=n.data)==null?void 0:a.providers)??[]).flatMap(x=>x.models.map(o=>o.key)))},[n.data]),lt=a=>{u(a),j(0)},R=a=>x=>{a(x),j(0)},te=c.useMemo(()=>{var M,v,_,A,L,w,Ae;const a=new Map(At(s.data??[]).map(d=>[d.model_key,d])),x=[],o=new Set,g=(d,ve,Ee,f)=>{if(o.has(d))return;o.add(d);const C=a.get(d);x.push({key:d,model:Ke(ve,Ee),provider:Ee,isDiscovered:Se.has(d),contextWindow:(f==null?void 0:f.contextWindow)??null,inputPrice:C?C.input_price_per_million:(f==null?void 0:f.inputPrice)??null,outputPrice:C?C.output_price_per_million:(f==null?void 0:f.outputPrice)??null,cacheReadPrice:C?C.cache_read_price_per_million:(f==null?void 0:f.cacheReadPrice)??null,cacheWritePrice:C?C.cache_write_price_per_million:(f==null?void 0:f.cacheWritePrice)??null,cacheWrite1hPrice:C?C.cache_write_1h_price_per_million??null:(f==null?void 0:f.cacheWrite1hPrice)??null,pricingTiers:C?C.pricing_tiers??[]:(f==null?void 0:f.pricingTiers)??[],source:C?"configured":(f==null?void 0:f.source)??"none"})};for(const d of((M=r.data)==null?void 0:M.data)??[]){if(d.owned_by===Et)continue;const ve=d.pricing_source==="default"?"default":d.pricing?"configured":"none";g(d.id,d.id,d.owned_by||Oe(d.id),{key:d.id,model:d.id,provider:d.owned_by,contextWindow:d.context_window,inputPrice:((v=d.pricing)==null?void 0:v.input_price_per_million)??null,outputPrice:((_=d.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:((A=d.pricing)==null?void 0:A.cache_read_price_per_million)??null,cacheWritePrice:((L=d.pricing)==null?void 0:L.cache_write_price_per_million)??null,cacheWrite1hPrice:((w=d.pricing)==null?void 0:w.cache_write_1h_price_per_million)??null,pricingTiers:((Ae=d.pricing)==null?void 0:Ae.pricing_tiers)??[],source:ve})}for(const d of a.keys())g(d,d,Oe(d));return x},[r.data,s.data,Se]),Ce=c.useMemo(()=>new Map(te.map(a=>[a.key,a])),[te]),ie=c.useMemo(()=>{var o,g,M;const a=te.map(v=>{var _,A;return{...v,contextWindow:v.contextWindow??((_=F[v.key])==null?void 0:_.context_window)??null,releaseDate:((A=F[v.key])==null?void 0:A.release_date)??null}}),x=new Set(a.map(v=>v.key));for(const v of((o=n.data)==null?void 0:o.providers)??[])for(const _ of v.models)x.has(_.key)||(x.add(_.key),a.push({key:_.key,model:Ke(_.key,v.provider),provider:v.provider,isDiscovered:!0,contextWindow:((g=F[_.key])==null?void 0:g.context_window)??null,releaseDate:((M=F[_.key])==null?void 0:M.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return a},[te,n.data,F]),at=((($e=n.data)==null?void 0:$e.providers)??[]).filter(a=>!a.ok),re=c.useMemo(()=>{const a=Array.from(new Set(ie.map(x=>x.provider))).sort((x,o)=>x.localeCompare(o));return[{value:"all",label:"All providers"},...a.map(x=>({value:x,label:x}))]},[ie]);c.useEffect(()=>{D==="all"||re.length<=1||re.some(a=>a.value===D)||Ne("all")},[re,D]);const U=p.trim().toLowerCase(),he=Number(de)||0,me=Z===""?Number.POSITIVE_INFINITY:Number(Z),st=pe===""?null:Number(pe),xe=ee==="all"?null:Date.now()-Number(ee)*Rt,G=c.useMemo(()=>{const a=o=>{if(U&&!o.key.toLowerCase().includes(U)&&!o.provider.toLowerCase().includes(U)||D!=="all"&&o.provider!==D||B==="configured"&&o.source!=="configured"||B==="default"&&o.source!=="default"||B==="priced"&&o.inputPrice==null||B==="unpriced"&&o.inputPrice!=null||q==="discovered"&&!o.isDiscovered||q==="custom"&&o.isDiscovered)return!1;if(H!=="all"){const g=De.find(v=>v.value===H),M=F[o.key];if(!g||!M||!g.test(M))return!1}if(he>0&&(o.contextWindow==null||o.contextWindowme))return!1;if(xe!=null){const g=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(g)||g{const M=S.dir==="asc"?1:-1;if(S.col==="model")return o.model.localeCompare(g.model)*M;if(S.col==="released"){const L=o.releaseDate??null,w=g.releaseDate??null;return!L&&!w?o.model.localeCompare(g.model):L?w?(Lw?1:0)*M||o.model.localeCompare(g.model):-1:1}const v=L=>S.col==="input"?L.inputPrice:L.outputPrice,_=v(o),A=v(g);return _==null&&A==null?o.model.localeCompare(g.model):_==null?1:A==null?-1:(_-A)*M||o.model.localeCompare(g.model)};return ie.filter(a).sort(x)},[ie,U,D,B,q,H,he,me,xe,F,S]),J=G.length,ct=Math.max(1,Math.ceil(J/k)),ke=Math.min(P,ct-1),Me=ke*k,fe=G.slice(Me,Me+k),ot={column:S.col,direction:S.dir==="asc"?"ascending":"descending"},ut=a=>{X({col:String(a.column),dir:a.direction==="ascending"?"asc":"desc"}),j(0)},dt=c.useCallback(a=>h(x=>x===a?null:a),[]),ge=fe.map(a=>a.key),Q=Wt(W.selectedKeys,ge),pt=ge.length>0&&Q.length===ge.length&&J>Q.length,ht=W.allMatching?G.map(a=>a.key):Q,We=W.allMatching?J:Q.length,Ie=y?G.find(a=>a.key===y)??Ce.get(y)??null:null,mt=async a=>{ye(!0),Pe(void 0);try{for(const x of ht)await m.mutateAsync({model_key:x,input_price_per_million:a.input_price_per_million,output_price_per_million:a.output_price_per_million,cache_read_price_per_million:a.cache_read_price_per_million??null,cache_write_price_per_million:a.cache_write_price_per_million??null,cache_write_1h_price_per_million:null,pricing_tiers:[]});W.clear(),ue(!1)}catch(x){Pe(x)}finally{ye(!1)}},xt=r.isLoading||s.isLoading||n.isLoading,ft=U!==""||D!=="all"||B!=="all"||q!=="all"||H!=="all"||de!=="0"||Z!==""||ee!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",ne=N?G.find(a=>a.key===N)??Ce.get(N)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Pt,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(Nt,{error:r.error??s.error??n.error??l.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${ne?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ut,{value:p,onChange:lt,placeholder:"Search models…"}),e.jsx(K,{ariaLabel:"Filter by provider",value:D,onChange:R(Ne),options:re}),e.jsx(K,{ariaLabel:"Filter by pricing",value:B,onChange:R(Qe),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(K,{ariaLabel:"Filter by source",value:q,onChange:R(Xe),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(K,{ariaLabel:"Filter by capability",value:H,onChange:R(Ze),options:[{value:"all",label:"Any capability"},...De.map(a=>({value:a.value,label:a.label}))]}),e.jsx(K,{ariaLabel:"Minimum context window",value:de,onChange:R(et),options:Dt}),e.jsx(K,{ariaLabel:"Maximum input price",value:Z,onChange:R(tt),options:Ft}),e.jsx(K,{ariaLabel:"Compare prices at context",value:pe,onChange:rt,options:Kt}),e.jsx(K,{ariaLabel:"Filter by release date",value:ee,onChange:R(it),options:Bt})]}),e.jsx(ii,{providers:at}),Q.length>0?e.jsx(It,{selectedCount:We,allMatching:W.allMatching,matchingTotal:J,canSelectAllMatching:pt,onSelectAllMatching:W.enableAllMatching,onClear:W.clear,children:e.jsx($,{size:"sm",variant:"primary",onPress:()=>ue(!0),children:"Set pricing"})}):null,e.jsx(ti,{rows:fe,isLoading:xt,empty:ft,sortDescriptor:ot,onSortChange:ut,selectedKey:N,onSelect:O,onEditPricing:dt,comparisonContextTokens:st,selectedKeys:W.selectedKeys,onSelectionChange:W.onSelectionChange}),Ie?e.jsx(se,{children:e.jsxs(se.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Edit pricing"}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>h(null),children:"Close"})]}),e.jsx(Qt,{row:Ie,onClose:()=>h(null)})]})}):null,e.jsx(Lt,{page:ke,pageSize:k,total:J,rowsOnPage:fe.length,onPageChange:j,onPageSizeChange:a=>{T(a),j(0)},pageSizeOptions:[15,25,50]})]}),ne?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(qt,{row:ne,metadata:F[ne.key],metadataAvailable:nt,onMakeAlias:a=>t(`/aliases?target=${encodeURIComponent(a)}`),onClose:()=>O(null)})}):null]}),e.jsx($t,{isOpen:Ue,onOpenChange:ue,targetCount:We,isPending:Ge,error:Je,onSubmit:mt,title:"Set pricing",description:a=>`Apply these per-1M rates to ${a.toLocaleString()} selected ${a===1?"model":"models"}. This replaces each model's price; pricing tiers and the 1h cache rate are cleared. Edit a single model for tiers.`})]})}export{pi as ModelsPage}; diff --git a/src/gateway/static/dashboard/assets/OverviewPage-XfWqfHJ2.js b/src/gateway/static/dashboard/assets/OverviewPage-BluitD8r.js similarity index 99% rename from src/gateway/static/dashboard/assets/OverviewPage-XfWqfHJ2.js rename to src/gateway/static/dashboard/assets/OverviewPage-BluitD8r.js index e7c7ac25d..9b4c3b093 100644 --- a/src/gateway/static/dashboard/assets/OverviewPage-XfWqfHJ2.js +++ b/src/gateway/static/dashboard/assets/OverviewPage-BluitD8r.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as y,i as st,N as I}from"./react-dgEcD0HR.js";import{T as at,U as nt,d as S,V as ot,q as it,a as lt,u as dt,b as ct,W as w,P as ut,R as mt,E as Y,X as b,Z as _,_ as N,$ as R,a0 as D,a1 as vt}from"./index-MlRogoGm.js";import{S as H}from"./charts-DIsd9m--.js";import{D as ht}from"./DataTable-Bmn_eYSV.js";import{d as B,B as xt}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function M(e){return e==="neutral"?void 0:e}const ft=.02,pt=.1;function W(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,s=n>=pt?"alert":n>=ft?"warn":"ok";return{rate:n,status:s}}function gt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy+e.degraded===0?"alert":"warn"}const bt=.8;function yt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(o=>o.max_budget!==null&&o.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let s=0,l=0,r,m=-1;for(const o of n){const a=o.max_budget*o.user_count,i=a>0?o.total_spend/a:0;i>=1?s+=1:i>=bt&&(l+=1),i>m&&(m=i,r={name:o.name??o.budget_id,spent:o.total_spend,allocated:a,pct:i})}const d=s>0?"alert":l>0?"warn":"ok",h=s>0?`${s} over limit`:l>0?`${l} near limit`:"All within budget";return{status:d,label:h,overCount:s,nearCount:l,cappedCount:n.length,worst:r}}const K=864e5,T=30;function G(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function jt(){const[e,n]=y.useState(G);return y.useEffect(()=>{const s=()=>{if(document.visibilityState==="visible"){const l=G();n(r=>r===l?r:l)}};return document.addEventListener("visibilitychange",s),window.addEventListener("focus",s),()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("focus",s)}},[]),y.useMemo(()=>{const s=Date.now(),l=new Date(s);return{today:new Date(l.getFullYear(),l.getMonth(),l.getDate()).toISOString(),periodStart:new Date(s-T*K).toISOString(),prevStart:new Date(s-2*T*K).toISOString()}},[e])}const St={ok:"Healthy",warn:"Elevated",alert:"High"},wt={ok:"On track",warn:"Near limit",alert:"Over budget"};function qt(){const e=at();return e.isLoading?t.jsx(nt,{}):t.jsx(Nt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function Nt({needsSetup:e=!1}){var $,L,O,A,F,P,q,U;const n=jt(),s=y.useMemo(()=>({start_date:n.today}),[n]),l=y.useMemo(()=>({start_date:n.periodStart}),[n]),r=y.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=S(s,"hour"),d=S(l,"day"),h=S(r,"day"),o=ot(),a=it(),i=lt(),x=dt(),f=ct({},0,5),E=($=m.data)==null?void 0:$.totals,v=(L=d.data)==null?void 0:L.totals,p=(O=h.data)==null?void 0:O.totals,j=((A=d.data)==null?void 0:A.series)??[],C=j.length>1,c=W(v),k=W(p),V=c.rate!==null&&k.rate!==null?w(c.rate,k.rate):null,u=yt(a.data??[]),X=gt(o.data),Z=(i.data??[]).filter(g=>g.is_active).length,z=(x.data??[]).filter(g=>!g.blocked).length,J=(((F=f.data)==null?void 0:F.length)??0)>0,Q=e&&f.isSuccess&&!J,tt=m.error??d.error??o.error??a.error??i.error??x.error,et=()=>{m.refetch(),d.refetch(),h.refetch(),o.refetch(),a.refetch(),i.refetch(),x.refetch(),f.refetch()},rt=m.isFetching||d.isFetching||h.isFetching||o.isFetching||a.isFetching||i.isFetching||x.isFetching||f.isFetching;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ut,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway.",action:t.jsx(mt,{onRefresh:et,isFetching:rt,updatedAt:d.dataUpdatedAt})}),Q?t.jsx(Rt,{}):null,t.jsx(Y,{error:tt}),t.jsx(Dt,{providerHealth:X,healthy:((P=o.data)==null?void 0:P.healthy)??0,degraded:((q=o.data)==null?void 0:q.degraded)??0,total:((U=o.data)==null?void 0:U.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:o.isSuccess&&a.isSuccess&&d.isSuccess,failed:o.isError||a.isError||d.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(b,{label:"Spend today",value:E?_(E.cost):"—"}),t.jsx(b,{label:"Spend, last 30 days",value:v?_(v.cost):"—",hint:v?t.jsx(N,{fraction:w(v.cost,p==null?void 0:p.cost)}):null,chart:C?t.jsx(H,{values:j.map(g=>g.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Requests, last 30 days",value:v?R(v.request_count):"—",hint:v?t.jsx(N,{fraction:w(v.request_count,p==null?void 0:p.request_count)}):null,chart:C?t.jsx(H,{values:j.map(g=>g.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Error rate, last 30 days",value:c.rate===null?"—":D(c.rate),status:M(c.status),statusLabel:c.status==="neutral"?void 0:St[c.status],hint:c.rate!==null?t.jsx(N,{fraction:V}):null}),t.jsx(b,{label:"Budget health",value:a.data&&u.worst?D(u.worst.pct):"—",status:a.data?M(u.status):void 0,statusLabel:a.data&&u.status!=="neutral"?wt[u.status]:void 0,hint:a.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(b,{label:"Active keys",value:i.data?R(Z):"—",to:"/keys"}),t.jsx(b,{label:"Active users",value:x.data?R(z):"—",to:"/users"})]}),t.jsx(Ct,{entries:f.data??[],loading:f.isLoading,error:f.error})]})}function Rt(){const e=st();return t.jsx(B,{children:t.jsxs(B.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(xt,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function _t({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function Dt({providerHealth:e,healthy:n,degraded:s,total:l,budget:r,errStatus:m,errRate:d,ready:h,failed:o}){if(o)return t.jsx(_t,{text:"Some status data could not be loaded."});if(!h)return null;const a=[];if((e==="warn"||e==="alert")&&l>0){const i=l-n-s;i>0&&a.push({text:`${i} provider${i===1?"":"s"} unreachable`,to:"/providers"}),s>0&&a.push({text:`${s} provider${s===1?"":"s"} without model discovery`,to:"/providers"})}return r.overCount>0?a.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&a.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),m==="alert"&&d!==null&&a.push({text:`error rate ${D(d)}`,to:"/activity?status=error"}),a.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),a.map((i,x)=>t.jsxs("span",{className:"flex items-center gap-2",children:[x>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(I,{to:i.to,className:"underline underline-offset-2 hover:text-amber-950",children:i.text})]},i.to+i.text))]})}function Et(e){return e==="error"?"error":"ok"}function Ct({entries:e,loading:n,error:s}){const l=[{id:"time",header:"Time",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(r.timestamp).toLocaleString(),children:vt(r.timestamp)})},{id:"model",header:"Model",isRowHeader:!0,cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:r.model})},{id:"cost",header:"Cost",align:"end",cell:r=>r.cost===null?"—":_(r.cost)},{id:"status",header:"Status",cell:r=>t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Et(r.status)})}];return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(I,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(Y,{error:s}),t.jsx(ht,{ariaLabel:"Recent activity",columns:l,rows:e,getRowKey:r=>r.id,isLoading:n,emptyContent:"No requests yet. Once the gateway serves traffic, it appears here."})]})}export{qt as OverviewIndex,Nt as OverviewPage,G as localDayKey}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as y,i as st,N as I}from"./react-dgEcD0HR.js";import{T as at,U as nt,d as S,V as ot,q as it,a as lt,u as dt,b as ct,W as w,P as ut,R as mt,E as Y,X as b,Z as _,_ as N,$ as R,a0 as D,a1 as vt}from"./index-BCvb90M0.js";import{S as H}from"./charts-DIsd9m--.js";import{D as ht}from"./DataTable-Bmn_eYSV.js";import{d as B,B as xt}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function M(e){return e==="neutral"?void 0:e}const ft=.02,pt=.1;function W(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,s=n>=pt?"alert":n>=ft?"warn":"ok";return{rate:n,status:s}}function gt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy+e.degraded===0?"alert":"warn"}const bt=.8;function yt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(o=>o.max_budget!==null&&o.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let s=0,l=0,r,m=-1;for(const o of n){const a=o.max_budget*o.user_count,i=a>0?o.total_spend/a:0;i>=1?s+=1:i>=bt&&(l+=1),i>m&&(m=i,r={name:o.name??o.budget_id,spent:o.total_spend,allocated:a,pct:i})}const d=s>0?"alert":l>0?"warn":"ok",h=s>0?`${s} over limit`:l>0?`${l} near limit`:"All within budget";return{status:d,label:h,overCount:s,nearCount:l,cappedCount:n.length,worst:r}}const K=864e5,T=30;function G(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function jt(){const[e,n]=y.useState(G);return y.useEffect(()=>{const s=()=>{if(document.visibilityState==="visible"){const l=G();n(r=>r===l?r:l)}};return document.addEventListener("visibilitychange",s),window.addEventListener("focus",s),()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("focus",s)}},[]),y.useMemo(()=>{const s=Date.now(),l=new Date(s);return{today:new Date(l.getFullYear(),l.getMonth(),l.getDate()).toISOString(),periodStart:new Date(s-T*K).toISOString(),prevStart:new Date(s-2*T*K).toISOString()}},[e])}const St={ok:"Healthy",warn:"Elevated",alert:"High"},wt={ok:"On track",warn:"Near limit",alert:"Over budget"};function qt(){const e=at();return e.isLoading?t.jsx(nt,{}):t.jsx(Nt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function Nt({needsSetup:e=!1}){var $,L,O,A,F,P,q,U;const n=jt(),s=y.useMemo(()=>({start_date:n.today}),[n]),l=y.useMemo(()=>({start_date:n.periodStart}),[n]),r=y.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=S(s,"hour"),d=S(l,"day"),h=S(r,"day"),o=ot(),a=it(),i=lt(),x=dt(),f=ct({},0,5),E=($=m.data)==null?void 0:$.totals,v=(L=d.data)==null?void 0:L.totals,p=(O=h.data)==null?void 0:O.totals,j=((A=d.data)==null?void 0:A.series)??[],C=j.length>1,c=W(v),k=W(p),V=c.rate!==null&&k.rate!==null?w(c.rate,k.rate):null,u=yt(a.data??[]),X=gt(o.data),Z=(i.data??[]).filter(g=>g.is_active).length,z=(x.data??[]).filter(g=>!g.blocked).length,J=(((F=f.data)==null?void 0:F.length)??0)>0,Q=e&&f.isSuccess&&!J,tt=m.error??d.error??o.error??a.error??i.error??x.error,et=()=>{m.refetch(),d.refetch(),h.refetch(),o.refetch(),a.refetch(),i.refetch(),x.refetch(),f.refetch()},rt=m.isFetching||d.isFetching||h.isFetching||o.isFetching||a.isFetching||i.isFetching||x.isFetching||f.isFetching;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ut,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway.",action:t.jsx(mt,{onRefresh:et,isFetching:rt,updatedAt:d.dataUpdatedAt})}),Q?t.jsx(Rt,{}):null,t.jsx(Y,{error:tt}),t.jsx(Dt,{providerHealth:X,healthy:((P=o.data)==null?void 0:P.healthy)??0,degraded:((q=o.data)==null?void 0:q.degraded)??0,total:((U=o.data)==null?void 0:U.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:o.isSuccess&&a.isSuccess&&d.isSuccess,failed:o.isError||a.isError||d.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(b,{label:"Spend today",value:E?_(E.cost):"—"}),t.jsx(b,{label:"Spend, last 30 days",value:v?_(v.cost):"—",hint:v?t.jsx(N,{fraction:w(v.cost,p==null?void 0:p.cost)}):null,chart:C?t.jsx(H,{values:j.map(g=>g.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Requests, last 30 days",value:v?R(v.request_count):"—",hint:v?t.jsx(N,{fraction:w(v.request_count,p==null?void 0:p.request_count)}):null,chart:C?t.jsx(H,{values:j.map(g=>g.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Error rate, last 30 days",value:c.rate===null?"—":D(c.rate),status:M(c.status),statusLabel:c.status==="neutral"?void 0:St[c.status],hint:c.rate!==null?t.jsx(N,{fraction:V}):null}),t.jsx(b,{label:"Budget health",value:a.data&&u.worst?D(u.worst.pct):"—",status:a.data?M(u.status):void 0,statusLabel:a.data&&u.status!=="neutral"?wt[u.status]:void 0,hint:a.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(b,{label:"Active keys",value:i.data?R(Z):"—",to:"/keys"}),t.jsx(b,{label:"Active users",value:x.data?R(z):"—",to:"/users"})]}),t.jsx(Ct,{entries:f.data??[],loading:f.isLoading,error:f.error})]})}function Rt(){const e=st();return t.jsx(B,{children:t.jsxs(B.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(xt,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function _t({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function Dt({providerHealth:e,healthy:n,degraded:s,total:l,budget:r,errStatus:m,errRate:d,ready:h,failed:o}){if(o)return t.jsx(_t,{text:"Some status data could not be loaded."});if(!h)return null;const a=[];if((e==="warn"||e==="alert")&&l>0){const i=l-n-s;i>0&&a.push({text:`${i} provider${i===1?"":"s"} unreachable`,to:"/providers"}),s>0&&a.push({text:`${s} provider${s===1?"":"s"} without model discovery`,to:"/providers"})}return r.overCount>0?a.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&a.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),m==="alert"&&d!==null&&a.push({text:`error rate ${D(d)}`,to:"/activity?status=error"}),a.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),a.map((i,x)=>t.jsxs("span",{className:"flex items-center gap-2",children:[x>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(I,{to:i.to,className:"underline underline-offset-2 hover:text-amber-950",children:i.text})]},i.to+i.text))]})}function Et(e){return e==="error"?"error":"ok"}function Ct({entries:e,loading:n,error:s}){const l=[{id:"time",header:"Time",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(r.timestamp).toLocaleString(),children:vt(r.timestamp)})},{id:"model",header:"Model",isRowHeader:!0,cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:r.model})},{id:"cost",header:"Cost",align:"end",cell:r=>r.cost===null?"—":_(r.cost)},{id:"status",header:"Status",cell:r=>t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Et(r.status)})}];return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(I,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(Y,{error:s}),t.jsx(ht,{ariaLabel:"Recent activity",columns:l,rows:e,getRowKey:r=>r.id,isLoading:n,emptyContent:"No requests yet. Once the gateway serves traffic, it appears here."})]})}export{qt as OverviewIndex,Nt as OverviewPage,G as localDayKey}; diff --git a/src/gateway/static/dashboard/assets/ProvidersPage-HN_Zodtk.js b/src/gateway/static/dashboard/assets/ProvidersPage-Bf-7xbup.js similarity index 99% rename from src/gateway/static/dashboard/assets/ProvidersPage-HN_Zodtk.js rename to src/gateway/static/dashboard/assets/ProvidersPage-Bf-7xbup.js index 3a5ef3b0e..875fb9f26 100644 --- a/src/gateway/static/dashboard/assets/ProvidersPage-HN_Zodtk.js +++ b/src/gateway/static/dashboard/assets/ProvidersPage-Bf-7xbup.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,L as M}from"./react-dgEcD0HR.js";import{T as Y,a2 as V,Q as G,V as Q,a3 as W,a4 as J,a5 as X,P as Z,E as I,I as ee,a6 as te,a7 as se,a1 as q,o as ae,a8 as $,a9 as re,N as O,aa as ne,ab as ie}from"./index-MlRogoGm.js";import{F as _}from"./Field-Dwp6u3t8.js";import{D as oe}from"./DataTable-Bmn_eYSV.js";import{B as f,d as S,f as de,T as le,L as F,I as H,D as ce,S as me,C as T,a as ue,b as xe}from"./heroui-BI50yK5B.js";function E({value:t,onChange:s,label:a,placeholder:n,description:i}){return e.jsxs(le,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(H,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),i?e.jsx(ce,{className:"text-xs text-[var(--otari-muted)]",children:i}):null]})}function z({label:t,value:s,onChange:a,description:n,placeholder:i,extra:d=[],includeCatalog:l=!0}){var k;const g=ne(),u=x.useMemo(()=>l?[...d,...(g.data??[]).map(o=>({id:o.id,name:o.name}))]:d,[g.data,d,l]),[p,m]=x.useState(()=>{var o;return((o=u.find(b=>b.id===s))==null?void 0:o.name)??""}),j=((k=u.find(o=>o.id===s))==null?void 0:k.name)??"",h=p.trim()===j.trim()?"":p.trim().toLowerCase(),c=u.filter(o=>!h||o.name.toLowerCase().includes(h)||o.id.toLowerCase().includes(h)).slice(0,50);return e.jsxs(T.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:p,onInputChange:m,onSelectionChange:o=>{var b;o!=null?(a(String(o)),m(((b=u.find(N=>N.id===String(o)))==null?void 0:b.name)??"")):(a(""),m(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(T.InputGroup,{children:[e.jsx(H,{placeholder:i??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:o=>o.currentTarget.select()}),e.jsx(T.Trigger,{})]}),e.jsx(T.Popover,{children:e.jsx(ue,{items:c,className:"max-h-72 overflow-auto",children:o=>e.jsx(xe,{id:o.id,textValue:o.name,children:o.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function U({getPayload:t}){const s=ie(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:O(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):s.data.discovery_unsupported?e.jsxs("span",{className:"block max-w-md break-words text-xs text-amber-800",children:["This provider does not list models, so the key could not be verified here. Save it and use the provider; declare its model ids under ",e.jsx("code",{children:"models:"})," to have them show up in the catalogue. If you did not expect this, check the provider's reply below.",s.data.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:s.data.error}):null]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function pe({onClose:t}){var A;const s=$(),[a,n]=x.useState(""),[i,d]=x.useState(""),[l,g]=x.useState(!1),[u,p]=x.useState(""),[m,j]=x.useState(""),h=re(a),c=((A=h.data)==null?void 0:A.id)===a?h.data:void 0;x.useEffect(()=>{c&&p(c.default_api_base??"")},[c]);const k=(c==null?void 0:c.env_key_present)??!1,o=((c==null?void 0:c.requires_api_key)??!0)&&!k,b=m.trim()!==""&&m.trim()!==a,N=/[:/]/.test(m),P=a!==""&&!N&&(!o||i.trim()!=="")&&!s.isPending,C=()=>{P&&s.mutate({instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsx(z,{label:"Provider",value:a,onChange:w=>{n(w),j(""),p("")},description:"Its endpoint is built in."}),e.jsx(E,{value:i,onChange:d,label:c&&!o?"API key (optional)":"API key",description:c?o?`${c.name}'s endpoint is built in — just add your key.`:k?`${c.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${c.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>g(w=>!w),children:l?"Hide advanced":"Advanced (API base, rename)"}),l?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:u,onChange:p,placeholder:(c==null?void 0:c.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:m,onChange:j,placeholder:a||"instance name",description:N?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!P,onPress:C,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a===""?null:{instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null}})]})]})}function he({onClose:t}){const s=$(),[a,n]=x.useState(""),[i,d]=x.useState("openai-compatible"),[l,g]=x.useState(""),[u,p]=x.useState(""),m=/[:/]/.test(a),j=a.trim()!==""&&!m&&l.trim()!==""&&!s.isPending,h=()=>{j&&s.mutate({instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:m?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(z,{label:"Compatible with",value:i,onChange:d,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:l,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(E,{value:u,onChange:p,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!j,onPress:h,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a.trim()===""||l.trim()===""?null:{instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null}})]})]})}function ve({onClose:t}){const[s,a]=x.useState("known");return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,i])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:i},n))})}),s==="known"?e.jsx(pe,{onClose:t}):e.jsx(he,{onClose:t})]})})}function ge({provider:t,onClose:s}){const a=te(),[n,i]=x.useState(t.provider_type??""),[d,l]=x.useState(t.api_base??""),[g,u]=x.useState(!1),[p,m]=x.useState(""),j=()=>{if(a.isPending)return;const h={provider_type:n.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};g&&p.trim()&&(h.api_key=p.trim()),a.mutate({instance:t.instance,body:h},{onSuccess:s})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(I,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:i,placeholder:"openai"}),e.jsx(_,{label:"API base",value:d,onChange:l,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(E,{value:p,onChange:m,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),m("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(f,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:a.isPending,onPress:j,children:a.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function fe(t,s){const a=new Map((s??[]).map(d=>[d.instance,d])),n=new Map((t??[]).map(d=>[d.instance,d]));return[...new Set([...a.keys(),...n.keys()])].sort().map(d=>{const l=a.get(d);return{instance:d,source:l?"stored":"config",stored:l,meta:n.get(d)}})}function je({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(me,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):t.discovery_unsupported?e.jsxs("span",{className:"block max-w-xs break-words text-xs text-amber-800",children:["Could not list models, so the key could not be verified. It may still work for requests.",t.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:t.error}):null]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function be({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=!t.ok&&t.discovery_unsupported,a=t.ok?"border-green-200 bg-green-50 text-green-700":s?"border-amber-200 bg-amber-50 text-amber-800":"border-red-200 bg-red-50 text-red-700",n=t.ok?"bg-green-500":s?"bg-amber-500":"bg-red-500",i=t.checked_at?`Last checked ${q(t.checked_at)}`:"Not checked yet",d=s?`${t.error??"This provider does not list models."} Requests to it may still work.`:t.error??"Unreachable",l=t.ok?i:`${d} · ${i}`;return e.jsxs("span",{title:l,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${n}`}),t.ok?"Reachable":s?"No model discovery":"Unreachable"]})}function ye({healthy:t,degraded:s,total:a,checkedAt:n}){const d=t===a?"bg-green-500":t+s===a?"bg-amber-500":"bg-red-500",l=se();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${d}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s>0?e.jsxs("span",{className:"text-amber-800",children:[s," without model discovery"]}):null,n?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",q(n)]}):null,e.jsx(f,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function R({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function ke({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n,secretKeyConfigured:i}){return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(R,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(R,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(R,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(f,{variant:"primary",isDisabled:!i,onPress:t,children:"Add your first provider"})})]})})}function Ae(){var K,B,D,L;const t=Y(),s=V(),a=G(),n=Q(),i=W(),d=J(),l=X(),[g,u]=x.useState(!1),[p,m]=x.useState(null),[j,h]=x.useState({}),c=fe((K=t.data)==null?void 0:K.providers,s.data),k=new Map((((B=n.data)==null?void 0:B.providers)??[]).map(r=>[r.instance,r])),o=t.isLoading||s.isLoading,b=((D=s.data)==null?void 0:D.find(r=>r.instance===p))??null,N=((L=a.data)==null?void 0:L.require_pricing)===!0&&a.data.default_pricing===!1,P=a.data?a.data.secret_key_configured!==!1:!a.isError,C=!o&&c.length===0&&!g,A=r=>{h(v=>({...v,[r]:{status:"pending"}})),d.mutate(r,{onSuccess:v=>h(y=>({...y,[r]:{status:"done",...v}})),onError:v=>h(y=>({...y,[r]:{status:"done",ok:!1,model_count:0,error:O(v),discovery_unsupported:!1}}))})},w=[{id:"provider",header:"Provider",isRowHeader:!0,cell:r=>e.jsx(M,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"font-medium text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})},{id:"type",header:"Type",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:((v=r.meta)==null?void 0:v.provider_type)??((y=r.stored)==null?void 0:y.provider_type)??r.instance})}},{id:"source",header:"Source",cell:r=>e.jsx(de,{size:"sm",color:r.source==="stored"?"accent":"default",children:r.source==="stored"?"stored":"config"})},{id:"api_key",header:"API key",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:(v=r.stored)!=null&&v.last4?`••••${r.stored.last4}`:"none set"}):(y=r.meta)!=null&&y.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"})}},{id:"status",header:"Status",cell:r=>e.jsx(be,{health:k.get(r.instance)})},{id:"actions",header:"Actions",align:"end",cell:r=>{var v,y;return r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:((v=j[r.instance])==null?void 0:v.status)==="pending"||((y=r.stored)==null?void 0:y.decryptable)===!1,onPress:()=>A(r.instance),children:"Test"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{u(!1),m(r.instance)},children:"Edit"}),e.jsx(ae,{confirmLabel:"Delete",isPending:i.isPending,onConfirm:()=>i.mutate(r.instance),children:"Delete"})]}),e.jsx(je,{state:j[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})}}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||C?null:e.jsx(f,{variant:"primary",isDisabled:!P,onPress:()=>{m(null),u(!0)},children:"Add provider"})}),e.jsx(I,{error:t.error??s.error??a.error??n.error??l.error??i.error}),P?null:e.jsxs(ee,{tone:"warning",children:[e.jsx("code",{children:"OTARI_SECRET_KEY"})," is not set, so provider keys can't be encrypted at rest and adding providers from the dashboard is disabled. Set it on the server and restart to add providers here. Providers defined in"," ",e.jsx("code",{children:"config.yml"})," keep working without it."]}),C?e.jsx(ke,{onAddProvider:()=>{m(null),u(!0)},needsPricing:N,onEnablePricing:()=>l.mutate({default_pricing:!0}),enabling:l.isPending,secretKeyConfigured:P}):null,g&&P?e.jsx(ve,{onClose:()=>u(!1)}):null,b?e.jsx(ge,{provider:b,onClose:()=>m(null)}):null,!o&&c.length>0&&n.data&&n.data.total>0?e.jsx(ye,{healthy:n.data.healthy,degraded:n.data.degraded,total:n.data.total,checkedAt:n.data.checked_at}):null,C?null:e.jsx(oe,{ariaLabel:"Providers",columns:w,rows:c,getRowKey:r=>r.instance,isLoading:o,emptyContent:"No providers yet. Add your first provider to start serving models."})]})}export{Ae as ProvidersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,L as M}from"./react-dgEcD0HR.js";import{T as Y,a2 as V,Q as G,V as Q,a3 as W,a4 as J,a5 as X,P as Z,E as I,I as ee,a6 as te,a7 as se,a1 as q,o as ae,a8 as $,a9 as re,N as O,aa as ne,ab as ie}from"./index-BCvb90M0.js";import{F as _}from"./Field-Dwp6u3t8.js";import{D as oe}from"./DataTable-Bmn_eYSV.js";import{B as f,d as S,f as de,T as le,L as F,I as H,D as ce,S as me,C as T,a as ue,b as xe}from"./heroui-BI50yK5B.js";function E({value:t,onChange:s,label:a,placeholder:n,description:i}){return e.jsxs(le,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(H,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),i?e.jsx(ce,{className:"text-xs text-[var(--otari-muted)]",children:i}):null]})}function z({label:t,value:s,onChange:a,description:n,placeholder:i,extra:d=[],includeCatalog:l=!0}){var k;const g=ne(),u=x.useMemo(()=>l?[...d,...(g.data??[]).map(o=>({id:o.id,name:o.name}))]:d,[g.data,d,l]),[p,m]=x.useState(()=>{var o;return((o=u.find(b=>b.id===s))==null?void 0:o.name)??""}),j=((k=u.find(o=>o.id===s))==null?void 0:k.name)??"",h=p.trim()===j.trim()?"":p.trim().toLowerCase(),c=u.filter(o=>!h||o.name.toLowerCase().includes(h)||o.id.toLowerCase().includes(h)).slice(0,50);return e.jsxs(T.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:p,onInputChange:m,onSelectionChange:o=>{var b;o!=null?(a(String(o)),m(((b=u.find(N=>N.id===String(o)))==null?void 0:b.name)??"")):(a(""),m(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(T.InputGroup,{children:[e.jsx(H,{placeholder:i??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:o=>o.currentTarget.select()}),e.jsx(T.Trigger,{})]}),e.jsx(T.Popover,{children:e.jsx(ue,{items:c,className:"max-h-72 overflow-auto",children:o=>e.jsx(xe,{id:o.id,textValue:o.name,children:o.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function U({getPayload:t}){const s=ie(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:O(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):s.data.discovery_unsupported?e.jsxs("span",{className:"block max-w-md break-words text-xs text-amber-800",children:["This provider does not list models, so the key could not be verified here. Save it and use the provider; declare its model ids under ",e.jsx("code",{children:"models:"})," to have them show up in the catalogue. If you did not expect this, check the provider's reply below.",s.data.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:s.data.error}):null]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function pe({onClose:t}){var A;const s=$(),[a,n]=x.useState(""),[i,d]=x.useState(""),[l,g]=x.useState(!1),[u,p]=x.useState(""),[m,j]=x.useState(""),h=re(a),c=((A=h.data)==null?void 0:A.id)===a?h.data:void 0;x.useEffect(()=>{c&&p(c.default_api_base??"")},[c]);const k=(c==null?void 0:c.env_key_present)??!1,o=((c==null?void 0:c.requires_api_key)??!0)&&!k,b=m.trim()!==""&&m.trim()!==a,N=/[:/]/.test(m),P=a!==""&&!N&&(!o||i.trim()!=="")&&!s.isPending,C=()=>{P&&s.mutate({instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsx(z,{label:"Provider",value:a,onChange:w=>{n(w),j(""),p("")},description:"Its endpoint is built in."}),e.jsx(E,{value:i,onChange:d,label:c&&!o?"API key (optional)":"API key",description:c?o?`${c.name}'s endpoint is built in — just add your key.`:k?`${c.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${c.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>g(w=>!w),children:l?"Hide advanced":"Advanced (API base, rename)"}),l?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:u,onChange:p,placeholder:(c==null?void 0:c.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:m,onChange:j,placeholder:a||"instance name",description:N?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!P,onPress:C,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a===""?null:{instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null}})]})]})}function he({onClose:t}){const s=$(),[a,n]=x.useState(""),[i,d]=x.useState("openai-compatible"),[l,g]=x.useState(""),[u,p]=x.useState(""),m=/[:/]/.test(a),j=a.trim()!==""&&!m&&l.trim()!==""&&!s.isPending,h=()=>{j&&s.mutate({instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:m?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(z,{label:"Compatible with",value:i,onChange:d,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:l,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(E,{value:u,onChange:p,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!j,onPress:h,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a.trim()===""||l.trim()===""?null:{instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null}})]})]})}function ve({onClose:t}){const[s,a]=x.useState("known");return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,i])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:i},n))})}),s==="known"?e.jsx(pe,{onClose:t}):e.jsx(he,{onClose:t})]})})}function ge({provider:t,onClose:s}){const a=te(),[n,i]=x.useState(t.provider_type??""),[d,l]=x.useState(t.api_base??""),[g,u]=x.useState(!1),[p,m]=x.useState(""),j=()=>{if(a.isPending)return;const h={provider_type:n.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};g&&p.trim()&&(h.api_key=p.trim()),a.mutate({instance:t.instance,body:h},{onSuccess:s})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(I,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:i,placeholder:"openai"}),e.jsx(_,{label:"API base",value:d,onChange:l,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(E,{value:p,onChange:m,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),m("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(f,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:a.isPending,onPress:j,children:a.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function fe(t,s){const a=new Map((s??[]).map(d=>[d.instance,d])),n=new Map((t??[]).map(d=>[d.instance,d]));return[...new Set([...a.keys(),...n.keys()])].sort().map(d=>{const l=a.get(d);return{instance:d,source:l?"stored":"config",stored:l,meta:n.get(d)}})}function je({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(me,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):t.discovery_unsupported?e.jsxs("span",{className:"block max-w-xs break-words text-xs text-amber-800",children:["Could not list models, so the key could not be verified. It may still work for requests.",t.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:t.error}):null]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function be({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=!t.ok&&t.discovery_unsupported,a=t.ok?"border-green-200 bg-green-50 text-green-700":s?"border-amber-200 bg-amber-50 text-amber-800":"border-red-200 bg-red-50 text-red-700",n=t.ok?"bg-green-500":s?"bg-amber-500":"bg-red-500",i=t.checked_at?`Last checked ${q(t.checked_at)}`:"Not checked yet",d=s?`${t.error??"This provider does not list models."} Requests to it may still work.`:t.error??"Unreachable",l=t.ok?i:`${d} · ${i}`;return e.jsxs("span",{title:l,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${n}`}),t.ok?"Reachable":s?"No model discovery":"Unreachable"]})}function ye({healthy:t,degraded:s,total:a,checkedAt:n}){const d=t===a?"bg-green-500":t+s===a?"bg-amber-500":"bg-red-500",l=se();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${d}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s>0?e.jsxs("span",{className:"text-amber-800",children:[s," without model discovery"]}):null,n?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",q(n)]}):null,e.jsx(f,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function R({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function ke({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n,secretKeyConfigured:i}){return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(R,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(R,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(R,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(f,{variant:"primary",isDisabled:!i,onPress:t,children:"Add your first provider"})})]})})}function Ae(){var K,B,D,L;const t=Y(),s=V(),a=G(),n=Q(),i=W(),d=J(),l=X(),[g,u]=x.useState(!1),[p,m]=x.useState(null),[j,h]=x.useState({}),c=fe((K=t.data)==null?void 0:K.providers,s.data),k=new Map((((B=n.data)==null?void 0:B.providers)??[]).map(r=>[r.instance,r])),o=t.isLoading||s.isLoading,b=((D=s.data)==null?void 0:D.find(r=>r.instance===p))??null,N=((L=a.data)==null?void 0:L.require_pricing)===!0&&a.data.default_pricing===!1,P=a.data?a.data.secret_key_configured!==!1:!a.isError,C=!o&&c.length===0&&!g,A=r=>{h(v=>({...v,[r]:{status:"pending"}})),d.mutate(r,{onSuccess:v=>h(y=>({...y,[r]:{status:"done",...v}})),onError:v=>h(y=>({...y,[r]:{status:"done",ok:!1,model_count:0,error:O(v),discovery_unsupported:!1}}))})},w=[{id:"provider",header:"Provider",isRowHeader:!0,cell:r=>e.jsx(M,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"font-medium text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})},{id:"type",header:"Type",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:((v=r.meta)==null?void 0:v.provider_type)??((y=r.stored)==null?void 0:y.provider_type)??r.instance})}},{id:"source",header:"Source",cell:r=>e.jsx(de,{size:"sm",color:r.source==="stored"?"accent":"default",children:r.source==="stored"?"stored":"config"})},{id:"api_key",header:"API key",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:(v=r.stored)!=null&&v.last4?`••••${r.stored.last4}`:"none set"}):(y=r.meta)!=null&&y.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"})}},{id:"status",header:"Status",cell:r=>e.jsx(be,{health:k.get(r.instance)})},{id:"actions",header:"Actions",align:"end",cell:r=>{var v,y;return r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:((v=j[r.instance])==null?void 0:v.status)==="pending"||((y=r.stored)==null?void 0:y.decryptable)===!1,onPress:()=>A(r.instance),children:"Test"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{u(!1),m(r.instance)},children:"Edit"}),e.jsx(ae,{confirmLabel:"Delete",isPending:i.isPending,onConfirm:()=>i.mutate(r.instance),children:"Delete"})]}),e.jsx(je,{state:j[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})}}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||C?null:e.jsx(f,{variant:"primary",isDisabled:!P,onPress:()=>{m(null),u(!0)},children:"Add provider"})}),e.jsx(I,{error:t.error??s.error??a.error??n.error??l.error??i.error}),P?null:e.jsxs(ee,{tone:"warning",children:[e.jsx("code",{children:"OTARI_SECRET_KEY"})," is not set, so provider keys can't be encrypted at rest and adding providers from the dashboard is disabled. Set it on the server and restart to add providers here. Providers defined in"," ",e.jsx("code",{children:"config.yml"})," keep working without it."]}),C?e.jsx(ke,{onAddProvider:()=>{m(null),u(!0)},needsPricing:N,onEnablePricing:()=>l.mutate({default_pricing:!0}),enabling:l.isPending,secretKeyConfigured:P}):null,g&&P?e.jsx(ve,{onClose:()=>u(!1)}):null,b?e.jsx(ge,{provider:b,onClose:()=>m(null)}):null,!o&&c.length>0&&n.data&&n.data.total>0?e.jsx(ye,{healthy:n.data.healthy,degraded:n.data.degraded,total:n.data.total,checkedAt:n.data.checked_at}):null,C?null:e.jsx(oe,{ariaLabel:"Providers",columns:w,rows:c,getRowKey:r=>r.instance,isLoading:o,emptyContent:"No providers yet. Add your first provider to start serving models."})]})}export{Ae as ProvidersPage}; diff --git a/src/gateway/static/dashboard/assets/SettingsPage-Csgj1pAU.js b/src/gateway/static/dashboard/assets/SettingsPage-OsrEeYZu.js similarity index 99% rename from src/gateway/static/dashboard/assets/SettingsPage-Csgj1pAU.js rename to src/gateway/static/dashboard/assets/SettingsPage-OsrEeYZu.js index 60fd82e29..23a943f7d 100644 --- a/src/gateway/static/dashboard/assets/SettingsPage-Csgj1pAU.js +++ b/src/gateway/static/dashboard/assets/SettingsPage-OsrEeYZu.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{Q as R,a5 as C,P,E as y,U as E,ac as T,ad as _,ae as D,F as A,af as O,a2 as F,ag as I,I as w}from"./index-MlRogoGm.js";import{d as v,B as h,A as d,g as K,I as z}from"./heroui-BI50yK5B.js";function b(t,r){return{[t]:r}}function M(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function L(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||M(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(A,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function U({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function V({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(V,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function Q({source:t}){const r=O(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:K({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(G,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function X(){var o;const t=F(),r=I(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(Q,{source:t}),e.jsx(X,{})]})})]})}function W({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=T(),r=_(),s=D(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(W,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&L(l,n)),k=ee(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,t.isLoading?e.jsx(E,{}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(U,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,L as fieldMatches}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{Q as R,a5 as C,P,E as y,U as E,ac as T,ad as _,ae as D,F as A,af as O,a2 as F,ag as I,I as w}from"./index-BCvb90M0.js";import{d as v,B as h,A as d,g as K,I as z}from"./heroui-BI50yK5B.js";function b(t,r){return{[t]:r}}function M(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function L(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||M(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(A,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function U({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function V({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(V,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function Q({source:t}){const r=O(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:K({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(G,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function X(){var o;const t=F(),r=I(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(Q,{source:t}),e.jsx(X,{})]})})]})}function W({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=T(),r=_(),s=D(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(W,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&L(l,n)),k=ee(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,t.isLoading?e.jsx(E,{}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(U,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,L as fieldMatches}; diff --git a/src/gateway/static/dashboard/assets/TablePagination-BHTN5PVb.js b/src/gateway/static/dashboard/assets/TablePagination-DSU6cRH7.js similarity index 98% rename from src/gateway/static/dashboard/assets/TablePagination-BHTN5PVb.js rename to src/gateway/static/dashboard/assets/TablePagination-DSU6cRH7.js index 92f714a9e..4865d5f46 100644 --- a/src/gateway/static/dashboard/assets/TablePagination-BHTN5PVb.js +++ b/src/gateway/static/dashboard/assets/TablePagination-DSU6cRH7.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{I as w,E as M,F as D}from"./index-MlRogoGm.js";import{A as o,B as x,T as F,L as $,I as T,S as y}from"./heroui-BI50yK5B.js";function _({label:t,value:r,onChange:a,isRequired:c,autoFocus:i}){return e.jsxs(F,{value:r,onChange:a,isRequired:c,className:"flex flex-col gap-1",children:[e.jsx($,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsx(T,{inputMode:"decimal",placeholder:"0.00",autoFocus:i})]})}function R(t){const r=t.trim();if(r==="")return null;const a=Number(r);return Number.isFinite(a)&&a>=0?a:Number.NaN}const C=t=>`Recompute cost for ${t.toLocaleString()} imported ${t===1?"row":"rows"} from each row's own token counts at these per-1M rates. Enforced gateway rows are never affected.`;function W({isOpen:t,onOpenChange:r,targetCount:a,isPending:c,error:i,onSubmit:E,title:I="Set price",description:L=C}){const[j,p]=u.useState(""),[n,h]=u.useState(""),[b,N]=u.useState(""),[f,v]=u.useState("");u.useEffect(()=>{t&&(p(""),h(""),N(""),v(""))},[t]);const m=R(j),l=R(n),d=R(b),s=R(f),g=m===null||Number.isNaN(m)||l===null||Number.isNaN(l)||Number.isNaN(d??0)||Number.isNaN(s??0),S=()=>{g||m===null||l===null||E({input_price_per_million:m,output_price_per_million:l,...d!==null&&!Number.isNaN(d)?{cache_read_price_per_million:d}:{},...s!==null&&!Number.isNaN(s)?{cache_write_price_per_million:s}:{}})};return e.jsx(o,{isOpen:t,onOpenChange:r,children:t?e.jsx(o.Backdrop,{children:e.jsx(o.Container,{placement:"center",size:"lg",children:e.jsxs(o.Dialog,{children:[e.jsx(o.Header,{children:e.jsx(o.Heading,{children:I})}),e.jsxs(o.Body,{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:L(a)}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(_,{label:"Input $ / 1M",value:j,onChange:p,isRequired:!0,autoFocus:!0}),e.jsx(_,{label:"Output $ / 1M",value:n,onChange:h,isRequired:!0}),e.jsx(_,{label:"Cache read $ / 1M",value:b,onChange:N}),e.jsx(_,{label:"Cache write $ / 1M",value:f,onChange:v})]}),e.jsx(w,{tone:"info",children:"Leave a cache rate blank to bill those tokens at the input rate."}),e.jsx(M,{error:i})]}),e.jsxs(o.Footer,{children:[e.jsx(x,{variant:"ghost",isDisabled:c,onPress:()=>r(!1),children:"Cancel"}),e.jsx(x,{variant:"primary",isDisabled:g,isPending:c,onPress:S,children:"Set price"})]})]})})}):null})}const P=[25,50,100];function q({page:t,pageSize:r,total:a,rowsOnPage:c,onPageChange:i,onPageSizeChange:E,pageSizeOptions:I=P,isFetching:L=!1,hasNextFallback:j=!1}){const p=u.useId(),n=a!=null?Math.max(1,Math.ceil(a/r)):null,h=t===0,b=n!=null?t>=n-1:!j,N=c>0?t*r+1:0,f=t*r+c,v=a!=null?a===0?"0 of 0":`${N.toLocaleString()}–${f.toLocaleString()} of ${a.toLocaleString()}`:c>0?`${N.toLocaleString()}–${f.toLocaleString()}`:"0",[m,l]=u.useState(String(t+1));u.useEffect(()=>{l(String(t+1))},[t]);const d=()=>{const s=Number.parseInt(m,10);if(Number.isNaN(s)){l(String(t+1));return}const g=n??Number.MAX_SAFE_INTEGER,S=Math.min(Math.max(s,1),g);S-1!==t?i(S-1):l(String(t+1))};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:p,className:"text-sm text-[var(--otari-muted)]",children:"Rows"}),e.jsx(D,{id:p,ariaLabel:"Rows per page",value:String(r),onChange:s=>E(Number.parseInt(s,10)),options:I.map(s=>({value:String(s),label:String(s)}))}),L?e.jsx(y,{size:"sm"}):null]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[var(--otari-muted)] tabular-nums",children:v}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"outline","aria-label":"First page",isDisabled:h,onPress:()=>i(0),children:"«"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Previous page",isDisabled:h,onPress:()=>i(t-1),children:"‹"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{"aria-label":"Page number",inputMode:"numeric",value:m,onChange:s=>l(s.target.value.replace(/[^0-9]/g,"")),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()},onBlur:d,className:"w-12 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-2 py-1 text-center text-sm text-[var(--otari-ink)] tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"}),n!=null?e.jsxs("span",{className:"tabular-nums",children:["/ ",n.toLocaleString()]}):null]}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Next page",isDisabled:b,onPress:()=>i(t+1),children:"›"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Last page",isDisabled:n==null||b,onPress:()=>n!=null&&i(n-1),children:"»"})]})]})]})}export{P,W as S,q as T}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{I as w,E as M,F as D}from"./index-BCvb90M0.js";import{A as o,B as x,T as F,L as $,I as T,S as y}from"./heroui-BI50yK5B.js";function _({label:t,value:r,onChange:a,isRequired:c,autoFocus:i}){return e.jsxs(F,{value:r,onChange:a,isRequired:c,className:"flex flex-col gap-1",children:[e.jsx($,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsx(T,{inputMode:"decimal",placeholder:"0.00",autoFocus:i})]})}function R(t){const r=t.trim();if(r==="")return null;const a=Number(r);return Number.isFinite(a)&&a>=0?a:Number.NaN}const C=t=>`Recompute cost for ${t.toLocaleString()} imported ${t===1?"row":"rows"} from each row's own token counts at these per-1M rates. Enforced gateway rows are never affected.`;function W({isOpen:t,onOpenChange:r,targetCount:a,isPending:c,error:i,onSubmit:E,title:I="Set price",description:L=C}){const[j,p]=u.useState(""),[n,h]=u.useState(""),[b,N]=u.useState(""),[f,v]=u.useState("");u.useEffect(()=>{t&&(p(""),h(""),N(""),v(""))},[t]);const m=R(j),l=R(n),d=R(b),s=R(f),g=m===null||Number.isNaN(m)||l===null||Number.isNaN(l)||Number.isNaN(d??0)||Number.isNaN(s??0),S=()=>{g||m===null||l===null||E({input_price_per_million:m,output_price_per_million:l,...d!==null&&!Number.isNaN(d)?{cache_read_price_per_million:d}:{},...s!==null&&!Number.isNaN(s)?{cache_write_price_per_million:s}:{}})};return e.jsx(o,{isOpen:t,onOpenChange:r,children:t?e.jsx(o.Backdrop,{children:e.jsx(o.Container,{placement:"center",size:"lg",children:e.jsxs(o.Dialog,{children:[e.jsx(o.Header,{children:e.jsx(o.Heading,{children:I})}),e.jsxs(o.Body,{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:L(a)}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(_,{label:"Input $ / 1M",value:j,onChange:p,isRequired:!0,autoFocus:!0}),e.jsx(_,{label:"Output $ / 1M",value:n,onChange:h,isRequired:!0}),e.jsx(_,{label:"Cache read $ / 1M",value:b,onChange:N}),e.jsx(_,{label:"Cache write $ / 1M",value:f,onChange:v})]}),e.jsx(w,{tone:"info",children:"Leave a cache rate blank to bill those tokens at the input rate."}),e.jsx(M,{error:i})]}),e.jsxs(o.Footer,{children:[e.jsx(x,{variant:"ghost",isDisabled:c,onPress:()=>r(!1),children:"Cancel"}),e.jsx(x,{variant:"primary",isDisabled:g,isPending:c,onPress:S,children:"Set price"})]})]})})}):null})}const P=[25,50,100];function q({page:t,pageSize:r,total:a,rowsOnPage:c,onPageChange:i,onPageSizeChange:E,pageSizeOptions:I=P,isFetching:L=!1,hasNextFallback:j=!1}){const p=u.useId(),n=a!=null?Math.max(1,Math.ceil(a/r)):null,h=t===0,b=n!=null?t>=n-1:!j,N=c>0?t*r+1:0,f=t*r+c,v=a!=null?a===0?"0 of 0":`${N.toLocaleString()}–${f.toLocaleString()} of ${a.toLocaleString()}`:c>0?`${N.toLocaleString()}–${f.toLocaleString()}`:"0",[m,l]=u.useState(String(t+1));u.useEffect(()=>{l(String(t+1))},[t]);const d=()=>{const s=Number.parseInt(m,10);if(Number.isNaN(s)){l(String(t+1));return}const g=n??Number.MAX_SAFE_INTEGER,S=Math.min(Math.max(s,1),g);S-1!==t?i(S-1):l(String(t+1))};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:p,className:"text-sm text-[var(--otari-muted)]",children:"Rows"}),e.jsx(D,{id:p,ariaLabel:"Rows per page",value:String(r),onChange:s=>E(Number.parseInt(s,10)),options:I.map(s=>({value:String(s),label:String(s)}))}),L?e.jsx(y,{size:"sm"}):null]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[var(--otari-muted)] tabular-nums",children:v}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"outline","aria-label":"First page",isDisabled:h,onPress:()=>i(0),children:"«"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Previous page",isDisabled:h,onPress:()=>i(t-1),children:"‹"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{"aria-label":"Page number",inputMode:"numeric",value:m,onChange:s=>l(s.target.value.replace(/[^0-9]/g,"")),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()},onBlur:d,className:"w-12 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-2 py-1 text-center text-sm text-[var(--otari-ink)] tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"}),n!=null?e.jsxs("span",{className:"tabular-nums",children:["/ ",n.toLocaleString()]}):null]}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Next page",isDisabled:b,onPress:()=>i(t+1),children:"›"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Last page",isDisabled:n==null||b,onPress:()=>n!=null&&i(n-1),children:"»"})]})]})]})}export{P,W as S,q as T}; diff --git a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-DPdRTl_b.js b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-CSxGfHtw.js similarity index 99% rename from src/gateway/static/dashboard/assets/ToolsGuardrailsPage-DPdRTl_b.js rename to src/gateway/static/dashboard/assets/ToolsGuardrailsPage-CSxGfHtw.js index 7cd6fdd1d..392561c0e 100644 --- a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-DPdRTl_b.js +++ b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-CSxGfHtw.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x}from"./react-dgEcD0HR.js";import{ah as L,ai as C,P,E,U as R,N as w,aj as D,F as U}from"./index-MlRogoGm.js";import{d as N,B as g}from"./heroui-BI50yK5B.js";function M(s,t){return{[s]:t}}const B=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=x.useState(null),a=x.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function z({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",b="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r),[m,p]=x.useState(null),c=D();x.useEffect(()=>{i(r)},[r]);const o=l.trim()!==r,d=l.trim(),h=m!==null&&m===d;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:l,disabled:n,placeholder:"unset",onChange:v=>{i(v.target.value),c.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(d===""?null:d),children:"Save"}),e.jsx(g,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:d===""||c.isPending,onPress:()=>{p(d),c.mutate({service:s.service,url:d})},children:c.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:c.isPending||!h?null:c.error?e.jsx("span",{className:"text-red-700",children:w(c.error)}):c.data?e.jsx("span",{className:c.data.ok?"font-medium text-green-700":"text-red-700",children:c.data.reason}):null}),e.jsx(j,{message:a})]})]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:p=>i(p.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(l.trim()===""?null:l.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l.trim(),p=Number(m),o=(m===""||Number.isInteger(p)&&p>=1)&&m!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:d=>i(d.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(m===""?null:p),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(U,{ariaLabel:s.key,value:r,onChange:l=>t(l==="default"?null:l==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function O({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(F,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n})}function V(){const s=L(),t=C(),[a,n]=$(),[r,l]=x.useState({}),i=s.data,m=!i||t.isPending,p=new Map(((i==null?void 0:i.fields)??[]).map(o=>[o.key,o])),c=(o,d)=>{l(h=>{const{[o.key]:v,...u}=h;return u}),t.mutate(M(o.key,d),{onSuccess:()=>n(`${o.key} saved`),onError:h=>l(v=>({...v,[o.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(E,{error:s.error}),s.isLoading?e.jsx(R,{}):null,B.map(o=>{const d=o.order.map(u=>p.get(u)).filter(u=>u!==void 0),h=((i==null?void 0:i.fields)??[]).filter(u=>u.service===o.key&&!o.order.includes(u.key)),v=[...d,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:o.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:o.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(O,{field:u,onSave:T=>c(u,T),saveError:r[u.key],disabled:m},u.key))})})]},o.key)}),e.jsx(z,{message:a})]})}export{V as ToolsGuardrailsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x}from"./react-dgEcD0HR.js";import{ah as L,ai as C,P,E,U as R,N as w,aj as D,F as U}from"./index-BCvb90M0.js";import{d as N,B as g}from"./heroui-BI50yK5B.js";function M(s,t){return{[s]:t}}const B=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=x.useState(null),a=x.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function z({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",b="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r),[m,p]=x.useState(null),c=D();x.useEffect(()=>{i(r)},[r]);const o=l.trim()!==r,d=l.trim(),h=m!==null&&m===d;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:l,disabled:n,placeholder:"unset",onChange:v=>{i(v.target.value),c.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(d===""?null:d),children:"Save"}),e.jsx(g,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:d===""||c.isPending,onPress:()=>{p(d),c.mutate({service:s.service,url:d})},children:c.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:c.isPending||!h?null:c.error?e.jsx("span",{className:"text-red-700",children:w(c.error)}):c.data?e.jsx("span",{className:c.data.ok?"font-medium text-green-700":"text-red-700",children:c.data.reason}):null}),e.jsx(j,{message:a})]})]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:p=>i(p.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(l.trim()===""?null:l.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l.trim(),p=Number(m),o=(m===""||Number.isInteger(p)&&p>=1)&&m!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:d=>i(d.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(m===""?null:p),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(U,{ariaLabel:s.key,value:r,onChange:l=>t(l==="default"?null:l==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function O({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(F,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n})}function V(){const s=L(),t=C(),[a,n]=$(),[r,l]=x.useState({}),i=s.data,m=!i||t.isPending,p=new Map(((i==null?void 0:i.fields)??[]).map(o=>[o.key,o])),c=(o,d)=>{l(h=>{const{[o.key]:v,...u}=h;return u}),t.mutate(M(o.key,d),{onSuccess:()=>n(`${o.key} saved`),onError:h=>l(v=>({...v,[o.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(E,{error:s.error}),s.isLoading?e.jsx(R,{}):null,B.map(o=>{const d=o.order.map(u=>p.get(u)).filter(u=>u!==void 0),h=((i==null?void 0:i.fields)??[]).filter(u=>u.service===o.key&&!o.order.includes(u.key)),v=[...d,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:o.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:o.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(O,{field:u,onSave:T=>c(u,T),saveError:r[u.key],disabled:m},u.key))})})]},o.key)}),e.jsx(z,{message:a})]})}export{V as ToolsGuardrailsPage}; diff --git a/src/gateway/static/dashboard/assets/UsagePage-BAefkQlH.js b/src/gateway/static/dashboard/assets/UsagePage-CtRIjZgb.js similarity index 98% rename from src/gateway/static/dashboard/assets/UsagePage-BAefkQlH.js rename to src/gateway/static/dashboard/assets/UsagePage-CtRIjZgb.js index e5263271a..56e6de883 100644 --- a/src/gateway/static/dashboard/assets/UsagePage-BAefkQlH.js +++ b/src/gateway/static/dashboard/assets/UsagePage-CtRIjZgb.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as Ae,r as i}from"./react-dgEcD0HR.js";import{u as Ue,a as Re,k as te,e as Oe,d as Y,W as T,ak as ke,P as Ke,E as ye,al as je,R as $e,j as se,w as Be,X as q,_ as A,Z as V,a0 as Ie,am as B,f as ze,g as He,h as Ze,b as Ge,c as xe}from"./index-MlRogoGm.js";import{A as We,F as Ye}from"./FilterChips-CxOVvh-O.js";import{u as Qe,r as Ve,B as Je}from"./tableSelection-9hV37uhu.js";import{S as ae,B as Xe}from"./charts-DIsd9m--.js";import{C as et}from"./ConfirmDialog-P_P4TNFr.js";import{D as we}from"./DataTable-Bmn_eYSV.js";import{T as tt,S as st}from"./TablePagination-BHTN5PVb.js";import{B as I,S as pe}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function Q(t){return t.toLocaleString()}function at(t){return t===null?"—":t<1e3?`${Math.round(t)} ms`:`${(t/1e3).toFixed(2)} s`}const fe=ze(je,ke),ne=15,_e="__other__",ve="__unknown__";function Se({title:t,rows:r,totalCost:h,emptyLabel:n,onDrill:v,loading:m}){const[c,x]=i.useState(!1),j=c?r:r.slice(0,ne),U=r.length-j.length,N=o=>o.is_other?_e:o.key??ve,R=[{id:"name",header:t.replace("Spend by ",""),isRowHeader:!0,cell:o=>{const d=h>0?o.cost/h:0;return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate text-[var(--otari-ink)]",children:o.is_other?`Other (${o.requests.toLocaleString()} req)`:o.key===null?"(unknown)":o.key}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,d*100)}%`}})})]})}},{id:"requests",header:"Requests",align:"end",cell:o=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:Q(o.requests)})},{id:"spend",header:"Spend",align:"end",cell:o=>e.jsx("span",{className:"text-[var(--otari-ink)]",children:V(o.cost)})}];return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(we,{ariaLabel:t,columns:R,rows:j,getRowKey:N,isLoading:m,emptyContent:n,onRowAction:o=>{o!==_e&&o!==ve&&v(o)}}),!m&&U>0?e.jsxs(I,{size:"sm",variant:"ghost",onPress:()=>x(!0),children:["Show all ",r.length]}):null,!m&&c&&r.length>ne?e.jsxs(I,{size:"sm",variant:"ghost",onPress:()=>x(!1),children:["Show top ",ne]}):null]})}const nt=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function ot(t,r){return r==="cost"?t.cost:r==="tokens"?t.tokens:t.requests}function be(t,r){return r==="cost"?V(t):r==="tokens"?B(t):Q(t)}function rt(t,r){const h=new Date(t);return Number.isNaN(h.getTime())?t:r==="hour"?h.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):h.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function lt(t,r,h){const n=t.map(m=>({label:rt(m.bucket_start,h),value:ot(m,r)})),v=n.length?Math.max(...n.map(m=>m.value)):0;return{points:n,peak:v,count:t.length}}const it=50;function ct(t){const r=new Date(t).getTime();if(Number.isNaN(r))return t;const h=Math.max(0,Math.round((Date.now()-r)/1e3));if(h<60)return`${h}s ago`;const n=Math.round(h/60);if(n<60)return`${n}m ago`;const v=Math.round(n/60);return v<24?`${v}h ago`:`${Math.round(v/24)}d ago`}function dt({status:t}){return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:t})}const ut=[{id:"time",header:"Time",isRowHeader:!0,cell:t=>e.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(t.timestamp).toLocaleString(),children:ct(t.timestamp)})},{id:"model",header:"Model",cell:t=>e.jsx("span",{className:"text-[var(--otari-ink)]",children:t.model})},{id:"user",header:"User",cell:t=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:t.user_id??"—"})},{id:"tokens",header:"Tokens",align:"end",cell:t=>t.total_tokens===null?"—":t.total_tokens.toLocaleString()},{id:"cost",header:"Cost",align:"end",cell:t=>t.cost===null?"—":V(t.cost)},{id:"status",header:"Status",cell:t=>e.jsx(dt,{status:t.status})}],mt=t=>t.id;function ht({filters:t,anyFilter:r}){var $,H;const[h,n]=i.useState(0),[v,m]=i.useState(it),c=Qe(),x=He(),j=Ze(),[U,N]=i.useState(!1),[R,o]=i.useState(!1),d=JSON.stringify(t),L=i.useRef(d);i.useEffect(()=>{L.current!==d&&(L.current=d,n(0),c.clear())},[d,c]);const p=Ge(t,h,v),C=xe(t),g=p.data??[],P=C.isSuccess&&!C.isPlaceholderData?(($=C.data)==null?void 0:$.total)??0:null,O=g.filter(_=>!_.counts_toward_budget).map(_=>_.id),f=g.filter(_=>_.counts_toward_budget).map(_=>_.id),S=Ve(c.selectedKeys,O),b=S.length,y=c.allMatching||b>0,D=i.useMemo(()=>({...t,counts_toward_budget:!1}),[t]),k=xe(D,y),E=k.isSuccess?((H=k.data)==null?void 0:H.total)??null:null,K=O.length>0&&b===O.length&&E!=null&&E>b,F=c.allMatching?E??b:b,l=()=>c.allMatching?{by_filter:!0,model:t.model,user_id:t.user_id,api_key_id:t.api_key_id,start_date:t.start_date,end_date:t.end_date,priced:t.priced}:{ids:S},a=()=>x.mutate(l(),{onSuccess:()=>{N(!1),c.clear()}}),u=_=>j.mutate({...l(),..._},{onSuccess:()=>{o(!1),c.clear()}});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Individual requests"}),e.jsx(ye,{error:p.error??C.error}),y?e.jsxs(Je,{selectedCount:F,allMatching:c.allMatching,matchingTotal:E,canSelectAllMatching:K,onSelectAllMatching:c.enableAllMatching,onClear:c.clear,children:[e.jsx(I,{size:"sm",variant:"primary",onPress:()=>o(!0),children:"Set price"}),e.jsx(I,{size:"sm",variant:"danger",onPress:()=>N(!0),children:"Delete"})]}):null,e.jsx(we,{ariaLabel:"Individual requests",columns:ut,rows:g,getRowKey:mt,isLoading:p.isLoading,emptyContent:r?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:c.selectedKeys,onSelectionChange:c.onSelectionChange,disabledKeys:f}),e.jsx(tt,{page:h,pageSize:v,total:P,rowsOnPage:g.length,onPageChange:n,onPageSizeChange:_=>{m(_),n(0)},isFetching:p.isFetching,hasNextFallback:g.length===v}),e.jsx(et,{isOpen:U,onOpenChange:N,heading:"Delete usage rows",body:`Delete ${F.toLocaleString()} imported ${F===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:x.isPending,error:x.error,onConfirm:a}),e.jsx(st,{isOpen:R,onOpenChange:o,targetCount:F,isPending:j.isPending,error:j.error,onSubmit:u})]})}function wt(){var ue,me,he,ge;const t=Ae(),r=Ue(),h=Re(),[n,v]=i.useState(fe),[m,c]=i.useState(()=>te(fe.seconds??0)),[x,j]=i.useState(!1),[U,N]=i.useState(),[R,o]=i.useState(),[d,L]=i.useState(""),[p,C]=i.useState(""),[g,z]=i.useState(""),[P,O]=i.useState("cost"),f=x?U:m,S=x?R:void 0,b=x?f?Oe(f,S):"day":n.bucket,y=i.useMemo(()=>({start_date:f,end_date:S,model:d.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0}),[f,S,d,p,g]),D=i.useMemo(()=>{if(x){if(!f||!S)return null;const s=new Date(S).getTime()-new Date(f).getTime();return s>0?{...y,start_date:new Date(new Date(f).getTime()-s).toISOString(),end_date:f}:null}return!m||n.seconds===null?null:{...y,start_date:new Date(new Date(m).getTime()-n.seconds*1e3).toISOString(),end_date:m}},[x,f,S,y,n.seconds,m]),k=Y(y,b),E=Y(D??y,b,D!==null),oe=i.useMemo(()=>({start_date:m,model:d.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0}),[m,d,p,g]),K=Y(oe,n.bucket),F=(((ue=K.data)==null?void 0:ue.series)??[]).map(s=>({bucketStart:s.bucket_start,requests:s.requests})),l=k.data,a=l==null?void 0:l.totals,u=D!==null?(me=E.data)==null?void 0:me.totals:void 0,$=a?T(a.cost,u==null?void 0:u.cost):null,H=i.useMemo(()=>({...y,model:void 0}),[y]),_=Y(H,b),J=((ge=(he=_.data)==null?void 0:he.by_model)==null?void 0:ge.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],re=(r.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),le=(h.data??[]).map(s=>({value:s.id,label:s.key_name??`${s.id.slice(0,8)}…`})),Ne=(d&&!J.includes(d)?[d,...J]:J).map(s=>({value:s,label:s})),Ce=x||n.key!==ke,Z=!!(d.trim()||p||g||Ce),ie=(s,w)=>{var G;return((G=s.find(W=>W.value===w))==null?void 0:G.label)??w},Pe=()=>{L(""),C(""),z("")},Ee=[...p?[{key:"user",label:"User",value:ie(re,p),onClear:()=>C("")}]:[],...d.trim()?[{key:"model",label:"Model",value:d.trim(),onClear:()=>L("")}]:[],...g?[{key:"key",label:"API key",value:ie(le,g),onClear:()=>z("")}]:[]],qe=!!(l&&a&&a.request_count===0&&!Z),Le=(l==null?void 0:l.start_date)??f,De=(l==null?void 0:l.end_date)??S,ce=s=>{j(!1),v(s),c(te(s.seconds??0)),N(void 0),o(void 0)},Fe=(s,w)=>{j(!0),N(s),o(w)},Me=()=>{x||c(te(n.seconds??0)),k.refetch(),K.refetch(),_.refetch(),D!==null&&E.refetch()},de=s=>{const w=new URLSearchParams;f&&w.set("start_date",f),S&&w.set("end_date",S);for(const[G,W]of Object.entries(s))W&&w.set(G,W);t(`/activity?${w.toString()}`)},Te=a&&a.request_count>0?a.error_count/a.request_count:0,M=(l==null?void 0:l.series)??[],X=M.length>1,ee=lt(M,P,b);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Ke,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log."}),e.jsx(ye,{error:k.error}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(We,{presets:je,extentKey:n.key,onPreset:ce,onSelectRange:Fe,onSelectFull:()=>ce(n),series:F,bucket:n.bucket,windowStart:Le,windowEnd:De,loading:K.isLoading,ariaLabel:"Usage request volume over the selected window",action:e.jsx($e,{onRefresh:Me,isFetching:k.isFetching,updatedAt:k.dataUpdatedAt})}),e.jsxs(Ye,{chips:Ee,onClearAll:Pe,children:[e.jsx(se,{label:"User",value:p,onChange:C,options:re,placeholder:"All users"}),e.jsx(se,{label:"Model",value:d,onChange:L,options:Ne,placeholder:"All models"}),e.jsx(se,{label:"API key",value:g,onChange:z,options:le,placeholder:"All keys"})]})]}),qe?e.jsx(Be,{title:"No usage yet",description:"Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[e.jsx(q,{label:"Tracked cost",value:a?V(a.cost):"—",hint:a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[e.jsx(A,{fraction:$}),a.unpriced_requests?`${$!==null?" · ":""}${Q(a.unpriced_requests)} unpriced`:null]}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),e.jsx(q,{label:"Requests",value:a?Q(a.request_count):"—",hint:a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Ie(Te)," errors",u?e.jsxs(e.Fragment,{children:[" · ",e.jsx(A,{fraction:T(a.request_count,u.request_count)})]}):null]}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),e.jsx(q,{label:"Tokens",value:a?B(a.total_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.total_tokens,u==null?void 0:u.total_tokens)}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.tokens),ariaLabel:"Token usage trend over the selected window"}):void 0}),e.jsx(q,{label:"Cache read",value:a?B(a.cache_read_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.cache_read_tokens,u==null?void 0:u.cache_read_tokens)}):null}),e.jsx(q,{label:"Cache write",value:a?B(a.cache_write_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.cache_write_tokens,u==null?void 0:u.cache_write_tokens)}):null}),e.jsx(q,{label:"1h cache write",value:a?B(a.cache_write_1h_tokens??0):"—",hint:a?e.jsx(A,{fraction:T(a.cache_write_1h_tokens??0,(u==null?void 0:u.cache_write_1h_tokens)??0)}):null}),e.jsx(q,{label:"Avg latency",value:a?at(a.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(Se,{title:"Spend by model",rows:(l==null?void 0:l.by_model)??[],totalCost:(a==null?void 0:a.cost)??0,emptyLabel:Z?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>de({model:s,user_id:p||void 0,api_key_id:g||void 0}),loading:k.isLoading}),e.jsx(Se,{title:"Spend by user",rows:(l==null?void 0:l.by_user)??[],totalCost:(a==null?void 0:a.cost)??0,emptyLabel:Z?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>de({user_id:s,model:d.trim()||void 0,api_key_id:g||void 0}),loading:k.isLoading})]}),e.jsx(ht,{filters:y,anyFilter:Z}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[nt.map(s=>e.jsx(I,{size:"sm",variant:P===s.key?"primary":"outline",onPress:()=>O(s.key),children:s.label},s.key)),k.isFetching?e.jsx(pe,{size:"sm"}):null]})]}),k.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(pe,{size:"sm"})}):M.length===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsx(Xe,{data:ee.points,formatValue:s=>be(s,P),ariaLabel:`${P} per ${b}`}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[be(ee.peak,P)," peak · ",ee.count," ",b==="hour"?"hours":"days"," (times in UTC)"]})]})]})]})]})}export{wt as UsagePage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as Ae,r as i}from"./react-dgEcD0HR.js";import{u as Ue,a as Re,k as te,e as Oe,d as Y,W as T,ak as ke,P as Ke,E as ye,al as je,R as $e,j as se,w as Be,X as q,_ as A,Z as V,a0 as Ie,am as B,f as ze,g as He,h as Ze,b as Ge,c as xe}from"./index-BCvb90M0.js";import{A as We,F as Ye}from"./FilterChips-EkMEVflY.js";import{u as Qe,r as Ve,B as Je}from"./tableSelection-9hV37uhu.js";import{S as ae,B as Xe}from"./charts-DIsd9m--.js";import{C as et}from"./ConfirmDialog-BXAKoq6j.js";import{D as we}from"./DataTable-Bmn_eYSV.js";import{T as tt,S as st}from"./TablePagination-DSU6cRH7.js";import{B as I,S as pe}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function Q(t){return t.toLocaleString()}function at(t){return t===null?"—":t<1e3?`${Math.round(t)} ms`:`${(t/1e3).toFixed(2)} s`}const fe=ze(je,ke),ne=15,_e="__other__",ve="__unknown__";function Se({title:t,rows:r,totalCost:h,emptyLabel:n,onDrill:v,loading:m}){const[c,x]=i.useState(!1),j=c?r:r.slice(0,ne),U=r.length-j.length,N=o=>o.is_other?_e:o.key??ve,R=[{id:"name",header:t.replace("Spend by ",""),isRowHeader:!0,cell:o=>{const d=h>0?o.cost/h:0;return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate text-[var(--otari-ink)]",children:o.is_other?`Other (${o.requests.toLocaleString()} req)`:o.key===null?"(unknown)":o.key}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,d*100)}%`}})})]})}},{id:"requests",header:"Requests",align:"end",cell:o=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:Q(o.requests)})},{id:"spend",header:"Spend",align:"end",cell:o=>e.jsx("span",{className:"text-[var(--otari-ink)]",children:V(o.cost)})}];return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(we,{ariaLabel:t,columns:R,rows:j,getRowKey:N,isLoading:m,emptyContent:n,onRowAction:o=>{o!==_e&&o!==ve&&v(o)}}),!m&&U>0?e.jsxs(I,{size:"sm",variant:"ghost",onPress:()=>x(!0),children:["Show all ",r.length]}):null,!m&&c&&r.length>ne?e.jsxs(I,{size:"sm",variant:"ghost",onPress:()=>x(!1),children:["Show top ",ne]}):null]})}const nt=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function ot(t,r){return r==="cost"?t.cost:r==="tokens"?t.tokens:t.requests}function be(t,r){return r==="cost"?V(t):r==="tokens"?B(t):Q(t)}function rt(t,r){const h=new Date(t);return Number.isNaN(h.getTime())?t:r==="hour"?h.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):h.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function lt(t,r,h){const n=t.map(m=>({label:rt(m.bucket_start,h),value:ot(m,r)})),v=n.length?Math.max(...n.map(m=>m.value)):0;return{points:n,peak:v,count:t.length}}const it=50;function ct(t){const r=new Date(t).getTime();if(Number.isNaN(r))return t;const h=Math.max(0,Math.round((Date.now()-r)/1e3));if(h<60)return`${h}s ago`;const n=Math.round(h/60);if(n<60)return`${n}m ago`;const v=Math.round(n/60);return v<24?`${v}h ago`:`${Math.round(v/24)}d ago`}function dt({status:t}){return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:t})}const ut=[{id:"time",header:"Time",isRowHeader:!0,cell:t=>e.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(t.timestamp).toLocaleString(),children:ct(t.timestamp)})},{id:"model",header:"Model",cell:t=>e.jsx("span",{className:"text-[var(--otari-ink)]",children:t.model})},{id:"user",header:"User",cell:t=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:t.user_id??"—"})},{id:"tokens",header:"Tokens",align:"end",cell:t=>t.total_tokens===null?"—":t.total_tokens.toLocaleString()},{id:"cost",header:"Cost",align:"end",cell:t=>t.cost===null?"—":V(t.cost)},{id:"status",header:"Status",cell:t=>e.jsx(dt,{status:t.status})}],mt=t=>t.id;function ht({filters:t,anyFilter:r}){var $,H;const[h,n]=i.useState(0),[v,m]=i.useState(it),c=Qe(),x=He(),j=Ze(),[U,N]=i.useState(!1),[R,o]=i.useState(!1),d=JSON.stringify(t),L=i.useRef(d);i.useEffect(()=>{L.current!==d&&(L.current=d,n(0),c.clear())},[d,c]);const p=Ge(t,h,v),C=xe(t),g=p.data??[],P=C.isSuccess&&!C.isPlaceholderData?(($=C.data)==null?void 0:$.total)??0:null,O=g.filter(_=>!_.counts_toward_budget).map(_=>_.id),f=g.filter(_=>_.counts_toward_budget).map(_=>_.id),S=Ve(c.selectedKeys,O),b=S.length,y=c.allMatching||b>0,D=i.useMemo(()=>({...t,counts_toward_budget:!1}),[t]),k=xe(D,y),E=k.isSuccess?((H=k.data)==null?void 0:H.total)??null:null,K=O.length>0&&b===O.length&&E!=null&&E>b,F=c.allMatching?E??b:b,l=()=>c.allMatching?{by_filter:!0,model:t.model,user_id:t.user_id,api_key_id:t.api_key_id,start_date:t.start_date,end_date:t.end_date,priced:t.priced}:{ids:S},a=()=>x.mutate(l(),{onSuccess:()=>{N(!1),c.clear()}}),u=_=>j.mutate({...l(),..._},{onSuccess:()=>{o(!1),c.clear()}});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Individual requests"}),e.jsx(ye,{error:p.error??C.error}),y?e.jsxs(Je,{selectedCount:F,allMatching:c.allMatching,matchingTotal:E,canSelectAllMatching:K,onSelectAllMatching:c.enableAllMatching,onClear:c.clear,children:[e.jsx(I,{size:"sm",variant:"primary",onPress:()=>o(!0),children:"Set price"}),e.jsx(I,{size:"sm",variant:"danger",onPress:()=>N(!0),children:"Delete"})]}):null,e.jsx(we,{ariaLabel:"Individual requests",columns:ut,rows:g,getRowKey:mt,isLoading:p.isLoading,emptyContent:r?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:c.selectedKeys,onSelectionChange:c.onSelectionChange,disabledKeys:f}),e.jsx(tt,{page:h,pageSize:v,total:P,rowsOnPage:g.length,onPageChange:n,onPageSizeChange:_=>{m(_),n(0)},isFetching:p.isFetching,hasNextFallback:g.length===v}),e.jsx(et,{isOpen:U,onOpenChange:N,heading:"Delete usage rows",body:`Delete ${F.toLocaleString()} imported ${F===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:x.isPending,error:x.error,onConfirm:a}),e.jsx(st,{isOpen:R,onOpenChange:o,targetCount:F,isPending:j.isPending,error:j.error,onSubmit:u})]})}function wt(){var ue,me,he,ge;const t=Ae(),r=Ue(),h=Re(),[n,v]=i.useState(fe),[m,c]=i.useState(()=>te(fe.seconds??0)),[x,j]=i.useState(!1),[U,N]=i.useState(),[R,o]=i.useState(),[d,L]=i.useState(""),[p,C]=i.useState(""),[g,z]=i.useState(""),[P,O]=i.useState("cost"),f=x?U:m,S=x?R:void 0,b=x?f?Oe(f,S):"day":n.bucket,y=i.useMemo(()=>({start_date:f,end_date:S,model:d.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0}),[f,S,d,p,g]),D=i.useMemo(()=>{if(x){if(!f||!S)return null;const s=new Date(S).getTime()-new Date(f).getTime();return s>0?{...y,start_date:new Date(new Date(f).getTime()-s).toISOString(),end_date:f}:null}return!m||n.seconds===null?null:{...y,start_date:new Date(new Date(m).getTime()-n.seconds*1e3).toISOString(),end_date:m}},[x,f,S,y,n.seconds,m]),k=Y(y,b),E=Y(D??y,b,D!==null),oe=i.useMemo(()=>({start_date:m,model:d.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0}),[m,d,p,g]),K=Y(oe,n.bucket),F=(((ue=K.data)==null?void 0:ue.series)??[]).map(s=>({bucketStart:s.bucket_start,requests:s.requests})),l=k.data,a=l==null?void 0:l.totals,u=D!==null?(me=E.data)==null?void 0:me.totals:void 0,$=a?T(a.cost,u==null?void 0:u.cost):null,H=i.useMemo(()=>({...y,model:void 0}),[y]),_=Y(H,b),J=((ge=(he=_.data)==null?void 0:he.by_model)==null?void 0:ge.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],re=(r.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),le=(h.data??[]).map(s=>({value:s.id,label:s.key_name??`${s.id.slice(0,8)}…`})),Ne=(d&&!J.includes(d)?[d,...J]:J).map(s=>({value:s,label:s})),Ce=x||n.key!==ke,Z=!!(d.trim()||p||g||Ce),ie=(s,w)=>{var G;return((G=s.find(W=>W.value===w))==null?void 0:G.label)??w},Pe=()=>{L(""),C(""),z("")},Ee=[...p?[{key:"user",label:"User",value:ie(re,p),onClear:()=>C("")}]:[],...d.trim()?[{key:"model",label:"Model",value:d.trim(),onClear:()=>L("")}]:[],...g?[{key:"key",label:"API key",value:ie(le,g),onClear:()=>z("")}]:[]],qe=!!(l&&a&&a.request_count===0&&!Z),Le=(l==null?void 0:l.start_date)??f,De=(l==null?void 0:l.end_date)??S,ce=s=>{j(!1),v(s),c(te(s.seconds??0)),N(void 0),o(void 0)},Fe=(s,w)=>{j(!0),N(s),o(w)},Me=()=>{x||c(te(n.seconds??0)),k.refetch(),K.refetch(),_.refetch(),D!==null&&E.refetch()},de=s=>{const w=new URLSearchParams;f&&w.set("start_date",f),S&&w.set("end_date",S);for(const[G,W]of Object.entries(s))W&&w.set(G,W);t(`/activity?${w.toString()}`)},Te=a&&a.request_count>0?a.error_count/a.request_count:0,M=(l==null?void 0:l.series)??[],X=M.length>1,ee=lt(M,P,b);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Ke,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log."}),e.jsx(ye,{error:k.error}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(We,{presets:je,extentKey:n.key,onPreset:ce,onSelectRange:Fe,onSelectFull:()=>ce(n),series:F,bucket:n.bucket,windowStart:Le,windowEnd:De,loading:K.isLoading,ariaLabel:"Usage request volume over the selected window",action:e.jsx($e,{onRefresh:Me,isFetching:k.isFetching,updatedAt:k.dataUpdatedAt})}),e.jsxs(Ye,{chips:Ee,onClearAll:Pe,children:[e.jsx(se,{label:"User",value:p,onChange:C,options:re,placeholder:"All users"}),e.jsx(se,{label:"Model",value:d,onChange:L,options:Ne,placeholder:"All models"}),e.jsx(se,{label:"API key",value:g,onChange:z,options:le,placeholder:"All keys"})]})]}),qe?e.jsx(Be,{title:"No usage yet",description:"Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[e.jsx(q,{label:"Tracked cost",value:a?V(a.cost):"—",hint:a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[e.jsx(A,{fraction:$}),a.unpriced_requests?`${$!==null?" · ":""}${Q(a.unpriced_requests)} unpriced`:null]}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),e.jsx(q,{label:"Requests",value:a?Q(a.request_count):"—",hint:a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Ie(Te)," errors",u?e.jsxs(e.Fragment,{children:[" · ",e.jsx(A,{fraction:T(a.request_count,u.request_count)})]}):null]}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),e.jsx(q,{label:"Tokens",value:a?B(a.total_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.total_tokens,u==null?void 0:u.total_tokens)}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.tokens),ariaLabel:"Token usage trend over the selected window"}):void 0}),e.jsx(q,{label:"Cache read",value:a?B(a.cache_read_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.cache_read_tokens,u==null?void 0:u.cache_read_tokens)}):null}),e.jsx(q,{label:"Cache write",value:a?B(a.cache_write_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.cache_write_tokens,u==null?void 0:u.cache_write_tokens)}):null}),e.jsx(q,{label:"1h cache write",value:a?B(a.cache_write_1h_tokens??0):"—",hint:a?e.jsx(A,{fraction:T(a.cache_write_1h_tokens??0,(u==null?void 0:u.cache_write_1h_tokens)??0)}):null}),e.jsx(q,{label:"Avg latency",value:a?at(a.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(Se,{title:"Spend by model",rows:(l==null?void 0:l.by_model)??[],totalCost:(a==null?void 0:a.cost)??0,emptyLabel:Z?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>de({model:s,user_id:p||void 0,api_key_id:g||void 0}),loading:k.isLoading}),e.jsx(Se,{title:"Spend by user",rows:(l==null?void 0:l.by_user)??[],totalCost:(a==null?void 0:a.cost)??0,emptyLabel:Z?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>de({user_id:s,model:d.trim()||void 0,api_key_id:g||void 0}),loading:k.isLoading})]}),e.jsx(ht,{filters:y,anyFilter:Z}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[nt.map(s=>e.jsx(I,{size:"sm",variant:P===s.key?"primary":"outline",onPress:()=>O(s.key),children:s.label},s.key)),k.isFetching?e.jsx(pe,{size:"sm"}):null]})]}),k.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(pe,{size:"sm"})}):M.length===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsx(Xe,{data:ee.points,formatValue:s=>be(s,P),ariaLabel:`${P} per ${b}`}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[be(ee.peak,P)," peak · ",ee.count," ",b==="hour"?"hours":"days"," (times in UTC)"]})]})]})]})]})}export{wt as UsagePage}; diff --git a/src/gateway/static/dashboard/assets/UsersPage-Lrd1SvIH.js b/src/gateway/static/dashboard/assets/UsersPage-T4PK8YrW.js similarity index 98% rename from src/gateway/static/dashboard/assets/UsersPage-Lrd1SvIH.js rename to src/gateway/static/dashboard/assets/UsersPage-T4PK8YrW.js index 4b496db22..f90860577 100644 --- a/src/gateway/static/dashboard/assets/UsersPage-Lrd1SvIH.js +++ b/src/gateway/static/dashboard/assets/UsersPage-T4PK8YrW.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r}from"./react-dgEcD0HR.js";import{u as Q,q as M,v as K,ar as X,P as Y,E as A,w as Z,as as ee,F as se}from"./index-MlRogoGm.js";import{u as te,r as ae,B as ne}from"./tableSelection-9hV37uhu.js";import{C as re}from"./ConfirmDialog-P_P4TNFr.js";import{D as le}from"./DataTable-Bmn_eYSV.js";import{F as B}from"./Field-Dwp6u3t8.js";import{a as ie,M as R}from"./ModelScopeControl-Bmks7cWc.js";import{f as I,B as d,d as S,A as f}from"./heroui-BI50yK5B.js";const de=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return de.format(t)}const oe=t=>t.user_id,D=t=>t.startsWith("apikey-");function H(t){return t.split("-")[0]}function E(t){return t.name??H(t.budget_id)}function $({value:t,onChange:l,budgets:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>l(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),n.map(a=>e.jsxs("option",{value:a.budget_id,children:[E(a),a.max_budget===null?" · no limit":` · ${U(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function ce({onClose:t}){const l=ee(),n=M(),[a,i]=r.useState(""),[o,u]=r.useState(""),[c,g]=r.useState(null),[p,m]=r.useState(null),[b,j]=r.useState(!0),x=()=>{if(l.isPending||!b||a.trim()==="")return;const h={user_id:a.trim(),alias:o.trim()||null,budget_id:c,allowed_models:p};l.mutate(h,{onSuccess:t})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:l.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(B,{label:"User ID",value:a,onChange:i,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(B,{label:"Alias (optional)",value:o,onChange:u,placeholder:"Alice"})]}),e.jsx($,{value:c,onChange:g,budgets:n.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{m(h),j(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:l.isPending||!b||a.trim()==="",onPress:x,children:l.isPending?"Creating…":"Create user"}),e.jsx(d,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ue({user:t,onClose:l}){const n=K(),a=M(),[i,o]=r.useState(t.alias??""),[u,c]=r.useState(t.budget_id),[g,p]=r.useState(t.allowed_models),[m,b]=r.useState(!0),j=()=>{if(n.isPending||!m)return;const x={alias:i.trim()||null,budget_id:u,allowed_models:g};n.mutate({id:t.user_id,body:x},{onSuccess:l})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:n.error}),e.jsx(B,{label:"Alias",value:i,onChange:o,placeholder:"Alice"}),e.jsx($,{value:u,onChange:c,budgets:a.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(x,h)=>{p(x),b(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:n.isPending||!m,onPress:j,children:n.isPending?"Saving…":"Save changes"}),e.jsx(d,{variant:"ghost",onPress:l,children:"Cancel"})]})]})})}function ge({trigger:t,message:l,confirmLabel:n,isPending:a,onConfirm:i}){const[o,u]=r.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:l}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(d,{size:"sm",variant:"danger",isDisabled:a,onPress:i,children:n}),e.jsx(d,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>u(!1),children:"Cancel"})]})]}):e.jsx(d,{size:"sm",variant:"danger-soft",onPress:()=>u(!0),children:t})}function me({user:t}){return t.blocked?e.jsx(I,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(I,{size:"sm",color:"accent",children:"Active"})}function xe({allowed:t}){const{text:l,tone:n}=ie(t),a=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",i=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:i,children:l})}function he({isOpen:t,onOpenChange:l,budgets:n,count:a,isPending:i,error:o,onAssign:u}){const[c,g]=r.useState("");return r.useEffect(()=>{t&&g("")},[t]),e.jsx(f,{isOpen:t,onOpenChange:l,children:t?e.jsx(f.Backdrop,{children:e.jsx(f.Container,{placement:"center",size:"md",children:e.jsxs(f.Dialog,{children:[e.jsx(f.Header,{children:e.jsx(f.Heading,{children:"Assign budget"})}),e.jsxs(f.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Assign a budget to ",a," selected ",a===1?"user":"users","."]}),e.jsx(se,{label:"Budget",value:c,onChange:g,options:[{value:"",label:"Select a budget…"},...n.map(p=>({value:p.budget_id,label:E(p)}))]}),e.jsx(A,{error:o})]}),e.jsxs(f.Footer,{children:[e.jsx(d,{variant:"ghost",isDisabled:i,onPress:()=>l(!1),children:"Cancel"}),e.jsx(d,{variant:"primary",isDisabled:!c,isPending:i,onPress:()=>u(c),children:"Assign"})]})]})})}):null})}function Ae(){const t=Q(),l=M(),n=K(),a=X(),[i,o]=r.useState(!1),[u,c]=r.useState(null),[g,p]=r.useState(!1),m=t.data??[],b=t.isLoading,j=m.filter(s=>D(s.user_id)).length,x=g?m:m.filter(s=>!D(s.user_id)),h=m.find(s=>s.user_id===u)??null,C=!b&&x.length===0&&!i,P=r.useMemo(()=>new Map((l.data??[]).map(s=>[s.budget_id,s])),[l.data]),y=te(),[q,_]=r.useState(!1),[W,N]=r.useState(!1),[F,z]=r.useState(void 0),[T,L]=r.useState(!1),G=x.map(s=>s.user_id),v=ae(y.selectedKeys,G),O=r.useCallback((s,k)=>n.mutate({id:s.user_id,body:{blocked:k}}),[n.mutate]),V=async(s,k)=>{L(!0),z(void 0);try{for(const w of v)await s(w);y.clear(),k()}catch(w){z(w)}finally{L(!1)}},J=r.useMemo(()=>[{id:"user",header:"User",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-medium text-[var(--otari-ink)]",children:s.user_id}),D(s.user_id)?e.jsx(I,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})},{id:"status",header:"Status",cell:s=>e.jsx(me,{user:s})},{id:"budget",header:"Budget",cell:s=>s.budget_id?e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.budget_id,children:P.get(s.budget_id)?E(P.get(s.budget_id)):H(s.budget_id)}):e.jsx("span",{className:"text-[var(--otari-muted)]",children:"—"})},{id:"spend",header:"Spend",cell:s=>e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[U(s.spend),s.reserved>0?e.jsxs("span",{children:[" (+",U(s.reserved)," held)"]}):null]})},{id:"access",header:"Model access",cell:s=>e.jsx(xe,{allowed:s.allowed_models})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(d,{size:"sm",variant:"outline",isDisabled:n.isPending,onPress:()=>O(s,!s.blocked),children:s.blocked?"Unblock":"Block"}),e.jsx(d,{size:"sm",variant:"ghost",onPress:()=>{o(!1),c(s.user_id)},children:"Edit"}),e.jsx(ge,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})}],[P,n.isPending,a.isPending,a.mutate,O]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:i?null:e.jsx(d,{variant:"primary",onPress:()=>{c(null),o(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??n.error??a.error}),C?e.jsx(Z,{title:"No users yet",description:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page.",actionLabel:"Create your first user",onAction:()=>{c(null),o(!0)}}):null,j>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>p(s.target.checked)}),"Show auto-created (virtual) users (",j,")"]}):null,i?e.jsx(ce,{onClose:()=>o(!1)}):null,h?e.jsx(ue,{user:h,onClose:()=>c(null)},h.user_id):null,v.length>0?e.jsxs(ne,{selectedCount:v.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:y.clear,children:[e.jsx(d,{size:"sm",variant:"primary",onPress:()=>N(!0),children:"Assign budget"}),e.jsx(d,{size:"sm",variant:"danger",onPress:()=>_(!0),children:"Delete"})]}):null,C?null:e.jsx(le,{ariaLabel:"Users",columns:J,rows:x,getRowKey:oe,isLoading:b,emptyContent:"No users yet. Create one, or create an API key to auto-create one.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange}),e.jsx(re,{isOpen:q,onOpenChange:_,heading:"Delete users",body:`Delete ${v.length} ${v.length===1?"user":"users"}? This deactivates their API keys and hides them; usage history is preserved.`,confirmLabel:"Delete",isPending:T,error:F,onConfirm:()=>V(s=>a.mutateAsync(s),()=>_(!1))}),e.jsx(he,{isOpen:W,onOpenChange:N,budgets:l.data??[],count:v.length,isPending:T,error:F,onAssign:s=>V(k=>n.mutateAsync({id:k,body:{budget_id:s}}),()=>N(!1))})]})}export{Ae as UsersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r}from"./react-dgEcD0HR.js";import{u as Q,q as M,v as K,ar as X,P as Y,E as A,w as Z,as as ee,F as se}from"./index-BCvb90M0.js";import{u as te,r as ae,B as ne}from"./tableSelection-9hV37uhu.js";import{C as re}from"./ConfirmDialog-BXAKoq6j.js";import{D as le}from"./DataTable-Bmn_eYSV.js";import{F as B}from"./Field-Dwp6u3t8.js";import{a as ie,M as R}from"./ModelScopeControl-CuclfKO5.js";import{f as I,B as d,d as S,A as f}from"./heroui-BI50yK5B.js";const de=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return de.format(t)}const oe=t=>t.user_id,D=t=>t.startsWith("apikey-");function H(t){return t.split("-")[0]}function E(t){return t.name??H(t.budget_id)}function $({value:t,onChange:l,budgets:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>l(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),n.map(a=>e.jsxs("option",{value:a.budget_id,children:[E(a),a.max_budget===null?" · no limit":` · ${U(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function ce({onClose:t}){const l=ee(),n=M(),[a,i]=r.useState(""),[o,u]=r.useState(""),[c,g]=r.useState(null),[p,m]=r.useState(null),[b,j]=r.useState(!0),x=()=>{if(l.isPending||!b||a.trim()==="")return;const h={user_id:a.trim(),alias:o.trim()||null,budget_id:c,allowed_models:p};l.mutate(h,{onSuccess:t})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:l.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(B,{label:"User ID",value:a,onChange:i,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(B,{label:"Alias (optional)",value:o,onChange:u,placeholder:"Alice"})]}),e.jsx($,{value:c,onChange:g,budgets:n.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{m(h),j(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:l.isPending||!b||a.trim()==="",onPress:x,children:l.isPending?"Creating…":"Create user"}),e.jsx(d,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ue({user:t,onClose:l}){const n=K(),a=M(),[i,o]=r.useState(t.alias??""),[u,c]=r.useState(t.budget_id),[g,p]=r.useState(t.allowed_models),[m,b]=r.useState(!0),j=()=>{if(n.isPending||!m)return;const x={alias:i.trim()||null,budget_id:u,allowed_models:g};n.mutate({id:t.user_id,body:x},{onSuccess:l})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:n.error}),e.jsx(B,{label:"Alias",value:i,onChange:o,placeholder:"Alice"}),e.jsx($,{value:u,onChange:c,budgets:a.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(x,h)=>{p(x),b(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:n.isPending||!m,onPress:j,children:n.isPending?"Saving…":"Save changes"}),e.jsx(d,{variant:"ghost",onPress:l,children:"Cancel"})]})]})})}function ge({trigger:t,message:l,confirmLabel:n,isPending:a,onConfirm:i}){const[o,u]=r.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:l}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(d,{size:"sm",variant:"danger",isDisabled:a,onPress:i,children:n}),e.jsx(d,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>u(!1),children:"Cancel"})]})]}):e.jsx(d,{size:"sm",variant:"danger-soft",onPress:()=>u(!0),children:t})}function me({user:t}){return t.blocked?e.jsx(I,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(I,{size:"sm",color:"accent",children:"Active"})}function xe({allowed:t}){const{text:l,tone:n}=ie(t),a=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",i=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:i,children:l})}function he({isOpen:t,onOpenChange:l,budgets:n,count:a,isPending:i,error:o,onAssign:u}){const[c,g]=r.useState("");return r.useEffect(()=>{t&&g("")},[t]),e.jsx(f,{isOpen:t,onOpenChange:l,children:t?e.jsx(f.Backdrop,{children:e.jsx(f.Container,{placement:"center",size:"md",children:e.jsxs(f.Dialog,{children:[e.jsx(f.Header,{children:e.jsx(f.Heading,{children:"Assign budget"})}),e.jsxs(f.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Assign a budget to ",a," selected ",a===1?"user":"users","."]}),e.jsx(se,{label:"Budget",value:c,onChange:g,options:[{value:"",label:"Select a budget…"},...n.map(p=>({value:p.budget_id,label:E(p)}))]}),e.jsx(A,{error:o})]}),e.jsxs(f.Footer,{children:[e.jsx(d,{variant:"ghost",isDisabled:i,onPress:()=>l(!1),children:"Cancel"}),e.jsx(d,{variant:"primary",isDisabled:!c,isPending:i,onPress:()=>u(c),children:"Assign"})]})]})})}):null})}function Ae(){const t=Q(),l=M(),n=K(),a=X(),[i,o]=r.useState(!1),[u,c]=r.useState(null),[g,p]=r.useState(!1),m=t.data??[],b=t.isLoading,j=m.filter(s=>D(s.user_id)).length,x=g?m:m.filter(s=>!D(s.user_id)),h=m.find(s=>s.user_id===u)??null,C=!b&&x.length===0&&!i,P=r.useMemo(()=>new Map((l.data??[]).map(s=>[s.budget_id,s])),[l.data]),y=te(),[q,_]=r.useState(!1),[W,N]=r.useState(!1),[F,z]=r.useState(void 0),[T,L]=r.useState(!1),G=x.map(s=>s.user_id),v=ae(y.selectedKeys,G),O=r.useCallback((s,k)=>n.mutate({id:s.user_id,body:{blocked:k}}),[n.mutate]),V=async(s,k)=>{L(!0),z(void 0);try{for(const w of v)await s(w);y.clear(),k()}catch(w){z(w)}finally{L(!1)}},J=r.useMemo(()=>[{id:"user",header:"User",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-medium text-[var(--otari-ink)]",children:s.user_id}),D(s.user_id)?e.jsx(I,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})},{id:"status",header:"Status",cell:s=>e.jsx(me,{user:s})},{id:"budget",header:"Budget",cell:s=>s.budget_id?e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.budget_id,children:P.get(s.budget_id)?E(P.get(s.budget_id)):H(s.budget_id)}):e.jsx("span",{className:"text-[var(--otari-muted)]",children:"—"})},{id:"spend",header:"Spend",cell:s=>e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[U(s.spend),s.reserved>0?e.jsxs("span",{children:[" (+",U(s.reserved)," held)"]}):null]})},{id:"access",header:"Model access",cell:s=>e.jsx(xe,{allowed:s.allowed_models})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(d,{size:"sm",variant:"outline",isDisabled:n.isPending,onPress:()=>O(s,!s.blocked),children:s.blocked?"Unblock":"Block"}),e.jsx(d,{size:"sm",variant:"ghost",onPress:()=>{o(!1),c(s.user_id)},children:"Edit"}),e.jsx(ge,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})}],[P,n.isPending,a.isPending,a.mutate,O]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:i?null:e.jsx(d,{variant:"primary",onPress:()=>{c(null),o(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??n.error??a.error}),C?e.jsx(Z,{title:"No users yet",description:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page.",actionLabel:"Create your first user",onAction:()=>{c(null),o(!0)}}):null,j>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>p(s.target.checked)}),"Show auto-created (virtual) users (",j,")"]}):null,i?e.jsx(ce,{onClose:()=>o(!1)}):null,h?e.jsx(ue,{user:h,onClose:()=>c(null)},h.user_id):null,v.length>0?e.jsxs(ne,{selectedCount:v.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:y.clear,children:[e.jsx(d,{size:"sm",variant:"primary",onPress:()=>N(!0),children:"Assign budget"}),e.jsx(d,{size:"sm",variant:"danger",onPress:()=>_(!0),children:"Delete"})]}):null,C?null:e.jsx(le,{ariaLabel:"Users",columns:J,rows:x,getRowKey:oe,isLoading:b,emptyContent:"No users yet. Create one, or create an API key to auto-create one.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange}),e.jsx(re,{isOpen:q,onOpenChange:_,heading:"Delete users",body:`Delete ${v.length} ${v.length===1?"user":"users"}? This deactivates their API keys and hides them; usage history is preserved.`,confirmLabel:"Delete",isPending:T,error:F,onConfirm:()=>V(s=>a.mutateAsync(s),()=>_(!1))}),e.jsx(he,{isOpen:W,onOpenChange:N,budgets:l.data??[],count:v.length,isPending:T,error:F,onAssign:s=>V(k=>n.mutateAsync({id:k,body:{budget_id:s}}),()=>N(!1))})]})}export{Ae as UsersPage}; diff --git a/src/gateway/static/dashboard/assets/index-MlRogoGm.js b/src/gateway/static/dashboard/assets/index-BCvb90M0.js similarity index 96% rename from src/gateway/static/dashboard/assets/index-MlRogoGm.js rename to src/gateway/static/dashboard/assets/index-BCvb90M0.js index a0593a392..fd7d18747 100644 --- a/src/gateway/static/dashboard/assets/index-MlRogoGm.js +++ b/src/gateway/static/dashboard/assets/index-BCvb90M0.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-CGtQFYkj.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/FilterChips-CxOVvh-O.js","assets/heroui-BI50yK5B.js","assets/recharts-C4kRDmvS.js","assets/tableSelection-9hV37uhu.js","assets/ConfirmDialog-P_P4TNFr.js","assets/DataTable-Bmn_eYSV.js","assets/TablePagination-BHTN5PVb.js","assets/AliasesPage-BW4Ki1y6.js","assets/Field-Dwp6u3t8.js","assets/UserComboBox-a9wxf8eF.js","assets/BudgetsPage-B98xbp9L.js","assets/DocsPage-CQXolIdY.js","assets/KeysPage-BBEXGo7q.js","assets/ModelScopeControl-Bmks7cWc.js","assets/ModelsPage-XwbqKUgz.js","assets/OverviewPage-XfWqfHJ2.js","assets/charts-DIsd9m--.js","assets/ProvidersPage-HN_Zodtk.js","assets/SettingsPage-Csgj1pAU.js","assets/ToolsGuardrailsPage-DPdRTl_b.js","assets/UsagePage-BAefkQlH.js","assets/UsersPage-Lrd1SvIH.js"])))=>i.map(i=>d[i]); -var Ie=Object.defineProperty;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>qe(e,typeof t!="symbol"?t+"":t,r);import{u as g,j as n,a as p,b as x,k as ne,Q as Re,c as Oe}from"./tanstack-query-1t81HyiD.js";import{d as Me,r as o,N as Z,L as Fe,O as Ue,H as Ke,e as Be,f as j,h as $e}from"./react-dgEcD0HR.js";import{B as C,C as U,L as xe,I as ye,a as ze,b as Qe,d as I,S as Ve,c as T,T as We,e as He}from"./heroui-BI50yK5B.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ge=Me();const Je="modulepreload",Ye=function(e){return"/"+e},ue={},P=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let u=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(r.map(y=>{if(y=Ye(y),y in ue)return;ue[y]=!0;const h=y.endsWith(".css"),b=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Je,h||(m.as="script"),m.crossOrigin="",m.href=y,f&&m.setAttribute("nonce",f),document.head.appendChild(m),h)return new Promise((N,M)=>{m.addEventListener("load",N),m.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};class L extends Error{constructor(r,s){super(s);ce(this,"status");this.name="ApiError",this.status=r}}let K=null;function de(e){K=e}async function ee(e){try{const t=await e.json();if(typeof t.detail=="string")return t.detail;if(t.detail!=null)return JSON.stringify(t.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Xe(e){let t;try{t=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(t.status===401||t.status===403)return!1;if(!t.ok)throw new L(t.status,await ee(t));return!0}async function Ze(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function c(e,t={}){const r=new Headers(t.headers);r.set("Accept","application/json"),t.body!=null&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let s;try{s=await fetch(e,{...t,headers:r})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(s.status===401||s.status===403)throw K==null||K(),new L(s.status,await ee(s));if(!s.ok)throw new L(s.status,await ee(s));if(s.status!==204)return await s.json()}const te="otari.dashboard.hasSession",ve=o.createContext(null);function et(){try{return window.localStorage.getItem(te)==="1"}catch{return!1}}function tt({children:e}){const t=g(),[r,s]=o.useState(et),a=o.useCallback(()=>{Ze(),s(!1),t.clear();try{window.localStorage.removeItem(te)}catch{}},[t]),i=o.useCallback(()=>{t.clear(),s(!0);try{window.localStorage.setItem(te,"1")}catch{}},[t]);o.useEffect(()=>(de(a),()=>de(null)),[a]);const u=o.useMemo(()=>({isAuthenticated:r,login:i,logout:a}),[r,i,a]);return n.jsx(ve.Provider,{value:u,children:e})}function re(){const e=o.useContext(ve);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function nt(e){return e instanceof L&&e.status===0}function rt(){const e=g(),[t,r]=o.useState(!1);return o.useEffect(()=>{const s=e.getQueryCache(),a=()=>s.getAll().some(i=>i.state.status==="error"&&nt(i.state.error));return r(a()),s.subscribe(()=>r(a()))},[e]),t}function st(){return rt()?n.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const $=3600,_=86400,at=365*_,dn=[{key:"1h",label:"Last hour",seconds:$,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"90d",label:"90d",seconds:90*_,bucket:"day"},{key:"12mo",label:"12mo",seconds:at,bucket:"day"}],mn="30d",fn=[{key:"1h",label:"1h",seconds:$,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"all",label:"All",seconds:null,bucket:"day"}],hn="24h",xn="custom";function yn(e,t){return e.find(r=>r.key===t)}function it(e,t=Date.now()){return new Date(t-e*1e3).toISOString()}function ot(e){return(e==="hour"?$:_)*1e3}function vn(e,t,r=Date.now()){const s=new Date(e).getTime();return(t?new Date(t).getTime():r)-s<=_*1e3?"hour":"day"}function gn(e,t,r,s){if(e.length===0)return null;const a=Math.max(0,Math.min(t,r)),i=Math.min(e.length-1,Math.max(t,r)),u=new Date(e[a]).getTime(),d=new Date(e[i]).getTime()+ot(s);return{startIso:new Date(u).toISOString(),endIso:new Date(d).toISOString()}}function pn(e,t,r){const s=e.length;if(s===0)return{startIndex:0,endIndex:0};const a=e.map(d=>new Date(d).getTime());let i=0;if(t){const d=new Date(t).getTime();for(let f=0;fc("/v1/models"),staleTime:6e4})}function dt(){return p({queryKey:[ct],queryFn:()=>c("/dashboard-build.json"),refetchInterval:ut,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function jn(){return p({queryKey:[ae],queryFn:()=>c("/v1/models/discoverable"),staleTime:5*6e4})}function Sn(){return p({queryKey:[ie],queryFn:()=>c("/v1/providers"),staleTime:5*6e4})}function kn(){return p({queryKey:["provider-catalog"],queryFn:()=>c("/v1/providers/catalog"),staleTime:1/0})}function En(e){return p({queryKey:["provider-catalog",e],queryFn:()=>c(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Pn(){return p({queryKey:[oe],queryFn:()=>c("/v1/providers/health"),staleTime:me,refetchInterval:me})}function Nn(){const e=g();return x({mutationFn:()=>c("/v1/providers/health?refresh=true"),onSuccess:t=>e.setQueryData([oe],t)})}function Cn(){return p({queryKey:[be],queryFn:()=>c("/v1/provider-credentials"),staleTime:6e4})}function Q(e){e.invalidateQueries({queryKey:[be]}),e.invalidateQueries({queryKey:[ie]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]}),e.invalidateQueries({queryKey:[oe]})}function Tn(){const e=g();return x({mutationFn:t=>c("/v1/provider-credentials",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>Q(e)})}function _n(){const e=g();return x({mutationFn:({instance:t,body:r})=>c(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>Q(e)})}function Ln(){const e=g();return x({mutationFn:t=>c(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>Q(e)})}function Dn(){const e=g();return x({mutationFn:()=>c("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>Q(e)})}function An(){return x({mutationFn:e=>c(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function In(){return x({mutationFn:e=>c("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function qn(){return p({queryKey:[lt],queryFn:()=>c("/v1/models/metadata"),staleTime:10*6e4})}function Rn(){return p({queryKey:[se],queryFn:()=>c("/v1/aliases"),staleTime:6e4})}function On(){const e=g();return x({mutationFn:t=>c("/v1/aliases",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function Mn(){const e=g();return x({mutationFn:({name:t,userId:r})=>{const s=r==null?"":`?user_id=${encodeURIComponent(r)}`;return c(`/v1/aliases/${encodeURIComponent(t)}${s}`,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function mt(){return p({queryKey:[ge],queryFn:()=>c("/v1/settings"),staleTime:6e4})}function ft(){const e=g();return x({mutationFn:t=>c("/v1/settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([ge],t),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]})}})}function Fn(){return x({mutationFn:()=>c("/v1/settings/master-key/rotate",{method:"POST"})})}function Un(){return p({queryKey:[pe],queryFn:()=>c("/v1/tool-settings"),staleTime:6e4})}function Kn(){const e=g();return x({mutationFn:t=>c("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([pe],t)}})}function Bn(){return x({mutationFn:({service:e,url:t})=>c(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:t})})})}const H=1e3,ht=100;async function xt(){const e=[];for(let t=0;tc("/v1/pricing",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]})}})}function Qn(){const e=g();return x({mutationFn:t=>c(`/v1/pricing/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]})}})}function Vn(){return x({mutationFn:()=>c("/v1/pricing/refresh",{method:"POST"})})}function Wn(){const e=g();return x({mutationFn:()=>c("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ie]})}})}function Hn(){return x({mutationFn:()=>c("/v1/pricing/refresh/reject",{method:"POST"})})}const G=1e3,yt=100;async function vt(){const e=[];for(let t=0;tc("/v1/keys",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Yn(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/keys/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Xn(){const e=g();return x({mutationFn:t=>c(`/v1/keys/${encodeURIComponent(t)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Zn(){const e=g();return x({mutationFn:t=>c(`/v1/keys/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}const J=1e3,gt=100;async function pt(){const e=[];for(let t=0;tc(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function nr(){const e=g();return x({mutationFn:t=>c("/v1/budgets",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function rr(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/budgets/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function sr(){const e=g();return x({mutationFn:t=>c(`/v1/budgets/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}const Y=1e3,bt=100;async function wt(){const e=[];for(let t=0;tc("/v1/users",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>le(e)})}function or(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/users/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>le(e)})}function lr(){const e=g();return x({mutationFn:t=>c(`/v1/users/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{le(e),e.invalidateQueries({queryKey:[q]})}})}function V(e){const t=new URLSearchParams;return e.start_date&&t.set("start_date",e.start_date),e.end_date&&t.set("end_date",e.end_date),e.status&&t.set("status",e.status),e.model&&t.set("model",e.model),e.endpoint&&t.set("endpoint",e.endpoint),e.user_id&&t.set("user_id",e.user_id),e.api_key_id&&t.set("api_key_id",e.api_key_id),e.source&&t.set("source",e.source),e.priced!==void 0&&t.set("priced",String(e.priced)),e.counts_toward_budget!==void 0&&t.set("counts_toward_budget",String(e.counts_toward_budget)),t}function cr(e,t,r){return p({queryKey:[O,"list",e,t,r],queryFn:()=>{const s=V(e);return s.set("skip",String(t*r)),s.set("limit",String(r)),c(`/v1/usage?${s.toString()}`)},placeholderData:ne,staleTime:1e4})}function ur(e,t=!0){return p({queryKey:[O,"count",e],queryFn:()=>c(`/v1/usage/count?${V(e).toString()}`),enabled:t,placeholderData:ne,staleTime:1e4})}const jt=6e4;function St(e,t=!0){return p({queryKey:[O,"count","failures",e],queryFn:()=>{const r={status:"error",source:"gateway",start_date:it(e)};return c(`/v1/usage/count?${V(r).toString()}`)},enabled:t,refetchInterval:jt,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function dr(){const e=g();return x({mutationFn:t=>c("/v1/usage",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]})}})}function mr(){const e=g();return x({mutationFn:t=>c("/v1/usage/set-price",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]})}})}function fr(e,t,r=!0){return p({queryKey:[O,"summary",e,t],queryFn:()=>{const s=V(e);return s.set("bucket",t),c(`/v1/usage/summary?${s.toString()}`)},enabled:r,placeholderData:ne,staleTime:3e4})}function hr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function xr(e){if(e==null)return"$0.00";const t=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}function yr(e){if(e==null)return"—";if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){const t=Math.round(e/1e3);return t>=1e3?"1M":`${t}K`}return String(e)}const kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function vr(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})/.exec(e);if(!t)return e;const r=Number(t[2])-1;return r<0||r>11?t[1]:`${kt[r]} ${t[1]}`}const Et=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function gr(e){return Et.format(e)}function pr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Pt(e){return`${(e*100).toFixed(1)}%`}function br(e,t){return t===void 0||t===0?null:(e-t)/t}function Nt(e,t=Date.now()){if(!e)return"never";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const s=Math.round((t-r.getTime())/1e3),a=s<0,i=Math.abs(s),u=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let d=i,f="second";for(const[h,b]of u){if(f=h,d0?"▲":e<0?"▼":"•";return n.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t," ",Pt(Math.abs(e))," vs prev"]})}function Ct(e){return e instanceof L||e instanceof Error?e.message:"Something went wrong."}function Tt({error:e}){return e?n.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:Ct(e)}):null}function _t({tone:e="info",children:t}){const r=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return n.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${r}`,children:t})}function Sr({title:e,description:t,action:r}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),r?n.jsx("div",{className:"flex flex-wrap gap-2",children:r}):null]})}function Lt(e){const[t,r]=o.useState(()=>Date.now());return o.useEffect(()=>{let s;const a=()=>{s===void 0&&(s=setInterval(()=>r(Date.now()),e))},i=()=>{s!==void 0&&(clearInterval(s),s=void 0)},u=()=>{r(Date.now()),document.visibilityState==="visible"?a():i()};return u(),document.addEventListener("visibilitychange",u),()=>{i(),document.removeEventListener("visibilitychange",u)}},[e]),t}function kr({onRefresh:e,isFetching:t=!1,updatedAt:r,label:s="Refresh"}){const a=Lt(15e3),i=r?Nt(new Date(r).toISOString(),a):null;return n.jsxs("span",{className:"inline-flex items-center gap-2",children:[i?n.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Updated ",i]}):null,n.jsx(C,{variant:"outline",size:"sm",isIconOnly:!0,isDisabled:t,onPress:e,"aria-label":s,children:n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`h-4 w-4 ${t?"animate-spin":""}`,"aria-hidden":"true",children:[n.jsx("path",{d:"M20 11a8 8 0 1 0-.5 4",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M20 4v5h-5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function Er({title:e,description:t,actionLabel:r,onAction:s,isActionDisabled:a,children:i}){return n.jsx(I,{children:n.jsxs(I.Content,{className:"flex flex-col gap-4 p-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),i,r&&s?n.jsx("div",{children:n.jsx(C,{variant:"primary",isDisabled:a,onPress:s,children:r})}):null]})})}function Pr({label:e="Loading…"}){return n.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 px-4 py-10 text-sm text-[var(--otari-muted)]",children:[n.jsx(Ve,{size:"sm"}),n.jsx("span",{children:e})]})}function Nr({children:e,confirmLabel:t,onConfirm:r,isPending:s}){const[a,i]=o.useState(!1);return a?n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(C,{size:"sm",variant:"danger",isDisabled:s,onPress:r,children:t}),n.jsx(C,{size:"sm",variant:"ghost",isDisabled:s,onPress:()=>i(!1),children:"Cancel"})]}):n.jsx(C,{size:"sm",variant:"danger-soft",onPress:()=>i(!0),children:e})}const Dt="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Cr({id:e,label:t,ariaLabel:r,value:s,onChange:a,options:i,children:u,disabled:d}){const f=o.useId(),y=e??(t?f:void 0),h=n.jsx("select",{id:y,"aria-label":t?void 0:r,value:s,disabled:d,onChange:b=>a(b.target.value),className:Dt,children:i?i.map(b=>n.jsx("option",{value:b.value,children:b.label},b.value)):u});return t?n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),h]}):h}function Tr({label:e,value:t,onChange:r,options:s,placeholder:a,maxVisible:i=50,allowsCustom:u=!1}){const d=m=>{var N;return((N=s.find(M=>M.value===m))==null?void 0:N.label)??m},[f,y]=o.useState(()=>d(t));o.useEffect(()=>{y(d(t))},[t]);const h=f.trim().toLowerCase(),b=s.filter(m=>!h||m.value.toLowerCase().includes(h)||m.label.toLowerCase().includes(h)).slice(0,i);return n.jsxs(U.Root,{allowsEmptyCollection:!0,allowsCustomValue:u,menuTrigger:"focus",inputValue:f,onInputChange:m=>{y(m),u?r(m.trim()):m.trim()===""&&r("")},onSelectionChange:m=>{m!=null&&r(String(m))},className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),n.jsxs(U.InputGroup,{children:[n.jsx(ye,{placeholder:a,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),n.jsx(U.Trigger,{})]}),n.jsx(U.Popover,{children:n.jsx(ze,{items:b,className:"max-h-72 overflow-auto",children:m=>n.jsx(Qe,{id:m.value,textValue:m.label,children:m.label})})})]})}function At(){var f,y;const e=mt(),t=ft(),[r,s]=o.useState(!1),i=((f=e.data)==null?void 0:f.require_pricing)===!0&&e.data.default_pricing===!1&&!r,d=((y=St($,i).data)==null?void 0:y.total)??0;return i?n.jsx("div",{className:"shrink-0 px-6 pt-3",children:n.jsx(_t,{tone:"warning",children:n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("span",{children:["Requests are rejected until pricing is set (",n.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away.",d>0?n.jsxs(n.Fragment,{children:[" ",n.jsxs("strong",{className:"font-semibold",children:[d.toLocaleString()," ",d===1?"request":"requests"," failed in the last hour."]})," ",n.jsx(Fe,{to:"/activity?status=error&range=1h&source=gateway",className:"underline underline-offset-2",children:"View failed requests"})]}):null]}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(C,{size:"sm",variant:"primary",isDisabled:t.isPending,onPress:()=>t.mutate({default_pricing:!0}),children:t.isPending?"Enabling…":"Enable default pricing"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Dismiss"})]})]})})}):null}function It(){const{data:e}=dt(),t=o.useRef(null);return e&&t.current===null&&(t.current=e.build),e!=null&&t.current!=null&&e.build!==t.current}function qt(){const e=It(),[t,r]=o.useState(!1);return!e||t?null:n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:n.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),n.jsx(C,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>r(!0),children:"Later"})]})})}const je=200,Se=480,X=240,Rt=60,ke="otari.dashboard.sidebarWidth",Ee="otari.dashboard.sidebarCollapsed",he=16,Pe="(max-width: 767px)",B=e=>Math.min(Se,Math.max(je,e));function Ot(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(Pe).matches}const Mt='a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ft(e){return e?Array.from(e.querySelectorAll(Mt)).filter(t=>t.offsetParent!==null||t===document.activeElement):[]}function Ut(){if(typeof window>"u")return X;try{const e=window.localStorage.getItem(ke),t=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(t)?X:B(t)}catch{return X}}function Kt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ee)==="1"}catch{return!1}}const Bt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],$t=[{to:"/",section:"home",label:"Overview",end:!0,icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),n.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),n.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),n.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),n.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function zt(){const{logout:e}=re(),t=o.useRef(null),r=o.useRef(null),s=o.useRef(null),[a,i]=o.useState(Ut),[u,d]=o.useState(Kt),[f,y]=o.useState(!1),[h,b]=o.useState(Ot),[m,N]=o.useState(!1);o.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const l=window.matchMedia(Pe),v=w=>{b(w.matches),w.matches||N(!1)};return typeof l.addEventListener=="function"?(l.addEventListener("change",v),()=>l.removeEventListener("change",v)):(l.addListener(v),()=>l.removeListener(v))},[]),o.useEffect(()=>{if(!m)return;const l=v=>{v.key==="Escape"&&N(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[m]),o.useEffect(()=>{var l,v,w;h&&(m?(l=t.current)==null||l.focus():(v=t.current)!=null&&v.contains(document.activeElement)&&((w=s.current)==null||w.focus()))},[h,m]);const M=o.useCallback(l=>{if(l.key!=="Tab")return;const v=Ft(t.current);if(v.length===0)return;const w=v[0],k=v[v.length-1],F=document.activeElement;l.shiftKey&&(F===w||F===t.current)?(l.preventDefault(),k.focus()):!l.shiftKey&&F===k&&(l.preventDefault(),w.focus())},[]);o.useEffect(()=>{const l=window.setTimeout(()=>{try{window.localStorage.setItem(ke,String(Math.round(a)))}catch{}},200);return()=>window.clearTimeout(l)},[a]),o.useEffect(()=>{try{window.localStorage.setItem(Ee,u?"1":"0")}catch{}},[u]);const Ce=o.useCallback(l=>{l.preventDefault(),l.currentTarget.setPointerCapture(l.pointerId),y(!0)},[]),Te=o.useCallback(l=>{var w;if(!l.currentTarget.hasPointerCapture(l.pointerId))return;const v=((w=t.current)==null?void 0:w.getBoundingClientRect().left)??0;i(B(l.clientX-v))},[]),_e=o.useCallback(l=>{l.currentTarget.hasPointerCapture(l.pointerId)&&l.currentTarget.releasePointerCapture(l.pointerId),y(!1)},[]),Le=o.useCallback(l=>{var v;l.preventDefault(),(v=r.current)==null||v.focus()},[]),De=o.useCallback(l=>{l.key==="ArrowLeft"?(l.preventDefault(),i(v=>B(v-he))):l.key==="ArrowRight"&&(l.preventDefault(),i(v=>B(v+he)))},[]),Ae=u?Rt:a,S=h?!1:u,W=h&&m?!0:void 0;return n.jsxs("div",{className:T("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[n.jsx("button",{type:"button",inert:W,onClick:Le,className:"sr-only focus:not-sr-only focus:absolute focus:top-3 focus:left-3 focus:z-50 focus:rounded-lg focus:border focus:border-[var(--otari-brand)] focus:bg-[var(--otari-surface)] focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-[var(--otari-brand-dark)] focus:shadow-md focus:outline-none",children:"Skip to main content"}),n.jsxs("header",{inert:W,className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("button",{type:"button",ref:s,onClick:()=>N(l=>!l),"aria-label":m?"Close navigation":"Open navigation","aria-expanded":m,"aria-controls":"app-sidebar",className:"-ml-1 flex h-8 w-8 items-center justify-center rounded-lg text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)] md:hidden",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5",children:n.jsx("path",{d:"M4 6h16M4 12h16M4 18h16",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),n.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),n.jsx(C,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),n.jsx(qt,{}),n.jsx(st,{}),n.jsx(At,{}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[h&&m?n.jsx("div",{"aria-hidden":"true",onClick:()=>N(!1),className:"fixed inset-0 z-30 bg-black/40 md:hidden"}):null,n.jsxs("aside",{ref:t,id:"app-sidebar",role:h?"dialog":void 0,"aria-modal":h&&m?!0:void 0,"aria-label":h?"Navigation":void 0,tabIndex:h?-1:void 0,inert:h&&!m?!0:void 0,onKeyDown:h&&m?M:void 0,style:h?void 0:{width:Ae},className:T("flex flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)] focus:outline-none",h?T("fixed inset-y-0 left-0 z-40 w-[17rem] shadow-xl transition-transform duration-200",m?"translate-x-0":"-translate-x-full"):T("relative shrink-0",!f&&"transition-[width] duration-150")),children:[n.jsx("button",{type:"button",onClick:()=>d(l=>!l),"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-pressed":u,title:u?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 hidden h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)] md:flex",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:T("h-3.5 w-3.5 transition-transform",u&&"rotate-180"),children:n.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("nav",{className:T("flex flex-col py-4",S?"px-2":"px-3"),children:Bt.map((l,v)=>{const w=$t.filter(k=>k.section===l.key);return w.length===0?null:n.jsxs("div",{className:v>0?"mt-4":void 0,children:[!S&&l.label?n.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:l.label}):null,v>0&&(S||!l.label)?n.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,n.jsx("div",{className:"flex flex-col gap-1",children:w.map(k=>n.jsxs(Z,{to:k.to,end:k.end,onClick:()=>N(!1),"aria-label":S?k.label:void 0,title:S?k.label:void 0,className:({isActive:F})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"justify-center px-0":"gap-3 px-3",F?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,S?null:k.label]},k.to))})]},l.key)})}),n.jsxs("div",{className:"mt-auto flex flex-col gap-1 pb-3",children:[n.jsxs(Z,{to:"/docs",onClick:()=>N(!1),"aria-label":S?"User guide":void 0,title:S?"User guide":void 0,className:({isActive:l})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"mx-2 justify-center px-0":"mx-3 gap-3 px-3",l?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[n.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.5V18c4 0 6.5.5 8 2 1.5-1.5 4-2 8-2V4.5c-4 0-6.5.5-8 2z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 6.5V20",strokeLinecap:"round"})]}),S?null:"User guide"]}),n.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai: the hosted Otari gateway",className:T("flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",S?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),S?null:n.jsxs("span",{className:"flex-1",children:["otari.ai ",n.jsx("span",{"aria-hidden":!0,children:"↗"})]})]})]}),u||h?null:n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(a),"aria-valuemin":je,"aria-valuemax":Se,tabIndex:0,onPointerDown:Ce,onPointerMove:Te,onPointerUp:_e,onKeyDown:De,className:T("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),n.jsx("main",{ref:r,id:"main-content",tabIndex:-1,inert:W,className:"flex-1 overflow-y-auto focus:outline-none",children:n.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-4 py-5 md:px-6 md:py-6",children:n.jsx(Ue,{})})})]})]})}function Qt(){const{login:e}=re(),[t,r]=o.useState(""),[s,a]=o.useState(null),[i,u]=o.useState(!1),d=async()=>{const f=t.trim();if(!(!f||i)){u(!0),a(null);try{await Xe(f)?e():a(new Error("Invalid master key."))}catch(y){a(y)}finally{u(!1)}}};return n.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:n.jsx(I,{className:"w-full max-w-md",children:n.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),n.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),d()},children:[n.jsxs(We,{value:t,onChange:f=>{r(f),s&&a(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),n.jsx(ye,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),n.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[n.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),n.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",n.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",n.jsx("code",{children:"Your master key:"})," (for example, run"," ",n.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),n.jsx(Tt,{error:s}),n.jsx(C,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!t.trim()||i,children:i?"Signing in…":"Sign in"})]}),n.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),n.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:n.jsx(He,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const Vt=o.lazy(async()=>({default:(await P(async()=>{const{ActivityPage:e}=await import("./ActivityPage-CGtQFYkj.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))).ActivityPage})),Wt=o.lazy(async()=>({default:(await P(async()=>{const{AliasesPage:e}=await import("./AliasesPage-BW4Ki1y6.js");return{AliasesPage:e}},__vite__mapDeps([10,1,2,6,4,7,8,11,12]))).AliasesPage})),Ht=o.lazy(async()=>({default:(await P(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-B98xbp9L.js");return{BudgetsPage:e}},__vite__mapDeps([13,1,2,6,4,7,8,11]))).BudgetsPage})),Gt=o.lazy(async()=>({default:(await P(async()=>{const{DocsPage:e}=await import("./DocsPage-CQXolIdY.js");return{DocsPage:e}},__vite__mapDeps([14,1,2,4]))).DocsPage})),Jt=o.lazy(async()=>({default:(await P(async()=>{const{KeysPage:e}=await import("./KeysPage-BBEXGo7q.js");return{KeysPage:e}},__vite__mapDeps([15,1,2,6,4,7,8,11,16,12]))).KeysPage})),Yt=o.lazy(async()=>({default:(await P(async()=>{const{ModelsPage:e}=await import("./ModelsPage-XwbqKUgz.js");return{ModelsPage:e}},__vite__mapDeps([17,1,2,6,4,8,9]))).ModelsPage})),Xt=o.lazy(async()=>({default:(await P(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-XfWqfHJ2.js");return{OverviewIndex:e}},__vite__mapDeps([18,1,2,19,5,4,8]))).OverviewIndex})),Zt=o.lazy(async()=>({default:(await P(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-HN_Zodtk.js");return{ProvidersPage:e}},__vite__mapDeps([20,1,2,11,4,8]))).ProvidersPage})),en=o.lazy(async()=>({default:(await P(async()=>{const{SettingsPage:e}=await import("./SettingsPage-Csgj1pAU.js");return{SettingsPage:e}},__vite__mapDeps([21,1,2,4]))).SettingsPage})),tn=o.lazy(async()=>({default:(await P(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-DPdRTl_b.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([22,1,2,4]))).ToolsGuardrailsPage})),nn=o.lazy(async()=>({default:(await P(async()=>{const{UsagePage:e}=await import("./UsagePage-BAefkQlH.js");return{UsagePage:e}},__vite__mapDeps([23,1,2,3,4,5,6,19,7,8,9]))).UsagePage})),rn=o.lazy(async()=>({default:(await P(async()=>{const{UsersPage:e}=await import("./UsersPage-Lrd1SvIH.js");return{UsersPage:e}},__vite__mapDeps([24,1,2,6,4,7,8,11,16]))).UsersPage}));function E(e){return n.jsx(o.Suspense,{fallback:n.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function sn(){const{isAuthenticated:e}=re();return e?n.jsx(Ke,{children:n.jsx(Be,{children:n.jsxs(j,{element:n.jsx(zt,{}),children:[n.jsx(j,{index:!0,element:E(n.jsx(Xt,{}))}),n.jsx(j,{path:"providers",element:E(n.jsx(Zt,{}))}),n.jsx(j,{path:"keys",element:E(n.jsx(Jt,{}))}),n.jsx(j,{path:"users",element:E(n.jsx(rn,{}))}),n.jsx(j,{path:"budgets",element:E(n.jsx(Ht,{}))}),n.jsx(j,{path:"activity",element:E(n.jsx(Vt,{}))}),n.jsx(j,{path:"usage",element:E(n.jsx(nn,{}))}),n.jsx(j,{path:"models",element:E(n.jsx(Yt,{}))}),n.jsx(j,{path:"aliases",element:E(n.jsx(Wt,{}))}),n.jsx(j,{path:"tools",element:E(n.jsx(tn,{}))}),n.jsx(j,{path:"settings",element:E(n.jsx(en,{}))}),n.jsx(j,{path:"docs",element:E(n.jsx(Gt,{}))}),n.jsx(j,{path:"*",element:n.jsx($e,{to:"/",replace:!0})})]})})}):n.jsx(Qt,{})}function an({children:e}){const[t]=o.useState(()=>new Re({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(r,s)=>s instanceof L&&(s.status===401||s.status===403)?!1:r<2}}}));return n.jsx(Oe,{client:t,children:n.jsx(tt,{children:e})})}const Ne=document.getElementById("root");if(!Ne)throw new Error("Root element #root not found");Ge.createRoot(Ne).render(n.jsx(o.StrictMode,{children:n.jsx(an,{children:n.jsx(sn,{})})}));export{hr as $,hn as A,Zn as B,xn as C,Jn as D,Tt as E,Cr as F,wn as G,$n as H,_t as I,qn as J,zn as K,yr as L,Qn as M,Ct as N,vr as O,Sr as P,mt as Q,kr as R,xr as S,Sn as T,Pr as U,Pn as V,br as W,wr as X,at as Y,gr as Z,jr as _,Gn as a,Pt as a0,Nt as a1,Cn as a2,Ln as a3,An as a4,ft as a5,_n as a6,Nn as a7,Tn as a8,En as a9,kn as aa,In as ab,Vn as ac,Wn as ad,Hn as ae,Fn as af,Dn as ag,Un as ah,Kn as ai,Bn as aj,mn as ak,dn as al,pr as am,bn as an,ot as ao,pn as ap,gn as aq,lr as ar,ir as as,cr as b,ur as c,fr as d,vn as e,yn as f,dr as g,mr as h,fn as i,Tr as j,it as k,jn as l,Rn as m,Mn as n,Nr as o,On as p,er as q,nr as r,rr as s,sr as t,ar as u,or as v,Er as w,tr as x,Yn as y,Xn as z}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-Dd5_lVjd.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/FilterChips-EkMEVflY.js","assets/heroui-BI50yK5B.js","assets/recharts-C4kRDmvS.js","assets/tableSelection-9hV37uhu.js","assets/ConfirmDialog-BXAKoq6j.js","assets/DataTable-Bmn_eYSV.js","assets/TablePagination-DSU6cRH7.js","assets/AliasesPage-BXueJgS_.js","assets/Field-Dwp6u3t8.js","assets/UserComboBox-a9wxf8eF.js","assets/BudgetsPage-BQktAQRZ.js","assets/DocsPage-xJDqWRaA.js","assets/KeysPage-DVB0fG8n.js","assets/ModelScopeControl-CuclfKO5.js","assets/ModelsPage-D-sOtTsj.js","assets/OverviewPage-BluitD8r.js","assets/charts-DIsd9m--.js","assets/ProvidersPage-Bf-7xbup.js","assets/SettingsPage-OsrEeYZu.js","assets/ToolsGuardrailsPage-CSxGfHtw.js","assets/UsagePage-CtRIjZgb.js","assets/UsersPage-T4PK8YrW.js"])))=>i.map(i=>d[i]); +var Ie=Object.defineProperty;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>qe(e,typeof t!="symbol"?t+"":t,r);import{u as g,j as n,a as p,b as x,k as ne,Q as Re,c as Oe}from"./tanstack-query-1t81HyiD.js";import{d as Me,r as o,N as Z,L as Fe,O as Ue,H as Ke,e as Be,f as j,h as $e}from"./react-dgEcD0HR.js";import{B as C,C as U,L as xe,I as ye,a as ze,b as Qe,d as I,S as Ve,c as T,T as We,e as He}from"./heroui-BI50yK5B.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ge=Me();const Je="modulepreload",Ye=function(e){return"/"+e},ue={},P=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let u=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(r.map(y=>{if(y=Ye(y),y in ue)return;ue[y]=!0;const h=y.endsWith(".css"),b=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Je,h||(m.as="script"),m.crossOrigin="",m.href=y,f&&m.setAttribute("nonce",f),document.head.appendChild(m),h)return new Promise((N,M)=>{m.addEventListener("load",N),m.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};class L extends Error{constructor(r,s){super(s);ce(this,"status");this.name="ApiError",this.status=r}}let K=null;function de(e){K=e}async function ee(e){try{const t=await e.json();if(typeof t.detail=="string")return t.detail;if(t.detail!=null)return JSON.stringify(t.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Xe(e){let t;try{t=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(t.status===401||t.status===403)return!1;if(!t.ok)throw new L(t.status,await ee(t));return!0}async function Ze(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function c(e,t={}){const r=new Headers(t.headers);r.set("Accept","application/json"),t.body!=null&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let s;try{s=await fetch(e,{...t,headers:r})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(s.status===401||s.status===403)throw K==null||K(),new L(s.status,await ee(s));if(!s.ok)throw new L(s.status,await ee(s));if(s.status!==204)return await s.json()}const te="otari.dashboard.hasSession",ve=o.createContext(null);function et(){try{return window.localStorage.getItem(te)==="1"}catch{return!1}}function tt({children:e}){const t=g(),[r,s]=o.useState(et),a=o.useCallback(()=>{Ze(),s(!1),t.clear();try{window.localStorage.removeItem(te)}catch{}},[t]),i=o.useCallback(()=>{t.clear(),s(!0);try{window.localStorage.setItem(te,"1")}catch{}},[t]);o.useEffect(()=>(de(a),()=>de(null)),[a]);const u=o.useMemo(()=>({isAuthenticated:r,login:i,logout:a}),[r,i,a]);return n.jsx(ve.Provider,{value:u,children:e})}function re(){const e=o.useContext(ve);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function nt(e){return e instanceof L&&e.status===0}function rt(){const e=g(),[t,r]=o.useState(!1);return o.useEffect(()=>{const s=e.getQueryCache(),a=()=>s.getAll().some(i=>i.state.status==="error"&&nt(i.state.error));return r(a()),s.subscribe(()=>r(a()))},[e]),t}function st(){return rt()?n.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const $=3600,_=86400,at=365*_,dn=[{key:"1h",label:"Last hour",seconds:$,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"90d",label:"90d",seconds:90*_,bucket:"day"},{key:"12mo",label:"12mo",seconds:at,bucket:"day"}],mn="30d",fn=[{key:"1h",label:"1h",seconds:$,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"all",label:"All",seconds:null,bucket:"day"}],hn="24h",xn="custom";function yn(e,t){return e.find(r=>r.key===t)}function it(e,t=Date.now()){return new Date(t-e*1e3).toISOString()}function ot(e){return(e==="hour"?$:_)*1e3}function vn(e,t,r=Date.now()){const s=new Date(e).getTime();return(t?new Date(t).getTime():r)-s<=_*1e3?"hour":"day"}function gn(e,t,r,s){if(e.length===0)return null;const a=Math.max(0,Math.min(t,r)),i=Math.min(e.length-1,Math.max(t,r)),u=new Date(e[a]).getTime(),d=new Date(e[i]).getTime()+ot(s);return{startIso:new Date(u).toISOString(),endIso:new Date(d).toISOString()}}function pn(e,t,r){const s=e.length;if(s===0)return{startIndex:0,endIndex:0};const a=e.map(d=>new Date(d).getTime());let i=0;if(t){const d=new Date(t).getTime();for(let f=0;fc("/v1/models"),staleTime:6e4})}function dt(){return p({queryKey:[ct],queryFn:()=>c("/dashboard-build.json"),refetchInterval:ut,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function jn(){return p({queryKey:[ae],queryFn:()=>c("/v1/models/discoverable"),staleTime:5*6e4})}function Sn(){return p({queryKey:[ie],queryFn:()=>c("/v1/providers"),staleTime:5*6e4})}function kn(){return p({queryKey:["provider-catalog"],queryFn:()=>c("/v1/providers/catalog"),staleTime:1/0})}function En(e){return p({queryKey:["provider-catalog",e],queryFn:()=>c(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Pn(){return p({queryKey:[oe],queryFn:()=>c("/v1/providers/health"),staleTime:me,refetchInterval:me})}function Nn(){const e=g();return x({mutationFn:()=>c("/v1/providers/health?refresh=true"),onSuccess:t=>e.setQueryData([oe],t)})}function Cn(){return p({queryKey:[be],queryFn:()=>c("/v1/provider-credentials"),staleTime:6e4})}function Q(e){e.invalidateQueries({queryKey:[be]}),e.invalidateQueries({queryKey:[ie]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]}),e.invalidateQueries({queryKey:[oe]})}function Tn(){const e=g();return x({mutationFn:t=>c("/v1/provider-credentials",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>Q(e)})}function _n(){const e=g();return x({mutationFn:({instance:t,body:r})=>c(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>Q(e)})}function Ln(){const e=g();return x({mutationFn:t=>c(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>Q(e)})}function Dn(){const e=g();return x({mutationFn:()=>c("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>Q(e)})}function An(){return x({mutationFn:e=>c(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function In(){return x({mutationFn:e=>c("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function qn(){return p({queryKey:[lt],queryFn:()=>c("/v1/models/metadata"),staleTime:10*6e4})}function Rn(){return p({queryKey:[se],queryFn:()=>c("/v1/aliases"),staleTime:6e4})}function On(){const e=g();return x({mutationFn:t=>c("/v1/aliases",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function Mn(){const e=g();return x({mutationFn:({name:t,userId:r})=>{const s=r==null?"":`?user_id=${encodeURIComponent(r)}`;return c(`/v1/aliases/${encodeURIComponent(t)}${s}`,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function mt(){return p({queryKey:[ge],queryFn:()=>c("/v1/settings"),staleTime:6e4})}function ft(){const e=g();return x({mutationFn:t=>c("/v1/settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([ge],t),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]})}})}function Fn(){return x({mutationFn:()=>c("/v1/settings/master-key/rotate",{method:"POST"})})}function Un(){return p({queryKey:[pe],queryFn:()=>c("/v1/tool-settings"),staleTime:6e4})}function Kn(){const e=g();return x({mutationFn:t=>c("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([pe],t)}})}function Bn(){return x({mutationFn:({service:e,url:t})=>c(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:t})})})}const H=1e3,ht=100;async function xt(){const e=[];for(let t=0;tc("/v1/pricing",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]})}})}function Qn(){const e=g();return x({mutationFn:t=>c(`/v1/pricing/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]})}})}function Vn(){return x({mutationFn:()=>c("/v1/pricing/refresh",{method:"POST"})})}function Wn(){const e=g();return x({mutationFn:()=>c("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ie]})}})}function Hn(){return x({mutationFn:()=>c("/v1/pricing/refresh/reject",{method:"POST"})})}const G=1e3,yt=100;async function vt(){const e=[];for(let t=0;tc("/v1/keys",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Yn(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/keys/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Xn(){const e=g();return x({mutationFn:t=>c(`/v1/keys/${encodeURIComponent(t)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Zn(){const e=g();return x({mutationFn:t=>c(`/v1/keys/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}const J=1e3,gt=100;async function pt(){const e=[];for(let t=0;tc(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function nr(){const e=g();return x({mutationFn:t=>c("/v1/budgets",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function rr(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/budgets/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function sr(){const e=g();return x({mutationFn:t=>c(`/v1/budgets/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}const Y=1e3,bt=100;async function wt(){const e=[];for(let t=0;tc("/v1/users",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>le(e)})}function or(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/users/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>le(e)})}function lr(){const e=g();return x({mutationFn:t=>c(`/v1/users/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{le(e),e.invalidateQueries({queryKey:[q]})}})}function V(e){const t=new URLSearchParams;return e.start_date&&t.set("start_date",e.start_date),e.end_date&&t.set("end_date",e.end_date),e.status&&t.set("status",e.status),e.model&&t.set("model",e.model),e.endpoint&&t.set("endpoint",e.endpoint),e.user_id&&t.set("user_id",e.user_id),e.api_key_id&&t.set("api_key_id",e.api_key_id),e.source&&t.set("source",e.source),e.priced!==void 0&&t.set("priced",String(e.priced)),e.counts_toward_budget!==void 0&&t.set("counts_toward_budget",String(e.counts_toward_budget)),t}function cr(e,t,r){return p({queryKey:[O,"list",e,t,r],queryFn:()=>{const s=V(e);return s.set("skip",String(t*r)),s.set("limit",String(r)),c(`/v1/usage?${s.toString()}`)},placeholderData:ne,staleTime:1e4})}function ur(e,t=!0){return p({queryKey:[O,"count",e],queryFn:()=>c(`/v1/usage/count?${V(e).toString()}`),enabled:t,placeholderData:ne,staleTime:1e4})}const jt=6e4;function St(e,t=!0){return p({queryKey:[O,"count","failures",e],queryFn:()=>{const r={status:"error",source:"gateway",start_date:it(e)};return c(`/v1/usage/count?${V(r).toString()}`)},enabled:t,refetchInterval:jt,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function dr(){const e=g();return x({mutationFn:t=>c("/v1/usage",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]})}})}function mr(){const e=g();return x({mutationFn:t=>c("/v1/usage/set-price",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]})}})}function fr(e,t,r=!0){return p({queryKey:[O,"summary",e,t],queryFn:()=>{const s=V(e);return s.set("bucket",t),c(`/v1/usage/summary?${s.toString()}`)},enabled:r,placeholderData:ne,staleTime:3e4})}function hr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function xr(e){if(e==null)return"$0.00";const t=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}function yr(e){if(e==null)return"—";if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){const t=Math.round(e/1e3);return t>=1e3?"1M":`${t}K`}return String(e)}const kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function vr(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})/.exec(e);if(!t)return e;const r=Number(t[2])-1;return r<0||r>11?t[1]:`${kt[r]} ${t[1]}`}const Et=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function gr(e){return Et.format(e)}function pr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Pt(e){return`${(e*100).toFixed(1)}%`}function br(e,t){return t===void 0||t===0?null:(e-t)/t}function Nt(e,t=Date.now()){if(!e)return"never";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const s=Math.round((t-r.getTime())/1e3),a=s<0,i=Math.abs(s),u=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let d=i,f="second";for(const[h,b]of u){if(f=h,d0?"▲":e<0?"▼":"•";return n.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t," ",Pt(Math.abs(e))," vs prev"]})}function Ct(e){return e instanceof L||e instanceof Error?e.message:"Something went wrong."}function Tt({error:e}){return e?n.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:Ct(e)}):null}function _t({tone:e="info",children:t}){const r=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return n.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${r}`,children:t})}function Sr({title:e,description:t,action:r}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),r?n.jsx("div",{className:"flex flex-wrap gap-2",children:r}):null]})}function Lt(e){const[t,r]=o.useState(()=>Date.now());return o.useEffect(()=>{let s;const a=()=>{s===void 0&&(s=setInterval(()=>r(Date.now()),e))},i=()=>{s!==void 0&&(clearInterval(s),s=void 0)},u=()=>{r(Date.now()),document.visibilityState==="visible"?a():i()};return u(),document.addEventListener("visibilitychange",u),()=>{i(),document.removeEventListener("visibilitychange",u)}},[e]),t}function kr({onRefresh:e,isFetching:t=!1,updatedAt:r,label:s="Refresh"}){const a=Lt(15e3),i=r?Nt(new Date(r).toISOString(),a):null;return n.jsxs("span",{className:"inline-flex items-center gap-2",children:[i?n.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Updated ",i]}):null,n.jsx(C,{variant:"outline",size:"sm",isIconOnly:!0,isDisabled:t,onPress:e,"aria-label":s,children:n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`h-4 w-4 ${t?"animate-spin":""}`,"aria-hidden":"true",children:[n.jsx("path",{d:"M20 11a8 8 0 1 0-.5 4",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M20 4v5h-5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function Er({title:e,description:t,actionLabel:r,onAction:s,isActionDisabled:a,children:i}){return n.jsx(I,{children:n.jsxs(I.Content,{className:"flex flex-col gap-4 p-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),i,r&&s?n.jsx("div",{children:n.jsx(C,{variant:"primary",isDisabled:a,onPress:s,children:r})}):null]})})}function Pr({label:e="Loading…"}){return n.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 px-4 py-10 text-sm text-[var(--otari-muted)]",children:[n.jsx(Ve,{size:"sm"}),n.jsx("span",{children:e})]})}function Nr({children:e,confirmLabel:t,onConfirm:r,isPending:s}){const[a,i]=o.useState(!1);return a?n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(C,{size:"sm",variant:"danger",isDisabled:s,onPress:r,children:t}),n.jsx(C,{size:"sm",variant:"ghost",isDisabled:s,onPress:()=>i(!1),children:"Cancel"})]}):n.jsx(C,{size:"sm",variant:"danger-soft",onPress:()=>i(!0),children:e})}const Dt="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Cr({id:e,label:t,ariaLabel:r,value:s,onChange:a,options:i,children:u,disabled:d}){const f=o.useId(),y=e??(t?f:void 0),h=n.jsx("select",{id:y,"aria-label":t?void 0:r,value:s,disabled:d,onChange:b=>a(b.target.value),className:Dt,children:i?i.map(b=>n.jsx("option",{value:b.value,children:b.label},b.value)):u});return t?n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),h]}):h}function Tr({label:e,value:t,onChange:r,options:s,placeholder:a,maxVisible:i=50,allowsCustom:u=!1}){const d=m=>{var N;return((N=s.find(M=>M.value===m))==null?void 0:N.label)??m},[f,y]=o.useState(()=>d(t));o.useEffect(()=>{y(d(t))},[t]);const h=f.trim().toLowerCase(),b=s.filter(m=>!h||m.value.toLowerCase().includes(h)||m.label.toLowerCase().includes(h)).slice(0,i);return n.jsxs(U.Root,{allowsEmptyCollection:!0,allowsCustomValue:u,menuTrigger:"focus",inputValue:f,onInputChange:m=>{y(m),u?r(m.trim()):m.trim()===""&&r("")},onSelectionChange:m=>{m!=null&&r(String(m))},className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),n.jsxs(U.InputGroup,{children:[n.jsx(ye,{placeholder:a,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),n.jsx(U.Trigger,{})]}),n.jsx(U.Popover,{children:n.jsx(ze,{items:b,className:"max-h-72 overflow-auto",children:m=>n.jsx(Qe,{id:m.value,textValue:m.label,children:m.label})})})]})}function At(){var f,y;const e=mt(),t=ft(),[r,s]=o.useState(!1),i=((f=e.data)==null?void 0:f.require_pricing)===!0&&e.data.default_pricing===!1&&!r,d=((y=St($,i).data)==null?void 0:y.total)??0;return i?n.jsx("div",{className:"shrink-0 px-6 pt-3",children:n.jsx(_t,{tone:"warning",children:n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("span",{children:["Requests are rejected until pricing is set (",n.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away.",d>0?n.jsxs(n.Fragment,{children:[" ",n.jsxs("strong",{className:"font-semibold",children:[d.toLocaleString()," ",d===1?"request":"requests"," failed in the last hour."]})," ",n.jsx(Fe,{to:"/activity?status=error&range=1h&source=gateway",className:"underline underline-offset-2",children:"View failed requests"})]}):null]}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(C,{size:"sm",variant:"primary",isDisabled:t.isPending,onPress:()=>t.mutate({default_pricing:!0}),children:t.isPending?"Enabling…":"Enable default pricing"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Dismiss"})]})]})})}):null}function It(){const{data:e}=dt(),t=o.useRef(null);return e&&t.current===null&&(t.current=e.build),e!=null&&t.current!=null&&e.build!==t.current}function qt(){const e=It(),[t,r]=o.useState(!1);return!e||t?null:n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:n.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),n.jsx(C,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>r(!0),children:"Later"})]})})}const je=200,Se=480,X=240,Rt=60,ke="otari.dashboard.sidebarWidth",Ee="otari.dashboard.sidebarCollapsed",he=16,Pe="(max-width: 767px)",B=e=>Math.min(Se,Math.max(je,e));function Ot(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(Pe).matches}const Mt='a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ft(e){return e?Array.from(e.querySelectorAll(Mt)).filter(t=>t.offsetParent!==null||t===document.activeElement):[]}function Ut(){if(typeof window>"u")return X;try{const e=window.localStorage.getItem(ke),t=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(t)?X:B(t)}catch{return X}}function Kt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ee)==="1"}catch{return!1}}const Bt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],$t=[{to:"/",section:"home",label:"Overview",end:!0,icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),n.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),n.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),n.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),n.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function zt(){const{logout:e}=re(),t=o.useRef(null),r=o.useRef(null),s=o.useRef(null),[a,i]=o.useState(Ut),[u,d]=o.useState(Kt),[f,y]=o.useState(!1),[h,b]=o.useState(Ot),[m,N]=o.useState(!1);o.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const l=window.matchMedia(Pe),v=w=>{b(w.matches),w.matches||N(!1)};return typeof l.addEventListener=="function"?(l.addEventListener("change",v),()=>l.removeEventListener("change",v)):(l.addListener(v),()=>l.removeListener(v))},[]),o.useEffect(()=>{if(!m)return;const l=v=>{v.key==="Escape"&&N(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[m]),o.useEffect(()=>{var l,v,w;h&&(m?(l=t.current)==null||l.focus():(v=t.current)!=null&&v.contains(document.activeElement)&&((w=s.current)==null||w.focus()))},[h,m]);const M=o.useCallback(l=>{if(l.key!=="Tab")return;const v=Ft(t.current);if(v.length===0)return;const w=v[0],k=v[v.length-1],F=document.activeElement;l.shiftKey&&(F===w||F===t.current)?(l.preventDefault(),k.focus()):!l.shiftKey&&F===k&&(l.preventDefault(),w.focus())},[]);o.useEffect(()=>{const l=window.setTimeout(()=>{try{window.localStorage.setItem(ke,String(Math.round(a)))}catch{}},200);return()=>window.clearTimeout(l)},[a]),o.useEffect(()=>{try{window.localStorage.setItem(Ee,u?"1":"0")}catch{}},[u]);const Ce=o.useCallback(l=>{l.preventDefault(),l.currentTarget.setPointerCapture(l.pointerId),y(!0)},[]),Te=o.useCallback(l=>{var w;if(!l.currentTarget.hasPointerCapture(l.pointerId))return;const v=((w=t.current)==null?void 0:w.getBoundingClientRect().left)??0;i(B(l.clientX-v))},[]),_e=o.useCallback(l=>{l.currentTarget.hasPointerCapture(l.pointerId)&&l.currentTarget.releasePointerCapture(l.pointerId),y(!1)},[]),Le=o.useCallback(l=>{var v;l.preventDefault(),(v=r.current)==null||v.focus()},[]),De=o.useCallback(l=>{l.key==="ArrowLeft"?(l.preventDefault(),i(v=>B(v-he))):l.key==="ArrowRight"&&(l.preventDefault(),i(v=>B(v+he)))},[]),Ae=u?Rt:a,S=h?!1:u,W=h&&m?!0:void 0;return n.jsxs("div",{className:T("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[n.jsx("button",{type:"button",inert:W,onClick:Le,className:"sr-only focus:not-sr-only focus:absolute focus:top-3 focus:left-3 focus:z-50 focus:rounded-lg focus:border focus:border-[var(--otari-brand)] focus:bg-[var(--otari-surface)] focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-[var(--otari-brand-dark)] focus:shadow-md focus:outline-none",children:"Skip to main content"}),n.jsxs("header",{inert:W,className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("button",{type:"button",ref:s,onClick:()=>N(l=>!l),"aria-label":m?"Close navigation":"Open navigation","aria-expanded":m,"aria-controls":"app-sidebar",className:"-ml-1 flex h-8 w-8 items-center justify-center rounded-lg text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)] md:hidden",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5",children:n.jsx("path",{d:"M4 6h16M4 12h16M4 18h16",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),n.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),n.jsx(C,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),n.jsx(qt,{}),n.jsx(st,{}),n.jsx(At,{}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[h&&m?n.jsx("div",{"aria-hidden":"true",onClick:()=>N(!1),className:"fixed inset-0 z-30 bg-black/40 md:hidden"}):null,n.jsxs("aside",{ref:t,id:"app-sidebar",role:h?"dialog":void 0,"aria-modal":h&&m?!0:void 0,"aria-label":h?"Navigation":void 0,tabIndex:h?-1:void 0,inert:h&&!m?!0:void 0,onKeyDown:h&&m?M:void 0,style:h?void 0:{width:Ae},className:T("flex flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)] focus:outline-none",h?T("fixed inset-y-0 left-0 z-40 w-[17rem] shadow-xl transition-transform duration-200",m?"translate-x-0":"-translate-x-full"):T("relative shrink-0",!f&&"transition-[width] duration-150")),children:[n.jsx("button",{type:"button",onClick:()=>d(l=>!l),"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-pressed":u,title:u?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 hidden h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)] md:flex",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:T("h-3.5 w-3.5 transition-transform",u&&"rotate-180"),children:n.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("nav",{className:T("flex flex-col py-4",S?"px-2":"px-3"),children:Bt.map((l,v)=>{const w=$t.filter(k=>k.section===l.key);return w.length===0?null:n.jsxs("div",{className:v>0?"mt-4":void 0,children:[!S&&l.label?n.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:l.label}):null,v>0&&(S||!l.label)?n.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,n.jsx("div",{className:"flex flex-col gap-1",children:w.map(k=>n.jsxs(Z,{to:k.to,end:k.end,onClick:()=>N(!1),"aria-label":S?k.label:void 0,title:S?k.label:void 0,className:({isActive:F})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"justify-center px-0":"gap-3 px-3",F?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,S?null:k.label]},k.to))})]},l.key)})}),n.jsxs("div",{className:"mt-auto flex flex-col gap-1 pb-3",children:[n.jsxs(Z,{to:"/docs",onClick:()=>N(!1),"aria-label":S?"User guide":void 0,title:S?"User guide":void 0,className:({isActive:l})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"mx-2 justify-center px-0":"mx-3 gap-3 px-3",l?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[n.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.5V18c4 0 6.5.5 8 2 1.5-1.5 4-2 8-2V4.5c-4 0-6.5.5-8 2z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 6.5V20",strokeLinecap:"round"})]}),S?null:"User guide"]}),n.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai: the hosted Otari gateway",className:T("flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",S?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),S?null:n.jsxs("span",{className:"flex-1",children:["otari.ai ",n.jsx("span",{"aria-hidden":!0,children:"↗"})]})]})]}),u||h?null:n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(a),"aria-valuemin":je,"aria-valuemax":Se,tabIndex:0,onPointerDown:Ce,onPointerMove:Te,onPointerUp:_e,onKeyDown:De,className:T("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),n.jsx("main",{ref:r,id:"main-content",tabIndex:-1,inert:W,className:"flex-1 overflow-y-auto focus:outline-none",children:n.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-4 py-5 md:px-6 md:py-6",children:n.jsx(Ue,{})})})]})]})}function Qt(){const{login:e}=re(),[t,r]=o.useState(""),[s,a]=o.useState(null),[i,u]=o.useState(!1),d=async()=>{const f=t.trim();if(!(!f||i)){u(!0),a(null);try{await Xe(f)?e():a(new Error("Invalid master key."))}catch(y){a(y)}finally{u(!1)}}};return n.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:n.jsx(I,{className:"w-full max-w-md",children:n.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),n.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),d()},children:[n.jsxs(We,{value:t,onChange:f=>{r(f),s&&a(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),n.jsx(ye,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),n.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[n.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),n.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",n.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",n.jsx("code",{children:"Your master key:"})," (for example, run"," ",n.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),n.jsx(Tt,{error:s}),n.jsx(C,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!t.trim()||i,children:i?"Signing in…":"Sign in"})]}),n.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),n.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:n.jsx(He,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const Vt=o.lazy(async()=>({default:(await P(async()=>{const{ActivityPage:e}=await import("./ActivityPage-Dd5_lVjd.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))).ActivityPage})),Wt=o.lazy(async()=>({default:(await P(async()=>{const{AliasesPage:e}=await import("./AliasesPage-BXueJgS_.js");return{AliasesPage:e}},__vite__mapDeps([10,1,2,6,4,7,8,11,12]))).AliasesPage})),Ht=o.lazy(async()=>({default:(await P(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-BQktAQRZ.js");return{BudgetsPage:e}},__vite__mapDeps([13,1,2,6,4,7,8,11]))).BudgetsPage})),Gt=o.lazy(async()=>({default:(await P(async()=>{const{DocsPage:e}=await import("./DocsPage-xJDqWRaA.js");return{DocsPage:e}},__vite__mapDeps([14,1,2,4]))).DocsPage})),Jt=o.lazy(async()=>({default:(await P(async()=>{const{KeysPage:e}=await import("./KeysPage-DVB0fG8n.js");return{KeysPage:e}},__vite__mapDeps([15,1,2,6,4,7,8,11,16,12]))).KeysPage})),Yt=o.lazy(async()=>({default:(await P(async()=>{const{ModelsPage:e}=await import("./ModelsPage-D-sOtTsj.js");return{ModelsPage:e}},__vite__mapDeps([17,1,2,6,4,8,9]))).ModelsPage})),Xt=o.lazy(async()=>({default:(await P(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-BluitD8r.js");return{OverviewIndex:e}},__vite__mapDeps([18,1,2,19,5,4,8]))).OverviewIndex})),Zt=o.lazy(async()=>({default:(await P(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-Bf-7xbup.js");return{ProvidersPage:e}},__vite__mapDeps([20,1,2,11,4,8]))).ProvidersPage})),en=o.lazy(async()=>({default:(await P(async()=>{const{SettingsPage:e}=await import("./SettingsPage-OsrEeYZu.js");return{SettingsPage:e}},__vite__mapDeps([21,1,2,4]))).SettingsPage})),tn=o.lazy(async()=>({default:(await P(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-CSxGfHtw.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([22,1,2,4]))).ToolsGuardrailsPage})),nn=o.lazy(async()=>({default:(await P(async()=>{const{UsagePage:e}=await import("./UsagePage-CtRIjZgb.js");return{UsagePage:e}},__vite__mapDeps([23,1,2,3,4,5,6,19,7,8,9]))).UsagePage})),rn=o.lazy(async()=>({default:(await P(async()=>{const{UsersPage:e}=await import("./UsersPage-T4PK8YrW.js");return{UsersPage:e}},__vite__mapDeps([24,1,2,6,4,7,8,11,16]))).UsersPage}));function E(e){return n.jsx(o.Suspense,{fallback:n.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function sn(){const{isAuthenticated:e}=re();return e?n.jsx(Ke,{children:n.jsx(Be,{children:n.jsxs(j,{element:n.jsx(zt,{}),children:[n.jsx(j,{index:!0,element:E(n.jsx(Xt,{}))}),n.jsx(j,{path:"providers",element:E(n.jsx(Zt,{}))}),n.jsx(j,{path:"keys",element:E(n.jsx(Jt,{}))}),n.jsx(j,{path:"users",element:E(n.jsx(rn,{}))}),n.jsx(j,{path:"budgets",element:E(n.jsx(Ht,{}))}),n.jsx(j,{path:"activity",element:E(n.jsx(Vt,{}))}),n.jsx(j,{path:"usage",element:E(n.jsx(nn,{}))}),n.jsx(j,{path:"models",element:E(n.jsx(Yt,{}))}),n.jsx(j,{path:"aliases",element:E(n.jsx(Wt,{}))}),n.jsx(j,{path:"tools",element:E(n.jsx(tn,{}))}),n.jsx(j,{path:"settings",element:E(n.jsx(en,{}))}),n.jsx(j,{path:"docs",element:E(n.jsx(Gt,{}))}),n.jsx(j,{path:"*",element:n.jsx($e,{to:"/",replace:!0})})]})})}):n.jsx(Qt,{})}function an({children:e}){const[t]=o.useState(()=>new Re({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(r,s)=>s instanceof L&&(s.status===401||s.status===403)?!1:r<2}}}));return n.jsx(Oe,{client:t,children:n.jsx(tt,{children:e})})}const Ne=document.getElementById("root");if(!Ne)throw new Error("Root element #root not found");Ge.createRoot(Ne).render(n.jsx(o.StrictMode,{children:n.jsx(an,{children:n.jsx(sn,{})})}));export{hr as $,hn as A,Zn as B,xn as C,Jn as D,Tt as E,Cr as F,wn as G,$n as H,_t as I,qn as J,zn as K,yr as L,Qn as M,Ct as N,vr as O,Sr as P,mt as Q,kr as R,xr as S,Sn as T,Pr as U,Pn as V,br as W,wr as X,at as Y,gr as Z,jr as _,Gn as a,Pt as a0,Nt as a1,Cn as a2,Ln as a3,An as a4,ft as a5,_n as a6,Nn as a7,Tn as a8,En as a9,kn as aa,In as ab,Vn as ac,Wn as ad,Hn as ae,Fn as af,Dn as ag,Un as ah,Kn as ai,Bn as aj,mn as ak,dn as al,pr as am,bn as an,ot as ao,pn as ap,gn as aq,lr as ar,ir as as,cr as b,ur as c,fr as d,vn as e,yn as f,dr as g,mr as h,fn as i,Tr as j,it as k,jn as l,Rn as m,Mn as n,Nr as o,On as p,er as q,nr as r,rr as s,sr as t,ar as u,or as v,Er as w,tr as x,Yn as y,Xn as z}; diff --git a/src/gateway/static/dashboard/assets/index-BqdGY8GQ.css b/src/gateway/static/dashboard/assets/index-Bu_MKbvb.css similarity index 99% rename from src/gateway/static/dashboard/assets/index-BqdGY8GQ.css rename to src/gateway/static/dashboard/assets/index-Bu_MKbvb.css index 8cfdebdf5..e8a027c3d 100644 --- a/src/gateway/static/dashboard/assets/index-BqdGY8GQ.css +++ b/src/gateway/static/dashboard/assets/index-Bu_MKbvb.css @@ -1 +1 @@ -/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--tw-content:"";--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-space-y-reverse:0;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-700:oklch(50.5% .213 27.518);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-500:oklch(72.3% .219 149.579);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-xl:calc(var(--radius) * 1.5);--radius-2xl:calc(var(--radius) * 2);--radius-3xl:calc(var(--radius) * 3);--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow-surface:var(--surface-shadow);--shadow-overlay:var(--overlay-shadow);--border-width-field:var(--field-border-width,var(--border-width));--ease-smooth:ease;--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-fluid:cubic-bezier(.32, .72, 0, 1);--ease-linear:linear}@layer theme.base{:root,.light,.default,[data-theme=light],[data-theme=default]{color-scheme:light;--white:oklch(100% 0 0);--black:oklch(0% 0 0);--snow:oklch(99.11% 0 0);--eclipse:oklch(21.03% .0059 285.89);--spacing:.25rem;--border-width:1px;--field-border-width:0px;--disabled-opacity:.5;--ring-offset-width:2px;--cursor-interactive:pointer;--cursor-disabled:not-allowed;--radius:.5rem;--field-radius:calc(var(--radius) * 1.5);--background:oklch(97.02% 0 0);--foreground:var(--eclipse);--surface:var(--white);--surface-foreground:var(--foreground);--surface-secondary:oklch(95.24% .0013 286.37);--surface-secondary-foreground:var(--foreground);--surface-tertiary:oklch(93.73% .0013 286.37);--surface-tertiary-foreground:var(--foreground);--overlay:var(--white);--overlay-foreground:var(--foreground);--muted:oklch(55.17% .0138 285.94);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(94% .001 286.375);--default-foreground:var(--eclipse);--accent:oklch(62.04% .195 253.83);--accent-foreground:var(--snow);--field-background:var(--white);--field-foreground:oklch(21.03% .0059 285.89);--field-placeholder:var(--muted);--field-border:transparent;--success:oklch(73.29% .1935 150.81);--success-foreground:var(--eclipse);--warning:oklch(78.19% .1585 72.33);--warning-foreground:var(--eclipse);--danger:oklch(65.32% .2328 25.74);--danger-foreground:var(--snow);--segment:var(--white);--segment-foreground:var(--eclipse);--border:oklch(90% .004 286.32);--separator:oklch(92% .004 286.32);--focus:var(--accent);--link:var(--foreground);--backdrop:#00000080;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:color-mix(in oklab, var(--accent) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 70%, var(--foreground) 30%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:color-mix(in oklab, var(--accent) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 70%, var(--foreground) 40%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:color-mix(in oklab, var(--warning) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 70%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:color-mix(in oklab, var(--warning) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:color-mix(in oklab, var(--success) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 60%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:color-mix(in oklab, var(--success) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--overlay-shadow:0 2px 8px 0 #0000000f, 0 -6px 12px 0 #00000008, 0 14px 28px 0 #00000014;--field-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--skeleton-animation:shimmer;--tooltip-delay:1.5s;--tooltip-close-delay:.5s}.dark,[data-theme=dark]{color-scheme:dark;--background:oklch(12% .005 285.823);--foreground:var(--snow);--surface:oklch(21.03% .0059 285.89);--surface-foreground:var(--foreground);--surface-secondary:oklch(25.7% .0037 286.14);--surface-tertiary:oklch(27.21% .0024 247.91);--overlay:oklch(21.03% .0059 285.89);--overlay-foreground:var(--foreground);--muted:oklch(70.5% .015 286.067);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}.dark,[data-theme=dark]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(27.4% .006 286.033);--default-foreground:var(--snow);--field-background:oklch(21.03% .0059 285.89);--field-foreground:var(--foreground);--warning:oklch(82.03% .1388 76.34);--warning-foreground:var(--eclipse);--danger:oklch(59.4% .1967 24.63);--danger-foreground:var(--snow);--segment:oklch(39.64% .01 285.93);--segment-foreground:var(--foreground);--border:oklch(28% .006 286.033);--separator:oklch(25% .006 286.033);--focus:var(--accent);--link:var(--foreground);--backdrop:#0009;--surface-shadow:0 0 0 0 transparent inset;--overlay-shadow:0 0 1px 0 #ffffff4d inset;--field-shadow:0 0 0 0 transparent inset;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}.dark,[data-theme=dark]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}.dark,[data-theme=dark]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}.dark,[data-theme=dark]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}.dark,[data-theme=dark]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}.dark,[data-theme=dark]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}.dark,[data-theme=dark]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}.dark,[data-theme=dark]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}.dark,[data-theme=dark]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}.dark,[data-theme=dark]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}.dark,[data-theme=dark]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}.dark,[data-theme=dark]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}.dark,[data-theme=dark]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}.dark,[data-theme=dark]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft:color-mix(in oklab, var(--accent) 12%, transparent)}}.dark,[data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-hover:color-mix(in oklab, var(--accent) 16%, transparent)}}.dark,[data-theme=dark]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}.dark,[data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}.dark,[data-theme=dark]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft:color-mix(in oklab, var(--warning) 12%, transparent)}}.dark,[data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-hover:color-mix(in oklab, var(--warning) 16%, transparent)}}.dark,[data-theme=dark]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft:color-mix(in oklab, var(--success) 12%, transparent)}}.dark,[data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-hover:color-mix(in oklab, var(--success) 16%, transparent)}}.dark,[data-theme=dark]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}.dark,[data-theme=dark]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}.dark,[data-theme=dark]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}.dark,[data-theme=dark]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}}@layer components;}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--border,currentColor)}::file-selector-button{border-color:var(--border,currentColor)}:root{view-transition-name:none}::view-transition{pointer-events:none}[data-scrollbar=thin]{--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--scrollbar-gutter:auto}[data-scrollbar=default]{--scrollbar-width:auto;--scrollbar-color:auto;--scrollbar-gutter:auto}[data-scrollbar=none]{--scrollbar-width:none;--scrollbar-color:auto;--scrollbar-gutter:auto}}@layer components{.close-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),color .15s var(--ease-out),background-color .1s var(--ease-out),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.close-button:focus-visible:not(:focus),.close-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.close-button:disabled,.close-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.close-button[data-pending=true]{pointer-events:none}.close-button svg{pointer-events:none;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);flex-shrink:0;align-self:center}.close-button--default{background-color:var(--default);color:var(--muted)}@media(hover:hover){.close-button--default:hover,.close-button--default[data-hovered=true]{background-color:var(--default-hover)}}.close-button--default:active,.close-button--default[data-pressed=true]{transform:scale(.93)}.description{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted)}.error-message{height:auto;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *),.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.field-error{height:0;padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);opacity:0}.field-error[data-visible]{opacity:1;height:auto}.field-error{transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *),.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox>.field-error,.checkbox>[data-slot=field-error],.switch>.field-error,.switch>[data-slot=field-error],.radio>.field-error,.radio>[data-slot=field-error]{height:auto;min-height:0;color:var(--muted);opacity:1;margin:0;padding:0;transition:none}.label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}:is(.label--required,[data-required=true]:not([role=group]):not([role=radiogroup]):not([role=checkboxgroup])>.label,[data-required=true]:not([data-slot=radio]):not([data-slot=checkbox])>.label):after{margin-left:calc(var(--spacing) * .5);color:var(--danger);--tw-content:"*";content:var(--tw-content)}.label--disabled,[data-disabled=true] .label{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.label--invalid,[data-invalid=true] .label,[aria-invalid=true] .label{color:var(--danger)}.accordion{contain:layout style;width:100%}.accordion__body{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.accordion__body-inner{padding-inline:calc(var(--spacing) * 4);padding-top:0;padding-bottom:calc(var(--spacing) * 4);color:var(--muted)}.accordion__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__indicator[data-expanded=true]{rotate:-180deg}.accordion__item{--tw-border-style:none;border-style:none;position:relative}.accordion__item:after{content:"";border-radius:calc(var(--radius) * .25);background-color:var(--separator);width:100%;height:1px;position:absolute;bottom:0;left:0}.accordion__item:last-child:after{content:none}.accordion__item[data-hide-separator=true]:after{display:none}.accordion__trigger{cursor:var(--cursor-interactive);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 4);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-tap-highlight-color:transparent;transition:opacity .15s var(--ease-out),box-shadow .15s var(--ease-out);flex:1;justify-content:space-between;align-items:center;display:flex}.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:color-mix(in oklab,var(--foreground) 3%,transparent 90%)}}}.accordion__trigger:focus-visible:not(:focus),.accordion__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.accordion__trigger:disabled,.accordion__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.accordion__panel{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__panel[data-expanded=true]{will-change:height,opacity;opacity:1}.accordion--surface{background-color:var(--surface);border-radius:min(32px,var(--radius-3xl))}@media(hover:hover){.accordion--surface .accordion__trigger:hover:not([aria-expanded=true]),.accordion--surface .accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--default)}}.accordion--surface .accordion__item:after{background-color:var(--surface-foreground)}@supports (color:color-mix(in lab,red,red)){.accordion--surface .accordion__item:after{background-color:color-mix(in oklab,var(--surface-foreground) 6%,transparent)}}.accordion--surface .accordion__item:after{width:94%;left:3%}.accordion--surface .accordion__item:first-child [data-slot=accordion-trigger]{border-top-left-radius:min(32px,var(--radius-3xl));border-top-right-radius:min(32px,var(--radius-3xl))}.accordion--surface .accordion__item:last-child:not(:has([data-slot=accordion-trigger][aria-expanded=true])) [data-slot=accordion-trigger]{border-bottom-left-radius:min(32px,var(--radius-3xl));border-bottom-right-radius:min(32px,var(--radius-3xl))}.breadcrumbs{align-items:center;display:flex}.breadcrumbs .breadcrumbs__link{padding-inline:calc(var(--spacing) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);opacity:1;text-decoration-line:none;position:relative}.breadcrumbs .breadcrumbs__link:hover,.breadcrumbs .breadcrumbs__link[data-hovered=true]{text-decoration-line:underline}.breadcrumbs .breadcrumbs__link[data-current=true]{color:var(--link);opacity:1}.breadcrumbs .breadcrumbs__item{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);padding-inline:calc(var(--spacing) * .5);flex-shrink:0;display:flex}.breadcrumbs .breadcrumbs__separator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:var(--muted)}.breadcrumbs .breadcrumbs__separator:where(:dir(rtl),[dir=rtl],[dir=rtl] *){rotate:180deg}.disclosure-group{contain:layout style;width:100%}.disclosure{position:relative}.accordion__heading{display:flex}.disclosure__trigger{cursor:var(--cursor-interactive);-webkit-tap-highlight-color:transparent;display:inline-block}.disclosure__trigger:focus-visible:not(:focus),.disclosure__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.disclosure__trigger:disabled,.disclosure__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.disclosure__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:inherit;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__indicator[data-expanded=true]{rotate:-180deg}.disclosure__content{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__content[data-expanded=true]{will-change:height,opacity;opacity:1}.disclosure__body{padding:calc(var(--spacing) * 2)}.link{border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);width:fit-content;height:fit-content;font-weight:var(--font-weight-medium);color:var(--link);text-decoration-line:none;-webkit-text-decoration-color:var(--separator-tertiary);text-decoration-color:var(--separator-tertiary);text-underline-offset:4px;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .1s var(--ease-out);align-items:center;text-decoration-thickness:1.5px;display:inline-flex;position:relative}.link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link{cursor:var(--cursor-interactive)}@media(hover:hover){.link:hover,.link[data-hovered=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.link:hover,.link[data-hovered=true]{-webkit-text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent);text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent)}}:is(.link:hover,.link[data-hovered=true]) .link__icon{opacity:1}}.link:active,.link[data-pressed=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}:is(.link:active,.link[data-pressed=true]) .link__icon{opacity:1}.link:focus-visible:not(:focus),.link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}:is(.link:focus-visible:not(:focus),.link[data-focus-visible=true]) .link__icon{opacity:1}.link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.link .link__icon{pointer-events:none;color:currentColor;opacity:.6;width:.75em;height:.75em;transition:opacity .15s var(--ease-out);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link .link__icon svg{transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.link .link__icon[data-default-icon=true]{margin-left:var(--spacing);padding-bottom:calc(var(--spacing) * 1.5)}.link.button{gap:0;text-decoration-line:none}.pagination{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);flex-direction:column;width:100%;display:flex}@media(min-width:40rem){.pagination{flex-direction:row}}.pagination__summary{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__summary{align-self:center}}.pagination__content{align-items:center;gap:var(--spacing);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__content{align-self:center}}.pagination__item{display:inline-flex}.pagination__link{isolation:isolate;width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);transform-origin:50%;border-radius:calc(var(--radius) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}@media(min-width:48rem){.pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.pagination__link{--pagination-link-bg:transparent;--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover);--pagination-link-fg:var(--default-foreground);background-color:var(--pagination-link-bg);color:var(--pagination-link-fg)}.pagination__link:focus-visible,.pagination__link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.pagination__link:disabled,.pagination__link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.pagination__link:hover,.pagination__link[data-hovered=true]{background-color:var(--pagination-link-bg-hover)}}.pagination__link:active,.pagination__link[data-pressed=true]{background-color:var(--pagination-link-bg-pressed);transform:scale(.97)}.pagination__link[data-active=true]{--pagination-link-bg:var(--default);--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover)}.pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:inline-flex}@media(min-width:48rem){.pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link--nav{gap:calc(var(--spacing) * 1.5);width:auto;padding-inline:calc(var(--spacing) * 2.5)}.pagination--sm .pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__link{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__link:active,.pagination--sm .pagination__link[data-pressed=true]{transform:scale(.98)}.pagination--sm .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 2)}.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.pagination--lg .pagination__link{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__link{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__link:active,.pagination--lg .pagination__link[data-pressed=true]{transform:scale(.96)}.pagination--lg .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 3)}.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__summary{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.tabs{gap:calc(var(--spacing) * 2);display:flex}.tabs[data-orientation=horizontal]{flex-direction:column}.tabs[data-orientation=vertical]{flex-direction:row}.tabs__list-container{position:relative}.tabs__list{background-color:var(--default);padding:var(--spacing);border-radius:calc(var(--radius) * 2.5);display:inline-flex}.tabs__list[data-orientation=horizontal]{flex-direction:row;width:100%}.tabs__list[data-orientation=vertical]{gap:var(--spacing);flex-direction:column}.tabs__list[data-orientation=vertical] .tabs__tab{min-width:calc(var(--spacing) * 20)}.tabs__tab{z-index:1;cursor:var(--cursor-interactive);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);width:100%;padding-inline:calc(var(--spacing) * 4);text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .15s var(--ease-smooth);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__tab[data-selected=true]{color:var(--segment-foreground)}.tabs__tab[data-selected=true] .tabs__separator,.tabs__tab[data-selected=true]+.tabs__tab .tabs__separator{opacity:0}.tabs__tab:disabled,.tabs__tab[data-disabled=true],.tabs__tab[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.tabs__tab:not([data-selected=true]):not([data-disabled=true]):hover,.tabs__tab[data-hovered=true]:not([data-selected=true]):not([data-disabled=true]){opacity:.7}}.tabs__tab:focus-visible:not(:focus),.tabs__tab[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tabs__separator{border-radius:calc(var(--radius) * .5);background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.tabs__separator{background-color:color-mix(in oklab,var(--muted) 25%,transparent)}}.tabs__separator{pointer-events:none;transition:opacity .15s var(--ease-smooth);position:absolute}.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__list[data-orientation=horizontal] .tabs__separator{width:1px;height:50%;top:25%;left:0}.tabs__list[data-orientation=vertical] .tabs__separator{width:90%;height:1px;top:0;left:5%}.tabs__panel{width:100%;padding:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none}.tabs__panel[data-exiting=true]{width:100%;position:absolute;top:0;left:0}.tabs__panel[data-orientation=horizontal]{margin-top:calc(var(--spacing) * 4)}.tabs__panel[data-orientation=vertical]{margin-left:calc(var(--spacing) * 4)}.tabs__indicator{box-shadow:var(--shadow-surface);z-index:-1;border-radius:var(--radius-3xl);background-color:var(--segment);width:100%;height:100%;transition-property:translate,width,height;transition-duration:.25s;transition-timing-function:var(--ease-out-fluid);position:absolute;top:0;left:0}.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs--secondary>.tabs__list-container>.tabs__list{background-color:#0000;border-radius:0;padding:0}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=horizontal]{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border);max-width:100%;overflow:auto clip}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=vertical]{border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--border)}.tabs--secondary>.tabs__list-container .tabs__tab{border-radius:0}.tabs--secondary>.tabs__list-container .tabs__tab[data-selected=true]{color:var(--foreground)}.tabs--secondary>.tabs__list-container .tabs__separator{display:none}.tabs--secondary>.tabs__list-container .tabs__indicator{background-color:var(--accent);box-shadow:none;border-radius:0}.tabs--secondary[data-orientation=horizontal]>.tabs__list-container .tabs__indicator{height:2px;top:auto;bottom:0}.tabs--secondary[data-orientation=vertical]>.tabs__list-container .tabs__indicator{width:2px;height:100%;top:0;left:0}.button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.button{height:calc(var(--spacing) * 9)}}.button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button{cursor:var(--cursor-interactive);--button-bg:transparent;--button-bg-hover:var(--button-bg);--button-bg-pressed:var(--button-bg-hover);--button-fg:currentColor;background-color:var(--button-bg);color:var(--button-fg)}.button:focus-visible:not(:focus),.button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.button:disabled,.button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.button[data-pending=true]{pointer-events:none}.button:active,.button[data-pressed=true]{background-color:var(--button-bg-pressed);transform:scale(.97)}@media(hover:hover){.button:hover,.button[data-hovered=true]{background-color:var(--button-bg-hover)}}.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.button--sm{height:calc(var(--spacing) * 8)}}.button--sm svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.button--sm:active,.button--sm[data-pressed=true]{transform:scale(.98)}.button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.button--lg{height:calc(var(--spacing) * 10)}}.button--lg:active,.button--lg[data-pressed=true]{transform:scale(.96)}.button--primary{--button-bg:var(--accent);--button-bg-hover:var(--accent-hover);--button-bg-pressed:var(--accent-hover);--button-fg:var(--accent-foreground)}.button--secondary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover);--button-fg:var(--accent-soft-foreground)}.button--tertiary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover)}.button--ghost,.button--outline{--button-bg:transparent;--button-bg-hover:var(--default);--button-bg-pressed:var(--default);--button-fg:var(--default-foreground)}.button--outline{border-style:var(--tw-border-style);border-width:1px;border-color:var(--border);--button-bg-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.button--outline{--button-bg-hover:color-mix(in srgb, var(--default) 60%, transparent)}}.button--danger{--button-bg:var(--danger);--button-bg-hover:var(--danger-hover);--button-bg-pressed:var(--danger-hover);--button-fg:var(--danger-foreground)}.button--danger-soft{--button-bg:var(--danger-soft);--button-bg-hover:var(--danger-soft-hover);--button-bg-pressed:var(--danger-soft-hover);--button-fg:var(--danger-soft-foreground)}.button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.button--icon-only{width:calc(var(--spacing) * 9)}}.button--icon-only.button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.button--icon-only.button--sm{width:calc(var(--spacing) * 8)}}.button--icon-only.button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.button--icon-only.button--lg{width:calc(var(--spacing) * 10)}}.button--full-width{width:100%}.button-group{justify-content:center;align-items:center;gap:0;height:auto;display:inline-flex}.button-group--horizontal{flex-direction:row}.button-group--vertical{flex-direction:column}.button-group .button{border-radius:0}.button-group--horizontal .button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.button-group--vertical .button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group .button:active,.button-group .button[data-pressed=true]{transform:none}.button-group .button:focus-visible:not(:focus),.button-group .button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button-group--horizontal .button-group__separator{width:1px;height:50%;top:25%;left:-1px}.button-group--vertical .button-group__separator{width:50%;height:1px;top:-1px;left:25%}.button-group--horizontal .button--outline:first-child{border-inline-end-style:var(--tw-border-style);border-inline-end-width:0}.button-group--horizontal .button--outline:last-child{border-inline-start-style:var(--tw-border-style);border-inline-start-width:0}.button-group--horizontal .button--outline:not(:first-child):not(:last-child){border-inline-style:var(--tw-border-style);border-inline-width:0}.button-group--vertical .button--outline:first-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.button-group--vertical .button--outline:last-child{border-top-style:var(--tw-border-style);border-top-width:0}.button-group--vertical .button--outline:not(:first-child):not(:last-child){border-block-style:var(--tw-border-style);border-block-width:0}.button-group--full-width{width:100%}.toggle-button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.toggle-button{height:calc(var(--spacing) * 9)}}.toggle-button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button{cursor:var(--cursor-interactive);--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover);--toggle-button-fg:currentColor;--toggle-button-bg-selected:var(--accent-soft);--toggle-button-bg-selected-hover:var(--accent-soft-hover);--toggle-button-bg-selected-pressed:var(--accent-soft-hover);--toggle-button-fg-selected:var(--accent-soft-foreground);background-color:var(--toggle-button-bg);color:var(--toggle-button-fg)}.toggle-button:focus-visible:not(:focus),.toggle-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.toggle-button:disabled,.toggle-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.toggle-button:hover,.toggle-button[data-hovered=true]{background-color:var(--toggle-button-bg-hover)}}.toggle-button:active,.toggle-button[data-pressed=true]{background-color:var(--toggle-button-bg-pressed);transform:scale(.97)}.toggle-button[data-selected=true]{background-color:var(--toggle-button-bg-selected);color:var(--toggle-button-fg-selected)}@media(hover:hover){.toggle-button[data-selected=true]:hover,.toggle-button[data-selected=true][data-hovered=true]{background-color:var(--toggle-button-bg-selected-hover)}}.toggle-button[data-selected=true]:active,.toggle-button[data-selected=true][data-pressed=true]{background-color:var(--toggle-button-bg-selected-pressed)}.toggle-button svg{pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.toggle-button svg{margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.toggle-button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.toggle-button--sm{height:calc(var(--spacing) * 8)}}.toggle-button--sm svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toggle-button--sm:active,.toggle-button--sm[data-pressed=true]{transform:scale(.98)}.toggle-button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.toggle-button--lg{height:calc(var(--spacing) * 10)}}.toggle-button--lg:active,.toggle-button--lg[data-pressed=true]{transform:scale(.96)}.toggle-button--default{--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover)}.toggle-button--ghost{--toggle-button-bg:transparent;--toggle-button-bg-hover:var(--default);--toggle-button-bg-pressed:var(--default);--toggle-button-fg:var(--default-foreground)}.toggle-button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.toggle-button--icon-only{width:calc(var(--spacing) * 9)}}.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 8)}}.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 10)}}.toggle-button-group{justify-content:center;align-items:center;gap:0;width:fit-content;height:auto;display:inline-flex}.toggle-button-group--horizontal{flex-direction:row}.toggle-button-group--vertical{flex-direction:column}.toggle-button-group--full-width{width:100%}.toggle-button-group .toggle-button{border-radius:0}.toggle-button-group--horizontal .toggle-button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group .toggle-button:active,.toggle-button-group .toggle-button[data-pressed=true]{transform:none}.toggle-button-group .toggle-button:focus-visible:not(:focus),.toggle-button-group .toggle-button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.toggle-button-group--full-width .toggle-button{flex:1}.toggle-button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button-group--horizontal .toggle-button-group__separator{width:1px;height:50%;top:25%;left:-1px}.toggle-button-group--vertical .toggle-button-group__separator{width:50%;height:1px;top:-1px;left:25%}.toggle-button-group--detached{gap:var(--spacing)}.toggle-button-group--detached .toggle-button{border-radius:calc(var(--radius) * 3)}.toggle-button-group--detached .toggle-button-group__separator{display:none}.toolbar{align-items:center;gap:calc(var(--spacing) * 2);grid-auto-flow:column;width:fit-content;display:grid}.toolbar .separator--vertical{align-self:center;height:50%}.toolbar .separator--horizontal{justify-content:center;justify-self:center;width:50%}.toolbar--vertical{grid-auto-flow:row;justify-content:flex-start;align-items:flex-start}.toolbar--vertical .button-group{justify-content:flex-start}.toolbar--attached{border-radius:calc(var(--radius) * 3);background-color:var(--surface);padding:var(--spacing);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dropdown{gap:var(--spacing);flex-direction:column;display:flex}.dropdown__trigger{--tw-outline-style:none;transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;display:inline-block}.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.dropdown__trigger{cursor:var(--cursor-interactive)}.dropdown__trigger:focus-visible:not(:focus),.dropdown__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.dropdown__trigger:disabled,.dropdown__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.dropdown__trigger[data-pending=true]{pointer-events:none}.dropdown__trigger:active,.dropdown__trigger[data-pressed=true]{transform:scale(.97)}.dropdown__popover{max-width:48svw;transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));padding:0;overflow-y:auto}@media(min-width:48rem){.dropdown__popover{min-width:calc(var(--spacing) * 55)}}.dropdown__popover{border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay)}.dropdown__popover:focus-visible:not(:focus),.dropdown__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.dropdown__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.dropdown__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.dropdown__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.dropdown__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.dropdown__popover[data-exiting=true],.dropdown__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.dropdown__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.dropdown__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.dropdown__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.dropdown__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.dropdown__popover [data-slot=dropdown-menu]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.dropdown__popover [data-slot=menu-item]{padding-inline:calc(var(--spacing) * 2.5)}.dropdown__menu{gap:calc(var(--spacing) * .5);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.dropdown__menu [data-slot=separator]{width:94%;margin-left:3%}.list-box-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item{cursor:var(--cursor-interactive)}.list-box-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.list-box-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.list-box-item:has(.list-box-item__indicator){padding-inline-end:calc(var(--spacing) * 7)}.list-box-item:focus-visible:not(:focus),.list-box-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.list-box-item:active,.list-box-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.list-box-item:hover,.list-box-item[data-hovered=true]{background-color:var(--default)}}.list-box-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.list-box-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--default-foreground);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-end:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]{transition:stroke-dashoffset .25s linear}:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item--danger .list-box-item__indicator,.list-box-item--danger [data-slot=label]{color:var(--danger)}.list-box-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.list-box{width:100%;padding:var(--spacing);position:relative;overflow:clip}.list-box>*+*{margin-top:var(--spacing)}.list-box [data-slot=separator][data-orientation=horizontal]{width:94%;margin-left:3%}.menu-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item{cursor:var(--cursor-interactive)}.menu-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.menu-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.menu-item [data-slot=submenu-indicator] svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.menu-item:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 7)}.menu-item[data-has-submenu=true]:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 7)}.menu-item:focus-visible:not(:focus),.menu-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.menu-item:active,.menu-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.menu-item:hover,.menu-item[data-hovered=true]{background-color:var(--default)}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]{transition:stroke-dashoffset .1s linear}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--dot]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.menu-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.menu-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-start:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item[data-has-submenu=true] .menu-item__indicator{inset-inline-start:auto;inset-inline-end:calc(var(--spacing) * 2)}.menu-item__indicator [data-slot=menu-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:0}.menu-item__indicator--submenu{color:var(--muted)}.menu-item__indicator--submenu svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.menu-item--danger .menu-item__indicator,.menu-item--danger [data-slot=label]{color:var(--danger)}.menu-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.menu{gap:var(--spacing);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.menu [data-slot=separator]{width:94%;margin-left:3%}.tag-group{gap:var(--spacing);flex-direction:column;display:flex;position:relative}.tag-group__list{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex;position:relative}.tag-group [slot=description],.tag-group [data-slot=description],.tag-group [slot=errorMessage],.tag-group [data-slot=error-message]{padding:var(--spacing)}.tag{--optical-offset:.031em;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:inline-flex;position:relative}.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tag{cursor:var(--cursor-interactive)}.tag svg{pointer-events:none;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:currentColor;flex-shrink:0;align-self:center}.tag:is([data-disabled=true],[aria-disabled=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tag:is(:focus-visible,[data-focus-visible]){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tag:is([data-selected=true],[aria-selected=true]){background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.tag:is([data-selected=true],[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-soft-hover)}}.tag--sm{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--md{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--lg{border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.tag--default{background-color:var(--default);color:var(--default-foreground)}@media(hover:hover){.tag--default:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--default-hover)}}.tag--surface{background-color:var(--surface);color:var(--surface-foreground)}@media(hover:hover){.tag--surface:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--surface-hover)}}.tag__remove-button{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:inherit}.tag__remove-button svg{width:inherit;height:inherit;color:currentColor;flex-shrink:0;align-self:center}.color-area{width:100%;max-width:calc(var(--spacing) * 56);border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;aspect-ratio:1;background:var(--color-area-background);flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-area[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-area--show-dots:after{content:"";pointer-events:none;border-radius:inherit;background-image:radial-gradient(circle,#fff3 1px,#0000 1px);background-size:8px 8px;position:absolute;top:0;right:0;bottom:0;left:0}.color-area__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);will-change:width,height;background-color:var(--color-area-thumb-color);transition:width .15s var(--ease-out),height .15s var(--ease-out);border:3px solid #fff;box-shadow:0 0 0 1px #0000001a,inset 0 0 0 1px #0000001a}.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-area__thumb[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-area__thumb[data-dragging=true]{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.color-area__thumb[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker{display:inline-flex}.color-picker__trigger{align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-flex}.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-picker__trigger [data-slot=label]{cursor:var(--cursor-interactive)}.color-picker__trigger:focus-visible:not(:focus),.color-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-picker__trigger:disabled,.color-picker__trigger[data-disabled=true],.color-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker__popover{min-width:calc(var(--spacing) * 62);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 3);box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5));gap:calc(var(--spacing) * 3);flex-direction:column;display:flex;overflow:hidden auto}.color-picker__popover:focus-visible:not(:focus),.color-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.color-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.color-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.color-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.color-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.color-picker__popover[data-exiting=true],.color-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.color-slider{gap:var(--spacing);grid-template:"label output""track track"/1fr auto;width:100%;display:grid}.color-slider:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template:"track"/1fr;gap:0}.color-slider:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-columns:1fr;grid-template-areas:"label""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output){grid-template-columns:1fr;grid-template-areas:"output""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output) .color-slider__output{justify-self:end}.color-slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.color-slider .color-slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.color-slider .color-slider__track{border-radius:calc(var(--radius) * 2);grid-area:track;position:relative}.color-slider .color-slider__track:before,.color-slider .color-slider__track:after{content:"";z-index:0;pointer-events:none;position:absolute}.color-slider .color-slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;border-style:var(--tw-border-style);border-width:3px;border-color:var(--color-white);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);z-index:1;transition:transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-slider .color-slider__thumb[data-dragging=true]{cursor:grabbing}.color-slider .color-slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-slider .color-slider__thumb[data-disabled=true]{cursor:default;background-color:var(--default)}.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]) [data-slot=label]{opacity:1}.color-slider[data-orientation=horizontal]{flex-direction:column}.color-slider[data-orientation=horizontal] .color-slider__track{height:calc(var(--spacing) * 5);border-radius:0;justify-self:center;width:calc(100% - 1.25rem);box-shadow:inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:before,.color-slider[data-orientation=horizontal] .color-slider__track:after{width:.625rem;height:100%;top:0}.color-slider[data-orientation=horizontal] .color-slider__track:before{border-top-left-radius:calc(var(--radius) * 2);border-bottom-left-radius:calc(var(--radius) * 2);background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;left:-.625rem;box-shadow:inset 1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:after{border-top-right-radius:calc(var(--radius) * 2);border-bottom-right-radius:calc(var(--radius) * 2);background-color:var(--track-end-color,transparent);right:-.625rem;box-shadow:inset -1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);top:50%}.color-slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;place-items:center;height:100%}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template-rows:1fr;grid-template-areas:"track";gap:0}.color-slider[data-orientation=vertical]:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-rows:1fr auto;grid-template-areas:"track""label"}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):has(.color-slider__output){grid-template-rows:auto 1fr;grid-template-areas:"output""track"}.color-slider[data-orientation=vertical] .color-slider__output,.color-slider[data-orientation=vertical] [data-slot=label]{text-align:center}.color-slider[data-orientation=vertical] .color-slider__track{width:calc(var(--spacing) * 5);border-radius:0;justify-self:center;height:calc(100% - 1.25rem);box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:before,.color-slider[data-orientation=vertical] .color-slider__track:after{width:100%;height:.625rem;left:0}.color-slider[data-orientation=vertical] .color-slider__track:before{background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;border-bottom-right-radius:999px;border-bottom-left-radius:999px;bottom:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:after{background-color:var(--track-end-color,transparent);border-top-left-radius:999px;border-top-right-radius:999px;top:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);left:50%}.color-swatch{box-sizing:border-box;width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);background:linear-gradient(var(--color-swatch-current),var(--color-swatch-current)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-swatch--circle{border-radius:calc(var(--radius) * 2)}.color-swatch--square{border-radius:calc(var(--radius) * .75)}.color-swatch--xs{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.color-swatch--xs.color-swatch--circle{border-radius:calc(var(--radius) * 1)}.color-swatch--sm{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.color-swatch--sm.color-swatch--circle{border-radius:calc(var(--radius) * 1.5)}.color-swatch--lg{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.color-swatch--lg.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.color-swatch--xl.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch-picker{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.color-swatch-picker__item{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);border-style:var(--tw-border-style);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:border-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);border-width:2px;border-color:#0000;outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__item:focus-visible,.color-swatch-picker__item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-swatch-picker__item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-swatch-picker__item[data-selected=true]{border-color:var(--color-swatch-current);box-shadow:var(--field-shadow)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{transform:scale(.77)}.color-swatch-picker__swatch{border-radius:inherit;width:100%;height:100%;transition:transform .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:block}.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-swatch-picker__swatch:hover{transform:scale(1.1)}}.color-swatch-picker__indicator{pointer-events:none;z-index:10;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.color-swatch-picker__indicator>*{width:33.3333%;height:33.3333%;color:var(--color-white);transition:transform .15s var(--ease-out);transform:scale(0)translateZ(0)}.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__indicator[data-light-color=true] .color-swatch-picker__indicator>*{color:var(--color-black)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__indicator>*{transform:scale(1)translateZ(0)}.color-swatch-picker--stack{flex-direction:column}.color-swatch-picker--xs .color-swatch-picker__item{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px}.color-swatch-picker--sm .color-swatch-picker__item{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);border-style:var(--tw-border-style);border-width:2px}.color-swatch-picker--lg .color-swatch-picker__item{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--xl .color-swatch-picker__item{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--square .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-input-group:hover:not(:focus-within),.color-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.color-input-group[data-focus-within=true],.color-input-group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.color-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group[data-invalid=true]:focus,.color-input-group[data-invalid=true]:focus-visible,.color-input-group[data-invalid=true][data-focused=true],.color-input-group[data-invalid=true][data-focus-visible=true],.color-input-group[data-invalid=true]:focus-within,.color-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.color-input-group[data-disabled=true],.color-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-input-group__input{cursor:text;border-style:var(--tw-border-style);height:100%;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;display:flex}@media(min-width:40rem){.color-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.color-input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}.color-input-group:has([data-slot=color-input-group-prefix]) .color-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.color-input-group:has([data-slot=color-input-group-suffix]) .color-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.color-input-group__input:focus,.color-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.color-input-group__prefix{color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group__suffix{color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--color-input-group-bg);--color-input-group-bg:var(--default);--color-input-group-bg-hover:var(--default-hover);--color-input-group-bg-focus:var(--default)}@media(hover:hover){.color-input-group--secondary:hover:not(:focus-within),.color-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--color-input-group-bg-hover)}}.color-input-group--secondary:focus-within,.color-input-group--secondary[data-focus-within=true]{background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group--secondary[data-invalid=true]:focus,.color-input-group--secondary[data-invalid=true]:focus-visible,.color-input-group--secondary[data-invalid=true][data-focused=true],.color-input-group--secondary[data-invalid=true][data-focus-visible=true],.color-input-group--secondary[data-invalid=true]:focus-within,.color-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary [data-slot=color-input-group-input]{background-color:#0000}.color-input-group--full-width{width:100%}.color-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.color-field[data-invalid=true],.color-field[aria-invalid=true]) [data-slot=description]{display:none}.color-field [data-slot=label]{width:fit-content}.color-field--full-width{width:100%}.slider{gap:var(--spacing);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.slider .slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.slider .slider__track{border-radius:calc(var(--radius) * 1.5);background-color:var(--default);grid-area:track;position:relative}.slider .slider__fill{pointer-events:none;background-color:var(--accent);position:absolute}.slider .slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 1.5);background-color:var(--accent);-webkit-tap-highlight-color:transparent;transition:background-color .25s var(--ease-smooth),transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.slider .slider__thumb:after{z-index:10;border-radius:calc(var(--radius) * 1);background-color:var(--accent-foreground);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);content:"";transform-origin:50%;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));position:relative}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:after:not(:is()){transition-property:none}}.slider .slider__thumb[data-dragging=true]{cursor:grabbing}.slider .slider__thumb[data-dragging=true]:after{scale:.9}@media(prefers-reduced-motion:reduce){.slider .slider__thumb[data-dragging=true]:after:not(:is()){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.slider .slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.slider .slider__thumb[data-disabled=true]{cursor:default}.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]) [data-slot=label]{opacity:1}.slider[data-orientation=horizontal]{flex-direction:column}.slider[data-orientation=horizontal] .slider__track{height:calc(var(--spacing) * 5);border-inline-style:var(--tw-border-style);border-inline-width:.75rem;border-inline-color:#0000;width:100%}.slider[data-orientation=horizontal] .slider__track[data-fill-start=true]{border-inline-start-color:var(--accent)}.slider[data-orientation=horizontal] .slider__track[data-fill-end=true]{border-inline-end-color:var(--accent)}.slider[data-orientation=horizontal] .slider__fill,.slider[data-orientation=horizontal] .slider__thumb{height:100%}.slider[data-orientation=horizontal] .slider__thumb{width:1.75rem;top:50%}.slider[data-orientation=horizontal] .slider__thumb:after{width:1.5rem;height:1rem}.slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;height:100%}.slider[data-orientation=vertical] .slider__output,.slider[data-orientation=vertical] [data-slot=label]{text-align:center}.slider[data-orientation=vertical] .slider__track{height:100%;width:calc(var(--spacing) * 5);border-block-style:var(--tw-border-style);border-block-width:.75rem;border-block-color:#0000;justify-self:center}.slider[data-orientation=vertical] .slider__track[data-fill-start=true]{border-bottom-color:var(--accent)}.slider[data-orientation=vertical] .slider__track[data-fill-end=true]{border-top-color:var(--accent)}.slider[data-orientation=vertical] .slider__fill,.slider[data-orientation=vertical] .slider__thumb{width:100%}.slider[data-orientation=vertical] .slider__thumb{height:1.75rem;left:50%}.slider[data-orientation=vertical] .slider__thumb:after{width:1rem;height:1.5rem}.switch{align-items:flex-start;gap:var(--spacing);-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);--switch-control-bg:var(--default);--switch-control-bg-hover:var(--switch-control-bg);flex-direction:column;display:flex}@supports (color:color-mix(in lab,red,red)){.switch{--switch-control-bg-hover:color-mix(in oklab, var(--switch-control-bg), transparent 20%)}}.switch{--switch-control-bg-pressed:var(--switch-control-bg-hover);--switch-control-bg-checked:var(--accent);--switch-control-bg-checked-hover:var(--accent-hover)}.switch[data-disabled=true],.switch[data-disabled=true] [data-slot=description],.switch[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.switch[data-disabled=true] .switch__thumb{background-color:var(--default-foreground)}@supports (color:color-mix(in lab,red,red)){.switch[data-disabled=true] .switch__thumb{background-color:color-mix(in oklab,var(--default-foreground) 20%,transparent)}}.switch>[data-slot=description]{width:100%;min-width:0;padding-inline-start:3.25rem}.switch>[data-slot=field-error]{width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--muted);padding-inline-start:3.25rem}.switch.switch--sm>[data-slot=description],.switch.switch--sm>[data-slot=field-error]{padding-inline-start:2.75rem}.switch.switch--lg>[data-slot=description],.switch.switch--lg>[data-slot=field-error]{padding-inline-start:3.75rem}:is(.switch:disabled[aria-checked=true],.switch:disabled[data-selected=true],.switch[data-disabled=true][aria-checked=true],.switch[data-disabled=true][data-selected=true],.switch[aria-disabled=true][aria-checked=true],.switch[aria-disabled=true][data-selected=true]) .switch__thumb{opacity:.4}.switch__control{border-radius:calc(var(--radius) * 1.5);background-color:var(--switch-control-bg);width:2.5rem;height:1.25rem;transition:background-color .25s var(--ease-smooth),box-shadow .15s var(--ease-out);flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch:focus-visible .switch__control,.switch:has([data-slot=switch-content][data-focus-visible=true]) .switch__control,.switch [data-slot=switch-content][data-focus-visible=true] .switch__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.switch:hover .switch__control,.switch:has([data-slot=switch-content][data-hovered=true]) .switch__control,.switch [data-slot=switch-content][data-hovered=true] .switch__control{background-color:var(--switch-control-bg-hover)}.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control{background-color:var(--switch-control-bg-pressed)}:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transform:none}@media(prefers-reduced-motion:reduce){:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transform:none}}.switch[aria-checked=true] .switch__control,.switch[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked)}.switch[aria-checked=true]:hover .switch__control,.switch[data-selected=true]:hover .switch__control,.switch[aria-checked=true][data-hovered=true] .switch__control,.switch[data-selected=true][data-hovered=true] .switch__control,.switch:has([data-slot=switch-content][data-hovered=true])[data-selected=true] .switch__control,.switch[aria-checked=true]:active .switch__control,.switch[data-selected=true]:active .switch__control,.switch[aria-checked=true][data-pressed=true] .switch__control,.switch[data-selected=true][data-pressed=true] .switch__control,.switch:has([data-slot=switch-content][data-pressed=true])[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked-hover)}.switch__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.switch--sm .switch__control{border-radius:calc(var(--radius) * 1);width:2rem;height:1rem}.switch--lg .switch__control{width:3rem;height:1.5rem}.switch__thumb{transform-origin:50%;border-radius:calc(var(--radius) * 1);background-color:var(--color-white);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);width:1.375rem;height:1rem;transition:margin .3s var(--ease-out-fluid),background-color .2s var(--ease-out);margin-inline-start:calc(var(--spacing) * .5);display:flex}.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch[aria-checked=true] .switch__thumb,.switch[data-selected=true] .switch__thumb{background-color:var(--accent-foreground);color:var(--accent);margin-inline-start:calc(100% - 1.5rem);box-shadow:0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d}.switch--sm .switch__thumb{border-radius:calc(var(--radius) * .75);width:1.03125rem;height:.75rem}.switch[aria-checked=true] :is(.switch--sm .switch__thumb),.switch[data-selected=true] :is(.switch--sm .switch__thumb){margin-inline-start:calc(100% - 1.15625rem)}.switch--lg .switch__thumb{border-radius:calc(var(--radius) * 1.5);width:1.71875rem;height:1.25rem}.switch[aria-checked=true] :is(.switch--lg .switch__thumb),.switch[data-selected=true] :is(.switch--lg .switch__thumb){margin-inline-start:calc(100% - 1.84375rem)}.switch__thumb>*{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.switch__label{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.switch [data-slot=label]{-webkit-user-select:none;user-select:none}.switch__content [data-slot=label]{cursor:var(--cursor-interactive)}.switch [data-slot=description]{cursor:default;-webkit-user-select:none;user-select:none}.switch-group{gap:calc(var(--spacing) * 6);flex-direction:column;display:flex}.switch-group__items{gap:calc(var(--spacing) * 4);display:flex}.switch-group--horizontal .switch-group__items{flex-direction:row}.switch-group--vertical .switch-group__items{flex-direction:column}.badge{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);min-height:calc(var(--spacing) * 7);min-width:calc(var(--spacing) * 7);border-radius:calc(var(--radius) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:1.34;--badge-bg:var(--default);--badge-fg:var(--default-foreground);--badge-border:var(--background);background-color:var(--badge-bg);color:var(--badge-fg);border:1px solid var(--badge-border);flex-shrink:0;line-height:1.34;display:inline-flex}.badge__label{padding-inline:calc(var(--spacing) * .5)}.badge-anchor{flex-shrink:0;display:inline-flex;position:relative}.badge--lg{min-height:calc(var(--spacing) * 8);min-width:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;line-height:1.43}.badge--sm{min-height:calc(var(--spacing) * 4);min-width:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);--tw-leading:1.34;font-size:10px;line-height:1.34}.badge--accent{--badge-fg:var(--accent-soft-foreground)}.badge--default{--badge-fg:var(--default-foreground)}.badge--success{--badge-fg:var(--success-soft-foreground)}.badge--warning{--badge-fg:var(--warning-soft-foreground)}.badge--danger{--badge-fg:var(--danger-soft-foreground)}.badge--top-right{position:absolute;top:0;right:0;transform:translate(25%,-25%)}.badge--top-left{position:absolute;top:0;left:0;transform:translate(-25%,-25%)}.badge--bottom-right{position:absolute;bottom:0;right:0;transform:translate(25%,25%)}.badge--bottom-left{position:absolute;bottom:0;left:0;transform:translate(-25%,25%)}.badge--primary.badge--accent{--badge-bg:var(--accent);--badge-fg:var(--accent-foreground)}.badge--primary.badge--default{--badge-bg:var(--default);--badge-fg:var(--default-foreground)}.badge--primary.badge--success{--badge-bg:var(--success);--badge-fg:var(--success-foreground)}.badge--primary.badge--warning{--badge-bg:var(--warning);--badge-fg:var(--warning-foreground)}.badge--primary.badge--danger{--badge-bg:var(--danger);--badge-fg:var(--danger-foreground)}.badge--soft.badge--accent{--badge-bg:var(--accent-soft);--badge-fg:var(--accent-soft-foreground)}.badge--soft.badge--default{--badge-bg:var(--default-soft);--badge-fg:var(--default-soft-foreground)}.badge--soft.badge--success{--badge-bg:var(--success-soft);--badge-fg:var(--success-soft-foreground)}.badge--soft.badge--warning{--badge-bg:var(--warning-soft);--badge-fg:var(--warning-soft-foreground)}.badge--soft.badge--danger{--badge-bg:var(--danger-soft);--badge-fg:var(--danger-soft-foreground)}.chip{align-items:center;gap:calc(var(--spacing) * .5);border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--chip-bg:var(--default);--chip-fg:currentColor;background-color:var(--chip-bg);color:var(--chip-fg);flex-shrink:0;display:inline-flex}.chip__label{padding-inline:calc(var(--spacing) * .5)}.chip--accent{--chip-fg:var(--accent-soft-foreground)}.chip--danger{--chip-fg:var(--danger-soft-foreground)}.chip--default{--chip-fg:var(--default-foreground)}.chip--success{--chip-fg:var(--success-soft-foreground)}.chip--warning{--chip-fg:var(--warning-soft-foreground)}.chip--tertiary{--chip-bg:transparent}.chip--sm{padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));padding-block:0}.chip--md{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.chip--lg{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.chip--primary.chip--accent{--chip-bg:var(--accent);--chip-fg:var(--accent-foreground)}.chip--primary.chip--success{--chip-bg:var(--success);--chip-fg:var(--success-foreground)}.chip--primary.chip--warning{--chip-bg:var(--warning);--chip-fg:var(--warning-foreground)}.chip--primary.chip--danger{--chip-bg:var(--danger);--chip-fg:var(--danger-foreground)}.chip--accent.chip--soft{--chip-bg:var(--accent-soft);--chip-fg:var(--accent-soft-foreground)}.chip--success.chip--soft{--chip-bg:var(--success-soft);--chip-fg:var(--success-soft-foreground)}.chip--warning.chip--soft{--chip-bg:var(--warning-soft);--chip-fg:var(--warning-soft-foreground)}.chip--danger.chip--soft{--chip-bg:var(--danger-soft);--chip-fg:var(--danger-soft-foreground)}.chip--default.chip--soft{--chip-bg:var(--default-soft);--chip-fg:var(--default-soft-foreground)}.table-root{grid-template-columns:minmax(0,1fr);width:100%;display:grid;position:relative;overflow:clip}.table__scroll-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;overflow-x:auto}.table-root--primary{background-color:var(--surface-secondary);padding-inline:var(--spacing);padding-bottom:var(--spacing);border-radius:min(32px,calc(var(--radius) * 2.5))}.table-root--secondary .table__header{border-bottom-style:var(--tw-border-style);background-color:#0000;border-bottom-width:0}.table-root--secondary .table__column{background-color:var(--surface-secondary)}.table-root--secondary :is(th.table__column:first-child,[role=row]>[role=presentation]:first-of-type>.table__column){border-start-start-radius:min(32px,var(--radius-2xl));border-end-start-radius:min(32px,var(--radius-2xl))}.table-root--secondary :is(th.table__column:last-child,[role=row]>[role=presentation]:last-of-type>.table__column){border-start-end-radius:min(32px,var(--radius-2xl));border-end-end-radius:min(32px,var(--radius-2xl))}.table-root--secondary .table__body{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table-root--secondary .table__body tr:first-child td:first-child,.table-root--secondary .table__body tr:first-child td:last-child,.table-root--secondary .table__body tr:last-child td:first-child,.table-root--secondary .table__body tr:last-child td:last-child{border-radius:0}.table-root--secondary .table__body:not(tbody){border-radius:0;overflow:visible}.table-root--secondary .table__row .table__cell{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row .table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table-root--secondary .table__row .table__cell{background-color:#0000}@media(hover:hover){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--default) 50%,transparent)}}}.table__content{border-collapse:separate;--tw-border-spacing-x:0;--tw-border-spacing-y:0;width:100%;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.table-root--primary .table__content{overflow:clip}.table__header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator)}@supports (color:color-mix(in lab,red,red)){.table__header{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__header{background-color:var(--surface-secondary)}.table__column{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);position:relative}.table__column:after{content:"";pointer-events:none;height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .5);background-color:var(--separator);inset-inline-end:calc(var(--spacing) * 0);position:absolute;top:50%}.table__column:last-child:not(:only-child):after{content:none}.table__column[data-allows-sorting=true]{cursor:var(--cursor-interactive)}@media(hover:hover){.table__column[data-allows-sorting=true]:hover,.table__column[data-allows-sorting=true][data-hovered=true]{color:var(--foreground)}}.table__column:focus-visible,.table__column[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}[role=row]>[role=presentation]:last-of-type:not(:only-of-type)>.table__column:after{content:none}.table__sortable-column-header{justify-content:space-between;align-items:center;display:flex}.table__sortable-column-indicator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out)}.table__sortable-column-indicator[data-direction=descending]{rotate:180deg}.table__body tr:first-child td:first-child{border-start-start-radius:min(32px,var(--radius-2xl))}.table__body tr:first-child td:last-child{border-start-end-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:first-child{border-end-start-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:last-child{border-end-end-radius:min(32px,var(--radius-2xl))}.table__body:not(tbody){border-radius:min(32px,var(--radius-2xl));height:100%;position:relative;overflow:clip}.table__row{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator);height:100%;position:relative}@supports (color:color-mix(in lab,red,red)){.table__row{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__row:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 40%,transparent)}}}.table__row[data-selected=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row[data-selected=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 10%,transparent)}}.table__row[aria-disabled=true],.table__row[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.table__row:focus-visible,.table__row[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.table__row[data-dragging=true]{opacity:.5}.table__row[data-drop-target=true] .table__cell{background-color:var(--accent-soft)}.table__cell{background-color:var(--surface);height:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);vertical-align:middle;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table__cell:focus-visible,.table__cell[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true]) :is(.table__cell,.table__column){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):only-child,.table__row:is(:focus-visible,[data-focus-visible=true])>:only-child :is(.table__cell,.table__column){border-radius:calc(var(--radius) * 1);--tw-shadow:inset 0 0 0 2px var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):first-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:first-child:not(:only-child) :is(.table__cell,.table__column){border-top-left-radius:calc(var(--radius) * 1);border-bottom-left-radius:calc(var(--radius) * 1);--tw-shadow:inset 2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):last-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:last-child:not(:only-child) :is(.table__cell,.table__column){border-top-right-radius:calc(var(--radius) * 1);border-bottom-right-radius:calc(var(--radius) * 1);--tw-shadow:inset -2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):not(:first-child):not(:last-child):not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:not(:first-child):not(:last-child):not(:only-child) :is(.table__cell,.table__column){--tw-shadow:inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__cell[data-tree-column]{padding-inline-start:calc(1rem * var(--table-row-level,1))}.table__footer{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);align-items:center;display:flex}.table__resizable-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;position:relative;overflow:auto}.table__column-resizer{height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;border-radius:calc(var(--radius) * .5);background-color:var(--separator);box-sizing:content-box;--tw-translate-x: 50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:col-resize;touch-action:none;padding-inline:calc(var(--spacing) * 2);--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-clip:content-box;border-style:none;outline-style:none;position:absolute;top:50%}.table__column-resizer[data-hovered=true],.table__column-resizer:hover,.table__column-resizer[data-resizing=true]{height:100%;width:calc(var(--spacing) * .5);background-color:var(--accent)}.table__column-resizer[data-focus-visible=true],.table__column-resizer:focus-visible{height:100%;width:calc(var(--spacing) * .5);background-color:var(--focus)}.table__column:has(.table__column-resizer):after{content:none}.table__load-more td,.table__load-more [role=rowheader]{padding-block:calc(var(--spacing) * 3);text-align:center}:is(.table__load-more td,.table__load-more [role=rowheader])>*{margin-inline:auto}.table__load-more-content{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 2);display:flex}.alert{justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 4);background-color:var(--surface);width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex}.alert__content{flex-direction:column;flex-grow:1;align-items:flex-start;height:100%;display:flex}.alert__indicator{padding:var(--spacing);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:flex}.alert__indicator [data-slot=alert-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.alert__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.alert__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.alert--default .alert__indicator,.alert--default .alert__title{color:var(--foreground)}.alert--accent .alert__indicator,.alert--accent .alert__title{color:var(--accent-soft-foreground)}.alert--success .alert__indicator,.alert--success .alert__title{color:var(--success-soft-foreground)}.alert--warning .alert__indicator,.alert--warning .alert__title{color:var(--warning-soft-foreground)}.alert--danger .alert__indicator,.alert--danger .alert__title{color:var(--danger-soft-foreground)}.empty-state{padding:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.skeleton{pointer-events:none;border-radius:calc(var(--radius) * .5);background-color:var(--surface-tertiary);position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.skeleton{background-color:color-mix(in oklab,var(--surface-tertiary) 70%,transparent)}}.skeleton--shimmer:after{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-gradient-position:to right;animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}@supports (background-image:linear-gradient(in lab,red,red)){.skeleton--shimmer:after{--tw-gradient-position:to right in oklab}}.skeleton--shimmer:after{background-image:linear-gradient(var(--tw-gradient-stops));--tw-gradient-from:transparent;--tw-gradient-via:var(--surface-tertiary);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));--tw-gradient-to:transparent;--tw-content:"";content:var(--tw-content)}.skeleton--shimmer:has(.skeleton):after{content:none}.skeleton--shimmer:has(.skeleton):before{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-content:"";content:var(--tw-content);z-index:10;pointer-events:none;mix-blend-mode:overlay;background:linear-gradient(90deg,#0000,#ffffff80,#0000);animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}.skeleton--shimmer:has(.skeleton) .skeleton:after{content:none}.skeleton--pulse{animation:var(--animate-pulse)}.meter{gap:var(--spacing);--meter-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.meter [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.meter .meter__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.meter .meter__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.meter .meter__fill{border-radius:calc(var(--radius) * .5);background-color:var(--meter-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]) [data-slot=label]{opacity:1}.meter--sm .meter__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.meter--sm .meter__fill{border-radius:calc(var(--radius) * .25)}.meter--lg .meter__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.meter--lg .meter__fill{border-radius:calc(var(--radius) * .75)}.meter--default{--meter-fill:var(--default-foreground)}.meter--accent{--meter-fill:var(--accent)}.meter--success{--meter-fill:var(--success)}.meter--warning{--meter-fill:var(--warning)}.meter--danger{--meter-fill:var(--danger)}.progress-bar{gap:var(--spacing);--progress-bar-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.progress-bar [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.progress-bar .progress-bar__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.progress-bar .progress-bar__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.progress-bar .progress-bar__fill{border-radius:calc(var(--radius) * .5);background-color:var(--progress-bar-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-bar:not([aria-valuenow]) .progress-bar__fill{width:40%;animation:1.5s cubic-bezier(.65,0,.35,1) infinite progress-bar-indeterminate}.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]) [data-slot=label]{opacity:1}@keyframes progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(350%)}}.progress-bar--sm .progress-bar__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.progress-bar--sm .progress-bar__fill{border-radius:calc(var(--radius) * .25)}.progress-bar--lg .progress-bar__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.progress-bar--lg .progress-bar__fill{border-radius:calc(var(--radius) * .75)}.progress-bar--default{--progress-bar-fill:var(--default-foreground)}.progress-bar--accent{--progress-bar-fill:var(--accent)}.progress-bar--success{--progress-bar-fill:var(--success)}.progress-bar--warning{--progress-bar-fill:var(--warning)}.progress-bar--danger{--progress-bar-fill:var(--danger)}.progress-circle{--progress-circle-stroke:var(--accent);--progress-circle-track-stroke:var(--default);justify-content:center;align-items:center;display:inline-flex}.progress-circle .progress-circle__track{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.progress-circle .progress-circle__track-circle{stroke:var(--progress-circle-track-stroke)}.progress-circle .progress-circle__fill-circle{stroke:var(--progress-circle-stroke);transition:stroke-dashoffset .3s var(--ease-out)}.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-circle:not([aria-valuenow]) .progress-circle__track{animation:1s linear infinite progress-circle-spin}.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-circle:disabled,.progress-circle[data-disabled=true],.progress-circle[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@keyframes progress-circle-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.progress-circle--sm .progress-circle__track{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.progress-circle--lg .progress-circle__track{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.progress-circle--default{--progress-circle-stroke:var(--default-foreground)}.progress-circle--accent{--progress-circle-stroke:var(--accent)}.progress-circle--success{--progress-circle-stroke:var(--success)}.progress-circle--warning{--progress-circle-stroke:var(--warning)}.progress-circle--danger{--progress-circle-stroke:var(--danger)}.spinner{pointer-events:none;width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);flex-shrink:0;animation:.75s linear infinite spin;display:inline-flex}.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *),.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.spinner--sm{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.spinner--lg{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.spinner--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.spinner--current{color:inherit}.spinner--accent{color:var(--accent)}.spinner--danger{color:var(--danger)}.spinner--success{color:var(--success)}.spinner--warning{color:var(--warning)}.toast-region{pointer-events:none;z-index:50;--tw-outline-style:none;outline-style:none;width:calc(100vw - 2rem);position:fixed}@media(min-width:40rem){.toast-region{width:auto;min-width:var(--toast-width)}}.toast-region{display:block}.toast-region--bottom{bottom:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--bottom-start{bottom:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--bottom-end{right:calc(var(--spacing) * 4);bottom:calc(var(--spacing) * 4)}.toast-region--top{top:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--top-start{top:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--top-end{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4)}.toast-region:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast{pointer-events:auto;justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 1.5);background-color:var(--surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex;position:absolute;left:0;right:0}.toast--bottom,.toast--bottom-start,.toast--bottom-end{bottom:0}.toast--top,.toast--top-start,.toast--top-end{top:0}.toast:not([data-frontmost=true]){pointer-events:none;height:var(--front-height);overflow:hidden}.toast:not([data-frontmost=true]) .toast__close-button{pointer-events:none;opacity:0;outline:none}.toast[data-hidden=true]{pointer-events:none;opacity:0;display:flex}.toast:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast--bottom,.toast--bottom-start,.toast--bottom-end{view-transition-class:toast-bottom}.toast--top,.toast--top-start,.toast--top-end{view-transition-class:toast-top}.toast__content{flex-direction:column;flex-grow:1;align-self:center;align-items:flex-start;height:100%;display:flex}.toast__indicator{padding:var(--spacing);color:var(--overlay-foreground);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.toast__indicator [data-slot=toast-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__indicator [data-slot=spinner],.toast__indicator [data-slot=spinner-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--overlay-foreground)}.toast__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.toast__close-button{pointer-events:none;top:calc(var(--spacing) * -1);right:calc(var(--spacing) * -1);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);border-color:var(--border);background-color:var(--default);opacity:0;position:absolute}@media(min-width:40rem){.toast__close-button{border-style:var(--tw-border-style);background-color:var(--overlay);border-width:1px}}.toast__close-button{transition:opacity .15s var(--ease-smooth)}.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(min-width:40rem){.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}}@media(hover:hover){.toast__close-button:hover,.toast__close-button[data-hovered=true]{background-color:var(--default)}}.toast[data-frontmost=true]:hover .toast__close-button{pointer-events:auto;opacity:1}.toast__action{margin-top:calc(var(--spacing) * 2)}@media(min-width:40rem){.toast__action{margin-top:0}}.toast--accent .toast__title{color:var(--accent-soft-foreground)}.toast--success .toast__title,.toast--success .toast__indicator{color:var(--success-soft-foreground)}.toast--warning .toast__title,.toast--warning .toast__indicator{color:var(--warning-soft-foreground)}.toast--danger .toast__title,.toast--danger .toast__indicator{color:var(--danger-soft-foreground)}::view-transition-old(*){will-change:translate,opacity}::view-transition-new(*){will-change:translate,opacity}::view-transition-new(.toast-bottom):only-child{animation:.35s toast-slide-bottom-in}::view-transition-old(.toast-bottom):only-child{animation:.35s forwards toast-slide-bottom-out}::view-transition-new(.toast-top):only-child{animation:.35s toast-slide-top-in}::view-transition-old(.toast-top):only-child{animation:.35s forwards toast-slide-top-out}@keyframes toast-slide-bottom-in{0%{opacity:0;translate:0 100%}}@keyframes toast-slide-bottom-out{to{opacity:0;translate:0 100%}}@keyframes toast-slide-top-in{0%{opacity:0;translate:0 -100%}}@keyframes toast-slide-top-out{to{opacity:0;translate:0 -100%}}.checkbox-group{flex-direction:column;display:flex}.checkbox-group [data-slot=checkbox]{margin-top:calc(var(--spacing) * 4)}.checkbox{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.checkbox>[data-slot=description],.checkbox>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.checkbox [data-slot=label]{-webkit-user-select:none;user-select:none}.checkbox .checkbox__content [data-slot=label]{cursor:var(--cursor-interactive)}.checkbox[data-disabled=true],.checkbox[data-disabled=true] [data-slot=description],.checkbox[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.checkbox[data-selected=true],.checkbox[data-indeterminate=true]) .checkbox__indicator{border-color:var(--accent-foreground)}.checkbox [data-slot=checkbox-default-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);stroke-width:2.5px;color:var(--accent-foreground);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.2s;transition-duration:.2s}.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox[data-selected=true] [data-slot=checkbox-default-indicator--checkmark]{transition:stroke-dashoffset .15s linear 15ms}.checkbox[data-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[data-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark]{color:var(--danger-foreground)}.checkbox[data-indeterminate=true] [data-slot=checkbox-default-indicator--indeterminate]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.checkbox[data-indeterminate=true][data-invalid=true] [data-slot=checkbox-default-indicator--indeterminate],.checkbox[data-indeterminate=true][aria-invalid=true] [data-slot=checkbox-default-indicator--indeterminate]{color:var(--danger-foreground)}.checkbox__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .75);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative;overflow:hidden}.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox__control{cursor:var(--cursor-interactive)}.checkbox__control:before{pointer-events:none;z-index:0;transform-origin:50%;--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);border-radius:calc(var(--radius) * .75);background-color:var(--accent);opacity:0;--tw-content:"";content:var(--tw-content);transition:scale .1s var(--ease-linear),opacity .2s var(--ease-linear),background-color .2s var(--ease-out);position:absolute;top:0;right:0;bottom:0;left:0}@media(prefers-reduced-motion:reduce){.checkbox__control:before:not(:is()){transition-property:none}}.checkbox:focus-visible .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-focus-visible=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-focus-visible=true] .checkbox__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control{border-color:var(--field-border-hover)}:is(.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control):before{background-color:var(--accent-hover)}.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control{color:var(--accent-foreground);border-color:#0000}:is(.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.checkbox[data-indeterminate=true] .checkbox__control{background-color:var(--accent);color:var(--accent-foreground)}.checkbox:active[data-indeterminate=true] .checkbox__control,.checkbox[data-pressed=true][data-indeterminate=true] .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-pressed=true])[data-indeterminate=true] .checkbox__control{background-color:var(--accent-hover)}.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-visible,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focused=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-visible=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-within,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground);border-color:#0000}:is(.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);background-color:var(--danger);opacity:1}.checkbox[data-indeterminate=true][aria-invalid=true] .checkbox__control,.checkbox[data-indeterminate=true][data-invalid=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground)}.checkbox__indicator{z-index:10;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);justify-content:center;align-items:center;display:flex;position:relative}.checkbox__indicator svg{width:100%;height:100%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.checkbox--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.checkbox--secondary .checkbox__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--checkbox-control-bg);--checkbox-control-bg:var(--default)}.checkbox:hover :is(.checkbox--secondary .checkbox__control),.checkbox:has([data-slot=checkbox-content][data-hovered=true]) :is(.checkbox--secondary .checkbox__control),.checkbox [data-slot=checkbox-content][data-hovered=true] :is(.checkbox--secondary .checkbox__control){border-color:var(--field-border-hover)}.checkbox__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.checkbox--secondary:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{background-color:var(--checkbox-control-bg)}:is(.checkbox--secondary[aria-checked=true] .checkbox__control,.checkbox--secondary[data-selected=true] .checkbox__control):before,.checkbox--secondary[data-indeterminate=true] .checkbox__control,.checkbox--secondary[data-indeterminate=true] .checkbox__control:before{background-color:var(--accent)}.fieldset{gap:calc(var(--spacing) * 6);flex-direction:column;flex:1 1 0;display:flex}.fieldset__legend{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.fieldset__field_group{width:100%}:where(.fieldset__field_group>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.fieldset__actions{align-items:center;gap:calc(var(--spacing) * 2);padding-top:var(--spacing);display:flex}.input-otp{align-items:center;gap:calc(var(--spacing) * 2);display:flex;position:relative}.input-otp[data-disabled=true]{cursor:not-allowed;opacity:.5}.input-otp__group{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.input-otp__slot{height:calc(var(--spacing) * 10);width:calc(var(--spacing) * 9.5);border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:var(--field-radius,calc(var(--radius) * 1.5));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;flex:1;justify-content:center;align-items:center;display:flex;position:relative}.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-otp__slot:hover,.input-otp__slot[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-otp__slot[data-active=true]{z-index:10;background-color:var(--field-focus);--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.input-otp__slot[data-filled=true]{background-color:var(--field-focus)}.input-otp__slot[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input-otp__slot[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-otp__slot[data-invalid=true]:focus,.input-otp__slot[data-invalid=true]:focus-visible,.input-otp__slot[data-invalid=true][data-focused=true],.input-otp__slot[data-invalid=true][data-focus-visible=true],.input-otp__slot[data-invalid=true]:focus-within,.input-otp__slot[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-otp__slot[data-invalid=true]{background-color:var(--field-focus)}.input-otp__slot-value{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-tracking:-.27px;letter-spacing:-.27px;animation:slot-value-in .25s var(--ease-smooth) both;transform-origin:bottom}.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.input-otp__caret{height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .5);background-color:var(--field-placeholder,var(--muted));width:2px;animation:1.2s ease-out infinite caret-blink;position:absolute}.input-otp__separator{border-radius:calc(var(--radius) * .5);background-color:var(--separator);flex-shrink:0;width:6px;height:2px}.input-otp--secondary .input-otp__slot{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-otp-slot-bg);--input-otp-slot-bg:var(--default);--input-otp-slot-bg-hover:var(--default-hover);--input-otp-slot-bg-focus:var(--default)}@media(hover:hover){.input-otp--secondary .input-otp__slot:hover,.input-otp--secondary .input-otp__slot[data-hovered=true]{background-color:var(--input-otp-slot-bg-hover)}}.input-otp--secondary .input-otp__slot[data-active=true],.input-otp--secondary .input-otp__slot[data-filled=true]{background-color:var(--input-otp-slot-bg-focus)}@keyframes slot-value-in{0%{opacity:0;transform:translateY(8px)scale(.8)}to{opacity:1;transform:translateY(0)scale(1)}}.input{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input{border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input:hover:not(:focus):not(:focus-visible),.input[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input:focus,.input[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input[data-invalid=true]:focus,.input[data-invalid=true]:focus-visible,.input[data-invalid=true][data-focused=true],.input[data-invalid=true][data-focus-visible=true],.input[data-invalid=true]:focus-within,.input[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input[data-invalid=true]{background-color:var(--field-focus)}.input:disabled,.input[data-disabled=true],.input[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-bg);--input-bg:var(--default);--input-bg-hover:var(--default-hover);--input-bg-focus:var(--default)}@media(hover:hover){.input--secondary:hover:not(:focus):not(:focus-visible),.input--secondary[data-hovered=true]:not([data-focus-visible=true]):not([data-focused=true]){background-color:var(--input-bg-hover)}}.input--secondary:focus,.input--secondary[data-focused=true]{background-color:var(--input-bg-focus)}.input--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input--secondary[data-invalid=true]:focus,.input--secondary[data-invalid=true]:focus-visible,.input--secondary[data-invalid=true][data-focused=true],.input--secondary[data-invalid=true][data-focus-visible=true],.input--secondary[data-invalid=true]:focus-within,.input--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input--secondary[data-invalid=true]{background-color:var(--input-bg-focus)}.input--full-width{width:100%}.input-group{min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);outline-style:none;align-items:center;display:inline-flex}.input-group:has([data-slot=input-group-textarea]){align-items:flex-start;height:auto}.input-group{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-group:hover:not(:focus-within),.input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-group:has([data-slot=input-group-input]:focus),.input-group:has([data-slot=input-group-textarea]:focus){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group[data-invalid=true]:focus,.input-group[data-invalid=true]:focus-visible,.input-group[data-invalid=true][data-focused=true],.input-group[data-invalid=true][data-focus-visible=true],.input-group[data-invalid=true]:focus-within,.input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.input-group[data-disabled=true],.input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.input-group:has([data-slot=input-group-input]:-webkit-autofill),.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.input-group__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}.input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input-group:has([data-slot=input-group-prefix]) .input-group__input{border-top-left-radius:0;border-bottom-left-radius:0;padding-left:0}.input-group:has([data-slot=input-group-suffix]) .input-group__input{border-top-right-radius:0;border-bottom-right-radius:0;padding-right:0}.input-group__input:focus,.input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.input-group__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input[data-slot=input-group-textarea]{resize:vertical;min-height:38px}.input-group__prefix{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-right-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-left:none;border-top-right-radius:0;border-bottom-right-radius:0;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__prefix{align-items:flex-start;padding-top:.5rem}.input-group__prefix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group__suffix{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-left-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-right:none;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__suffix{align-items:flex-start;padding-top:.5rem}.input-group__suffix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-group-bg);--input-group-bg:var(--default);--input-group-bg-hover:var(--default-hover);--input-group-bg-focus:var(--default)}@media(hover:hover){.input-group--secondary:hover:not(:focus-within),.input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--input-group-bg-hover)}}.input-group--secondary:has([data-slot=input-group-input]:focus),.input-group--secondary:has([data-slot=input-group-textarea]:focus){background-color:var(--input-group-bg-focus)}.input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group--secondary[data-invalid=true]:focus,.input-group--secondary[data-invalid=true]:focus-visible,.input-group--secondary[data-invalid=true][data-focused=true],.input-group--secondary[data-invalid=true][data-focus-visible=true],.input-group--secondary[data-invalid=true]:focus-within,.input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--input-group-bg-focus)}.input-group--secondary [data-slot=input-group-input],.input-group--secondary [data-slot=input-group-textarea]{background-color:#0000}.input-group--full-width{width:100%}.number-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.number-field[data-invalid=true],.number-field[aria-invalid=true]) [data-slot=description]{display:none}.number-field [data-slot=label]{width:fit-content}.number-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;grid-template-columns:40px 1fr 40px;align-items:center;display:grid;overflow:hidden}.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.number-field__group:hover:not(:focus-within),.number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.number-field__group[data-focus-within=true],.number-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field__group[data-invalid=true]:focus,.number-field__group[data-invalid=true]:focus-visible,.number-field__group[data-invalid=true][data-focused=true],.number-field__group[data-invalid=true][data-focus-visible=true],.number-field__group[data-invalid=true]:focus-within,.number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.number-field__group[data-disabled=true],.number-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.number-field__group:has([data-slot=number-field-input]:-webkit-autofill),.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.number-field__input{border-style:var(--tw-border-style);min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none}@media(min-width:40rem){.number-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.number-field__group:has([slot=decrement]) .number-field__input{border-top-left-radius:0;border-bottom-left-radius:0}.number-field__group:has([slot=increment]) .number-field__input{border-top-right-radius:0;border-bottom-right-radius:0}.number-field__input:focus,.number-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.number-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__increment-button,.number-field__decrement-button{height:100%;width:calc(var(--spacing) * 10);color:var(--field-foreground,var(--foreground));--tw-outline-style:none;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth);background-color:#0000;border-style:solid;border-radius:0;outline-style:none;justify-content:center;align-items:center;display:flex}:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.number-field__increment-button,.number-field__decrement-button{cursor:var(--cursor-interactive)}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:var(--field-foreground,var(--foreground))}@supports (color:color-mix(in lab,red,red)){:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:color-mix(in oklab,var(--field-foreground,var(--foreground)) 10%,transparent)}}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{transform:scale(.97)}:is(.number-field__increment-button,.number-field__decrement-button):disabled,:is(.number-field__increment-button,.number-field__decrement-button)[data-disabled=true],:is(.number-field__increment-button,.number-field__decrement-button)[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-increment-button-icon],:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-decrement-button-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.number-field__increment-button{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--field-placeholder,var(--muted))}@supports (color:color-mix(in lab,red,red)){.number-field__increment-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field__decrement-button{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--field-placeholder,var(--muted));border-top-right-radius:0;border-bottom-right-radius:0}@supports (color:color-mix(in lab,red,red)){.number-field__decrement-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field--secondary .number-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--number-field-group-bg);--number-field-group-bg:var(--default);--number-field-group-bg-hover:var(--default-hover);--number-field-group-bg-focus:var(--default)}@media(hover:hover){.number-field--secondary .number-field__group:hover:not(:focus-within),.number-field--secondary .number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--number-field-group-bg-hover)}}.number-field--secondary .number-field__group:focus-within,.number-field--secondary .number-field__group[data-focus-within=true]{background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field--secondary .number-field__group[data-invalid=true]:focus,.number-field--secondary .number-field__group[data-invalid=true]:focus-visible,.number-field--secondary .number-field__group[data-invalid=true][data-focused=true],.number-field--secondary .number-field__group[data-invalid=true][data-focus-visible=true],.number-field--secondary .number-field__group[data-invalid=true]:focus-within,.number-field--secondary .number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field--secondary .number-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group [data-slot=number-field-input]{background-color:#0000}.number-field--full-width,.number-field__group--full-width{width:100%}.radio-group{flex-direction:column;display:flex}.radio-group[data-orientation=vertical] [data-slot=radio]{margin-top:calc(var(--spacing) * 4)}.radio-group[data-orientation=horizontal]{gap:calc(var(--spacing) * 4);flex-flow:wrap}.radio-group--secondary .radio__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--radio-control-bg);--radio-control-bg:var(--default);--radio-control-bg-hover:var(--default-hover)}.radio:has([data-slot=radio-content][data-hovered=true]) :is(.radio-group--secondary .radio__control),.radio [data-slot=radio-content][data-hovered=true] :is(.radio-group--secondary .radio__control){border-color:var(--field-border-hover)}.radio:not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg-hover)}.radio{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.radio [data-slot=label]{-webkit-user-select:none;user-select:none}.radio .radio__content [data-slot=label]{cursor:var(--cursor-interactive)}.radio>[data-slot=description],.radio>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=description],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.radio__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.radio__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.radio__control{cursor:var(--cursor-interactive)}.radio:has([data-slot=radio-content][data-focus-visible=true]) .radio__control,.radio [data-slot=radio-content][data-focus-visible=true] .radio__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.radio:has([data-slot=radio-content][data-hovered=true]) .radio__control,.radio [data-slot=radio-content][data-hovered=true] .radio__control{border-color:var(--field-border-hover)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) .radio__control .radio__indicator:empty:before{background-color:var(--field-hover)}.radio:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio [data-slot=radio-content][data-pressed=true] .radio__control{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.radio[data-selected] .radio__control,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__control,.radio:has(input:checked) .radio__control{background-color:var(--accent);border-color:#0000}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__control,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__control{background-color:var(--accent-hover)}.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-visible,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focused=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-within,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-visible,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focused=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-within,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio__indicator{pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.radio__indicator:empty:before{content:"";border-radius:calc(var(--radius) * 1);background-color:var(--field-background,var(--default));width:100%;height:100%;transition:scale .2s var(--ease-out),background-color .2s var(--ease-out);scale:1}@media(prefers-reduced-motion:reduce){.radio__indicator:empty:before:not(:is()){transition-property:none}}.radio[data-selected] .radio__indicator:empty:before,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked) .radio__indicator:empty:before{background-color:var(--accent-foreground);scale:.4286}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before{scale:.5714}.radio--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textfield{gap:var(--spacing);flex-direction:column;display:flex}:is(.textfield[data-invalid=true],.textfield[aria-invalid=true]) [data-slot=description]{display:none}.textfield--full-width,.textfield--full-width [data-slot=input],.textfield--full-width [data-slot=textarea]{width:100%}.search-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.search-field[data-invalid=true],.search-field[aria-invalid=true]) [data-slot=description]{display:none}.search-field [data-slot=label]{width:fit-content}.search-field[data-empty=true] [data-slot=search-field-clear-button]{pointer-events:none;opacity:0}.search-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;position:relative;overflow:hidden}.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.search-field__group:hover:not(:focus-within),.search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.search-field__group[data-focus-within=true],.search-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field__group[data-invalid=true]:focus,.search-field__group[data-invalid=true]:focus-visible,.search-field__group[data-invalid=true][data-focused=true],.search-field__group[data-invalid=true][data-focus-visible=true],.search-field__group[data-invalid=true]:focus-within,.search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.search-field__group[data-disabled=true],.search-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.search-field__group:has([data-slot=search-field-input]:-webkit-autofill),.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.search-field__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}@media(min-width:40rem){.search-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.search-field__input::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__input::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__group:has([data-slot=search-field-search-icon]) .search-field__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.search-field__group:has([slot=clear]) .search-field__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.search-field__input:focus,.search-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.search-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__search-icon{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);flex-shrink:0}.search-field__clear-button{margin-right:calc(var(--spacing) * 2);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0}.search-field__clear-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.search-field--secondary .search-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--search-field-group-bg);--search-field-group-bg:var(--default);--search-field-group-bg-hover:var(--default-hover);--search-field-group-bg-focus:var(--default)}@media(hover:hover){.search-field--secondary .search-field__group:hover:not(:focus-within),.search-field--secondary .search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--search-field-group-bg-hover)}}.search-field--secondary .search-field__group:focus-within,.search-field--secondary .search-field__group[data-focus-within=true]{background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field--secondary .search-field__group[data-invalid=true]:focus,.search-field--secondary .search-field__group[data-invalid=true]:focus-visible,.search-field--secondary .search-field__group[data-invalid=true][data-focused=true],.search-field--secondary .search-field__group[data-invalid=true][data-focus-visible=true],.search-field--secondary .search-field__group[data-invalid=true]:focus-within,.search-field--secondary .search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field--secondary .search-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group [data-slot=search-field-input]{background-color:#0000}.search-field--full-width,.search-field__group--full-width{width:100%}.textarea{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.textarea::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.textarea{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.textarea{border-width:var(--border-width-field);border-color:var(--field-border);min-height:38px;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *),.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.textarea:hover:not(:focus):not(:focus-visible),.textarea[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.textarea:focus,.textarea[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.textarea[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea[data-invalid=true]:focus,.textarea[data-invalid=true]:focus-visible,.textarea[data-invalid=true][data-focused=true],.textarea[data-invalid=true][data-focus-visible=true],.textarea[data-invalid=true]:focus-within,.textarea[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea[data-invalid=true]{background-color:var(--field-focus)}.textarea:disabled,.textarea[data-disabled=true],.textarea[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textarea--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--textarea-bg);--textarea-bg:var(--default);--textarea-bg-hover:var(--default-hover);--textarea-bg-focus:var(--default)}@media(hover:hover){.textarea--secondary:hover:not(:focus):not(:focus-visible),.textarea--secondary[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--textarea-bg-hover)}}.textarea--secondary:focus,.textarea--secondary[data-focused=true]{background-color:var(--textarea-bg-focus)}.textarea--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea--secondary[data-invalid=true]:focus,.textarea--secondary[data-invalid=true]:focus-visible,.textarea--secondary[data-invalid=true][data-focused=true],.textarea--secondary[data-invalid=true][data-focus-visible=true],.textarea--secondary[data-invalid=true]:focus-within,.textarea--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea--secondary[data-invalid=true]{background-color:var(--textarea-bg-focus)}.textarea--full-width{width:100%}.calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.calendar--week-view .calendar__cell,.calendar--day-view .calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.calendar--day-view .calendar__grid{flex-direction:column;display:flex}.calendar--day-view .calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-header>tr{display:contents}.calendar--day-view .calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-body>tr{display:contents}.calendar--day-view .calendar__grid-body>tr:first-child>td{margin-top:0}.calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .calendar__nav-button{pointer-events:none;opacity:0}.calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 2);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.calendar__nav-button:hover,.calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.calendar__nav-button:active,.calendar__nav-button[data-pressed=true]{transform:scale(.95)}.calendar__nav-button:focus-visible,.calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__nav-button:disabled,.calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar__grid[aria-readonly=true] .calendar__cell{pointer-events:none}.calendar__grid-header,.calendar__grid-header>tr,.calendar__grid-body,.calendar__grid-body>tr{display:contents}.calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.calendar__grid-row{display:contents}.calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.calendar__cell{aspect-ratio:1;border-radius:calc(var(--radius) * 3);text-align:center;width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;will-change:scale;transition:transform .25s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__cell{cursor:var(--cursor-interactive)}.calendar__cell:focus-visible:not(:focus),.calendar__cell[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__cell[data-today=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.calendar__cell[data-today=true]:hover:not([data-selected=true]),.calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true]){background-color:var(--accent-soft-hover)}}.calendar__cell[data-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}.calendar__cell:active,.calendar__cell[data-pressed=true]{background-color:var(--default);transform:scale(.95)}:is(.calendar__cell:active,.calendar__cell[data-pressed=true])[data-selected=true]{background-color:var(--accent-hover)}@media(hover:hover){.calendar__cell:hover:not([data-selected=true]),.calendar__cell[data-hovered=true]:not([data-selected=true]){background-color:var(--default)}}.calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.calendar__cell[data-selected=true][data-outside-month=true]{background-color:var(--default)}.calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__cell:disabled:not([data-outside-month=true]),.calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.calendar__cell-indicator{background-color:var(--accent-foreground)}.range-calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.range-calendar--week-view .range-calendar__cell,.range-calendar--day-view .range-calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.range-calendar--day-view .range-calendar__grid{flex-direction:column;display:flex}.range-calendar--day-view .range-calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-header>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-body>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body>tr:first-child>td{margin-top:0}.range-calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.range-calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .range-calendar__nav-button{pointer-events:none;opacity:0}.range-calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.range-calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.range-calendar__nav-button:hover,.range-calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.range-calendar__nav-button:active,.range-calendar__nav-button[data-pressed=true]{transform:scale(.95)}.range-calendar__nav-button:focus-visible,.range-calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__nav-button:disabled,.range-calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.range-calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar__grid[aria-readonly=true] .range-calendar__cell{pointer-events:none}.range-calendar__grid-header,.range-calendar__grid-header>tr,.range-calendar__grid-body,.range-calendar__grid-body>tr{display:contents}.range-calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.range-calendar__grid-row{display:contents}.range-calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.range-calendar__cell{z-index:1;border-radius:calc(var(--radius) * 3);--tw-outline-style:none;cursor:var(--cursor-interactive);will-change:background-color,border-color;transition:box-shadow .1s var(--ease-out),border-color .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;margin-block:2px;margin-inline:0;padding:0;position:relative}.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell .range-calendar__cell-button{aspect-ratio:1;border-radius:calc(var(--radius) * 3);width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);-webkit-tap-highlight-color:transparent;will-change:scale;transition:scale .2s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]{z-index:2}:is(.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]) .range-calendar__cell-button{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__cell[data-today=true] .range-calendar__cell-button{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){:is(.range-calendar__cell[data-today=true]:hover:not([data-selected=true]),.range-calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--accent-soft-hover)}}.range-calendar__cell[data-selected=true]:not([data-outside-month=true]){background-color:var(--accent-soft);border-radius:0}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*){border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*)[data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*){border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*)[data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){z-index:2}:is(.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true])) .range-calendar__cell-button{background-color:var(--accent);color:var(--accent-foreground)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]){border-top-left-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){border-top-right-radius:calc(var(--radius) * 3);border-bottom-right-radius:calc(var(--radius) * 3)}:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true]) .range-calendar__cell-button{scale:.9}:is(:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-start=true],:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-end=true]) .range-calendar__cell-button{background-color:var(--accent-hover)}@media(hover:hover){:is(.range-calendar__cell:hover:not([data-selected=true]),.range-calendar__cell[data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--default)}}.range-calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:color-mix(in oklab,var(--default) 20%,transparent)}}.range-calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__cell:disabled:not([data-outside-month=true]),.range-calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true]{border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true]{border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.range-calendar__cell-indicator{background-color:var(--accent-foreground)}.calendar:has(.calendar-year-picker__year-grid),.range-calendar:has(.calendar-year-picker__year-grid){position:relative}.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]{will-change:opacity;transition:opacity .15s var(--ease-out),visibility 0s linear}:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]{pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s var(--ease-out),visibility 0s linear .15s}:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger{justify-content:flex-start;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1);--tw-outline-style:none;cursor:var(--cursor-interactive);touch-action:manipulation;outline-style:none;flex:1;display:flex}.calendar-year-picker__trigger:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar-year-picker__trigger-heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition:color .15s var(--ease-out)}.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger-indicator{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--accent-soft-foreground);transition:transform .15s var(--ease-out)}.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-indicator{transform:rotate(90deg)}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-heading{color:var(--accent-soft-foreground)}.calendar-year-picker__year-grid{pointer-events:none;scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);align-content:flex-start;gap:var(--spacing);padding:var(--spacing);opacity:0;will-change:opacity;grid-template-columns:repeat(3,1fr);display:grid;position:absolute;left:0;right:0;overflow-y:auto}.calendar-year-picker__year-grid[data-open=true]{pointer-events:auto;opacity:1;transition:opacity .2s var(--ease-out) 50ms}.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);padding-inline:calc(var(--spacing) * 2.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{cursor:var(--cursor-interactive)}@media(hover:hover)and (pointer:fine){.calendar-year-picker__year-cell:is(:hover,[data-hovered=true]):not([data-selected=true]){background-color:var(--default);color:var(--default-foreground)}}.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}@media(hover:hover)and (pointer:fine){:is(.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-hover)}}.calendar-year-picker__year-cell:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.date-field[data-invalid=true],.date-field[aria-invalid=true]) [data-slot=description]{display:none}.date-field [data-slot=label]{width:fit-content}.date-field--full-width{width:100%}.time-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.time-field[data-invalid=true],.time-field[aria-invalid=true]) [data-slot=description]{display:none}.time-field [data-slot=label]{width:fit-content}.time-field--full-width{width:100%}.date-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.date-input-group:hover:not(:focus-within),.date-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.date-input-group[data-focus-within=true]:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])),.date-input-group:focus-within:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.date-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group[data-invalid=true]:focus,.date-input-group[data-invalid=true]:focus-visible,.date-input-group[data-invalid=true][data-focused=true],.date-input-group[data-invalid=true][data-focus-visible=true],.date-input-group[data-invalid=true]:focus-within,.date-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.date-input-group[data-disabled=true],.date-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-input-group__input{cursor:text;border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;gap:1px;display:flex}@media(min-width:40rem){.date-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.date-input-group:has([data-slot=date-input-group-prefix]) .date-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.date-input-group:has([data-slot=date-input-group-suffix]) .date-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=start]{flex:none;padding-right:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=end]{padding-left:0}.date-input-group__input:focus,.date-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.date-input-group__input-container{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;flex:1;align-items:center;width:fit-content;display:flex;overflow:auto clip}.date-input-group__segment{border-radius:calc(var(--radius) * .75);padding-inline:calc(var(--spacing) * .5);text-align:end;text-wrap:nowrap;--tw-outline-style:none;outline-style:none;display:inline-block}.date-input-group__segment[data-type=literal]{color:var(--muted);padding:0}.date-input-group__segment[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.date-input-group__segment:focus,.date-input-group__segment[data-focused=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.date-input-group__segment[data-disabled=true]{opacity:.5}.date-input-group__segment[data-invalid=true]{color:var(--danger)}.date-input-group__segment[data-invalid=true]:focus,.date-input-group__segment[data-invalid=true][data-focused=true]{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.date-input-group__prefix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group__suffix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--date-input-group-bg);--date-input-group-bg:var(--default);--date-input-group-bg-hover:var(--default-hover);--date-input-group-bg-focus:var(--default)}@media(hover:hover){.date-input-group--secondary:hover:not(:focus-within),.date-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--date-input-group-bg-hover)}}.date-input-group--secondary:focus-within,.date-input-group--secondary[data-focus-within=true]{background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group--secondary[data-invalid=true]:focus,.date-input-group--secondary[data-invalid=true]:focus-visible,.date-input-group--secondary[data-invalid=true][data-focused=true],.date-input-group--secondary[data-invalid=true][data-focus-visible=true],.date-input-group--secondary[data-invalid=true]:focus-within,.date-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary [data-slot=date-input-group-input]{background-color:#0000}.date-input-group--full-width{width:100%}.date-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-picker .date-input-group__suffix,.date-picker .date-input-group__prefix{pointer-events:auto}.date-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__trigger:focus-visible:not(:focus),.date-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-picker__trigger:disabled,.date-picker__trigger[data-disabled=true],.date-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-picker__popover:focus-visible:not(:focus),.date-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-picker__popover[data-exiting=true],.date-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.date-range-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-range-picker .date-input-group__suffix,.date-range-picker .date-input-group__prefix{pointer-events:auto}.date-range-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__trigger:focus-visible:not(:focus),.date-range-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-range-picker__trigger:disabled,.date-range-picker__trigger[data-disabled=true],.date-range-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-range-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-range-picker__range-separator{padding-inline:var(--spacing);color:var(--field-placeholder,var(--muted));-webkit-user-select:none;user-select:none}.date-range-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-range-picker__popover:focus-visible:not(:focus),.date-range-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-range-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-range-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-range-picker__popover[data-exiting=true],.date-range-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.card{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 4);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:column;display:flex;position:relative;overflow:visible}.card__header{flex-direction:column;display:flex}.card__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.card__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);color:var(--muted)}.card__content{gap:var(--spacing);flex-direction:column;flex:1;display:flex}.card__footer{flex-direction:row;align-items:center;display:flex}.card--transparent{--tw-border-style:none;--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000;border-style:none}.card--default{background-color:var(--surface)}.card--secondary{background-color:var(--surface-secondary)}.card--tertiary{background-color:var(--surface-tertiary)}.header{width:100%;padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 1.5);padding-bottom:var(--spacing);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted)}.separator{border-radius:calc(var(--radius) * .5);border-top-style:var(--tw-border-style);border-top-width:0;border-bottom-style:var(--tw-border-style);background-color:var(--separator);border-bottom-width:0;flex-shrink:0;width:100%;height:1px}.separator--horizontal{width:100%;height:1px}.separator--vertical{height:auto;min-height:calc(var(--spacing) * 2);align-self:stretch;width:1px}.separator--default{background-color:var(--separator)}.separator--secondary{background-color:var(--separator-secondary)}.separator--tertiary{background-color:var(--separator-tertiary)}.separator__container{align-items:center;gap:calc(var(--spacing) * 3);display:flex}.separator__container--horizontal{flex-direction:row;width:100%}.separator__container--vertical{flex-direction:column;justify-content:center;height:100%}.separator__line{flex-grow:1;flex-shrink:0}.separator__content{text-align:center;white-space:nowrap;color:var(--muted);justify-content:center;align-items:center;display:inline-flex}.separator__content--horizontal,.separator__content--vertical{text-align:center}.surface{color:var(--foreground);position:relative}.surface--transparent{background-color:#0000}.surface--default{background-color:var(--surface);color:var(--surface-foreground)}.surface--secondary{background-color:var(--surface-secondary);color:var(--surface-secondary-foreground)}.surface--tertiary{background-color:var(--surface-tertiary);color:var(--surface-tertiary-foreground)}.avatar{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);background-color:var(--default);flex-shrink:0;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}.avatar__fallback{background-color:var(--default);width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);justify-content:center;align-items:center;display:flex}.avatar__image{aspect-ratio:1;width:100%;height:100%;transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s;position:absolute;top:0;right:0;bottom:0;left:0}.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *),.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.avatar--sm{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2)}.avatar--lg{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12);border-radius:calc(var(--radius) * 3)}.avatar--lg .avatar__fallback{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.avatar__fallback--accent{color:var(--accent-soft-foreground)}.avatar__fallback--default{color:var(--default-soft-foreground)}.avatar__fallback--success{color:var(--success-soft-foreground)}.avatar__fallback--warning{color:var(--warning-soft-foreground)}.avatar__fallback--danger{color:var(--danger-soft-foreground)}.avatar--soft{background-color:#0000}.avatar--soft .avatar__fallback--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.avatar--soft .avatar__fallback--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.avatar--soft .avatar__fallback--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.avatar--soft .avatar__fallback--default{background-color:var(--default-soft);color:var(--default-soft-foreground)}.avatar--soft .avatar__fallback--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.alert-dialog__trigger:focus-visible:not(:focus),.alert-dialog__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.alert-dialog__trigger:disabled,.alert-dialog__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.alert-dialog__trigger:active,.alert-dialog__trigger[data-pressed=true]{transform:scale(.97)}.alert-dialog__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.alert-dialog__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.alert-dialog__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]{will-change:opacity}:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__backdrop--transparent{background-color:#0000}.alert-dialog__backdrop--opaque{background-color:var(--backdrop)}.alert-dialog__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.alert-dialog__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.alert-dialog__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.alert-dialog__container{pointer-events:none}.alert-dialog__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.alert-dialog__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.alert-dialog__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.alert-dialog__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.alert-dialog__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]{will-change:opacity,transform}:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;min-height:0;max-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative;overflow:clip}.alert-dialog__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.alert-dialog__dialog[data-placement=auto]{margin-block:auto}}.alert-dialog__dialog[data-placement=center]{margin-block:auto}.alert-dialog__dialog[data-placement=bottom]{margin-top:auto}.alert-dialog__dialog[data-placement=top]{margin-top:0}.alert-dialog__dialog--xs{max-width:var(--container-xs)}.alert-dialog__dialog--sm{max-width:var(--container-sm)}.alert-dialog__dialog--md{max-width:var(--container-md)}.alert-dialog__dialog--lg{max-width:var(--container-lg)}.alert-dialog__dialog--cover{width:100%;height:100%;min-height:100%}.alert-dialog__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.alert-dialog__header>.modal__icon{margin-bottom:0}.alert-dialog__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.alert-dialog__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.alert-dialog__icon [data-slot=alert-dialog-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.alert-dialog__icon--default{background-color:var(--default);color:var(--foreground)}.alert-dialog__icon--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.alert-dialog__icon--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.alert-dialog__icon--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.alert-dialog__icon--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.alert-dialog__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.alert-dialog__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.alert-dialog__header+.alert-dialog__body{margin-top:calc(var(--spacing) * 2)}.alert-dialog__header+.alert-dialog__footer,.alert-dialog__body+.alert-dialog__footer{margin-top:calc(var(--spacing) * 5)}.drawer__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.drawer__trigger:focus-visible:not(:focus),.drawer__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.drawer__trigger:disabled,.drawer__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.drawer__trigger:active,.drawer__trigger[data-pressed=true]{transform:scale(.97)}.drawer__backdrop{z-index:50;height:var(--visual-viewport-height);opacity:1;width:100%;transition:opacity .25s cubic-bezier(.32,.72,0,1);position:fixed;top:0;right:0;bottom:0;left:0}.drawer__backdrop[data-entering=true]{opacity:0}.drawer__backdrop[data-exiting=true]{opacity:0;transition-duration:.2s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.drawer__backdrop[data-exiting=true],.drawer__backdrop[data-entering=true]{will-change:opacity}@media(prefers-reduced-motion:reduce){.drawer__backdrop{transition:none}}.drawer__backdrop--transparent{background-color:#0000}.drawer__backdrop--opaque{background-color:var(--backdrop)}.drawer__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.drawer__content{pointer-events:none;z-index:50;height:var(--visual-viewport-height);width:100%;min-width:0;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.drawer__content--bottom{align-items:flex-end}.drawer__content--top{align-items:flex-start}.drawer__content--left{justify-content:flex-start}.drawer__content--right{justify-content:flex-end}.drawer__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;padding:calc(var(--spacing) * 6);pointer-events:auto;--drawer-enter-duration:.25s;--drawer-exit-duration:.2s;--drawer-enter-ease:cubic-bezier(.32, .72, 0, 1);--drawer-exit-ease:cubic-bezier(.32, .72, 0, 1);will-change:translate;transition:translate var(--drawer-enter-duration) var(--drawer-enter-ease);outline-style:none;flex-direction:column;display:flex;position:relative}@media(prefers-reduced-motion:reduce){.drawer__dialog{transition:none}}.drawer__dialog[data-placement=bottom]{border-top-left-radius:min(32px,var(--radius-2xl));border-top-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=top]{border-bottom-left-radius:min(32px,var(--radius-2xl));border-bottom-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=left]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=left]{width:calc(var(--spacing) * 96)}}.drawer__dialog[data-placement=right]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=right]{width:calc(var(--spacing) * 96)}}[data-exiting=true] .drawer__dialog{transition-duration:var(--drawer-exit-duration);transition-timing-function:var(--drawer-exit-ease)}.drawer__content--left .drawer__dialog,.drawer__content--right .drawer__dialog,.drawer__content--top .drawer__dialog,.drawer__content--bottom .drawer__dialog{translate:0}.drawer__content--left[data-entering=true] .drawer__dialog,.drawer__content--left[data-exiting=true] .drawer__dialog{translate:-100%}.drawer__content--right[data-entering=true] .drawer__dialog,.drawer__content--right[data-exiting=true] .drawer__dialog{translate:100%}.drawer__content--top[data-entering=true] .drawer__dialog,.drawer__content--top[data-exiting=true] .drawer__dialog{translate:0 -100%}.drawer__content--bottom[data-entering=true] .drawer__dialog,.drawer__content--bottom[data-exiting=true] .drawer__dialog{translate:0 100%}.drawer__dialog--top{padding-bottom:calc(var(--spacing) * 2)}.drawer__dialog--top .drawer__handle{padding-bottom:0}.drawer__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.drawer__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.drawer__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.drawer__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.drawer__handle{padding-bottom:calc(var(--spacing) * 2);justify-content:center;align-items:center;display:flex}.drawer__handle>[data-slot=drawer-handle-bar]{height:var(--spacing);width:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * .25);background-color:var(--separator)}.drawer__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.drawer__header+.drawer__body{margin-top:calc(var(--spacing) * 2)}.drawer__header+.drawer__footer,.drawer__body+.drawer__footer{margin-top:calc(var(--spacing) * 5)}.drawer__handle+.drawer__header,.drawer__handle+.drawer__body{margin-top:0}.modal__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.modal__trigger:focus-visible:not(:focus),.modal__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.modal__trigger:disabled,.modal__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.modal__trigger:active,.modal__trigger[data-pressed=true]{transform:scale(.97)}.modal__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.modal__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.modal__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]{will-change:opacity}:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__backdrop--transparent{background-color:#0000}.modal__backdrop--opaque{background-color:var(--backdrop)}.modal__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.modal__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.modal__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.modal__container{pointer-events:none}.modal__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.modal__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.modal__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.modal__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.modal__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-exiting=true],.modal__container[data-entering=true]{will-change:opacity,transform}:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__container--scroll-outside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);pointer-events:auto;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__container--full{padding:0}@media(min-width:40rem){.modal__container--full{padding:0}}.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% ;--tw-enter-scale:1}@media(min-width:40rem){.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% }}.modal__container--full[data-exiting=true]{--tw-exit-scale:1}.modal__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative}.modal__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.modal__dialog[data-placement=auto]{margin-block:auto}}.modal__dialog[data-placement=center]{margin-block:auto}.modal__dialog[data-placement=bottom]{margin-top:auto}.modal__dialog[data-placement=top]{margin-top:0}.modal__dialog--scroll-inside{min-height:0;max-height:100%;overflow:clip}.modal__dialog--scroll-outside{flex-shrink:0;height:auto;min-height:0}.modal__dialog--xs{max-width:var(--container-xs)}.modal__dialog--sm{max-width:var(--container-sm)}.modal__dialog--md{max-width:var(--container-md)}.modal__dialog--lg{max-width:var(--container-lg)}.modal__dialog--cover{width:100%;height:100%;min-height:100%}.modal__dialog--full{--tw-shadow:0 0 #0000;width:100%;height:100%;min-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:0}.modal__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.modal__header>.modal__icon{margin-bottom:0}.modal__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.modal__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.modal__body{min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow:visible}.modal__body--scroll-inside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__body--scroll-outside{overflow-y:visible}.modal__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.modal__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.modal__header+.modal__body{margin-top:calc(var(--spacing) * 2)}.modal__header+.modal__footer,.modal__body+.modal__footer{margin-top:calc(var(--spacing) * 5)}.popover{transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0}.popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.popover[data-exiting=true],.popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.popover__dialog{padding:calc(var(--spacing) * 4);--tw-outline-style:none;outline-style:none}.popover__heading{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.popover__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.popover__trigger{cursor:var(--cursor-interactive)}.popover__trigger:focus-visible:not(:focus),.popover__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.popover__trigger:disabled,.popover__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tooltip{max-width:var(--container-xs);transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);padding:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));word-break:break-all;border-radius:min(32px,var(--radius-xl));box-shadow:var(--shadow-overlay)}.tooltip[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.tooltip[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.tooltip[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.tooltip[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.tooltip[data-exiting=true],.tooltip[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.tooltip [data-slot=overlay-arrow]{stroke:var(--border)}@supports (color:color-mix(in lab,red,red)){.tooltip [data-slot=overlay-arrow]{stroke:color-mix(in oklab,var(--border) 40%,transparent)}}.tooltip [data-slot=overlay-arrow]{fill:var(--overlay)}.tooltip[data-placement=bottom] [data-slot=overlay-arrow]{rotate:180deg}.tooltip[data-placement=left] [data-slot=overlay-arrow]{rotate:-90deg}.tooltip[data-placement=right] [data-slot=overlay-arrow]{rotate:90deg}.tooltip__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tooltip__trigger:focus-visible:not(:focus),.tooltip__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.combo-box{gap:var(--spacing);flex-direction:column;display:flex}:is(.combo-box[data-invalid=true],.combo-box[aria-invalid=true]) [data-slot=description]{display:none}.combo-box [data-slot=label]{width:fit-content}.combo-box [data-slot=input]{flex:1;min-width:0}.combo-box [data-slot=input]:has(+.combo-box__trigger){padding-inline-end:calc(var(--spacing) * 7)}.combo-box [data-slot=input]:focus,.combo-box [data-slot=input][data-focus]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.combo-box [data-slot=input]:disabled,.combo-box [data-slot=input][data-disabled],.combo-box [data-slot=input][aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.combo-box__input-group{isolation:isolate;align-items:center;display:inline-flex;position:relative}.combo-box__trigger{--tw-translate-y: -50% ;height:100%;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:pointer;color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;-webkit-tap-highlight-color:transparent;--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-color:#0000;border-style:none;outline-style:none;flex-shrink:0;justify-content:center;align-items:center;padding-inline-end:calc(var(--spacing) * 2);transition-duration:.15s;display:flex;position:absolute;top:50%}@media(hover:hover){.combo-box__trigger:hover,.combo-box__trigger[data-hovered=true]{color:var(--field-foreground,var(--foreground))}}.combo-box__trigger:focus-visible:not(:focus),.combo-box__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-radius:.25rem;outline-style:none}.combo-box__trigger[data-pressed=true]{opacity:.7}.combo-box__trigger:disabled,.combo-box__trigger[data-disabled],.combo-box__trigger[aria-disabled=true]{cursor:not-allowed;opacity:.5}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;transition-duration:.15s}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.combo-box__trigger[data-open=true] [data-slot=combo-box-trigger-default-icon]{rotate:180deg}.combo-box__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.combo-box__popover:focus-visible:not(:focus),.combo-box__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.combo-box__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.combo-box__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.combo-box__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.combo-box__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.combo-box__popover[data-exiting=true],.combo-box__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.combo-box__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.combo-box__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.combo-box__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.combo-box__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.combo-box__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.combo-box__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.combo-box__popover [data-slot=list-box-item] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.combo-box--full-width,.combo-box__input-group--full-width{width:100%}.select{gap:var(--spacing);flex-direction:column;display:flex}:is(.select[data-invalid=true],.select[aria-invalid=true]) [data-slot=description]{display:none}.select [data-slot=label]{width:fit-content}.select__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.select__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.select__trigger:has(.select__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.select__trigger:hover,.select__trigger[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.select__trigger:focus-visible:not(:focus),.select__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-visible,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focused=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-visible=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-within,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{background-color:var(--field-focus)}.select__trigger:disabled,.select__trigger[data-disabled=true],.select__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.select--secondary .select__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--select-trigger-bg);--select-trigger-bg:var(--default);--select-trigger-bg-hover:var(--default-hover);--select-trigger-bg-focus:var(--default)}@media(hover:hover){.select--secondary .select__trigger:hover,.select--secondary .select__trigger[data-hovered=true]{background-color:var(--select-trigger-bg-hover)}}.select--secondary .select__trigger:focus-visible:not(:focus),.select--secondary .select__trigger[data-focus-visible=true],.select[data-invalid=true] :is(.select--secondary .select__trigger),.select[aria-invalid=true] :is(.select--secondary .select__trigger){background-color:var(--select-trigger-bg-focus)}.select__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.select__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.select__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.select__value [data-slot=list-box-item-indicator]{display:none}.select__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.select__indicator[data-open=true]{rotate:180deg}.select__indicator[data-slot=select-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.select__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.select__popover:focus-visible:not(:focus),.select__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.select__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.select__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.select__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.select__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.select__popover[data-exiting=true],.select__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.select__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.select__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.select__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.select__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.select__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.select__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.select--full-width,.select__trigger--full-width{width:100%}.autocomplete{gap:var(--spacing);flex-direction:column;display:flex}.autocomplete__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.autocomplete__trigger:has(.autocomplete__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.autocomplete__trigger:focus-visible:not(:focus),.autocomplete__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-visible,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focused=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-visible=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-within,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{background-color:var(--field-focus)}.autocomplete__trigger:disabled,.autocomplete__trigger[data-disabled=true],.autocomplete__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.autocomplete--secondary .autocomplete__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--autocomplete-trigger-bg);--autocomplete-trigger-bg:var(--default);--autocomplete-trigger-bg-hover:var(--default-hover);--autocomplete-trigger-bg-focus:var(--default)}@media(hover:hover){.autocomplete--secondary .autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete--secondary .autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--autocomplete-trigger-bg-hover)}}.autocomplete--secondary .autocomplete__trigger:focus-visible:not(:focus),.autocomplete--secondary .autocomplete__trigger[data-focus-visible=true],.autocomplete[data-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger),.autocomplete[aria-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger){background-color:var(--autocomplete-trigger-bg-focus)}.autocomplete__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.autocomplete__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.autocomplete__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.autocomplete__value [data-slot=list-box-item-indicator]{display:none}.autocomplete__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;cursor:var(--cursor-interactive);flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.autocomplete__indicator[data-open=true]{rotate:180deg}.autocomplete__indicator[data-slot=autocomplete-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.autocomplete__popover{width:var(--trigger-width);max-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);overscroll-behavior:contain;background-color:var(--overlay);padding:0;padding-top:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);overflow:hidden}.autocomplete__popover:focus-visible:not(:focus),.autocomplete__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.32, .72, 0, 1);--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.25s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.autocomplete__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.autocomplete__popover[data-exiting=true],.autocomplete__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.autocomplete__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.autocomplete__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.autocomplete__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.autocomplete__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.autocomplete__popover [data-slot=list-box]{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);max-height:320px;padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none;overflow-y:auto}.autocomplete__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.autocomplete__popover [data-slot=search-field]{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);--tw-outline-style:none;outline-style:none}.autocomplete__popover [data-slot=empty-state]{text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--overlay-foreground)}@supports (color:color-mix(in lab,red,red)){.autocomplete__popover [data-slot=empty-state]{color:color-mix(in oklab,var(--overlay-foreground) 60%,transparent)}}.autocomplete__popover-dialog,.autocomplete__popover-dialog:focus,.autocomplete__popover-dialog:focus-visible,.autocomplete__popover-dialog[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete--full-width,.autocomplete__trigger--full-width{width:100%}.autocomplete__clear-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);color:var(--muted);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);cursor:var(--cursor-interactive);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);background-color:#0000;flex-shrink:0;justify-content:center;align-self:center;align-items:center;margin-inline-end:0;display:inline-flex;position:relative}.autocomplete__clear-button:not([data-empty=true]){transition:opacity .15s var(--ease-smooth)}.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__clear-button[data-empty=true]{pointer-events:none;opacity:0}.autocomplete__clear-button [data-slot=autocomplete-clear-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(hover:hover){.autocomplete__clear-button:hover,.autocomplete__clear-button[data-hovered=true]{background-color:var(--default-hover)}}.autocomplete__clear-button:active,.autocomplete__clear-button[data-pressed=true]{transform:scale(.93)}.kbd{height:calc(var(--spacing) * 6);align-items:center;display:inline-flex}:where(.kbd>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * .5) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-x-reverse)))}.kbd{border-radius:calc(var(--radius) * 1);background-color:var(--default);padding-inline:calc(var(--spacing) * 2);text-align:center;font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;color:var(--muted)}:where(.kbd:where(:dir(rtl),[dir=rtl],[dir=rtl] *)>:not(:last-child)){--tw-space-x-reverse:1}.kbd{word-spacing:-.25rem}.kbd__abbr{justify-content:center;align-items:center;width:100%;height:100%;text-decoration:none;display:flex}.kbd__content{justify-content:center;align-items:center;display:flex}.kbd--light{background-color:#0000}.typography,.typography-prose{color:var(--foreground)}.typography-prose h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose p{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography-prose a{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--link);text-underline-offset:4px;text-decoration-line:underline}.typography-prose blockquote{margin-top:calc(var(--spacing) * 4);border-left-style:var(--tw-border-style);border-left-width:4px;border-color:var(--border);padding-left:calc(var(--spacing) * 4);color:var(--muted);font-style:italic}.typography-prose ul{margin-block:calc(var(--spacing) * 4);list-style-type:disc}:where(.typography-prose ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ul{padding-left:calc(var(--spacing) * 6)}.typography-prose ol{margin-block:calc(var(--spacing) * 4);list-style-type:decimal}:where(.typography-prose ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ol{padding-left:calc(var(--spacing) * 6)}.typography-prose li{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose hr{margin-block:calc(var(--spacing) * 8);border-color:var(--separator)}.typography-prose pre{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);background-color:var(--default);padding:calc(var(--spacing) * 4);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);overflow-x:auto}.typography-prose strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--foreground)}.typography-prose em{font-style:italic}.typography-prose img{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5)}.typography--h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--body{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography--body-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.typography--body-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.typography--code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography--align-start{text-align:left}.typography--align-start:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:right}.typography--align-center{text-align:center}.typography--align-end{text-align:right}.typography--align-end:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:left}.typography--align-justify{text-align:justify}.typography--color-default{color:var(--foreground)}.typography--color-muted{color:var(--muted)}.typography--truncate{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.typography--weight-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.typography--weight-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.typography--weight-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.typography--weight-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.scroll-shadow{--scroll-shadow-size:40px;--scroll-shadow-scrollbar-size:10px;position:relative}.scroll-shadow--vertical{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-y:auto}.scroll-shadow--horizontal{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-x:auto}.scroll-shadow--fade.scroll-shadow--vertical:where([data-top-scroll=true],[data-bottom-scroll=true],[data-top-bottom-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,100% 0;mask-repeat:no-repeat;mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%;-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,100% 0;-webkit-mask-repeat:no-repeat;-webkit-mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%}.scroll-shadow--fade.scroll-shadow--vertical[data-top-scroll=true]{--scroll-linear-gradient:0deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-bottom-scroll=true]{--scroll-linear-gradient:180deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-top-bottom-scroll=true]{--scroll-linear-gradient:#000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal:where([data-left-scroll=true],[data-right-scroll=true],[data-left-right-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,0 100%;mask-repeat:no-repeat;mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,0 100%;-webkit-mask-repeat:no-repeat;-webkit-mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size)}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-scroll=true]{--scroll-linear-gradient:270deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-right-scroll=true]{--scroll-linear-gradient:90deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-right-scroll=true]{--scroll-linear-gradient:to right, #000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--hide-scrollbar{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;--scroll-shadow-scrollbar-size:0px}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{inset-inline:0}.inset-y-0{inset-block:0}.top-0{top:0}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.-right-3{right:calc(var(--spacing) * -3)}.right-0{right:0}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:0}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-0{left:0}.left-1\/2{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[1\]{z-index:1}.z-\[2\]{z-index:2}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing) * -1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:var(--spacing)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-12{height:calc(var(--spacing) * 12)}.h-48{height:calc(var(--spacing) * 48)}.h-\[90px\]{height:90px}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:0}.min-h-full{min-height:100%}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-16{width:calc(var(--spacing) * 16)}.w-28{width:calc(var(--spacing) * 28)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-\[17rem\]{width:17rem}.w-\[calc\(100\%-2rem\)\]{width:calc(100% - 2rem)}.w-\[n\%\]{width:n%}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-44{max-width:calc(var(--spacing) * 44)}.max-w-\[1800px\]{max-width:1800px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-\[140px\]{min-width:140px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing) * 5);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-ew-resize{cursor:ew-resize}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y:pan-y;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--otari-line\)\]>:not(:last-child)){border-color:var(--otari-line)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:calc(var(--radius) * 1)}.rounded-md{border-radius:calc(var(--radius) * .75)}.rounded-xl{border-radius:calc(var(--radius) * 1.5)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-\[\#c2843a\]{border-color:#c2843a}.border-\[var\(--otari-brand\)\]{border-color:var(--otari-brand)}.border-\[var\(--otari-line\)\]{border-color:var(--otari-line)}.border-amber-200{border-color:var(--color-amber-200)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-red-500{border-left-color:var(--color-red-500)}.bg-\[var\(--otari-bg\)\]{background-color:var(--otari-bg)}.bg-\[var\(--otari-brand\)\],.bg-\[var\(--otari-brand\)\]\/10{background-color:var(--otari-brand)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--otari-brand\)\]\/10{background-color:color-mix(in oklab,var(--otari-brand) 10%,transparent)}}.bg-\[var\(--otari-brand-tint\)\]{background-color:var(--otari-brand-tint)}.bg-\[var\(--otari-line\)\]{background-color:var(--otari-line)}.bg-\[var\(--otari-surface\)\]{background-color:var(--otari-surface)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-500{background-color:var(--color-green-500)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1{padding-bottom:var(--spacing)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#b45309\]{color:#b45309}.text-\[var\(--otari-brand-dark\)\]{color:var(--otari-brand-dark)}.text-\[var\(--otari-ink\)\]{color:var(--otari-ink)}.text-\[var\(--otari-muted\)\]{color:var(--otari-muted)}.text-amber-400{color:var(--color-amber-400)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-emerald-700{color:var(--color-emerald-700)}.text-green-700{color:var(--color-green-700)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.accent-\[var\(--otari-brand\)\]{accent-color:var(--otari-brand)}.opacity-0{opacity:0}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.running{animation-play-state:running}.zoom-out{--tw-exit-scale:0}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-focus-visible\:ring-2:is(:where(.group):focus-visible *){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-focus-visible\:ring-\[var\(--otari-brand\)\]:is(:where(.group):focus-visible *){--tw-ring-color:var(--otari-brand)}.group-data-\[focus-visible\]\:outline-2:is(:where(.group)[data-focus-visible] *){outline-style:var(--tw-outline-style);outline-width:2px}.group-data-\[focus-visible\]\:outline-\[var\(--otari-brand\)\]:is(:where(.group)[data-focus-visible] *){outline-color:var(--otari-brand)}@media(hover:hover){.hover\:border-\[var\(--otari-brand\)\]:hover{border-color:var(--otari-brand)}.hover\:bg-\[var\(--otari-bg\)\]:hover{background-color:var(--otari-bg)}.hover\:bg-\[var\(--otari-brand\)\]:hover,.hover\:bg-\[var\(--otari-brand\)\]\/20:hover{background-color:var(--otari-brand)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--otari-brand\)\]\/20:hover{background-color:color-mix(in oklab,var(--otari-brand) 20%,transparent)}}.hover\:bg-\[var\(--otari-line\)\]:hover{background-color:var(--otari-line)}.hover\:text-\[var\(--otari-brand\)\]:hover{color:var(--otari-brand)}.hover\:text-\[var\(--otari-brand-dark\)\]:hover{color:var(--otari-brand-dark)}.hover\:text-\[var\(--otari-ink\)\]:hover{color:var(--otari-ink)}.hover\:text-amber-950:hover{color:var(--color-amber-950)}.hover\:text-red-700:hover{color:var(--color-red-700)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:not-sr-only:focus{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.focus\:absolute:focus{position:absolute}.focus\:top-3:focus{top:calc(var(--spacing) * 3)}.focus\:left-3:focus{left:calc(var(--spacing) * 3)}.focus\:z-50:focus{z-index:50}.focus\:rounded-lg:focus{border-radius:calc(var(--radius) * 1)}.focus\:border:focus{border-style:var(--tw-border-style);border-width:1px}.focus\:border-\[var\(--otari-brand\)\]:focus{border-color:var(--otari-brand)}.focus\:bg-\[var\(--otari-surface\)\]:focus{background-color:var(--otari-surface)}.focus\:px-4:focus{padding-inline:calc(var(--spacing) * 4)}.focus\:py-2:focus{padding-block:calc(var(--spacing) * 2)}.focus\:text-sm:focus{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.focus\:font-medium:focus{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.focus\:text-\[var\(--otari-brand-dark\)\]:focus{color:var(--otari-brand-dark)}.focus\:shadow-md:focus{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:bg-\[var\(--otari-brand\)\]:focus-visible{background-color:var(--otari-brand)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[var\(--otari-brand\)\]:focus-visible{--tw-ring-color:var(--otari-brand)}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-start-1{grid-column-start:1}.sm\:col-start-2{grid-column-start:2}.sm\:col-start-3{grid-column-start:3}.sm\:inline{display:inline}.sm\:w-28{width:calc(var(--spacing) * 28)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[minmax\(0\,1fr\)_16rem_10rem\]{grid-template-columns:minmax(0,1fr) 16rem 10rem}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-self-end{justify-self:flex-end}.sm\:justify-self-start{justify-self:flex-start}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}@media(min-width:48rem){.md\:flex{display:flex}.md\:hidden{display:none}.md\:px-6{padding-inline:calc(var(--spacing) * 6)}.md\:py-6{padding-block:calc(var(--spacing) * 6)}}@media(min-width:64rem){.lg\:sticky{position:sticky}.lg\:top-4{top:calc(var(--spacing) * 4)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_360px\]{grid-template-columns:minmax(0,1fr) 360px}.lg\:items-start{align-items:flex-start}}@media(min-width:80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--otari-brand:#4e8295;--otari-brand-dark:#3c6678;--otari-brand-soft:#a8c4ce;--otari-brand-tint:#eaf1f3;--otari-ink:#14242c;--otari-muted:#5b6b73;--otari-line:#dbe5e8;--otari-surface:#fff;--otari-bg:#f6f9fa;--otari-code-ink:#e8eef0}.otari-table.table-root{background-color:var(--otari-surface);border:1px solid var(--otari-line);border-radius:.75rem;padding:0;overflow:hidden}.otari-table .table__header{background-color:var(--otari-brand-tint);border-bottom:1px solid var(--otari-line)}.otari-table .table__column,.otari-table [role=row]>[role=presentation]:first-of-type>.table__column,.otari-table [role=row]>[role=presentation]:last-of-type>.table__column{color:var(--otari-ink);background-color:#0000;border-radius:0;font-weight:600}.otari-table .table__column:after{content:none}.otari-table .table__row .table__cell{border-color:var(--otari-line)}.otari-table .table__row:hover .table__cell{background-color:var(--otari-bg)}.otari-table .otari-detail-row>td{border-bottom:1px solid var(--otari-line);background-color:var(--otari-bg);padding:0}.otari-table .otari-detail-opening .table__cell{background-color:var(--otari-brand-tint)}.otari-detail-reveal{grid-template-rows:0fr;animation:.18s ease-out forwards otari-detail-open;display:grid}.otari-detail-reveal>div{overflow:hidden}@keyframes otari-detail-open{0%{opacity:.5;grid-template-rows:0fr}to{opacity:1;grid-template-rows:1fr}}.otari-bulk-bar{animation:.16s ease-out otari-bulk-bar-in}@keyframes otari-bulk-bar-in{0%{opacity:0;transform:translate(-50%,.5rem)}to{opacity:1;transform:translate(-50%)}}@media(prefers-reduced-motion:reduce){.otari-detail-reveal{grid-template-rows:1fr;animation:none}.otari-bulk-bar{animation:none}}.otari-markdown{color:var(--otari-ink);font-size:.875rem;line-height:1.65}.otari-markdown>:first-child{margin-top:0}.otari-markdown h1,.otari-markdown h2,.otari-markdown h3,.otari-markdown h4{color:var(--otari-ink);font-weight:600;line-height:1.3}.otari-markdown h1{margin:2rem 0 .75rem;font-size:1.5rem}.otari-markdown h2{border-bottom:1px solid var(--otari-line);margin:2rem 0 .5rem;padding-bottom:.3rem;font-size:1.25rem}.otari-markdown h3{margin:1.5rem 0 .5rem;font-size:1.05rem}.otari-markdown h4{margin:1.25rem 0 .25rem;font-size:.95rem}.otari-markdown p{margin:.75rem 0}.otari-markdown a{color:var(--otari-brand-dark);text-underline-offset:2px;text-decoration:underline}.otari-markdown a:hover{text-decoration-thickness:2px}.otari-markdown ul,.otari-markdown ol{margin:.75rem 0;padding-left:1.5rem}.otari-markdown ul{list-style:outside}.otari-markdown ol{list-style:decimal}.otari-markdown li,.otari-markdown li>ul,.otari-markdown li>ol{margin:.25rem 0}.otari-markdown code{background-color:var(--otari-brand-tint);color:var(--otari-brand-dark);border-radius:.35rem;padding:.1rem .35rem;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,monospace;font-size:.85em}.otari-markdown pre{background-color:var(--otari-ink);border-radius:.6rem;margin:1rem 0;padding:.85rem 1rem;overflow-x:auto}.otari-markdown pre code{color:var(--otari-code-ink);background-color:#0000;border-radius:0;padding:0;font-size:.82rem;line-height:1.55}.otari-markdown blockquote{border-left:3px solid var(--otari-brand);color:var(--otari-muted);margin:1rem 0;padding:.25rem 0 .25rem 1rem}.otari-markdown hr{border:0;border-top:1px solid var(--otari-line);margin:1.5rem 0}.otari-markdown-scroll{max-width:100%;margin:1rem 0;overflow-x:auto}.otari-markdown table{border-collapse:collapse;font-size:.85rem}.otari-markdown th,.otari-markdown td{border:1px solid var(--otari-line);text-align:left;vertical-align:top;padding:.4rem .7rem}.otari-markdown th{background-color:var(--otari-brand-tint);color:var(--otari-ink);font-weight:600}.otari-markdown tbody tr:hover td,.otari-markdown tr:hover td{background-color:var(--otari-bg)}html,body,#root{height:100%}body{background-color:var(--otari-bg);color:var(--otari-ink);margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}@keyframes caret-blink{0%,70%,to{opacity:1}20%,50%{opacity:0}}@keyframes skeleton{to{transform:translate(200%)}} +/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--tw-content:"";--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-space-y-reverse:0;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-700:oklch(50.5% .213 27.518);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-500:oklch(72.3% .219 149.579);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-xl:calc(var(--radius) * 1.5);--radius-2xl:calc(var(--radius) * 2);--radius-3xl:calc(var(--radius) * 3);--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow-surface:var(--surface-shadow);--shadow-overlay:var(--overlay-shadow);--border-width-field:var(--field-border-width,var(--border-width));--ease-smooth:ease;--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-fluid:cubic-bezier(.32, .72, 0, 1);--ease-linear:linear}@layer theme.base{:root,.light,.default,[data-theme=light],[data-theme=default]{color-scheme:light;--white:oklch(100% 0 0);--black:oklch(0% 0 0);--snow:oklch(99.11% 0 0);--eclipse:oklch(21.03% .0059 285.89);--spacing:.25rem;--border-width:1px;--field-border-width:0px;--disabled-opacity:.5;--ring-offset-width:2px;--cursor-interactive:pointer;--cursor-disabled:not-allowed;--radius:.5rem;--field-radius:calc(var(--radius) * 1.5);--background:oklch(97.02% 0 0);--foreground:var(--eclipse);--surface:var(--white);--surface-foreground:var(--foreground);--surface-secondary:oklch(95.24% .0013 286.37);--surface-secondary-foreground:var(--foreground);--surface-tertiary:oklch(93.73% .0013 286.37);--surface-tertiary-foreground:var(--foreground);--overlay:var(--white);--overlay-foreground:var(--foreground);--muted:oklch(55.17% .0138 285.94);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(94% .001 286.375);--default-foreground:var(--eclipse);--accent:oklch(62.04% .195 253.83);--accent-foreground:var(--snow);--field-background:var(--white);--field-foreground:oklch(21.03% .0059 285.89);--field-placeholder:var(--muted);--field-border:transparent;--success:oklch(73.29% .1935 150.81);--success-foreground:var(--eclipse);--warning:oklch(78.19% .1585 72.33);--warning-foreground:var(--eclipse);--danger:oklch(65.32% .2328 25.74);--danger-foreground:var(--snow);--segment:var(--white);--segment-foreground:var(--eclipse);--border:oklch(90% .004 286.32);--separator:oklch(92% .004 286.32);--focus:var(--accent);--link:var(--foreground);--backdrop:#00000080;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:color-mix(in oklab, var(--accent) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 70%, var(--foreground) 30%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:color-mix(in oklab, var(--accent) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 70%, var(--foreground) 40%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:color-mix(in oklab, var(--warning) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 70%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:color-mix(in oklab, var(--warning) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:color-mix(in oklab, var(--success) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 60%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:color-mix(in oklab, var(--success) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--overlay-shadow:0 2px 8px 0 #0000000f, 0 -6px 12px 0 #00000008, 0 14px 28px 0 #00000014;--field-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--skeleton-animation:shimmer;--tooltip-delay:1.5s;--tooltip-close-delay:.5s}.dark,[data-theme=dark]{color-scheme:dark;--background:oklch(12% .005 285.823);--foreground:var(--snow);--surface:oklch(21.03% .0059 285.89);--surface-foreground:var(--foreground);--surface-secondary:oklch(25.7% .0037 286.14);--surface-tertiary:oklch(27.21% .0024 247.91);--overlay:oklch(21.03% .0059 285.89);--overlay-foreground:var(--foreground);--muted:oklch(70.5% .015 286.067);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}.dark,[data-theme=dark]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(27.4% .006 286.033);--default-foreground:var(--snow);--field-background:oklch(21.03% .0059 285.89);--field-foreground:var(--foreground);--warning:oklch(82.03% .1388 76.34);--warning-foreground:var(--eclipse);--danger:oklch(59.4% .1967 24.63);--danger-foreground:var(--snow);--segment:oklch(39.64% .01 285.93);--segment-foreground:var(--foreground);--border:oklch(28% .006 286.033);--separator:oklch(25% .006 286.033);--focus:var(--accent);--link:var(--foreground);--backdrop:#0009;--surface-shadow:0 0 0 0 transparent inset;--overlay-shadow:0 0 1px 0 #ffffff4d inset;--field-shadow:0 0 0 0 transparent inset;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}.dark,[data-theme=dark]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}.dark,[data-theme=dark]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}.dark,[data-theme=dark]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}.dark,[data-theme=dark]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}.dark,[data-theme=dark]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}.dark,[data-theme=dark]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}.dark,[data-theme=dark]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}.dark,[data-theme=dark]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}.dark,[data-theme=dark]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}.dark,[data-theme=dark]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}.dark,[data-theme=dark]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}.dark,[data-theme=dark]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}.dark,[data-theme=dark]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft:color-mix(in oklab, var(--accent) 12%, transparent)}}.dark,[data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-hover:color-mix(in oklab, var(--accent) 16%, transparent)}}.dark,[data-theme=dark]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}.dark,[data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}.dark,[data-theme=dark]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft:color-mix(in oklab, var(--warning) 12%, transparent)}}.dark,[data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-hover:color-mix(in oklab, var(--warning) 16%, transparent)}}.dark,[data-theme=dark]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft:color-mix(in oklab, var(--success) 12%, transparent)}}.dark,[data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-hover:color-mix(in oklab, var(--success) 16%, transparent)}}.dark,[data-theme=dark]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}.dark,[data-theme=dark]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}.dark,[data-theme=dark]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}.dark,[data-theme=dark]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}}@layer components;}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--border,currentColor)}::file-selector-button{border-color:var(--border,currentColor)}:root{view-transition-name:none}::view-transition{pointer-events:none}[data-scrollbar=thin]{--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--scrollbar-gutter:auto}[data-scrollbar=default]{--scrollbar-width:auto;--scrollbar-color:auto;--scrollbar-gutter:auto}[data-scrollbar=none]{--scrollbar-width:none;--scrollbar-color:auto;--scrollbar-gutter:auto}}@layer components{.close-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),color .15s var(--ease-out),background-color .1s var(--ease-out),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.close-button:focus-visible:not(:focus),.close-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.close-button:disabled,.close-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.close-button[data-pending=true]{pointer-events:none}.close-button svg{pointer-events:none;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);flex-shrink:0;align-self:center}.close-button--default{background-color:var(--default);color:var(--muted)}@media(hover:hover){.close-button--default:hover,.close-button--default[data-hovered=true]{background-color:var(--default-hover)}}.close-button--default:active,.close-button--default[data-pressed=true]{transform:scale(.93)}.description{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted)}.error-message{height:auto;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *),.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.field-error{height:0;padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);opacity:0}.field-error[data-visible]{opacity:1;height:auto}.field-error{transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *),.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox>.field-error,.checkbox>[data-slot=field-error],.switch>.field-error,.switch>[data-slot=field-error],.radio>.field-error,.radio>[data-slot=field-error]{height:auto;min-height:0;color:var(--muted);opacity:1;margin:0;padding:0;transition:none}.label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}:is(.label--required,[data-required=true]:not([role=group]):not([role=radiogroup]):not([role=checkboxgroup])>.label,[data-required=true]:not([data-slot=radio]):not([data-slot=checkbox])>.label):after{margin-left:calc(var(--spacing) * .5);color:var(--danger);--tw-content:"*";content:var(--tw-content)}.label--disabled,[data-disabled=true] .label{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.label--invalid,[data-invalid=true] .label,[aria-invalid=true] .label{color:var(--danger)}.accordion{contain:layout style;width:100%}.accordion__body{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.accordion__body-inner{padding-inline:calc(var(--spacing) * 4);padding-top:0;padding-bottom:calc(var(--spacing) * 4);color:var(--muted)}.accordion__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__indicator[data-expanded=true]{rotate:-180deg}.accordion__item{--tw-border-style:none;border-style:none;position:relative}.accordion__item:after{content:"";border-radius:calc(var(--radius) * .25);background-color:var(--separator);width:100%;height:1px;position:absolute;bottom:0;left:0}.accordion__item:last-child:after{content:none}.accordion__item[data-hide-separator=true]:after{display:none}.accordion__trigger{cursor:var(--cursor-interactive);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 4);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-tap-highlight-color:transparent;transition:opacity .15s var(--ease-out),box-shadow .15s var(--ease-out);flex:1;justify-content:space-between;align-items:center;display:flex}.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:color-mix(in oklab,var(--foreground) 3%,transparent 90%)}}}.accordion__trigger:focus-visible:not(:focus),.accordion__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.accordion__trigger:disabled,.accordion__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.accordion__panel{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__panel[data-expanded=true]{will-change:height,opacity;opacity:1}.accordion--surface{background-color:var(--surface);border-radius:min(32px,var(--radius-3xl))}@media(hover:hover){.accordion--surface .accordion__trigger:hover:not([aria-expanded=true]),.accordion--surface .accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--default)}}.accordion--surface .accordion__item:after{background-color:var(--surface-foreground)}@supports (color:color-mix(in lab,red,red)){.accordion--surface .accordion__item:after{background-color:color-mix(in oklab,var(--surface-foreground) 6%,transparent)}}.accordion--surface .accordion__item:after{width:94%;left:3%}.accordion--surface .accordion__item:first-child [data-slot=accordion-trigger]{border-top-left-radius:min(32px,var(--radius-3xl));border-top-right-radius:min(32px,var(--radius-3xl))}.accordion--surface .accordion__item:last-child:not(:has([data-slot=accordion-trigger][aria-expanded=true])) [data-slot=accordion-trigger]{border-bottom-left-radius:min(32px,var(--radius-3xl));border-bottom-right-radius:min(32px,var(--radius-3xl))}.breadcrumbs{align-items:center;display:flex}.breadcrumbs .breadcrumbs__link{padding-inline:calc(var(--spacing) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);opacity:1;text-decoration-line:none;position:relative}.breadcrumbs .breadcrumbs__link:hover,.breadcrumbs .breadcrumbs__link[data-hovered=true]{text-decoration-line:underline}.breadcrumbs .breadcrumbs__link[data-current=true]{color:var(--link);opacity:1}.breadcrumbs .breadcrumbs__item{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);padding-inline:calc(var(--spacing) * .5);flex-shrink:0;display:flex}.breadcrumbs .breadcrumbs__separator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:var(--muted)}.breadcrumbs .breadcrumbs__separator:where(:dir(rtl),[dir=rtl],[dir=rtl] *){rotate:180deg}.disclosure-group{contain:layout style;width:100%}.disclosure{position:relative}.accordion__heading{display:flex}.disclosure__trigger{cursor:var(--cursor-interactive);-webkit-tap-highlight-color:transparent;display:inline-block}.disclosure__trigger:focus-visible:not(:focus),.disclosure__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.disclosure__trigger:disabled,.disclosure__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.disclosure__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:inherit;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__indicator[data-expanded=true]{rotate:-180deg}.disclosure__content{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__content[data-expanded=true]{will-change:height,opacity;opacity:1}.disclosure__body{padding:calc(var(--spacing) * 2)}.link{border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);width:fit-content;height:fit-content;font-weight:var(--font-weight-medium);color:var(--link);text-decoration-line:none;-webkit-text-decoration-color:var(--separator-tertiary);text-decoration-color:var(--separator-tertiary);text-underline-offset:4px;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .1s var(--ease-out);align-items:center;text-decoration-thickness:1.5px;display:inline-flex;position:relative}.link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link{cursor:var(--cursor-interactive)}@media(hover:hover){.link:hover,.link[data-hovered=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.link:hover,.link[data-hovered=true]{-webkit-text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent);text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent)}}:is(.link:hover,.link[data-hovered=true]) .link__icon{opacity:1}}.link:active,.link[data-pressed=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}:is(.link:active,.link[data-pressed=true]) .link__icon{opacity:1}.link:focus-visible:not(:focus),.link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}:is(.link:focus-visible:not(:focus),.link[data-focus-visible=true]) .link__icon{opacity:1}.link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.link .link__icon{pointer-events:none;color:currentColor;opacity:.6;width:.75em;height:.75em;transition:opacity .15s var(--ease-out);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link .link__icon svg{transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.link .link__icon[data-default-icon=true]{margin-left:var(--spacing);padding-bottom:calc(var(--spacing) * 1.5)}.link.button{gap:0;text-decoration-line:none}.pagination{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);flex-direction:column;width:100%;display:flex}@media(min-width:40rem){.pagination{flex-direction:row}}.pagination__summary{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__summary{align-self:center}}.pagination__content{align-items:center;gap:var(--spacing);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__content{align-self:center}}.pagination__item{display:inline-flex}.pagination__link{isolation:isolate;width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);transform-origin:50%;border-radius:calc(var(--radius) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}@media(min-width:48rem){.pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.pagination__link{--pagination-link-bg:transparent;--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover);--pagination-link-fg:var(--default-foreground);background-color:var(--pagination-link-bg);color:var(--pagination-link-fg)}.pagination__link:focus-visible,.pagination__link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.pagination__link:disabled,.pagination__link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.pagination__link:hover,.pagination__link[data-hovered=true]{background-color:var(--pagination-link-bg-hover)}}.pagination__link:active,.pagination__link[data-pressed=true]{background-color:var(--pagination-link-bg-pressed);transform:scale(.97)}.pagination__link[data-active=true]{--pagination-link-bg:var(--default);--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover)}.pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:inline-flex}@media(min-width:48rem){.pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link--nav{gap:calc(var(--spacing) * 1.5);width:auto;padding-inline:calc(var(--spacing) * 2.5)}.pagination--sm .pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__link{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__link:active,.pagination--sm .pagination__link[data-pressed=true]{transform:scale(.98)}.pagination--sm .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 2)}.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.pagination--lg .pagination__link{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__link{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__link:active,.pagination--lg .pagination__link[data-pressed=true]{transform:scale(.96)}.pagination--lg .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 3)}.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__summary{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.tabs{gap:calc(var(--spacing) * 2);display:flex}.tabs[data-orientation=horizontal]{flex-direction:column}.tabs[data-orientation=vertical]{flex-direction:row}.tabs__list-container{position:relative}.tabs__list{background-color:var(--default);padding:var(--spacing);border-radius:calc(var(--radius) * 2.5);display:inline-flex}.tabs__list[data-orientation=horizontal]{flex-direction:row;width:100%}.tabs__list[data-orientation=vertical]{gap:var(--spacing);flex-direction:column}.tabs__list[data-orientation=vertical] .tabs__tab{min-width:calc(var(--spacing) * 20)}.tabs__tab{z-index:1;cursor:var(--cursor-interactive);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);width:100%;padding-inline:calc(var(--spacing) * 4);text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .15s var(--ease-smooth);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__tab[data-selected=true]{color:var(--segment-foreground)}.tabs__tab[data-selected=true] .tabs__separator,.tabs__tab[data-selected=true]+.tabs__tab .tabs__separator{opacity:0}.tabs__tab:disabled,.tabs__tab[data-disabled=true],.tabs__tab[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.tabs__tab:not([data-selected=true]):not([data-disabled=true]):hover,.tabs__tab[data-hovered=true]:not([data-selected=true]):not([data-disabled=true]){opacity:.7}}.tabs__tab:focus-visible:not(:focus),.tabs__tab[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tabs__separator{border-radius:calc(var(--radius) * .5);background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.tabs__separator{background-color:color-mix(in oklab,var(--muted) 25%,transparent)}}.tabs__separator{pointer-events:none;transition:opacity .15s var(--ease-smooth);position:absolute}.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__list[data-orientation=horizontal] .tabs__separator{width:1px;height:50%;top:25%;left:0}.tabs__list[data-orientation=vertical] .tabs__separator{width:90%;height:1px;top:0;left:5%}.tabs__panel{width:100%;padding:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none}.tabs__panel[data-exiting=true]{width:100%;position:absolute;top:0;left:0}.tabs__panel[data-orientation=horizontal]{margin-top:calc(var(--spacing) * 4)}.tabs__panel[data-orientation=vertical]{margin-left:calc(var(--spacing) * 4)}.tabs__indicator{box-shadow:var(--shadow-surface);z-index:-1;border-radius:var(--radius-3xl);background-color:var(--segment);width:100%;height:100%;transition-property:translate,width,height;transition-duration:.25s;transition-timing-function:var(--ease-out-fluid);position:absolute;top:0;left:0}.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs--secondary>.tabs__list-container>.tabs__list{background-color:#0000;border-radius:0;padding:0}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=horizontal]{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border);max-width:100%;overflow:auto clip}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=vertical]{border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--border)}.tabs--secondary>.tabs__list-container .tabs__tab{border-radius:0}.tabs--secondary>.tabs__list-container .tabs__tab[data-selected=true]{color:var(--foreground)}.tabs--secondary>.tabs__list-container .tabs__separator{display:none}.tabs--secondary>.tabs__list-container .tabs__indicator{background-color:var(--accent);box-shadow:none;border-radius:0}.tabs--secondary[data-orientation=horizontal]>.tabs__list-container .tabs__indicator{height:2px;top:auto;bottom:0}.tabs--secondary[data-orientation=vertical]>.tabs__list-container .tabs__indicator{width:2px;height:100%;top:0;left:0}.button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.button{height:calc(var(--spacing) * 9)}}.button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button{cursor:var(--cursor-interactive);--button-bg:transparent;--button-bg-hover:var(--button-bg);--button-bg-pressed:var(--button-bg-hover);--button-fg:currentColor;background-color:var(--button-bg);color:var(--button-fg)}.button:focus-visible:not(:focus),.button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.button:disabled,.button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.button[data-pending=true]{pointer-events:none}.button:active,.button[data-pressed=true]{background-color:var(--button-bg-pressed);transform:scale(.97)}@media(hover:hover){.button:hover,.button[data-hovered=true]{background-color:var(--button-bg-hover)}}.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.button--sm{height:calc(var(--spacing) * 8)}}.button--sm svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.button--sm:active,.button--sm[data-pressed=true]{transform:scale(.98)}.button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.button--lg{height:calc(var(--spacing) * 10)}}.button--lg:active,.button--lg[data-pressed=true]{transform:scale(.96)}.button--primary{--button-bg:var(--accent);--button-bg-hover:var(--accent-hover);--button-bg-pressed:var(--accent-hover);--button-fg:var(--accent-foreground)}.button--secondary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover);--button-fg:var(--accent-soft-foreground)}.button--tertiary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover)}.button--ghost,.button--outline{--button-bg:transparent;--button-bg-hover:var(--default);--button-bg-pressed:var(--default);--button-fg:var(--default-foreground)}.button--outline{border-style:var(--tw-border-style);border-width:1px;border-color:var(--border);--button-bg-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.button--outline{--button-bg-hover:color-mix(in srgb, var(--default) 60%, transparent)}}.button--danger{--button-bg:var(--danger);--button-bg-hover:var(--danger-hover);--button-bg-pressed:var(--danger-hover);--button-fg:var(--danger-foreground)}.button--danger-soft{--button-bg:var(--danger-soft);--button-bg-hover:var(--danger-soft-hover);--button-bg-pressed:var(--danger-soft-hover);--button-fg:var(--danger-soft-foreground)}.button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.button--icon-only{width:calc(var(--spacing) * 9)}}.button--icon-only.button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.button--icon-only.button--sm{width:calc(var(--spacing) * 8)}}.button--icon-only.button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.button--icon-only.button--lg{width:calc(var(--spacing) * 10)}}.button--full-width{width:100%}.button-group{justify-content:center;align-items:center;gap:0;height:auto;display:inline-flex}.button-group--horizontal{flex-direction:row}.button-group--vertical{flex-direction:column}.button-group .button{border-radius:0}.button-group--horizontal .button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.button-group--vertical .button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group .button:active,.button-group .button[data-pressed=true]{transform:none}.button-group .button:focus-visible:not(:focus),.button-group .button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button-group--horizontal .button-group__separator{width:1px;height:50%;top:25%;left:-1px}.button-group--vertical .button-group__separator{width:50%;height:1px;top:-1px;left:25%}.button-group--horizontal .button--outline:first-child{border-inline-end-style:var(--tw-border-style);border-inline-end-width:0}.button-group--horizontal .button--outline:last-child{border-inline-start-style:var(--tw-border-style);border-inline-start-width:0}.button-group--horizontal .button--outline:not(:first-child):not(:last-child){border-inline-style:var(--tw-border-style);border-inline-width:0}.button-group--vertical .button--outline:first-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.button-group--vertical .button--outline:last-child{border-top-style:var(--tw-border-style);border-top-width:0}.button-group--vertical .button--outline:not(:first-child):not(:last-child){border-block-style:var(--tw-border-style);border-block-width:0}.button-group--full-width{width:100%}.toggle-button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.toggle-button{height:calc(var(--spacing) * 9)}}.toggle-button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button{cursor:var(--cursor-interactive);--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover);--toggle-button-fg:currentColor;--toggle-button-bg-selected:var(--accent-soft);--toggle-button-bg-selected-hover:var(--accent-soft-hover);--toggle-button-bg-selected-pressed:var(--accent-soft-hover);--toggle-button-fg-selected:var(--accent-soft-foreground);background-color:var(--toggle-button-bg);color:var(--toggle-button-fg)}.toggle-button:focus-visible:not(:focus),.toggle-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.toggle-button:disabled,.toggle-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.toggle-button:hover,.toggle-button[data-hovered=true]{background-color:var(--toggle-button-bg-hover)}}.toggle-button:active,.toggle-button[data-pressed=true]{background-color:var(--toggle-button-bg-pressed);transform:scale(.97)}.toggle-button[data-selected=true]{background-color:var(--toggle-button-bg-selected);color:var(--toggle-button-fg-selected)}@media(hover:hover){.toggle-button[data-selected=true]:hover,.toggle-button[data-selected=true][data-hovered=true]{background-color:var(--toggle-button-bg-selected-hover)}}.toggle-button[data-selected=true]:active,.toggle-button[data-selected=true][data-pressed=true]{background-color:var(--toggle-button-bg-selected-pressed)}.toggle-button svg{pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.toggle-button svg{margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.toggle-button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.toggle-button--sm{height:calc(var(--spacing) * 8)}}.toggle-button--sm svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toggle-button--sm:active,.toggle-button--sm[data-pressed=true]{transform:scale(.98)}.toggle-button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.toggle-button--lg{height:calc(var(--spacing) * 10)}}.toggle-button--lg:active,.toggle-button--lg[data-pressed=true]{transform:scale(.96)}.toggle-button--default{--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover)}.toggle-button--ghost{--toggle-button-bg:transparent;--toggle-button-bg-hover:var(--default);--toggle-button-bg-pressed:var(--default);--toggle-button-fg:var(--default-foreground)}.toggle-button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.toggle-button--icon-only{width:calc(var(--spacing) * 9)}}.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 8)}}.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 10)}}.toggle-button-group{justify-content:center;align-items:center;gap:0;width:fit-content;height:auto;display:inline-flex}.toggle-button-group--horizontal{flex-direction:row}.toggle-button-group--vertical{flex-direction:column}.toggle-button-group--full-width{width:100%}.toggle-button-group .toggle-button{border-radius:0}.toggle-button-group--horizontal .toggle-button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group .toggle-button:active,.toggle-button-group .toggle-button[data-pressed=true]{transform:none}.toggle-button-group .toggle-button:focus-visible:not(:focus),.toggle-button-group .toggle-button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.toggle-button-group--full-width .toggle-button{flex:1}.toggle-button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button-group--horizontal .toggle-button-group__separator{width:1px;height:50%;top:25%;left:-1px}.toggle-button-group--vertical .toggle-button-group__separator{width:50%;height:1px;top:-1px;left:25%}.toggle-button-group--detached{gap:var(--spacing)}.toggle-button-group--detached .toggle-button{border-radius:calc(var(--radius) * 3)}.toggle-button-group--detached .toggle-button-group__separator{display:none}.toolbar{align-items:center;gap:calc(var(--spacing) * 2);grid-auto-flow:column;width:fit-content;display:grid}.toolbar .separator--vertical{align-self:center;height:50%}.toolbar .separator--horizontal{justify-content:center;justify-self:center;width:50%}.toolbar--vertical{grid-auto-flow:row;justify-content:flex-start;align-items:flex-start}.toolbar--vertical .button-group{justify-content:flex-start}.toolbar--attached{border-radius:calc(var(--radius) * 3);background-color:var(--surface);padding:var(--spacing);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dropdown{gap:var(--spacing);flex-direction:column;display:flex}.dropdown__trigger{--tw-outline-style:none;transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;display:inline-block}.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.dropdown__trigger{cursor:var(--cursor-interactive)}.dropdown__trigger:focus-visible:not(:focus),.dropdown__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.dropdown__trigger:disabled,.dropdown__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.dropdown__trigger[data-pending=true]{pointer-events:none}.dropdown__trigger:active,.dropdown__trigger[data-pressed=true]{transform:scale(.97)}.dropdown__popover{max-width:48svw;transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));padding:0;overflow-y:auto}@media(min-width:48rem){.dropdown__popover{min-width:calc(var(--spacing) * 55)}}.dropdown__popover{border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay)}.dropdown__popover:focus-visible:not(:focus),.dropdown__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.dropdown__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.dropdown__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.dropdown__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.dropdown__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.dropdown__popover[data-exiting=true],.dropdown__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.dropdown__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.dropdown__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.dropdown__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.dropdown__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.dropdown__popover [data-slot=dropdown-menu]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.dropdown__popover [data-slot=menu-item]{padding-inline:calc(var(--spacing) * 2.5)}.dropdown__menu{gap:calc(var(--spacing) * .5);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.dropdown__menu [data-slot=separator]{width:94%;margin-left:3%}.list-box-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item{cursor:var(--cursor-interactive)}.list-box-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.list-box-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.list-box-item:has(.list-box-item__indicator){padding-inline-end:calc(var(--spacing) * 7)}.list-box-item:focus-visible:not(:focus),.list-box-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.list-box-item:active,.list-box-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.list-box-item:hover,.list-box-item[data-hovered=true]{background-color:var(--default)}}.list-box-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.list-box-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--default-foreground);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-end:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]{transition:stroke-dashoffset .25s linear}:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item--danger .list-box-item__indicator,.list-box-item--danger [data-slot=label]{color:var(--danger)}.list-box-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.list-box{width:100%;padding:var(--spacing);position:relative;overflow:clip}.list-box>*+*{margin-top:var(--spacing)}.list-box [data-slot=separator][data-orientation=horizontal]{width:94%;margin-left:3%}.menu-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item{cursor:var(--cursor-interactive)}.menu-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.menu-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.menu-item [data-slot=submenu-indicator] svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.menu-item:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 7)}.menu-item[data-has-submenu=true]:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 7)}.menu-item:focus-visible:not(:focus),.menu-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.menu-item:active,.menu-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.menu-item:hover,.menu-item[data-hovered=true]{background-color:var(--default)}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]{transition:stroke-dashoffset .1s linear}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--dot]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.menu-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.menu-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-start:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item[data-has-submenu=true] .menu-item__indicator{inset-inline-start:auto;inset-inline-end:calc(var(--spacing) * 2)}.menu-item__indicator [data-slot=menu-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:0}.menu-item__indicator--submenu{color:var(--muted)}.menu-item__indicator--submenu svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.menu-item--danger .menu-item__indicator,.menu-item--danger [data-slot=label]{color:var(--danger)}.menu-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.menu{gap:var(--spacing);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.menu [data-slot=separator]{width:94%;margin-left:3%}.tag-group{gap:var(--spacing);flex-direction:column;display:flex;position:relative}.tag-group__list{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex;position:relative}.tag-group [slot=description],.tag-group [data-slot=description],.tag-group [slot=errorMessage],.tag-group [data-slot=error-message]{padding:var(--spacing)}.tag{--optical-offset:.031em;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:inline-flex;position:relative}.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tag{cursor:var(--cursor-interactive)}.tag svg{pointer-events:none;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:currentColor;flex-shrink:0;align-self:center}.tag:is([data-disabled=true],[aria-disabled=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tag:is(:focus-visible,[data-focus-visible]){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tag:is([data-selected=true],[aria-selected=true]){background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.tag:is([data-selected=true],[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-soft-hover)}}.tag--sm{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--md{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--lg{border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.tag--default{background-color:var(--default);color:var(--default-foreground)}@media(hover:hover){.tag--default:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--default-hover)}}.tag--surface{background-color:var(--surface);color:var(--surface-foreground)}@media(hover:hover){.tag--surface:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--surface-hover)}}.tag__remove-button{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:inherit}.tag__remove-button svg{width:inherit;height:inherit;color:currentColor;flex-shrink:0;align-self:center}.color-area{width:100%;max-width:calc(var(--spacing) * 56);border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;aspect-ratio:1;background:var(--color-area-background);flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-area[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-area--show-dots:after{content:"";pointer-events:none;border-radius:inherit;background-image:radial-gradient(circle,#fff3 1px,#0000 1px);background-size:8px 8px;position:absolute;top:0;right:0;bottom:0;left:0}.color-area__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);will-change:width,height;background-color:var(--color-area-thumb-color);transition:width .15s var(--ease-out),height .15s var(--ease-out);border:3px solid #fff;box-shadow:0 0 0 1px #0000001a,inset 0 0 0 1px #0000001a}.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-area__thumb[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-area__thumb[data-dragging=true]{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.color-area__thumb[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker{display:inline-flex}.color-picker__trigger{align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-flex}.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-picker__trigger [data-slot=label]{cursor:var(--cursor-interactive)}.color-picker__trigger:focus-visible:not(:focus),.color-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-picker__trigger:disabled,.color-picker__trigger[data-disabled=true],.color-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker__popover{min-width:calc(var(--spacing) * 62);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 3);box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5));gap:calc(var(--spacing) * 3);flex-direction:column;display:flex;overflow:hidden auto}.color-picker__popover:focus-visible:not(:focus),.color-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.color-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.color-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.color-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.color-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.color-picker__popover[data-exiting=true],.color-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.color-slider{gap:var(--spacing);grid-template:"label output""track track"/1fr auto;width:100%;display:grid}.color-slider:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template:"track"/1fr;gap:0}.color-slider:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-columns:1fr;grid-template-areas:"label""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output){grid-template-columns:1fr;grid-template-areas:"output""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output) .color-slider__output{justify-self:end}.color-slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.color-slider .color-slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.color-slider .color-slider__track{border-radius:calc(var(--radius) * 2);grid-area:track;position:relative}.color-slider .color-slider__track:before,.color-slider .color-slider__track:after{content:"";z-index:0;pointer-events:none;position:absolute}.color-slider .color-slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;border-style:var(--tw-border-style);border-width:3px;border-color:var(--color-white);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);z-index:1;transition:transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-slider .color-slider__thumb[data-dragging=true]{cursor:grabbing}.color-slider .color-slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-slider .color-slider__thumb[data-disabled=true]{cursor:default;background-color:var(--default)}.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]) [data-slot=label]{opacity:1}.color-slider[data-orientation=horizontal]{flex-direction:column}.color-slider[data-orientation=horizontal] .color-slider__track{height:calc(var(--spacing) * 5);border-radius:0;justify-self:center;width:calc(100% - 1.25rem);box-shadow:inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:before,.color-slider[data-orientation=horizontal] .color-slider__track:after{width:.625rem;height:100%;top:0}.color-slider[data-orientation=horizontal] .color-slider__track:before{border-top-left-radius:calc(var(--radius) * 2);border-bottom-left-radius:calc(var(--radius) * 2);background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;left:-.625rem;box-shadow:inset 1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:after{border-top-right-radius:calc(var(--radius) * 2);border-bottom-right-radius:calc(var(--radius) * 2);background-color:var(--track-end-color,transparent);right:-.625rem;box-shadow:inset -1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);top:50%}.color-slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;place-items:center;height:100%}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template-rows:1fr;grid-template-areas:"track";gap:0}.color-slider[data-orientation=vertical]:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-rows:1fr auto;grid-template-areas:"track""label"}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):has(.color-slider__output){grid-template-rows:auto 1fr;grid-template-areas:"output""track"}.color-slider[data-orientation=vertical] .color-slider__output,.color-slider[data-orientation=vertical] [data-slot=label]{text-align:center}.color-slider[data-orientation=vertical] .color-slider__track{width:calc(var(--spacing) * 5);border-radius:0;justify-self:center;height:calc(100% - 1.25rem);box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:before,.color-slider[data-orientation=vertical] .color-slider__track:after{width:100%;height:.625rem;left:0}.color-slider[data-orientation=vertical] .color-slider__track:before{background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;border-bottom-right-radius:999px;border-bottom-left-radius:999px;bottom:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:after{background-color:var(--track-end-color,transparent);border-top-left-radius:999px;border-top-right-radius:999px;top:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);left:50%}.color-swatch{box-sizing:border-box;width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);background:linear-gradient(var(--color-swatch-current),var(--color-swatch-current)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-swatch--circle{border-radius:calc(var(--radius) * 2)}.color-swatch--square{border-radius:calc(var(--radius) * .75)}.color-swatch--xs{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.color-swatch--xs.color-swatch--circle{border-radius:calc(var(--radius) * 1)}.color-swatch--sm{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.color-swatch--sm.color-swatch--circle{border-radius:calc(var(--radius) * 1.5)}.color-swatch--lg{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.color-swatch--lg.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.color-swatch--xl.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch-picker{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.color-swatch-picker__item{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);border-style:var(--tw-border-style);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:border-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);border-width:2px;border-color:#0000;outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__item:focus-visible,.color-swatch-picker__item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-swatch-picker__item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-swatch-picker__item[data-selected=true]{border-color:var(--color-swatch-current);box-shadow:var(--field-shadow)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{transform:scale(.77)}.color-swatch-picker__swatch{border-radius:inherit;width:100%;height:100%;transition:transform .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:block}.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-swatch-picker__swatch:hover{transform:scale(1.1)}}.color-swatch-picker__indicator{pointer-events:none;z-index:10;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.color-swatch-picker__indicator>*{width:33.3333%;height:33.3333%;color:var(--color-white);transition:transform .15s var(--ease-out);transform:scale(0)translateZ(0)}.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__indicator[data-light-color=true] .color-swatch-picker__indicator>*{color:var(--color-black)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__indicator>*{transform:scale(1)translateZ(0)}.color-swatch-picker--stack{flex-direction:column}.color-swatch-picker--xs .color-swatch-picker__item{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px}.color-swatch-picker--sm .color-swatch-picker__item{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);border-style:var(--tw-border-style);border-width:2px}.color-swatch-picker--lg .color-swatch-picker__item{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--xl .color-swatch-picker__item{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--square .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-input-group:hover:not(:focus-within),.color-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.color-input-group[data-focus-within=true],.color-input-group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.color-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group[data-invalid=true]:focus,.color-input-group[data-invalid=true]:focus-visible,.color-input-group[data-invalid=true][data-focused=true],.color-input-group[data-invalid=true][data-focus-visible=true],.color-input-group[data-invalid=true]:focus-within,.color-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.color-input-group[data-disabled=true],.color-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-input-group__input{cursor:text;border-style:var(--tw-border-style);height:100%;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;display:flex}@media(min-width:40rem){.color-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.color-input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}.color-input-group:has([data-slot=color-input-group-prefix]) .color-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.color-input-group:has([data-slot=color-input-group-suffix]) .color-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.color-input-group__input:focus,.color-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.color-input-group__prefix{color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group__suffix{color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--color-input-group-bg);--color-input-group-bg:var(--default);--color-input-group-bg-hover:var(--default-hover);--color-input-group-bg-focus:var(--default)}@media(hover:hover){.color-input-group--secondary:hover:not(:focus-within),.color-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--color-input-group-bg-hover)}}.color-input-group--secondary:focus-within,.color-input-group--secondary[data-focus-within=true]{background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group--secondary[data-invalid=true]:focus,.color-input-group--secondary[data-invalid=true]:focus-visible,.color-input-group--secondary[data-invalid=true][data-focused=true],.color-input-group--secondary[data-invalid=true][data-focus-visible=true],.color-input-group--secondary[data-invalid=true]:focus-within,.color-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary [data-slot=color-input-group-input]{background-color:#0000}.color-input-group--full-width{width:100%}.color-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.color-field[data-invalid=true],.color-field[aria-invalid=true]) [data-slot=description]{display:none}.color-field [data-slot=label]{width:fit-content}.color-field--full-width{width:100%}.slider{gap:var(--spacing);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.slider .slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.slider .slider__track{border-radius:calc(var(--radius) * 1.5);background-color:var(--default);grid-area:track;position:relative}.slider .slider__fill{pointer-events:none;background-color:var(--accent);position:absolute}.slider .slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 1.5);background-color:var(--accent);-webkit-tap-highlight-color:transparent;transition:background-color .25s var(--ease-smooth),transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.slider .slider__thumb:after{z-index:10;border-radius:calc(var(--radius) * 1);background-color:var(--accent-foreground);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);content:"";transform-origin:50%;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));position:relative}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:after:not(:is()){transition-property:none}}.slider .slider__thumb[data-dragging=true]{cursor:grabbing}.slider .slider__thumb[data-dragging=true]:after{scale:.9}@media(prefers-reduced-motion:reduce){.slider .slider__thumb[data-dragging=true]:after:not(:is()){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.slider .slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.slider .slider__thumb[data-disabled=true]{cursor:default}.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]) [data-slot=label]{opacity:1}.slider[data-orientation=horizontal]{flex-direction:column}.slider[data-orientation=horizontal] .slider__track{height:calc(var(--spacing) * 5);border-inline-style:var(--tw-border-style);border-inline-width:.75rem;border-inline-color:#0000;width:100%}.slider[data-orientation=horizontal] .slider__track[data-fill-start=true]{border-inline-start-color:var(--accent)}.slider[data-orientation=horizontal] .slider__track[data-fill-end=true]{border-inline-end-color:var(--accent)}.slider[data-orientation=horizontal] .slider__fill,.slider[data-orientation=horizontal] .slider__thumb{height:100%}.slider[data-orientation=horizontal] .slider__thumb{width:1.75rem;top:50%}.slider[data-orientation=horizontal] .slider__thumb:after{width:1.5rem;height:1rem}.slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;height:100%}.slider[data-orientation=vertical] .slider__output,.slider[data-orientation=vertical] [data-slot=label]{text-align:center}.slider[data-orientation=vertical] .slider__track{height:100%;width:calc(var(--spacing) * 5);border-block-style:var(--tw-border-style);border-block-width:.75rem;border-block-color:#0000;justify-self:center}.slider[data-orientation=vertical] .slider__track[data-fill-start=true]{border-bottom-color:var(--accent)}.slider[data-orientation=vertical] .slider__track[data-fill-end=true]{border-top-color:var(--accent)}.slider[data-orientation=vertical] .slider__fill,.slider[data-orientation=vertical] .slider__thumb{width:100%}.slider[data-orientation=vertical] .slider__thumb{height:1.75rem;left:50%}.slider[data-orientation=vertical] .slider__thumb:after{width:1rem;height:1.5rem}.switch{align-items:flex-start;gap:var(--spacing);-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);--switch-control-bg:var(--default);--switch-control-bg-hover:var(--switch-control-bg);flex-direction:column;display:flex}@supports (color:color-mix(in lab,red,red)){.switch{--switch-control-bg-hover:color-mix(in oklab, var(--switch-control-bg), transparent 20%)}}.switch{--switch-control-bg-pressed:var(--switch-control-bg-hover);--switch-control-bg-checked:var(--accent);--switch-control-bg-checked-hover:var(--accent-hover)}.switch[data-disabled=true],.switch[data-disabled=true] [data-slot=description],.switch[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.switch[data-disabled=true] .switch__thumb{background-color:var(--default-foreground)}@supports (color:color-mix(in lab,red,red)){.switch[data-disabled=true] .switch__thumb{background-color:color-mix(in oklab,var(--default-foreground) 20%,transparent)}}.switch>[data-slot=description]{width:100%;min-width:0;padding-inline-start:3.25rem}.switch>[data-slot=field-error]{width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--muted);padding-inline-start:3.25rem}.switch.switch--sm>[data-slot=description],.switch.switch--sm>[data-slot=field-error]{padding-inline-start:2.75rem}.switch.switch--lg>[data-slot=description],.switch.switch--lg>[data-slot=field-error]{padding-inline-start:3.75rem}:is(.switch:disabled[aria-checked=true],.switch:disabled[data-selected=true],.switch[data-disabled=true][aria-checked=true],.switch[data-disabled=true][data-selected=true],.switch[aria-disabled=true][aria-checked=true],.switch[aria-disabled=true][data-selected=true]) .switch__thumb{opacity:.4}.switch__control{border-radius:calc(var(--radius) * 1.5);background-color:var(--switch-control-bg);width:2.5rem;height:1.25rem;transition:background-color .25s var(--ease-smooth),box-shadow .15s var(--ease-out);flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch:focus-visible .switch__control,.switch:has([data-slot=switch-content][data-focus-visible=true]) .switch__control,.switch [data-slot=switch-content][data-focus-visible=true] .switch__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.switch:hover .switch__control,.switch:has([data-slot=switch-content][data-hovered=true]) .switch__control,.switch [data-slot=switch-content][data-hovered=true] .switch__control{background-color:var(--switch-control-bg-hover)}.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control{background-color:var(--switch-control-bg-pressed)}:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transform:none}@media(prefers-reduced-motion:reduce){:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transform:none}}.switch[aria-checked=true] .switch__control,.switch[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked)}.switch[aria-checked=true]:hover .switch__control,.switch[data-selected=true]:hover .switch__control,.switch[aria-checked=true][data-hovered=true] .switch__control,.switch[data-selected=true][data-hovered=true] .switch__control,.switch:has([data-slot=switch-content][data-hovered=true])[data-selected=true] .switch__control,.switch[aria-checked=true]:active .switch__control,.switch[data-selected=true]:active .switch__control,.switch[aria-checked=true][data-pressed=true] .switch__control,.switch[data-selected=true][data-pressed=true] .switch__control,.switch:has([data-slot=switch-content][data-pressed=true])[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked-hover)}.switch__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.switch--sm .switch__control{border-radius:calc(var(--radius) * 1);width:2rem;height:1rem}.switch--lg .switch__control{width:3rem;height:1.5rem}.switch__thumb{transform-origin:50%;border-radius:calc(var(--radius) * 1);background-color:var(--color-white);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);width:1.375rem;height:1rem;transition:margin .3s var(--ease-out-fluid),background-color .2s var(--ease-out);margin-inline-start:calc(var(--spacing) * .5);display:flex}.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch[aria-checked=true] .switch__thumb,.switch[data-selected=true] .switch__thumb{background-color:var(--accent-foreground);color:var(--accent);margin-inline-start:calc(100% - 1.5rem);box-shadow:0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d}.switch--sm .switch__thumb{border-radius:calc(var(--radius) * .75);width:1.03125rem;height:.75rem}.switch[aria-checked=true] :is(.switch--sm .switch__thumb),.switch[data-selected=true] :is(.switch--sm .switch__thumb){margin-inline-start:calc(100% - 1.15625rem)}.switch--lg .switch__thumb{border-radius:calc(var(--radius) * 1.5);width:1.71875rem;height:1.25rem}.switch[aria-checked=true] :is(.switch--lg .switch__thumb),.switch[data-selected=true] :is(.switch--lg .switch__thumb){margin-inline-start:calc(100% - 1.84375rem)}.switch__thumb>*{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.switch__label{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.switch [data-slot=label]{-webkit-user-select:none;user-select:none}.switch__content [data-slot=label]{cursor:var(--cursor-interactive)}.switch [data-slot=description]{cursor:default;-webkit-user-select:none;user-select:none}.switch-group{gap:calc(var(--spacing) * 6);flex-direction:column;display:flex}.switch-group__items{gap:calc(var(--spacing) * 4);display:flex}.switch-group--horizontal .switch-group__items{flex-direction:row}.switch-group--vertical .switch-group__items{flex-direction:column}.badge{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);min-height:calc(var(--spacing) * 7);min-width:calc(var(--spacing) * 7);border-radius:calc(var(--radius) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:1.34;--badge-bg:var(--default);--badge-fg:var(--default-foreground);--badge-border:var(--background);background-color:var(--badge-bg);color:var(--badge-fg);border:1px solid var(--badge-border);flex-shrink:0;line-height:1.34;display:inline-flex}.badge__label{padding-inline:calc(var(--spacing) * .5)}.badge-anchor{flex-shrink:0;display:inline-flex;position:relative}.badge--lg{min-height:calc(var(--spacing) * 8);min-width:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;line-height:1.43}.badge--sm{min-height:calc(var(--spacing) * 4);min-width:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);--tw-leading:1.34;font-size:10px;line-height:1.34}.badge--accent{--badge-fg:var(--accent-soft-foreground)}.badge--default{--badge-fg:var(--default-foreground)}.badge--success{--badge-fg:var(--success-soft-foreground)}.badge--warning{--badge-fg:var(--warning-soft-foreground)}.badge--danger{--badge-fg:var(--danger-soft-foreground)}.badge--top-right{position:absolute;top:0;right:0;transform:translate(25%,-25%)}.badge--top-left{position:absolute;top:0;left:0;transform:translate(-25%,-25%)}.badge--bottom-right{position:absolute;bottom:0;right:0;transform:translate(25%,25%)}.badge--bottom-left{position:absolute;bottom:0;left:0;transform:translate(-25%,25%)}.badge--primary.badge--accent{--badge-bg:var(--accent);--badge-fg:var(--accent-foreground)}.badge--primary.badge--default{--badge-bg:var(--default);--badge-fg:var(--default-foreground)}.badge--primary.badge--success{--badge-bg:var(--success);--badge-fg:var(--success-foreground)}.badge--primary.badge--warning{--badge-bg:var(--warning);--badge-fg:var(--warning-foreground)}.badge--primary.badge--danger{--badge-bg:var(--danger);--badge-fg:var(--danger-foreground)}.badge--soft.badge--accent{--badge-bg:var(--accent-soft);--badge-fg:var(--accent-soft-foreground)}.badge--soft.badge--default{--badge-bg:var(--default-soft);--badge-fg:var(--default-soft-foreground)}.badge--soft.badge--success{--badge-bg:var(--success-soft);--badge-fg:var(--success-soft-foreground)}.badge--soft.badge--warning{--badge-bg:var(--warning-soft);--badge-fg:var(--warning-soft-foreground)}.badge--soft.badge--danger{--badge-bg:var(--danger-soft);--badge-fg:var(--danger-soft-foreground)}.chip{align-items:center;gap:calc(var(--spacing) * .5);border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--chip-bg:var(--default);--chip-fg:currentColor;background-color:var(--chip-bg);color:var(--chip-fg);flex-shrink:0;display:inline-flex}.chip__label{padding-inline:calc(var(--spacing) * .5)}.chip--accent{--chip-fg:var(--accent-soft-foreground)}.chip--danger{--chip-fg:var(--danger-soft-foreground)}.chip--default{--chip-fg:var(--default-foreground)}.chip--success{--chip-fg:var(--success-soft-foreground)}.chip--warning{--chip-fg:var(--warning-soft-foreground)}.chip--tertiary{--chip-bg:transparent}.chip--sm{padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));padding-block:0}.chip--md{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.chip--lg{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.chip--primary.chip--accent{--chip-bg:var(--accent);--chip-fg:var(--accent-foreground)}.chip--primary.chip--success{--chip-bg:var(--success);--chip-fg:var(--success-foreground)}.chip--primary.chip--warning{--chip-bg:var(--warning);--chip-fg:var(--warning-foreground)}.chip--primary.chip--danger{--chip-bg:var(--danger);--chip-fg:var(--danger-foreground)}.chip--accent.chip--soft{--chip-bg:var(--accent-soft);--chip-fg:var(--accent-soft-foreground)}.chip--success.chip--soft{--chip-bg:var(--success-soft);--chip-fg:var(--success-soft-foreground)}.chip--warning.chip--soft{--chip-bg:var(--warning-soft);--chip-fg:var(--warning-soft-foreground)}.chip--danger.chip--soft{--chip-bg:var(--danger-soft);--chip-fg:var(--danger-soft-foreground)}.chip--default.chip--soft{--chip-bg:var(--default-soft);--chip-fg:var(--default-soft-foreground)}.table-root{grid-template-columns:minmax(0,1fr);width:100%;display:grid;position:relative;overflow:clip}.table__scroll-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;overflow-x:auto}.table-root--primary{background-color:var(--surface-secondary);padding-inline:var(--spacing);padding-bottom:var(--spacing);border-radius:min(32px,calc(var(--radius) * 2.5))}.table-root--secondary .table__header{border-bottom-style:var(--tw-border-style);background-color:#0000;border-bottom-width:0}.table-root--secondary .table__column{background-color:var(--surface-secondary)}.table-root--secondary :is(th.table__column:first-child,[role=row]>[role=presentation]:first-of-type>.table__column){border-start-start-radius:min(32px,var(--radius-2xl));border-end-start-radius:min(32px,var(--radius-2xl))}.table-root--secondary :is(th.table__column:last-child,[role=row]>[role=presentation]:last-of-type>.table__column){border-start-end-radius:min(32px,var(--radius-2xl));border-end-end-radius:min(32px,var(--radius-2xl))}.table-root--secondary .table__body{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table-root--secondary .table__body tr:first-child td:first-child,.table-root--secondary .table__body tr:first-child td:last-child,.table-root--secondary .table__body tr:last-child td:first-child,.table-root--secondary .table__body tr:last-child td:last-child{border-radius:0}.table-root--secondary .table__body:not(tbody){border-radius:0;overflow:visible}.table-root--secondary .table__row .table__cell{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row .table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table-root--secondary .table__row .table__cell{background-color:#0000}@media(hover:hover){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--default) 50%,transparent)}}}.table__content{border-collapse:separate;--tw-border-spacing-x:0;--tw-border-spacing-y:0;width:100%;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.table-root--primary .table__content{overflow:clip}.table__header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator)}@supports (color:color-mix(in lab,red,red)){.table__header{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__header{background-color:var(--surface-secondary)}.table__column{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);position:relative}.table__column:after{content:"";pointer-events:none;height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .5);background-color:var(--separator);inset-inline-end:calc(var(--spacing) * 0);position:absolute;top:50%}.table__column:last-child:not(:only-child):after{content:none}.table__column[data-allows-sorting=true]{cursor:var(--cursor-interactive)}@media(hover:hover){.table__column[data-allows-sorting=true]:hover,.table__column[data-allows-sorting=true][data-hovered=true]{color:var(--foreground)}}.table__column:focus-visible,.table__column[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}[role=row]>[role=presentation]:last-of-type:not(:only-of-type)>.table__column:after{content:none}.table__sortable-column-header{justify-content:space-between;align-items:center;display:flex}.table__sortable-column-indicator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out)}.table__sortable-column-indicator[data-direction=descending]{rotate:180deg}.table__body tr:first-child td:first-child{border-start-start-radius:min(32px,var(--radius-2xl))}.table__body tr:first-child td:last-child{border-start-end-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:first-child{border-end-start-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:last-child{border-end-end-radius:min(32px,var(--radius-2xl))}.table__body:not(tbody){border-radius:min(32px,var(--radius-2xl));height:100%;position:relative;overflow:clip}.table__row{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator);height:100%;position:relative}@supports (color:color-mix(in lab,red,red)){.table__row{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__row:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 40%,transparent)}}}.table__row[data-selected=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row[data-selected=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 10%,transparent)}}.table__row[aria-disabled=true],.table__row[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.table__row:focus-visible,.table__row[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.table__row[data-dragging=true]{opacity:.5}.table__row[data-drop-target=true] .table__cell{background-color:var(--accent-soft)}.table__cell{background-color:var(--surface);height:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);vertical-align:middle;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table__cell:focus-visible,.table__cell[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true]) :is(.table__cell,.table__column){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):only-child,.table__row:is(:focus-visible,[data-focus-visible=true])>:only-child :is(.table__cell,.table__column){border-radius:calc(var(--radius) * 1);--tw-shadow:inset 0 0 0 2px var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):first-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:first-child:not(:only-child) :is(.table__cell,.table__column){border-top-left-radius:calc(var(--radius) * 1);border-bottom-left-radius:calc(var(--radius) * 1);--tw-shadow:inset 2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):last-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:last-child:not(:only-child) :is(.table__cell,.table__column){border-top-right-radius:calc(var(--radius) * 1);border-bottom-right-radius:calc(var(--radius) * 1);--tw-shadow:inset -2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):not(:first-child):not(:last-child):not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:not(:first-child):not(:last-child):not(:only-child) :is(.table__cell,.table__column){--tw-shadow:inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__cell[data-tree-column]{padding-inline-start:calc(1rem * var(--table-row-level,1))}.table__footer{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);align-items:center;display:flex}.table__resizable-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;position:relative;overflow:auto}.table__column-resizer{height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;border-radius:calc(var(--radius) * .5);background-color:var(--separator);box-sizing:content-box;--tw-translate-x: 50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:col-resize;touch-action:none;padding-inline:calc(var(--spacing) * 2);--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-clip:content-box;border-style:none;outline-style:none;position:absolute;top:50%}.table__column-resizer[data-hovered=true],.table__column-resizer:hover,.table__column-resizer[data-resizing=true]{height:100%;width:calc(var(--spacing) * .5);background-color:var(--accent)}.table__column-resizer[data-focus-visible=true],.table__column-resizer:focus-visible{height:100%;width:calc(var(--spacing) * .5);background-color:var(--focus)}.table__column:has(.table__column-resizer):after{content:none}.table__load-more td,.table__load-more [role=rowheader]{padding-block:calc(var(--spacing) * 3);text-align:center}:is(.table__load-more td,.table__load-more [role=rowheader])>*{margin-inline:auto}.table__load-more-content{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 2);display:flex}.alert{justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 4);background-color:var(--surface);width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex}.alert__content{flex-direction:column;flex-grow:1;align-items:flex-start;height:100%;display:flex}.alert__indicator{padding:var(--spacing);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:flex}.alert__indicator [data-slot=alert-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.alert__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.alert__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.alert--default .alert__indicator,.alert--default .alert__title{color:var(--foreground)}.alert--accent .alert__indicator,.alert--accent .alert__title{color:var(--accent-soft-foreground)}.alert--success .alert__indicator,.alert--success .alert__title{color:var(--success-soft-foreground)}.alert--warning .alert__indicator,.alert--warning .alert__title{color:var(--warning-soft-foreground)}.alert--danger .alert__indicator,.alert--danger .alert__title{color:var(--danger-soft-foreground)}.empty-state{padding:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.skeleton{pointer-events:none;border-radius:calc(var(--radius) * .5);background-color:var(--surface-tertiary);position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.skeleton{background-color:color-mix(in oklab,var(--surface-tertiary) 70%,transparent)}}.skeleton--shimmer:after{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-gradient-position:to right;animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}@supports (background-image:linear-gradient(in lab,red,red)){.skeleton--shimmer:after{--tw-gradient-position:to right in oklab}}.skeleton--shimmer:after{background-image:linear-gradient(var(--tw-gradient-stops));--tw-gradient-from:transparent;--tw-gradient-via:var(--surface-tertiary);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));--tw-gradient-to:transparent;--tw-content:"";content:var(--tw-content)}.skeleton--shimmer:has(.skeleton):after{content:none}.skeleton--shimmer:has(.skeleton):before{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-content:"";content:var(--tw-content);z-index:10;pointer-events:none;mix-blend-mode:overlay;background:linear-gradient(90deg,#0000,#ffffff80,#0000);animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}.skeleton--shimmer:has(.skeleton) .skeleton:after{content:none}.skeleton--pulse{animation:var(--animate-pulse)}.meter{gap:var(--spacing);--meter-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.meter [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.meter .meter__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.meter .meter__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.meter .meter__fill{border-radius:calc(var(--radius) * .5);background-color:var(--meter-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]) [data-slot=label]{opacity:1}.meter--sm .meter__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.meter--sm .meter__fill{border-radius:calc(var(--radius) * .25)}.meter--lg .meter__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.meter--lg .meter__fill{border-radius:calc(var(--radius) * .75)}.meter--default{--meter-fill:var(--default-foreground)}.meter--accent{--meter-fill:var(--accent)}.meter--success{--meter-fill:var(--success)}.meter--warning{--meter-fill:var(--warning)}.meter--danger{--meter-fill:var(--danger)}.progress-bar{gap:var(--spacing);--progress-bar-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.progress-bar [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.progress-bar .progress-bar__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.progress-bar .progress-bar__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.progress-bar .progress-bar__fill{border-radius:calc(var(--radius) * .5);background-color:var(--progress-bar-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-bar:not([aria-valuenow]) .progress-bar__fill{width:40%;animation:1.5s cubic-bezier(.65,0,.35,1) infinite progress-bar-indeterminate}.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]) [data-slot=label]{opacity:1}@keyframes progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(350%)}}.progress-bar--sm .progress-bar__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.progress-bar--sm .progress-bar__fill{border-radius:calc(var(--radius) * .25)}.progress-bar--lg .progress-bar__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.progress-bar--lg .progress-bar__fill{border-radius:calc(var(--radius) * .75)}.progress-bar--default{--progress-bar-fill:var(--default-foreground)}.progress-bar--accent{--progress-bar-fill:var(--accent)}.progress-bar--success{--progress-bar-fill:var(--success)}.progress-bar--warning{--progress-bar-fill:var(--warning)}.progress-bar--danger{--progress-bar-fill:var(--danger)}.progress-circle{--progress-circle-stroke:var(--accent);--progress-circle-track-stroke:var(--default);justify-content:center;align-items:center;display:inline-flex}.progress-circle .progress-circle__track{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.progress-circle .progress-circle__track-circle{stroke:var(--progress-circle-track-stroke)}.progress-circle .progress-circle__fill-circle{stroke:var(--progress-circle-stroke);transition:stroke-dashoffset .3s var(--ease-out)}.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-circle:not([aria-valuenow]) .progress-circle__track{animation:1s linear infinite progress-circle-spin}.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-circle:disabled,.progress-circle[data-disabled=true],.progress-circle[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@keyframes progress-circle-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.progress-circle--sm .progress-circle__track{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.progress-circle--lg .progress-circle__track{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.progress-circle--default{--progress-circle-stroke:var(--default-foreground)}.progress-circle--accent{--progress-circle-stroke:var(--accent)}.progress-circle--success{--progress-circle-stroke:var(--success)}.progress-circle--warning{--progress-circle-stroke:var(--warning)}.progress-circle--danger{--progress-circle-stroke:var(--danger)}.spinner{pointer-events:none;width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);flex-shrink:0;animation:.75s linear infinite spin;display:inline-flex}.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *),.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.spinner--sm{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.spinner--lg{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.spinner--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.spinner--current{color:inherit}.spinner--accent{color:var(--accent)}.spinner--danger{color:var(--danger)}.spinner--success{color:var(--success)}.spinner--warning{color:var(--warning)}.toast-region{pointer-events:none;z-index:50;--tw-outline-style:none;outline-style:none;width:calc(100vw - 2rem);position:fixed}@media(min-width:40rem){.toast-region{width:auto;min-width:var(--toast-width)}}.toast-region{display:block}.toast-region--bottom{bottom:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--bottom-start{bottom:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--bottom-end{right:calc(var(--spacing) * 4);bottom:calc(var(--spacing) * 4)}.toast-region--top{top:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--top-start{top:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--top-end{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4)}.toast-region:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast{pointer-events:auto;justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 1.5);background-color:var(--surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex;position:absolute;left:0;right:0}.toast--bottom,.toast--bottom-start,.toast--bottom-end{bottom:0}.toast--top,.toast--top-start,.toast--top-end{top:0}.toast:not([data-frontmost=true]){pointer-events:none;height:var(--front-height);overflow:hidden}.toast:not([data-frontmost=true]) .toast__close-button{pointer-events:none;opacity:0;outline:none}.toast[data-hidden=true]{pointer-events:none;opacity:0;display:flex}.toast:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast--bottom,.toast--bottom-start,.toast--bottom-end{view-transition-class:toast-bottom}.toast--top,.toast--top-start,.toast--top-end{view-transition-class:toast-top}.toast__content{flex-direction:column;flex-grow:1;align-self:center;align-items:flex-start;height:100%;display:flex}.toast__indicator{padding:var(--spacing);color:var(--overlay-foreground);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.toast__indicator [data-slot=toast-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__indicator [data-slot=spinner],.toast__indicator [data-slot=spinner-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--overlay-foreground)}.toast__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.toast__close-button{pointer-events:none;top:calc(var(--spacing) * -1);right:calc(var(--spacing) * -1);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);border-color:var(--border);background-color:var(--default);opacity:0;position:absolute}@media(min-width:40rem){.toast__close-button{border-style:var(--tw-border-style);background-color:var(--overlay);border-width:1px}}.toast__close-button{transition:opacity .15s var(--ease-smooth)}.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(min-width:40rem){.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}}@media(hover:hover){.toast__close-button:hover,.toast__close-button[data-hovered=true]{background-color:var(--default)}}.toast[data-frontmost=true]:hover .toast__close-button{pointer-events:auto;opacity:1}.toast__action{margin-top:calc(var(--spacing) * 2)}@media(min-width:40rem){.toast__action{margin-top:0}}.toast--accent .toast__title{color:var(--accent-soft-foreground)}.toast--success .toast__title,.toast--success .toast__indicator{color:var(--success-soft-foreground)}.toast--warning .toast__title,.toast--warning .toast__indicator{color:var(--warning-soft-foreground)}.toast--danger .toast__title,.toast--danger .toast__indicator{color:var(--danger-soft-foreground)}::view-transition-old(*){will-change:translate,opacity}::view-transition-new(*){will-change:translate,opacity}::view-transition-new(.toast-bottom):only-child{animation:.35s toast-slide-bottom-in}::view-transition-old(.toast-bottom):only-child{animation:.35s forwards toast-slide-bottom-out}::view-transition-new(.toast-top):only-child{animation:.35s toast-slide-top-in}::view-transition-old(.toast-top):only-child{animation:.35s forwards toast-slide-top-out}@keyframes toast-slide-bottom-in{0%{opacity:0;translate:0 100%}}@keyframes toast-slide-bottom-out{to{opacity:0;translate:0 100%}}@keyframes toast-slide-top-in{0%{opacity:0;translate:0 -100%}}@keyframes toast-slide-top-out{to{opacity:0;translate:0 -100%}}.checkbox-group{flex-direction:column;display:flex}.checkbox-group [data-slot=checkbox]{margin-top:calc(var(--spacing) * 4)}.checkbox{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.checkbox>[data-slot=description],.checkbox>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.checkbox [data-slot=label]{-webkit-user-select:none;user-select:none}.checkbox .checkbox__content [data-slot=label]{cursor:var(--cursor-interactive)}.checkbox[data-disabled=true],.checkbox[data-disabled=true] [data-slot=description],.checkbox[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.checkbox[data-selected=true],.checkbox[data-indeterminate=true]) .checkbox__indicator{border-color:var(--accent-foreground)}.checkbox [data-slot=checkbox-default-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);stroke-width:2.5px;color:var(--accent-foreground);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.2s;transition-duration:.2s}.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox[data-selected=true] [data-slot=checkbox-default-indicator--checkmark]{transition:stroke-dashoffset .15s linear 15ms}.checkbox[data-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[data-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark]{color:var(--danger-foreground)}.checkbox[data-indeterminate=true] [data-slot=checkbox-default-indicator--indeterminate]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.checkbox[data-indeterminate=true][data-invalid=true] [data-slot=checkbox-default-indicator--indeterminate],.checkbox[data-indeterminate=true][aria-invalid=true] [data-slot=checkbox-default-indicator--indeterminate]{color:var(--danger-foreground)}.checkbox__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .75);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative;overflow:hidden}.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox__control{cursor:var(--cursor-interactive)}.checkbox__control:before{pointer-events:none;z-index:0;transform-origin:50%;--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);border-radius:calc(var(--radius) * .75);background-color:var(--accent);opacity:0;--tw-content:"";content:var(--tw-content);transition:scale .1s var(--ease-linear),opacity .2s var(--ease-linear),background-color .2s var(--ease-out);position:absolute;top:0;right:0;bottom:0;left:0}@media(prefers-reduced-motion:reduce){.checkbox__control:before:not(:is()){transition-property:none}}.checkbox:focus-visible .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-focus-visible=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-focus-visible=true] .checkbox__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control{border-color:var(--field-border-hover)}:is(.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control):before{background-color:var(--accent-hover)}.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control{color:var(--accent-foreground);border-color:#0000}:is(.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.checkbox[data-indeterminate=true] .checkbox__control{background-color:var(--accent);color:var(--accent-foreground)}.checkbox:active[data-indeterminate=true] .checkbox__control,.checkbox[data-pressed=true][data-indeterminate=true] .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-pressed=true])[data-indeterminate=true] .checkbox__control{background-color:var(--accent-hover)}.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-visible,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focused=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-visible=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-within,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground);border-color:#0000}:is(.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);background-color:var(--danger);opacity:1}.checkbox[data-indeterminate=true][aria-invalid=true] .checkbox__control,.checkbox[data-indeterminate=true][data-invalid=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground)}.checkbox__indicator{z-index:10;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);justify-content:center;align-items:center;display:flex;position:relative}.checkbox__indicator svg{width:100%;height:100%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.checkbox--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.checkbox--secondary .checkbox__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--checkbox-control-bg);--checkbox-control-bg:var(--default)}.checkbox:hover :is(.checkbox--secondary .checkbox__control),.checkbox:has([data-slot=checkbox-content][data-hovered=true]) :is(.checkbox--secondary .checkbox__control),.checkbox [data-slot=checkbox-content][data-hovered=true] :is(.checkbox--secondary .checkbox__control){border-color:var(--field-border-hover)}.checkbox__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.checkbox--secondary:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{background-color:var(--checkbox-control-bg)}:is(.checkbox--secondary[aria-checked=true] .checkbox__control,.checkbox--secondary[data-selected=true] .checkbox__control):before,.checkbox--secondary[data-indeterminate=true] .checkbox__control,.checkbox--secondary[data-indeterminate=true] .checkbox__control:before{background-color:var(--accent)}.fieldset{gap:calc(var(--spacing) * 6);flex-direction:column;flex:1 1 0;display:flex}.fieldset__legend{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.fieldset__field_group{width:100%}:where(.fieldset__field_group>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.fieldset__actions{align-items:center;gap:calc(var(--spacing) * 2);padding-top:var(--spacing);display:flex}.input-otp{align-items:center;gap:calc(var(--spacing) * 2);display:flex;position:relative}.input-otp[data-disabled=true]{cursor:not-allowed;opacity:.5}.input-otp__group{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.input-otp__slot{height:calc(var(--spacing) * 10);width:calc(var(--spacing) * 9.5);border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:var(--field-radius,calc(var(--radius) * 1.5));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;flex:1;justify-content:center;align-items:center;display:flex;position:relative}.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-otp__slot:hover,.input-otp__slot[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-otp__slot[data-active=true]{z-index:10;background-color:var(--field-focus);--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.input-otp__slot[data-filled=true]{background-color:var(--field-focus)}.input-otp__slot[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input-otp__slot[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-otp__slot[data-invalid=true]:focus,.input-otp__slot[data-invalid=true]:focus-visible,.input-otp__slot[data-invalid=true][data-focused=true],.input-otp__slot[data-invalid=true][data-focus-visible=true],.input-otp__slot[data-invalid=true]:focus-within,.input-otp__slot[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-otp__slot[data-invalid=true]{background-color:var(--field-focus)}.input-otp__slot-value{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-tracking:-.27px;letter-spacing:-.27px;animation:slot-value-in .25s var(--ease-smooth) both;transform-origin:bottom}.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.input-otp__caret{height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .5);background-color:var(--field-placeholder,var(--muted));width:2px;animation:1.2s ease-out infinite caret-blink;position:absolute}.input-otp__separator{border-radius:calc(var(--radius) * .5);background-color:var(--separator);flex-shrink:0;width:6px;height:2px}.input-otp--secondary .input-otp__slot{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-otp-slot-bg);--input-otp-slot-bg:var(--default);--input-otp-slot-bg-hover:var(--default-hover);--input-otp-slot-bg-focus:var(--default)}@media(hover:hover){.input-otp--secondary .input-otp__slot:hover,.input-otp--secondary .input-otp__slot[data-hovered=true]{background-color:var(--input-otp-slot-bg-hover)}}.input-otp--secondary .input-otp__slot[data-active=true],.input-otp--secondary .input-otp__slot[data-filled=true]{background-color:var(--input-otp-slot-bg-focus)}@keyframes slot-value-in{0%{opacity:0;transform:translateY(8px)scale(.8)}to{opacity:1;transform:translateY(0)scale(1)}}.input{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input{border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input:hover:not(:focus):not(:focus-visible),.input[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input:focus,.input[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input[data-invalid=true]:focus,.input[data-invalid=true]:focus-visible,.input[data-invalid=true][data-focused=true],.input[data-invalid=true][data-focus-visible=true],.input[data-invalid=true]:focus-within,.input[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input[data-invalid=true]{background-color:var(--field-focus)}.input:disabled,.input[data-disabled=true],.input[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-bg);--input-bg:var(--default);--input-bg-hover:var(--default-hover);--input-bg-focus:var(--default)}@media(hover:hover){.input--secondary:hover:not(:focus):not(:focus-visible),.input--secondary[data-hovered=true]:not([data-focus-visible=true]):not([data-focused=true]){background-color:var(--input-bg-hover)}}.input--secondary:focus,.input--secondary[data-focused=true]{background-color:var(--input-bg-focus)}.input--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input--secondary[data-invalid=true]:focus,.input--secondary[data-invalid=true]:focus-visible,.input--secondary[data-invalid=true][data-focused=true],.input--secondary[data-invalid=true][data-focus-visible=true],.input--secondary[data-invalid=true]:focus-within,.input--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input--secondary[data-invalid=true]{background-color:var(--input-bg-focus)}.input--full-width{width:100%}.input-group{min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);outline-style:none;align-items:center;display:inline-flex}.input-group:has([data-slot=input-group-textarea]){align-items:flex-start;height:auto}.input-group{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-group:hover:not(:focus-within),.input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-group:has([data-slot=input-group-input]:focus),.input-group:has([data-slot=input-group-textarea]:focus){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group[data-invalid=true]:focus,.input-group[data-invalid=true]:focus-visible,.input-group[data-invalid=true][data-focused=true],.input-group[data-invalid=true][data-focus-visible=true],.input-group[data-invalid=true]:focus-within,.input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.input-group[data-disabled=true],.input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.input-group:has([data-slot=input-group-input]:-webkit-autofill),.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.input-group__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}.input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input-group:has([data-slot=input-group-prefix]) .input-group__input{border-top-left-radius:0;border-bottom-left-radius:0;padding-left:0}.input-group:has([data-slot=input-group-suffix]) .input-group__input{border-top-right-radius:0;border-bottom-right-radius:0;padding-right:0}.input-group__input:focus,.input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.input-group__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input[data-slot=input-group-textarea]{resize:vertical;min-height:38px}.input-group__prefix{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-right-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-left:none;border-top-right-radius:0;border-bottom-right-radius:0;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__prefix{align-items:flex-start;padding-top:.5rem}.input-group__prefix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group__suffix{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-left-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-right:none;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__suffix{align-items:flex-start;padding-top:.5rem}.input-group__suffix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-group-bg);--input-group-bg:var(--default);--input-group-bg-hover:var(--default-hover);--input-group-bg-focus:var(--default)}@media(hover:hover){.input-group--secondary:hover:not(:focus-within),.input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--input-group-bg-hover)}}.input-group--secondary:has([data-slot=input-group-input]:focus),.input-group--secondary:has([data-slot=input-group-textarea]:focus){background-color:var(--input-group-bg-focus)}.input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group--secondary[data-invalid=true]:focus,.input-group--secondary[data-invalid=true]:focus-visible,.input-group--secondary[data-invalid=true][data-focused=true],.input-group--secondary[data-invalid=true][data-focus-visible=true],.input-group--secondary[data-invalid=true]:focus-within,.input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--input-group-bg-focus)}.input-group--secondary [data-slot=input-group-input],.input-group--secondary [data-slot=input-group-textarea]{background-color:#0000}.input-group--full-width{width:100%}.number-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.number-field[data-invalid=true],.number-field[aria-invalid=true]) [data-slot=description]{display:none}.number-field [data-slot=label]{width:fit-content}.number-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;grid-template-columns:40px 1fr 40px;align-items:center;display:grid;overflow:hidden}.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.number-field__group:hover:not(:focus-within),.number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.number-field__group[data-focus-within=true],.number-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field__group[data-invalid=true]:focus,.number-field__group[data-invalid=true]:focus-visible,.number-field__group[data-invalid=true][data-focused=true],.number-field__group[data-invalid=true][data-focus-visible=true],.number-field__group[data-invalid=true]:focus-within,.number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.number-field__group[data-disabled=true],.number-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.number-field__group:has([data-slot=number-field-input]:-webkit-autofill),.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.number-field__input{border-style:var(--tw-border-style);min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none}@media(min-width:40rem){.number-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.number-field__group:has([slot=decrement]) .number-field__input{border-top-left-radius:0;border-bottom-left-radius:0}.number-field__group:has([slot=increment]) .number-field__input{border-top-right-radius:0;border-bottom-right-radius:0}.number-field__input:focus,.number-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.number-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__increment-button,.number-field__decrement-button{height:100%;width:calc(var(--spacing) * 10);color:var(--field-foreground,var(--foreground));--tw-outline-style:none;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth);background-color:#0000;border-style:solid;border-radius:0;outline-style:none;justify-content:center;align-items:center;display:flex}:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.number-field__increment-button,.number-field__decrement-button{cursor:var(--cursor-interactive)}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:var(--field-foreground,var(--foreground))}@supports (color:color-mix(in lab,red,red)){:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:color-mix(in oklab,var(--field-foreground,var(--foreground)) 10%,transparent)}}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{transform:scale(.97)}:is(.number-field__increment-button,.number-field__decrement-button):disabled,:is(.number-field__increment-button,.number-field__decrement-button)[data-disabled=true],:is(.number-field__increment-button,.number-field__decrement-button)[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-increment-button-icon],:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-decrement-button-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.number-field__increment-button{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--field-placeholder,var(--muted))}@supports (color:color-mix(in lab,red,red)){.number-field__increment-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field__decrement-button{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--field-placeholder,var(--muted));border-top-right-radius:0;border-bottom-right-radius:0}@supports (color:color-mix(in lab,red,red)){.number-field__decrement-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field--secondary .number-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--number-field-group-bg);--number-field-group-bg:var(--default);--number-field-group-bg-hover:var(--default-hover);--number-field-group-bg-focus:var(--default)}@media(hover:hover){.number-field--secondary .number-field__group:hover:not(:focus-within),.number-field--secondary .number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--number-field-group-bg-hover)}}.number-field--secondary .number-field__group:focus-within,.number-field--secondary .number-field__group[data-focus-within=true]{background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field--secondary .number-field__group[data-invalid=true]:focus,.number-field--secondary .number-field__group[data-invalid=true]:focus-visible,.number-field--secondary .number-field__group[data-invalid=true][data-focused=true],.number-field--secondary .number-field__group[data-invalid=true][data-focus-visible=true],.number-field--secondary .number-field__group[data-invalid=true]:focus-within,.number-field--secondary .number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field--secondary .number-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group [data-slot=number-field-input]{background-color:#0000}.number-field--full-width,.number-field__group--full-width{width:100%}.radio-group{flex-direction:column;display:flex}.radio-group[data-orientation=vertical] [data-slot=radio]{margin-top:calc(var(--spacing) * 4)}.radio-group[data-orientation=horizontal]{gap:calc(var(--spacing) * 4);flex-flow:wrap}.radio-group--secondary .radio__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--radio-control-bg);--radio-control-bg:var(--default);--radio-control-bg-hover:var(--default-hover)}.radio:has([data-slot=radio-content][data-hovered=true]) :is(.radio-group--secondary .radio__control),.radio [data-slot=radio-content][data-hovered=true] :is(.radio-group--secondary .radio__control){border-color:var(--field-border-hover)}.radio:not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg-hover)}.radio{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.radio [data-slot=label]{-webkit-user-select:none;user-select:none}.radio .radio__content [data-slot=label]{cursor:var(--cursor-interactive)}.radio>[data-slot=description],.radio>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=description],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.radio__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.radio__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.radio__control{cursor:var(--cursor-interactive)}.radio:has([data-slot=radio-content][data-focus-visible=true]) .radio__control,.radio [data-slot=radio-content][data-focus-visible=true] .radio__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.radio:has([data-slot=radio-content][data-hovered=true]) .radio__control,.radio [data-slot=radio-content][data-hovered=true] .radio__control{border-color:var(--field-border-hover)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) .radio__control .radio__indicator:empty:before{background-color:var(--field-hover)}.radio:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio [data-slot=radio-content][data-pressed=true] .radio__control{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.radio[data-selected] .radio__control,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__control,.radio:has(input:checked) .radio__control{background-color:var(--accent);border-color:#0000}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__control,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__control{background-color:var(--accent-hover)}.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-visible,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focused=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-within,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-visible,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focused=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-within,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio__indicator{pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.radio__indicator:empty:before{content:"";border-radius:calc(var(--radius) * 1);background-color:var(--field-background,var(--default));width:100%;height:100%;transition:scale .2s var(--ease-out),background-color .2s var(--ease-out);scale:1}@media(prefers-reduced-motion:reduce){.radio__indicator:empty:before:not(:is()){transition-property:none}}.radio[data-selected] .radio__indicator:empty:before,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked) .radio__indicator:empty:before{background-color:var(--accent-foreground);scale:.4286}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before{scale:.5714}.radio--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textfield{gap:var(--spacing);flex-direction:column;display:flex}:is(.textfield[data-invalid=true],.textfield[aria-invalid=true]) [data-slot=description]{display:none}.textfield--full-width,.textfield--full-width [data-slot=input],.textfield--full-width [data-slot=textarea]{width:100%}.search-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.search-field[data-invalid=true],.search-field[aria-invalid=true]) [data-slot=description]{display:none}.search-field [data-slot=label]{width:fit-content}.search-field[data-empty=true] [data-slot=search-field-clear-button]{pointer-events:none;opacity:0}.search-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;position:relative;overflow:hidden}.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.search-field__group:hover:not(:focus-within),.search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.search-field__group[data-focus-within=true],.search-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field__group[data-invalid=true]:focus,.search-field__group[data-invalid=true]:focus-visible,.search-field__group[data-invalid=true][data-focused=true],.search-field__group[data-invalid=true][data-focus-visible=true],.search-field__group[data-invalid=true]:focus-within,.search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.search-field__group[data-disabled=true],.search-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.search-field__group:has([data-slot=search-field-input]:-webkit-autofill),.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.search-field__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}@media(min-width:40rem){.search-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.search-field__input::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__input::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__group:has([data-slot=search-field-search-icon]) .search-field__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.search-field__group:has([slot=clear]) .search-field__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.search-field__input:focus,.search-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.search-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__search-icon{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);flex-shrink:0}.search-field__clear-button{margin-right:calc(var(--spacing) * 2);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0}.search-field__clear-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.search-field--secondary .search-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--search-field-group-bg);--search-field-group-bg:var(--default);--search-field-group-bg-hover:var(--default-hover);--search-field-group-bg-focus:var(--default)}@media(hover:hover){.search-field--secondary .search-field__group:hover:not(:focus-within),.search-field--secondary .search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--search-field-group-bg-hover)}}.search-field--secondary .search-field__group:focus-within,.search-field--secondary .search-field__group[data-focus-within=true]{background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field--secondary .search-field__group[data-invalid=true]:focus,.search-field--secondary .search-field__group[data-invalid=true]:focus-visible,.search-field--secondary .search-field__group[data-invalid=true][data-focused=true],.search-field--secondary .search-field__group[data-invalid=true][data-focus-visible=true],.search-field--secondary .search-field__group[data-invalid=true]:focus-within,.search-field--secondary .search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field--secondary .search-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group [data-slot=search-field-input]{background-color:#0000}.search-field--full-width,.search-field__group--full-width{width:100%}.textarea{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.textarea::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.textarea{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.textarea{border-width:var(--border-width-field);border-color:var(--field-border);min-height:38px;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *),.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.textarea:hover:not(:focus):not(:focus-visible),.textarea[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.textarea:focus,.textarea[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.textarea[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea[data-invalid=true]:focus,.textarea[data-invalid=true]:focus-visible,.textarea[data-invalid=true][data-focused=true],.textarea[data-invalid=true][data-focus-visible=true],.textarea[data-invalid=true]:focus-within,.textarea[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea[data-invalid=true]{background-color:var(--field-focus)}.textarea:disabled,.textarea[data-disabled=true],.textarea[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textarea--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--textarea-bg);--textarea-bg:var(--default);--textarea-bg-hover:var(--default-hover);--textarea-bg-focus:var(--default)}@media(hover:hover){.textarea--secondary:hover:not(:focus):not(:focus-visible),.textarea--secondary[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--textarea-bg-hover)}}.textarea--secondary:focus,.textarea--secondary[data-focused=true]{background-color:var(--textarea-bg-focus)}.textarea--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea--secondary[data-invalid=true]:focus,.textarea--secondary[data-invalid=true]:focus-visible,.textarea--secondary[data-invalid=true][data-focused=true],.textarea--secondary[data-invalid=true][data-focus-visible=true],.textarea--secondary[data-invalid=true]:focus-within,.textarea--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea--secondary[data-invalid=true]{background-color:var(--textarea-bg-focus)}.textarea--full-width{width:100%}.calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.calendar--week-view .calendar__cell,.calendar--day-view .calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.calendar--day-view .calendar__grid{flex-direction:column;display:flex}.calendar--day-view .calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-header>tr{display:contents}.calendar--day-view .calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-body>tr{display:contents}.calendar--day-view .calendar__grid-body>tr:first-child>td{margin-top:0}.calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .calendar__nav-button{pointer-events:none;opacity:0}.calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 2);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.calendar__nav-button:hover,.calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.calendar__nav-button:active,.calendar__nav-button[data-pressed=true]{transform:scale(.95)}.calendar__nav-button:focus-visible,.calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__nav-button:disabled,.calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar__grid[aria-readonly=true] .calendar__cell{pointer-events:none}.calendar__grid-header,.calendar__grid-header>tr,.calendar__grid-body,.calendar__grid-body>tr{display:contents}.calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.calendar__grid-row{display:contents}.calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.calendar__cell{aspect-ratio:1;border-radius:calc(var(--radius) * 3);text-align:center;width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;will-change:scale;transition:transform .25s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__cell{cursor:var(--cursor-interactive)}.calendar__cell:focus-visible:not(:focus),.calendar__cell[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__cell[data-today=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.calendar__cell[data-today=true]:hover:not([data-selected=true]),.calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true]){background-color:var(--accent-soft-hover)}}.calendar__cell[data-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}.calendar__cell:active,.calendar__cell[data-pressed=true]{background-color:var(--default);transform:scale(.95)}:is(.calendar__cell:active,.calendar__cell[data-pressed=true])[data-selected=true]{background-color:var(--accent-hover)}@media(hover:hover){.calendar__cell:hover:not([data-selected=true]),.calendar__cell[data-hovered=true]:not([data-selected=true]){background-color:var(--default)}}.calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.calendar__cell[data-selected=true][data-outside-month=true]{background-color:var(--default)}.calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__cell:disabled:not([data-outside-month=true]),.calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.calendar__cell-indicator{background-color:var(--accent-foreground)}.range-calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.range-calendar--week-view .range-calendar__cell,.range-calendar--day-view .range-calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.range-calendar--day-view .range-calendar__grid{flex-direction:column;display:flex}.range-calendar--day-view .range-calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-header>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-body>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body>tr:first-child>td{margin-top:0}.range-calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.range-calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .range-calendar__nav-button{pointer-events:none;opacity:0}.range-calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.range-calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.range-calendar__nav-button:hover,.range-calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.range-calendar__nav-button:active,.range-calendar__nav-button[data-pressed=true]{transform:scale(.95)}.range-calendar__nav-button:focus-visible,.range-calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__nav-button:disabled,.range-calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.range-calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar__grid[aria-readonly=true] .range-calendar__cell{pointer-events:none}.range-calendar__grid-header,.range-calendar__grid-header>tr,.range-calendar__grid-body,.range-calendar__grid-body>tr{display:contents}.range-calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.range-calendar__grid-row{display:contents}.range-calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.range-calendar__cell{z-index:1;border-radius:calc(var(--radius) * 3);--tw-outline-style:none;cursor:var(--cursor-interactive);will-change:background-color,border-color;transition:box-shadow .1s var(--ease-out),border-color .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;margin-block:2px;margin-inline:0;padding:0;position:relative}.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell .range-calendar__cell-button{aspect-ratio:1;border-radius:calc(var(--radius) * 3);width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);-webkit-tap-highlight-color:transparent;will-change:scale;transition:scale .2s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]{z-index:2}:is(.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]) .range-calendar__cell-button{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__cell[data-today=true] .range-calendar__cell-button{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){:is(.range-calendar__cell[data-today=true]:hover:not([data-selected=true]),.range-calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--accent-soft-hover)}}.range-calendar__cell[data-selected=true]:not([data-outside-month=true]){background-color:var(--accent-soft);border-radius:0}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*){border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*)[data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*){border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*)[data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){z-index:2}:is(.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true])) .range-calendar__cell-button{background-color:var(--accent);color:var(--accent-foreground)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]){border-top-left-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){border-top-right-radius:calc(var(--radius) * 3);border-bottom-right-radius:calc(var(--radius) * 3)}:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true]) .range-calendar__cell-button{scale:.9}:is(:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-start=true],:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-end=true]) .range-calendar__cell-button{background-color:var(--accent-hover)}@media(hover:hover){:is(.range-calendar__cell:hover:not([data-selected=true]),.range-calendar__cell[data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--default)}}.range-calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:color-mix(in oklab,var(--default) 20%,transparent)}}.range-calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__cell:disabled:not([data-outside-month=true]),.range-calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true]{border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true]{border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.range-calendar__cell-indicator{background-color:var(--accent-foreground)}.calendar:has(.calendar-year-picker__year-grid),.range-calendar:has(.calendar-year-picker__year-grid){position:relative}.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]{will-change:opacity;transition:opacity .15s var(--ease-out),visibility 0s linear}:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]{pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s var(--ease-out),visibility 0s linear .15s}:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger{justify-content:flex-start;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1);--tw-outline-style:none;cursor:var(--cursor-interactive);touch-action:manipulation;outline-style:none;flex:1;display:flex}.calendar-year-picker__trigger:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar-year-picker__trigger-heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition:color .15s var(--ease-out)}.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger-indicator{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--accent-soft-foreground);transition:transform .15s var(--ease-out)}.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-indicator{transform:rotate(90deg)}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-heading{color:var(--accent-soft-foreground)}.calendar-year-picker__year-grid{pointer-events:none;scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);align-content:flex-start;gap:var(--spacing);padding:var(--spacing);opacity:0;will-change:opacity;grid-template-columns:repeat(3,1fr);display:grid;position:absolute;left:0;right:0;overflow-y:auto}.calendar-year-picker__year-grid[data-open=true]{pointer-events:auto;opacity:1;transition:opacity .2s var(--ease-out) 50ms}.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);padding-inline:calc(var(--spacing) * 2.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{cursor:var(--cursor-interactive)}@media(hover:hover)and (pointer:fine){.calendar-year-picker__year-cell:is(:hover,[data-hovered=true]):not([data-selected=true]){background-color:var(--default);color:var(--default-foreground)}}.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}@media(hover:hover)and (pointer:fine){:is(.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-hover)}}.calendar-year-picker__year-cell:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.date-field[data-invalid=true],.date-field[aria-invalid=true]) [data-slot=description]{display:none}.date-field [data-slot=label]{width:fit-content}.date-field--full-width{width:100%}.time-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.time-field[data-invalid=true],.time-field[aria-invalid=true]) [data-slot=description]{display:none}.time-field [data-slot=label]{width:fit-content}.time-field--full-width{width:100%}.date-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.date-input-group:hover:not(:focus-within),.date-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.date-input-group[data-focus-within=true]:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])),.date-input-group:focus-within:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.date-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group[data-invalid=true]:focus,.date-input-group[data-invalid=true]:focus-visible,.date-input-group[data-invalid=true][data-focused=true],.date-input-group[data-invalid=true][data-focus-visible=true],.date-input-group[data-invalid=true]:focus-within,.date-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.date-input-group[data-disabled=true],.date-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-input-group__input{cursor:text;border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;gap:1px;display:flex}@media(min-width:40rem){.date-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.date-input-group:has([data-slot=date-input-group-prefix]) .date-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.date-input-group:has([data-slot=date-input-group-suffix]) .date-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=start]{flex:none;padding-right:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=end]{padding-left:0}.date-input-group__input:focus,.date-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.date-input-group__input-container{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;flex:1;align-items:center;width:fit-content;display:flex;overflow:auto clip}.date-input-group__segment{border-radius:calc(var(--radius) * .75);padding-inline:calc(var(--spacing) * .5);text-align:end;text-wrap:nowrap;--tw-outline-style:none;outline-style:none;display:inline-block}.date-input-group__segment[data-type=literal]{color:var(--muted);padding:0}.date-input-group__segment[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.date-input-group__segment:focus,.date-input-group__segment[data-focused=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.date-input-group__segment[data-disabled=true]{opacity:.5}.date-input-group__segment[data-invalid=true]{color:var(--danger)}.date-input-group__segment[data-invalid=true]:focus,.date-input-group__segment[data-invalid=true][data-focused=true]{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.date-input-group__prefix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group__suffix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--date-input-group-bg);--date-input-group-bg:var(--default);--date-input-group-bg-hover:var(--default-hover);--date-input-group-bg-focus:var(--default)}@media(hover:hover){.date-input-group--secondary:hover:not(:focus-within),.date-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--date-input-group-bg-hover)}}.date-input-group--secondary:focus-within,.date-input-group--secondary[data-focus-within=true]{background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group--secondary[data-invalid=true]:focus,.date-input-group--secondary[data-invalid=true]:focus-visible,.date-input-group--secondary[data-invalid=true][data-focused=true],.date-input-group--secondary[data-invalid=true][data-focus-visible=true],.date-input-group--secondary[data-invalid=true]:focus-within,.date-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary [data-slot=date-input-group-input]{background-color:#0000}.date-input-group--full-width{width:100%}.date-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-picker .date-input-group__suffix,.date-picker .date-input-group__prefix{pointer-events:auto}.date-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__trigger:focus-visible:not(:focus),.date-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-picker__trigger:disabled,.date-picker__trigger[data-disabled=true],.date-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-picker__popover:focus-visible:not(:focus),.date-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-picker__popover[data-exiting=true],.date-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.date-range-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-range-picker .date-input-group__suffix,.date-range-picker .date-input-group__prefix{pointer-events:auto}.date-range-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__trigger:focus-visible:not(:focus),.date-range-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-range-picker__trigger:disabled,.date-range-picker__trigger[data-disabled=true],.date-range-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-range-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-range-picker__range-separator{padding-inline:var(--spacing);color:var(--field-placeholder,var(--muted));-webkit-user-select:none;user-select:none}.date-range-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-range-picker__popover:focus-visible:not(:focus),.date-range-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-range-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-range-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-range-picker__popover[data-exiting=true],.date-range-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.card{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 4);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:column;display:flex;position:relative;overflow:visible}.card__header{flex-direction:column;display:flex}.card__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.card__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);color:var(--muted)}.card__content{gap:var(--spacing);flex-direction:column;flex:1;display:flex}.card__footer{flex-direction:row;align-items:center;display:flex}.card--transparent{--tw-border-style:none;--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000;border-style:none}.card--default{background-color:var(--surface)}.card--secondary{background-color:var(--surface-secondary)}.card--tertiary{background-color:var(--surface-tertiary)}.header{width:100%;padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 1.5);padding-bottom:var(--spacing);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted)}.separator{border-radius:calc(var(--radius) * .5);border-top-style:var(--tw-border-style);border-top-width:0;border-bottom-style:var(--tw-border-style);background-color:var(--separator);border-bottom-width:0;flex-shrink:0;width:100%;height:1px}.separator--horizontal{width:100%;height:1px}.separator--vertical{height:auto;min-height:calc(var(--spacing) * 2);align-self:stretch;width:1px}.separator--default{background-color:var(--separator)}.separator--secondary{background-color:var(--separator-secondary)}.separator--tertiary{background-color:var(--separator-tertiary)}.separator__container{align-items:center;gap:calc(var(--spacing) * 3);display:flex}.separator__container--horizontal{flex-direction:row;width:100%}.separator__container--vertical{flex-direction:column;justify-content:center;height:100%}.separator__line{flex-grow:1;flex-shrink:0}.separator__content{text-align:center;white-space:nowrap;color:var(--muted);justify-content:center;align-items:center;display:inline-flex}.separator__content--horizontal,.separator__content--vertical{text-align:center}.surface{color:var(--foreground);position:relative}.surface--transparent{background-color:#0000}.surface--default{background-color:var(--surface);color:var(--surface-foreground)}.surface--secondary{background-color:var(--surface-secondary);color:var(--surface-secondary-foreground)}.surface--tertiary{background-color:var(--surface-tertiary);color:var(--surface-tertiary-foreground)}.avatar{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);background-color:var(--default);flex-shrink:0;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}.avatar__fallback{background-color:var(--default);width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);justify-content:center;align-items:center;display:flex}.avatar__image{aspect-ratio:1;width:100%;height:100%;transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s;position:absolute;top:0;right:0;bottom:0;left:0}.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *),.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.avatar--sm{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2)}.avatar--lg{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12);border-radius:calc(var(--radius) * 3)}.avatar--lg .avatar__fallback{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.avatar__fallback--accent{color:var(--accent-soft-foreground)}.avatar__fallback--default{color:var(--default-soft-foreground)}.avatar__fallback--success{color:var(--success-soft-foreground)}.avatar__fallback--warning{color:var(--warning-soft-foreground)}.avatar__fallback--danger{color:var(--danger-soft-foreground)}.avatar--soft{background-color:#0000}.avatar--soft .avatar__fallback--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.avatar--soft .avatar__fallback--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.avatar--soft .avatar__fallback--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.avatar--soft .avatar__fallback--default{background-color:var(--default-soft);color:var(--default-soft-foreground)}.avatar--soft .avatar__fallback--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.alert-dialog__trigger:focus-visible:not(:focus),.alert-dialog__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.alert-dialog__trigger:disabled,.alert-dialog__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.alert-dialog__trigger:active,.alert-dialog__trigger[data-pressed=true]{transform:scale(.97)}.alert-dialog__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.alert-dialog__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.alert-dialog__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]{will-change:opacity}:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__backdrop--transparent{background-color:#0000}.alert-dialog__backdrop--opaque{background-color:var(--backdrop)}.alert-dialog__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.alert-dialog__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.alert-dialog__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.alert-dialog__container{pointer-events:none}.alert-dialog__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.alert-dialog__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.alert-dialog__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.alert-dialog__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.alert-dialog__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]{will-change:opacity,transform}:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;min-height:0;max-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative;overflow:clip}.alert-dialog__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.alert-dialog__dialog[data-placement=auto]{margin-block:auto}}.alert-dialog__dialog[data-placement=center]{margin-block:auto}.alert-dialog__dialog[data-placement=bottom]{margin-top:auto}.alert-dialog__dialog[data-placement=top]{margin-top:0}.alert-dialog__dialog--xs{max-width:var(--container-xs)}.alert-dialog__dialog--sm{max-width:var(--container-sm)}.alert-dialog__dialog--md{max-width:var(--container-md)}.alert-dialog__dialog--lg{max-width:var(--container-lg)}.alert-dialog__dialog--cover{width:100%;height:100%;min-height:100%}.alert-dialog__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.alert-dialog__header>.modal__icon{margin-bottom:0}.alert-dialog__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.alert-dialog__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.alert-dialog__icon [data-slot=alert-dialog-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.alert-dialog__icon--default{background-color:var(--default);color:var(--foreground)}.alert-dialog__icon--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.alert-dialog__icon--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.alert-dialog__icon--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.alert-dialog__icon--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.alert-dialog__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.alert-dialog__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.alert-dialog__header+.alert-dialog__body{margin-top:calc(var(--spacing) * 2)}.alert-dialog__header+.alert-dialog__footer,.alert-dialog__body+.alert-dialog__footer{margin-top:calc(var(--spacing) * 5)}.drawer__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.drawer__trigger:focus-visible:not(:focus),.drawer__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.drawer__trigger:disabled,.drawer__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.drawer__trigger:active,.drawer__trigger[data-pressed=true]{transform:scale(.97)}.drawer__backdrop{z-index:50;height:var(--visual-viewport-height);opacity:1;width:100%;transition:opacity .25s cubic-bezier(.32,.72,0,1);position:fixed;top:0;right:0;bottom:0;left:0}.drawer__backdrop[data-entering=true]{opacity:0}.drawer__backdrop[data-exiting=true]{opacity:0;transition-duration:.2s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.drawer__backdrop[data-exiting=true],.drawer__backdrop[data-entering=true]{will-change:opacity}@media(prefers-reduced-motion:reduce){.drawer__backdrop{transition:none}}.drawer__backdrop--transparent{background-color:#0000}.drawer__backdrop--opaque{background-color:var(--backdrop)}.drawer__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.drawer__content{pointer-events:none;z-index:50;height:var(--visual-viewport-height);width:100%;min-width:0;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.drawer__content--bottom{align-items:flex-end}.drawer__content--top{align-items:flex-start}.drawer__content--left{justify-content:flex-start}.drawer__content--right{justify-content:flex-end}.drawer__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;padding:calc(var(--spacing) * 6);pointer-events:auto;--drawer-enter-duration:.25s;--drawer-exit-duration:.2s;--drawer-enter-ease:cubic-bezier(.32, .72, 0, 1);--drawer-exit-ease:cubic-bezier(.32, .72, 0, 1);will-change:translate;transition:translate var(--drawer-enter-duration) var(--drawer-enter-ease);outline-style:none;flex-direction:column;display:flex;position:relative}@media(prefers-reduced-motion:reduce){.drawer__dialog{transition:none}}.drawer__dialog[data-placement=bottom]{border-top-left-radius:min(32px,var(--radius-2xl));border-top-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=top]{border-bottom-left-radius:min(32px,var(--radius-2xl));border-bottom-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=left]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=left]{width:calc(var(--spacing) * 96)}}.drawer__dialog[data-placement=right]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=right]{width:calc(var(--spacing) * 96)}}[data-exiting=true] .drawer__dialog{transition-duration:var(--drawer-exit-duration);transition-timing-function:var(--drawer-exit-ease)}.drawer__content--left .drawer__dialog,.drawer__content--right .drawer__dialog,.drawer__content--top .drawer__dialog,.drawer__content--bottom .drawer__dialog{translate:0}.drawer__content--left[data-entering=true] .drawer__dialog,.drawer__content--left[data-exiting=true] .drawer__dialog{translate:-100%}.drawer__content--right[data-entering=true] .drawer__dialog,.drawer__content--right[data-exiting=true] .drawer__dialog{translate:100%}.drawer__content--top[data-entering=true] .drawer__dialog,.drawer__content--top[data-exiting=true] .drawer__dialog{translate:0 -100%}.drawer__content--bottom[data-entering=true] .drawer__dialog,.drawer__content--bottom[data-exiting=true] .drawer__dialog{translate:0 100%}.drawer__dialog--top{padding-bottom:calc(var(--spacing) * 2)}.drawer__dialog--top .drawer__handle{padding-bottom:0}.drawer__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.drawer__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.drawer__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.drawer__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.drawer__handle{padding-bottom:calc(var(--spacing) * 2);justify-content:center;align-items:center;display:flex}.drawer__handle>[data-slot=drawer-handle-bar]{height:var(--spacing);width:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * .25);background-color:var(--separator)}.drawer__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.drawer__header+.drawer__body{margin-top:calc(var(--spacing) * 2)}.drawer__header+.drawer__footer,.drawer__body+.drawer__footer{margin-top:calc(var(--spacing) * 5)}.drawer__handle+.drawer__header,.drawer__handle+.drawer__body{margin-top:0}.modal__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.modal__trigger:focus-visible:not(:focus),.modal__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.modal__trigger:disabled,.modal__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.modal__trigger:active,.modal__trigger[data-pressed=true]{transform:scale(.97)}.modal__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.modal__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.modal__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]{will-change:opacity}:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__backdrop--transparent{background-color:#0000}.modal__backdrop--opaque{background-color:var(--backdrop)}.modal__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.modal__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.modal__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.modal__container{pointer-events:none}.modal__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.modal__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.modal__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.modal__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.modal__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-exiting=true],.modal__container[data-entering=true]{will-change:opacity,transform}:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__container--scroll-outside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);pointer-events:auto;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__container--full{padding:0}@media(min-width:40rem){.modal__container--full{padding:0}}.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% ;--tw-enter-scale:1}@media(min-width:40rem){.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% }}.modal__container--full[data-exiting=true]{--tw-exit-scale:1}.modal__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative}.modal__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.modal__dialog[data-placement=auto]{margin-block:auto}}.modal__dialog[data-placement=center]{margin-block:auto}.modal__dialog[data-placement=bottom]{margin-top:auto}.modal__dialog[data-placement=top]{margin-top:0}.modal__dialog--scroll-inside{min-height:0;max-height:100%;overflow:clip}.modal__dialog--scroll-outside{flex-shrink:0;height:auto;min-height:0}.modal__dialog--xs{max-width:var(--container-xs)}.modal__dialog--sm{max-width:var(--container-sm)}.modal__dialog--md{max-width:var(--container-md)}.modal__dialog--lg{max-width:var(--container-lg)}.modal__dialog--cover{width:100%;height:100%;min-height:100%}.modal__dialog--full{--tw-shadow:0 0 #0000;width:100%;height:100%;min-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:0}.modal__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.modal__header>.modal__icon{margin-bottom:0}.modal__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.modal__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.modal__body{min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow:visible}.modal__body--scroll-inside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__body--scroll-outside{overflow-y:visible}.modal__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.modal__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.modal__header+.modal__body{margin-top:calc(var(--spacing) * 2)}.modal__header+.modal__footer,.modal__body+.modal__footer{margin-top:calc(var(--spacing) * 5)}.popover{transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0}.popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.popover[data-exiting=true],.popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.popover__dialog{padding:calc(var(--spacing) * 4);--tw-outline-style:none;outline-style:none}.popover__heading{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.popover__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.popover__trigger{cursor:var(--cursor-interactive)}.popover__trigger:focus-visible:not(:focus),.popover__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.popover__trigger:disabled,.popover__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tooltip{max-width:var(--container-xs);transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);padding:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));word-break:break-all;border-radius:min(32px,var(--radius-xl));box-shadow:var(--shadow-overlay)}.tooltip[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.tooltip[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.tooltip[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.tooltip[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.tooltip[data-exiting=true],.tooltip[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.tooltip [data-slot=overlay-arrow]{stroke:var(--border)}@supports (color:color-mix(in lab,red,red)){.tooltip [data-slot=overlay-arrow]{stroke:color-mix(in oklab,var(--border) 40%,transparent)}}.tooltip [data-slot=overlay-arrow]{fill:var(--overlay)}.tooltip[data-placement=bottom] [data-slot=overlay-arrow]{rotate:180deg}.tooltip[data-placement=left] [data-slot=overlay-arrow]{rotate:-90deg}.tooltip[data-placement=right] [data-slot=overlay-arrow]{rotate:90deg}.tooltip__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tooltip__trigger:focus-visible:not(:focus),.tooltip__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.combo-box{gap:var(--spacing);flex-direction:column;display:flex}:is(.combo-box[data-invalid=true],.combo-box[aria-invalid=true]) [data-slot=description]{display:none}.combo-box [data-slot=label]{width:fit-content}.combo-box [data-slot=input]{flex:1;min-width:0}.combo-box [data-slot=input]:has(+.combo-box__trigger){padding-inline-end:calc(var(--spacing) * 7)}.combo-box [data-slot=input]:focus,.combo-box [data-slot=input][data-focus]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.combo-box [data-slot=input]:disabled,.combo-box [data-slot=input][data-disabled],.combo-box [data-slot=input][aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.combo-box__input-group{isolation:isolate;align-items:center;display:inline-flex;position:relative}.combo-box__trigger{--tw-translate-y: -50% ;height:100%;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:pointer;color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;-webkit-tap-highlight-color:transparent;--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-color:#0000;border-style:none;outline-style:none;flex-shrink:0;justify-content:center;align-items:center;padding-inline-end:calc(var(--spacing) * 2);transition-duration:.15s;display:flex;position:absolute;top:50%}@media(hover:hover){.combo-box__trigger:hover,.combo-box__trigger[data-hovered=true]{color:var(--field-foreground,var(--foreground))}}.combo-box__trigger:focus-visible:not(:focus),.combo-box__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-radius:.25rem;outline-style:none}.combo-box__trigger[data-pressed=true]{opacity:.7}.combo-box__trigger:disabled,.combo-box__trigger[data-disabled],.combo-box__trigger[aria-disabled=true]{cursor:not-allowed;opacity:.5}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;transition-duration:.15s}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.combo-box__trigger[data-open=true] [data-slot=combo-box-trigger-default-icon]{rotate:180deg}.combo-box__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.combo-box__popover:focus-visible:not(:focus),.combo-box__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.combo-box__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.combo-box__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.combo-box__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.combo-box__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.combo-box__popover[data-exiting=true],.combo-box__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.combo-box__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.combo-box__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.combo-box__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.combo-box__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.combo-box__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.combo-box__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.combo-box__popover [data-slot=list-box-item] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.combo-box--full-width,.combo-box__input-group--full-width{width:100%}.select{gap:var(--spacing);flex-direction:column;display:flex}:is(.select[data-invalid=true],.select[aria-invalid=true]) [data-slot=description]{display:none}.select [data-slot=label]{width:fit-content}.select__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.select__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.select__trigger:has(.select__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.select__trigger:hover,.select__trigger[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.select__trigger:focus-visible:not(:focus),.select__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-visible,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focused=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-visible=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-within,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{background-color:var(--field-focus)}.select__trigger:disabled,.select__trigger[data-disabled=true],.select__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.select--secondary .select__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--select-trigger-bg);--select-trigger-bg:var(--default);--select-trigger-bg-hover:var(--default-hover);--select-trigger-bg-focus:var(--default)}@media(hover:hover){.select--secondary .select__trigger:hover,.select--secondary .select__trigger[data-hovered=true]{background-color:var(--select-trigger-bg-hover)}}.select--secondary .select__trigger:focus-visible:not(:focus),.select--secondary .select__trigger[data-focus-visible=true],.select[data-invalid=true] :is(.select--secondary .select__trigger),.select[aria-invalid=true] :is(.select--secondary .select__trigger){background-color:var(--select-trigger-bg-focus)}.select__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.select__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.select__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.select__value [data-slot=list-box-item-indicator]{display:none}.select__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.select__indicator[data-open=true]{rotate:180deg}.select__indicator[data-slot=select-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.select__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.select__popover:focus-visible:not(:focus),.select__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.select__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.select__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.select__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.select__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.select__popover[data-exiting=true],.select__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.select__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.select__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.select__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.select__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.select__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.select__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.select--full-width,.select__trigger--full-width{width:100%}.autocomplete{gap:var(--spacing);flex-direction:column;display:flex}.autocomplete__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.autocomplete__trigger:has(.autocomplete__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.autocomplete__trigger:focus-visible:not(:focus),.autocomplete__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-visible,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focused=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-visible=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-within,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{background-color:var(--field-focus)}.autocomplete__trigger:disabled,.autocomplete__trigger[data-disabled=true],.autocomplete__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.autocomplete--secondary .autocomplete__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--autocomplete-trigger-bg);--autocomplete-trigger-bg:var(--default);--autocomplete-trigger-bg-hover:var(--default-hover);--autocomplete-trigger-bg-focus:var(--default)}@media(hover:hover){.autocomplete--secondary .autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete--secondary .autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--autocomplete-trigger-bg-hover)}}.autocomplete--secondary .autocomplete__trigger:focus-visible:not(:focus),.autocomplete--secondary .autocomplete__trigger[data-focus-visible=true],.autocomplete[data-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger),.autocomplete[aria-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger){background-color:var(--autocomplete-trigger-bg-focus)}.autocomplete__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.autocomplete__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.autocomplete__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.autocomplete__value [data-slot=list-box-item-indicator]{display:none}.autocomplete__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;cursor:var(--cursor-interactive);flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.autocomplete__indicator[data-open=true]{rotate:180deg}.autocomplete__indicator[data-slot=autocomplete-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.autocomplete__popover{width:var(--trigger-width);max-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);overscroll-behavior:contain;background-color:var(--overlay);padding:0;padding-top:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);overflow:hidden}.autocomplete__popover:focus-visible:not(:focus),.autocomplete__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.32, .72, 0, 1);--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.25s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.autocomplete__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.autocomplete__popover[data-exiting=true],.autocomplete__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.autocomplete__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.autocomplete__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.autocomplete__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.autocomplete__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.autocomplete__popover [data-slot=list-box]{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);max-height:320px;padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none;overflow-y:auto}.autocomplete__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.autocomplete__popover [data-slot=search-field]{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);--tw-outline-style:none;outline-style:none}.autocomplete__popover [data-slot=empty-state]{text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--overlay-foreground)}@supports (color:color-mix(in lab,red,red)){.autocomplete__popover [data-slot=empty-state]{color:color-mix(in oklab,var(--overlay-foreground) 60%,transparent)}}.autocomplete__popover-dialog,.autocomplete__popover-dialog:focus,.autocomplete__popover-dialog:focus-visible,.autocomplete__popover-dialog[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete--full-width,.autocomplete__trigger--full-width{width:100%}.autocomplete__clear-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);color:var(--muted);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);cursor:var(--cursor-interactive);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);background-color:#0000;flex-shrink:0;justify-content:center;align-self:center;align-items:center;margin-inline-end:0;display:inline-flex;position:relative}.autocomplete__clear-button:not([data-empty=true]){transition:opacity .15s var(--ease-smooth)}.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__clear-button[data-empty=true]{pointer-events:none;opacity:0}.autocomplete__clear-button [data-slot=autocomplete-clear-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(hover:hover){.autocomplete__clear-button:hover,.autocomplete__clear-button[data-hovered=true]{background-color:var(--default-hover)}}.autocomplete__clear-button:active,.autocomplete__clear-button[data-pressed=true]{transform:scale(.93)}.kbd{height:calc(var(--spacing) * 6);align-items:center;display:inline-flex}:where(.kbd>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * .5) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-x-reverse)))}.kbd{border-radius:calc(var(--radius) * 1);background-color:var(--default);padding-inline:calc(var(--spacing) * 2);text-align:center;font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;color:var(--muted)}:where(.kbd:where(:dir(rtl),[dir=rtl],[dir=rtl] *)>:not(:last-child)){--tw-space-x-reverse:1}.kbd{word-spacing:-.25rem}.kbd__abbr{justify-content:center;align-items:center;width:100%;height:100%;text-decoration:none;display:flex}.kbd__content{justify-content:center;align-items:center;display:flex}.kbd--light{background-color:#0000}.typography,.typography-prose{color:var(--foreground)}.typography-prose h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose p{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography-prose a{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--link);text-underline-offset:4px;text-decoration-line:underline}.typography-prose blockquote{margin-top:calc(var(--spacing) * 4);border-left-style:var(--tw-border-style);border-left-width:4px;border-color:var(--border);padding-left:calc(var(--spacing) * 4);color:var(--muted);font-style:italic}.typography-prose ul{margin-block:calc(var(--spacing) * 4);list-style-type:disc}:where(.typography-prose ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ul{padding-left:calc(var(--spacing) * 6)}.typography-prose ol{margin-block:calc(var(--spacing) * 4);list-style-type:decimal}:where(.typography-prose ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ol{padding-left:calc(var(--spacing) * 6)}.typography-prose li{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose hr{margin-block:calc(var(--spacing) * 8);border-color:var(--separator)}.typography-prose pre{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);background-color:var(--default);padding:calc(var(--spacing) * 4);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);overflow-x:auto}.typography-prose strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--foreground)}.typography-prose em{font-style:italic}.typography-prose img{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5)}.typography--h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--body{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography--body-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.typography--body-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.typography--code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography--align-start{text-align:left}.typography--align-start:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:right}.typography--align-center{text-align:center}.typography--align-end{text-align:right}.typography--align-end:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:left}.typography--align-justify{text-align:justify}.typography--color-default{color:var(--foreground)}.typography--color-muted{color:var(--muted)}.typography--truncate{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.typography--weight-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.typography--weight-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.typography--weight-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.typography--weight-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.scroll-shadow{--scroll-shadow-size:40px;--scroll-shadow-scrollbar-size:10px;position:relative}.scroll-shadow--vertical{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-y:auto}.scroll-shadow--horizontal{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-x:auto}.scroll-shadow--fade.scroll-shadow--vertical:where([data-top-scroll=true],[data-bottom-scroll=true],[data-top-bottom-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,100% 0;mask-repeat:no-repeat;mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%;-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,100% 0;-webkit-mask-repeat:no-repeat;-webkit-mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%}.scroll-shadow--fade.scroll-shadow--vertical[data-top-scroll=true]{--scroll-linear-gradient:0deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-bottom-scroll=true]{--scroll-linear-gradient:180deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-top-bottom-scroll=true]{--scroll-linear-gradient:#000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal:where([data-left-scroll=true],[data-right-scroll=true],[data-left-right-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,0 100%;mask-repeat:no-repeat;mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,0 100%;-webkit-mask-repeat:no-repeat;-webkit-mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size)}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-scroll=true]{--scroll-linear-gradient:270deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-right-scroll=true]{--scroll-linear-gradient:90deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-right-scroll=true]{--scroll-linear-gradient:to right, #000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--hide-scrollbar{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;--scroll-shadow-scrollbar-size:0px}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{inset-inline:0}.inset-y-0{inset-block:0}.top-0{top:0}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.-right-3{right:calc(var(--spacing) * -3)}.right-0{right:0}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:0}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-0{left:0}.left-1\/2{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[1\]{z-index:1}.z-\[2\]{z-index:2}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing) * -1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:var(--spacing)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-12{height:calc(var(--spacing) * 12)}.h-48{height:calc(var(--spacing) * 48)}.h-\[90px\]{height:90px}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:0}.min-h-full{min-height:100%}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-20{width:calc(var(--spacing) * 20)}.w-28{width:calc(var(--spacing) * 28)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-\[17rem\]{width:17rem}.w-\[calc\(100\%-2rem\)\]{width:calc(100% - 2rem)}.w-\[n\%\]{width:n%}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-44{max-width:calc(var(--spacing) * 44)}.max-w-\[1800px\]{max-width:1800px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-\[140px\]{min-width:140px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing) * 5);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-ew-resize{cursor:ew-resize}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y:pan-y;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--otari-line\)\]>:not(:last-child)){border-color:var(--otari-line)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:calc(var(--radius) * 1)}.rounded-md{border-radius:calc(var(--radius) * .75)}.rounded-xl{border-radius:calc(var(--radius) * 1.5)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-\[\#c2843a\]{border-color:#c2843a}.border-\[var\(--otari-brand\)\]{border-color:var(--otari-brand)}.border-\[var\(--otari-line\)\]{border-color:var(--otari-line)}.border-amber-200{border-color:var(--color-amber-200)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-red-500{border-left-color:var(--color-red-500)}.bg-\[var\(--otari-bg\)\]{background-color:var(--otari-bg)}.bg-\[var\(--otari-brand\)\],.bg-\[var\(--otari-brand\)\]\/10{background-color:var(--otari-brand)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--otari-brand\)\]\/10{background-color:color-mix(in oklab,var(--otari-brand) 10%,transparent)}}.bg-\[var\(--otari-brand-tint\)\]{background-color:var(--otari-brand-tint)}.bg-\[var\(--otari-line\)\]{background-color:var(--otari-line)}.bg-\[var\(--otari-surface\)\]{background-color:var(--otari-surface)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-500{background-color:var(--color-green-500)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1{padding-bottom:var(--spacing)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#b45309\]{color:#b45309}.text-\[var\(--otari-brand-dark\)\]{color:var(--otari-brand-dark)}.text-\[var\(--otari-ink\)\]{color:var(--otari-ink)}.text-\[var\(--otari-muted\)\]{color:var(--otari-muted)}.text-amber-400{color:var(--color-amber-400)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-emerald-700{color:var(--color-emerald-700)}.text-green-700{color:var(--color-green-700)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.accent-\[var\(--otari-brand\)\]{accent-color:var(--otari-brand)}.opacity-0{opacity:0}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.running{animation-play-state:running}.zoom-out{--tw-exit-scale:0}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-focus-visible\:ring-2:is(:where(.group):focus-visible *){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-focus-visible\:ring-\[var\(--otari-brand\)\]:is(:where(.group):focus-visible *){--tw-ring-color:var(--otari-brand)}.group-data-\[focus-visible\]\:outline-2:is(:where(.group)[data-focus-visible] *){outline-style:var(--tw-outline-style);outline-width:2px}.group-data-\[focus-visible\]\:outline-\[var\(--otari-brand\)\]:is(:where(.group)[data-focus-visible] *){outline-color:var(--otari-brand)}@media(hover:hover){.hover\:border-\[var\(--otari-brand\)\]:hover{border-color:var(--otari-brand)}.hover\:bg-\[var\(--otari-bg\)\]:hover{background-color:var(--otari-bg)}.hover\:bg-\[var\(--otari-brand\)\]:hover,.hover\:bg-\[var\(--otari-brand\)\]\/20:hover{background-color:var(--otari-brand)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--otari-brand\)\]\/20:hover{background-color:color-mix(in oklab,var(--otari-brand) 20%,transparent)}}.hover\:bg-\[var\(--otari-line\)\]:hover{background-color:var(--otari-line)}.hover\:text-\[var\(--otari-brand\)\]:hover{color:var(--otari-brand)}.hover\:text-\[var\(--otari-brand-dark\)\]:hover{color:var(--otari-brand-dark)}.hover\:text-\[var\(--otari-ink\)\]:hover{color:var(--otari-ink)}.hover\:text-amber-950:hover{color:var(--color-amber-950)}.hover\:text-red-700:hover{color:var(--color-red-700)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:not-sr-only:focus{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.focus\:absolute:focus{position:absolute}.focus\:top-3:focus{top:calc(var(--spacing) * 3)}.focus\:left-3:focus{left:calc(var(--spacing) * 3)}.focus\:z-50:focus{z-index:50}.focus\:rounded-lg:focus{border-radius:calc(var(--radius) * 1)}.focus\:border:focus{border-style:var(--tw-border-style);border-width:1px}.focus\:border-\[var\(--otari-brand\)\]:focus{border-color:var(--otari-brand)}.focus\:bg-\[var\(--otari-surface\)\]:focus{background-color:var(--otari-surface)}.focus\:px-4:focus{padding-inline:calc(var(--spacing) * 4)}.focus\:py-2:focus{padding-block:calc(var(--spacing) * 2)}.focus\:text-sm:focus{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.focus\:font-medium:focus{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.focus\:text-\[var\(--otari-brand-dark\)\]:focus{color:var(--otari-brand-dark)}.focus\:shadow-md:focus{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:bg-\[var\(--otari-brand\)\]:focus-visible{background-color:var(--otari-brand)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[var\(--otari-brand\)\]:focus-visible{--tw-ring-color:var(--otari-brand)}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-start-1{grid-column-start:1}.sm\:col-start-2{grid-column-start:2}.sm\:col-start-3{grid-column-start:3}.sm\:inline{display:inline}.sm\:w-28{width:calc(var(--spacing) * 28)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[minmax\(0\,1fr\)_16rem_10rem\]{grid-template-columns:minmax(0,1fr) 16rem 10rem}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-self-end{justify-self:flex-end}.sm\:justify-self-start{justify-self:flex-start}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}@media(min-width:48rem){.md\:flex{display:flex}.md\:hidden{display:none}.md\:px-6{padding-inline:calc(var(--spacing) * 6)}.md\:py-6{padding-block:calc(var(--spacing) * 6)}}@media(min-width:64rem){.lg\:sticky{position:sticky}.lg\:top-4{top:calc(var(--spacing) * 4)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_360px\]{grid-template-columns:minmax(0,1fr) 360px}.lg\:items-start{align-items:flex-start}}@media(min-width:80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--otari-brand:#4e8295;--otari-brand-dark:#3c6678;--otari-brand-soft:#8fb2bf;--otari-brand-tint:#eaf1f3;--otari-ink:#14242c;--otari-muted:#5b6b73;--otari-line:#dbe5e8;--otari-surface:#fff;--otari-bg:#f6f9fa;--otari-code-ink:#e8eef0}.otari-table.table-root{background-color:var(--otari-surface);border:1px solid var(--otari-line);border-radius:.75rem;padding:0;overflow:hidden}.otari-table .table__header{background-color:var(--otari-brand-tint);border-bottom:1px solid var(--otari-line)}.otari-table .table__column,.otari-table [role=row]>[role=presentation]:first-of-type>.table__column,.otari-table [role=row]>[role=presentation]:last-of-type>.table__column{color:var(--otari-ink);background-color:#0000;border-radius:0;font-weight:600}.otari-table .table__column:after{content:none}.otari-table .table__row .table__cell{border-color:var(--otari-line)}.otari-table .table__row:hover .table__cell{background-color:var(--otari-bg)}.otari-table .otari-detail-row>td{border-bottom:1px solid var(--otari-line);background-color:var(--otari-bg);padding:0}.otari-table .otari-detail-opening .table__cell{background-color:var(--otari-brand-tint)}.otari-detail-reveal{grid-template-rows:0fr;animation:.18s ease-out forwards otari-detail-open;display:grid}.otari-detail-reveal>div{overflow:hidden}@keyframes otari-detail-open{0%{opacity:.5;grid-template-rows:0fr}to{opacity:1;grid-template-rows:1fr}}.otari-bulk-bar{animation:.16s ease-out otari-bulk-bar-in}@keyframes otari-bulk-bar-in{0%{opacity:0;transform:translate(-50%,.5rem)}to{opacity:1;transform:translate(-50%)}}@media(prefers-reduced-motion:reduce){.otari-detail-reveal{grid-template-rows:1fr;animation:none}.otari-bulk-bar{animation:none}}.otari-markdown{color:var(--otari-ink);font-size:.875rem;line-height:1.65}.otari-markdown>:first-child{margin-top:0}.otari-markdown h1,.otari-markdown h2,.otari-markdown h3,.otari-markdown h4{color:var(--otari-ink);font-weight:600;line-height:1.3}.otari-markdown h1{margin:2rem 0 .75rem;font-size:1.5rem}.otari-markdown h2{border-bottom:1px solid var(--otari-line);margin:2rem 0 .5rem;padding-bottom:.3rem;font-size:1.25rem}.otari-markdown h3{margin:1.5rem 0 .5rem;font-size:1.05rem}.otari-markdown h4{margin:1.25rem 0 .25rem;font-size:.95rem}.otari-markdown p{margin:.75rem 0}.otari-markdown a{color:var(--otari-brand-dark);text-underline-offset:2px;text-decoration:underline}.otari-markdown a:hover{text-decoration-thickness:2px}.otari-markdown ul,.otari-markdown ol{margin:.75rem 0;padding-left:1.5rem}.otari-markdown ul{list-style:outside}.otari-markdown ol{list-style:decimal}.otari-markdown li,.otari-markdown li>ul,.otari-markdown li>ol{margin:.25rem 0}.otari-markdown code{background-color:var(--otari-brand-tint);color:var(--otari-brand-dark);border-radius:.35rem;padding:.1rem .35rem;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,monospace;font-size:.85em}.otari-markdown pre{background-color:var(--otari-ink);border-radius:.6rem;margin:1rem 0;padding:.85rem 1rem;overflow-x:auto}.otari-markdown pre code{color:var(--otari-code-ink);background-color:#0000;border-radius:0;padding:0;font-size:.82rem;line-height:1.55}.otari-markdown blockquote{border-left:3px solid var(--otari-brand);color:var(--otari-muted);margin:1rem 0;padding:.25rem 0 .25rem 1rem}.otari-markdown hr{border:0;border-top:1px solid var(--otari-line);margin:1.5rem 0}.otari-markdown-scroll{max-width:100%;margin:1rem 0;overflow-x:auto}.otari-markdown table{border-collapse:collapse;font-size:.85rem}.otari-markdown th,.otari-markdown td{border:1px solid var(--otari-line);text-align:left;vertical-align:top;padding:.4rem .7rem}.otari-markdown th{background-color:var(--otari-brand-tint);color:var(--otari-ink);font-weight:600}.otari-markdown tbody tr:hover td,.otari-markdown tr:hover td{background-color:var(--otari-bg)}html,body,#root{height:100%}body{background-color:var(--otari-bg);color:var(--otari-ink);margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}@keyframes caret-blink{0%,70%,to{opacity:1}20%,50%{opacity:0}}@keyframes skeleton{to{transform:translate(200%)}} diff --git a/src/gateway/static/dashboard/index.html b/src/gateway/static/dashboard/index.html index 3b09a04d9..6690ff3e0 100644 --- a/src/gateway/static/dashboard/index.html +++ b/src/gateway/static/dashboard/index.html @@ -19,11 +19,11 @@ insets to sit out of the way. --> Otari Dashboard - + - +
diff --git a/web/src/api/types.ts b/web/src/api/types.ts index 2ec4df077..085f90374 100644 --- a/web/src/api/types.ts +++ b/web/src/api/types.ts @@ -530,8 +530,9 @@ export interface UsageSummary { by_model: UsageGroupRow[]; by_user: UsageGroupRow[]; by_api_key: UsageGroupRow[]; - // Provenance breakdown. Optional because it postdates the other groupings, so - // an older gateway serving a newer dashboard omits it; read it defensively. + // Provenance breakdown. Optional because it postdates the other groupings: the + // built bundle ships inside the gateway, but `vite dev` can point at an older + // one that omits it, so read it defensively. by_source?: UsageGroupRow[]; series: UsageSeriesPoint[]; } diff --git a/web/src/pages/ActivityPage.tsx b/web/src/pages/ActivityPage.tsx index b82a22608..d124cc03f 100644 --- a/web/src/pages/ActivityPage.tsx +++ b/web/src/pages/ActivityPage.tsx @@ -212,19 +212,24 @@ function tokenComposition(entry: UsageEntry): TokenComposition | null { } // Segment order runs input side first (fresh, then the two cache buckets), then -// output. Shading is one hue at four lightnesses, ordered so the dearest tokens -// read darkest: nothing is encoded by hue, and the tooltip / accessible name -// carry every number, so the bar adds a shape to scan and removes no information. +// output. Shading is one hue at four lightnesses, assigned for legibility rather +// than for price: every fill clears the track it sits on, adjacent fills differ +// enough to show their boundary, and the bucket that is usually the bulk (cache +// read) takes a mid tone instead of the palest step, so a cache-heavy row reads +// as a filled bar and a fresh-input row as a dark one. Nothing is encoded by hue, +// and the tooltip / accessible name carry every number, so the bar adds a shape +// to scan and removes no information. const TOKEN_SEGMENTS: { key: keyof Omit; label: string; fill: string }[] = [ - { key: "fresh", label: "Fresh input", fill: "var(--otari-brand)" }, - { key: "cacheRead", label: "Cache read", fill: "var(--otari-line)" }, + { key: "fresh", label: "Fresh input", fill: "var(--otari-ink)" }, + { key: "cacheRead", label: "Cache read", fill: "var(--otari-brand)" }, { key: "cacheWrite", label: "Cache write", fill: "var(--otari-brand-soft)" }, { key: "output", label: "Output", fill: "var(--otari-brand-dark)" }, ]; // The total plus a thin stacked bar of its composition. Widths are SVG rect // attributes in a 100-unit viewBox (a dynamic Tailwind `w-[n%]` would not survive -// the JIT scanner, and inline styles are out). +// the JIT scanner, and inline styles are out). Proportions are exact, so a segment +// under a percent or so lands sub-pixel; the tooltip carries the real numbers. // // The number shown is the sum of the segments, so the cell is internally // consistent and reads as "tokens billed". For an additive-convention row that is @@ -257,7 +262,7 @@ function TokenBar({ entry }: { entry: UsageEntry }) { preserveAspectRatio="none" role="img" aria-label={`Token composition: ${summary}`} - className="h-1 w-16 overflow-hidden rounded-full bg-[var(--otari-bg)]" + className="h-1.5 w-20 overflow-hidden rounded-full bg-[var(--otari-brand-tint)]" > {rects .filter((rect) => rect.width > 0) @@ -458,10 +463,14 @@ export function ActivityPage() { modelSummary.data?.by_model?.filter((r) => !r.is_other && r.key !== null).map((r) => r.key as string) ?? []; const keyOptions = (keys.data ?? []).map((k) => ({ value: k.id, label: k.key_name ?? `${k.id.slice(0, 8)}…` })); - // Source options, mirroring the model suggestions: sources with usage in the - // window, with the source filter itself omitted so switching from one source to - // another does not require clearing first. While neither this nor the model - // filter is set the two filter sets are equal, so the queries collapse into one. + // Source options: the sources with usage in the window. Like the model + // suggestions, this must ignore the source filter itself, or picking Claude Code + // would hide every other source and switching would mean clearing first. + // + // While no source is picked the model-suggestion summary is already computed + // without one, so its provenance breakdown is that full list and no second query + // is needed. Only a picked source needs its own, so it is fetched then and only + // then (each summary runs four grouped aggregations plus the series). const sourceSuggestFilters: UsageFilters = useMemo( () => ({ start_date: win.start, @@ -473,15 +482,14 @@ export function ActivityPage() { }), [win, statusFilter, modelFilter, userFilter, apiKeyFilter], ); - const sourceSummary = useUsageSummary(sourceSuggestFilters, "day"); + const sourceSummary = useUsageSummary(sourceSuggestFilters, "day", Boolean(sourceFilter)); + const sourceBreakdown = (sourceFilter ? sourceSummary.data : modelSummary.data)?.by_source; // A drill-down can name a source with no rows in the window; keep it listed so // the select shows the filter that is actually applied. const sourceOptions = useMemo(() => { - const seen = (sourceSummary.data?.by_source ?? []) - .filter((r) => !r.is_other && r.key !== null) - .map((r) => r.key as string); + const seen = (sourceBreakdown ?? []).filter((r) => !r.is_other && r.key !== null).map((r) => r.key as string); return sourceFilter && !seen.includes(sourceFilter) ? [sourceFilter, ...seen] : seen; - }, [sourceSummary.data, sourceFilter]); + }, [sourceBreakdown, sourceFilter]); // The timeline histogram spans the whole preset *extent* (the rolling preset // window, independent of any brushed sub-window), so the brush always has diff --git a/web/src/styles/globals.css b/web/src/styles/globals.css index 9e0742fe0..d968442e1 100644 --- a/web/src/styles/globals.css +++ b/web/src/styles/globals.css @@ -13,8 +13,11 @@ --otari-brand-dark: #3c6678; /* Mid-step of the brand ramp, between --otari-brand and --otari-line. Exists so a small multi-part mark (the Activity token-composition bar) can shade its - segments by one hue at four legible lightnesses instead of by four hues. */ - --otari-brand-soft: #a8c4ce; + segments by one hue at four legible lightnesses instead of by four hues. It + is deliberately darker than --otari-line: a hairline token used as a data + fill sits at ~1.2:1 against the surrounding surface, which reads as an empty + bar rather than a segment. */ + --otari-brand-soft: #8fb2bf; --otari-brand-tint: #eaf1f3; --otari-ink: #14242c; --otari-muted: #5b6b73; From 6a77ed69db54663e7a6494a29ee3d782a88cadfa Mon Sep 17 00:00:00 2001 From: Nathan Brake Date: Sun, 2 Aug 2026 21:06:49 +0000 Subject: [PATCH 3/9] feat(dashboard): spell out the billed token total in the request detail The Tokens column shows the total its bar splits, which counts the cache buckets. A provider that reports those outside the prompt (the Anthropic shape, and every imported Claude Code row) leaves the stored `total_tokens` well below it, so the same request could read 100,700 in the column and 1,200 as "Total tokens" one click away, with nothing on screen to reconcile them. The detail panel now carries both, so the column's number is explained where the raw provider fields already live, rather than the two silently disagreeing. Co-Authored-By: Claude Opus 5 (1M context) --- .../dashboard/assets/ActivityPage-Dd5_lVjd.js | 1 - .../dashboard/assets/ActivityPage-VQgwkhn4.js | 1 + ...ge-BXueJgS_.js => AliasesPage-nuRqwFaK.js} | 2 +- ...ge-BQktAQRZ.js => BudgetsPage-_DPQrLj-.js} | 2 +- ...-BXAKoq6j.js => ConfirmDialog-NCJIhH2z.js} | 2 +- ...sPage-xJDqWRaA.js => DocsPage-LBlDxv2S.js} | 2 +- ...ps-EkMEVflY.js => FilterChips-Dah6AI5Z.js} | 2 +- ...sPage-DVB0fG8n.js => KeysPage-C7uXJfSL.js} | 2 +- ...lfKO5.js => ModelScopeControl-B4eI_pm-.js} | 2 +- ...age-D-sOtTsj.js => ModelsPage-Dgku-JK2.js} | 2 +- ...e-BluitD8r.js => OverviewPage-C5sP44tb.js} | 2 +- ...-Bf-7xbup.js => ProvidersPage-CYSSSf8R.js} | 2 +- ...e-OsrEeYZu.js => SettingsPage-DaOqG5a9.js} | 2 +- ...SU6cRH7.js => TablePagination-DgA36VXY.js} | 2 +- ...Htw.js => ToolsGuardrailsPage-B5j54QGf.js} | 2 +- ...Page-CtRIjZgb.js => UsagePage-DQoRJkY3.js} | 2 +- ...Page-T4PK8YrW.js => UsersPage-DUd7-214.js} | 2 +- .../{index-BCvb90M0.js => index-DsUY4UvK.js} | 4 +-- src/gateway/static/dashboard/index.html | 2 +- web/src/pages/ActivityPage.test.tsx | 36 +++++++++++++++++++ web/src/pages/ActivityPage.tsx | 8 +++++ 21 files changed, 63 insertions(+), 19 deletions(-) delete mode 100644 src/gateway/static/dashboard/assets/ActivityPage-Dd5_lVjd.js create mode 100644 src/gateway/static/dashboard/assets/ActivityPage-VQgwkhn4.js rename src/gateway/static/dashboard/assets/{AliasesPage-BXueJgS_.js => AliasesPage-nuRqwFaK.js} (98%) rename src/gateway/static/dashboard/assets/{BudgetsPage-BQktAQRZ.js => BudgetsPage-_DPQrLj-.js} (99%) rename src/gateway/static/dashboard/assets/{ConfirmDialog-BXAKoq6j.js => ConfirmDialog-NCJIhH2z.js} (92%) rename src/gateway/static/dashboard/assets/{DocsPage-xJDqWRaA.js => DocsPage-LBlDxv2S.js} (99%) rename src/gateway/static/dashboard/assets/{FilterChips-EkMEVflY.js => FilterChips-Dah6AI5Z.js} (99%) rename src/gateway/static/dashboard/assets/{KeysPage-DVB0fG8n.js => KeysPage-C7uXJfSL.js} (98%) rename src/gateway/static/dashboard/assets/{ModelScopeControl-CuclfKO5.js => ModelScopeControl-B4eI_pm-.js} (98%) rename src/gateway/static/dashboard/assets/{ModelsPage-D-sOtTsj.js => ModelsPage-Dgku-JK2.js} (99%) rename src/gateway/static/dashboard/assets/{OverviewPage-BluitD8r.js => OverviewPage-C5sP44tb.js} (99%) rename src/gateway/static/dashboard/assets/{ProvidersPage-Bf-7xbup.js => ProvidersPage-CYSSSf8R.js} (99%) rename src/gateway/static/dashboard/assets/{SettingsPage-OsrEeYZu.js => SettingsPage-DaOqG5a9.js} (99%) rename src/gateway/static/dashboard/assets/{TablePagination-DSU6cRH7.js => TablePagination-DgA36VXY.js} (98%) rename src/gateway/static/dashboard/assets/{ToolsGuardrailsPage-CSxGfHtw.js => ToolsGuardrailsPage-B5j54QGf.js} (99%) rename src/gateway/static/dashboard/assets/{UsagePage-CtRIjZgb.js => UsagePage-DQoRJkY3.js} (98%) rename src/gateway/static/dashboard/assets/{UsersPage-T4PK8YrW.js => UsersPage-DUd7-214.js} (98%) rename src/gateway/static/dashboard/assets/{index-BCvb90M0.js => index-DsUY4UvK.js} (96%) diff --git a/src/gateway/static/dashboard/assets/ActivityPage-Dd5_lVjd.js b/src/gateway/static/dashboard/assets/ActivityPage-Dd5_lVjd.js deleted file mode 100644 index b11104b4f..000000000 --- a/src/gateway/static/dashboard/assets/ActivityPage-Dd5_lVjd.js +++ /dev/null @@ -1 +0,0 @@ -import{j as s}from"./tanstack-query-1t81HyiD.js";import{u as rt,r as c}from"./react-dgEcD0HR.js";import{u as nt,a as ot,b as lt,c as Pe,d as J,f as C,e as it,A as $,g as ct,h as dt,P as ut,E as mt,C as Fe,i as w,R as pt,F as Q,j as X,k as Me,Y as ht}from"./index-BCvb90M0.js";import{A as gt,F as ft}from"./FilterChips-EkMEVflY.js";import{u as xt,r as _t,B as bt}from"./tableSelection-9hV37uhu.js";import{C as vt}from"./ConfirmDialog-BXAKoq6j.js";import{D as kt}from"./DataTable-Bmn_eYSV.js";import{T as yt,S as St,P as jt}from"./TablePagination-DSU6cRH7.js";import{B as ee}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function wt(t){const[r,i]=rt(),a=c.useCallback(o=>r.get(o)??t[o],[r,t]),l=c.useCallback(o=>{const d=Number.parseInt(r.get(o)??"",10);if(!Number.isNaN(d))return d;const u=Number.parseInt(t[o],10);return Number.isNaN(u)?0:u},[r,t]),x=c.useCallback(o=>{i(d=>{const u=new URLSearchParams(d);for(const[p,f]of Object.entries(o)){const v=String(f);v===""||v===t[p]?u.delete(p):u.set(p,v)}return u},{replace:!0})},[i,t]);return{get:a,getNumber:l,patch:x}}const Ct=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function L(t){return t===null?"—":Ct.format(t)}function y(t){return t===null?"—":t.toLocaleString()}function Te(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function Nt(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleString()}function Pt(t){const r=new Date(t).getTime();if(Number.isNaN(r))return t;const i=Math.max(0,Math.round((Date.now()-r)/1e3));if(i<60)return`${i}s ago`;const a=Math.round(i/60);if(a<60)return`${a}m ago`;const l=Math.round(a/60);return l<24?`${l}h ago`:`${Math.round(l/24)}d ago`}const At=t=>t.id,Et=t=>t.status==="error"?"bg-red-50":void 0,Ae=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],Ee=[{label:"All",value:""},{label:"Priced",value:"true"},{label:"Unpriced",value:"false"}],Ft=50,Mt={range:$,start_date:"",end_date:"",status:"",model:"",user_id:"",api_key_id:"",priced:"",source:"",page:"0",size:String(Ft)};function U(t,r,i){if(r||i)return{start:r||void 0,end:i||void 0};if(t===Fe)return{};const a=C(w,t)??C(w,$),l=(a==null?void 0:a.seconds)??null;return{start:l==null?void 0:Me(l),end:void 0}}function te(t){const r=U(t,"","");if(r.start)return r;const i=C(w,t);return(i==null?void 0:i.seconds)==null?{start:Me(ht)}:r}function Tt({status:t}){const r=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return s.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r}`,children:t})}const Dt={gateway:"Gateway",claude_code:"Claude Code",codex:"Codex"};function se(t){return Dt[t]??t}function k(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function Ot(t){const r=t.billing_meters??null,i=k(r?r.total_input_tokens:t.prompt_tokens),a=k(r?r.cache_read_tokens:t.cache_read_tokens),l=k(r?r.cache_write_tokens:t.cache_write_tokens),x=k(r?r.completion_tokens:t.completion_tokens),o=Math.max(0,i-a-l),d=o+a+l+x;return d>0?{fresh:o,cacheRead:a,cacheWrite:l,output:x,total:d}:null}const It=[{key:"fresh",label:"Fresh input",fill:"var(--otari-ink)"},{key:"cacheRead",label:"Cache read",fill:"var(--otari-brand)"},{key:"cacheWrite",label:"Cache write",fill:"var(--otari-brand-soft)"},{key:"output",label:"Output",fill:"var(--otari-brand-dark)"}];function Rt({entry:t}){const r=Ot(t);if(r===null)return s.jsx("span",{className:"tabular-nums",children:y(t.total_tokens)});const i=It.map(o=>({...o,value:r[o.key]})),a=i.filter(o=>o.value>0).map(o=>`${o.label} ${o.value.toLocaleString()}`).join(", ");let l=0;const x=i.map(o=>{const d=o.value/r.total*100,u={...o,x:l,width:d};return l+=d,u});return s.jsxs("span",{className:"inline-flex flex-col items-end gap-1",title:a,children:[s.jsx("span",{className:"tabular-nums",children:r.total.toLocaleString()}),s.jsx("svg",{viewBox:"0 0 100 4",preserveAspectRatio:"none",role:"img","aria-label":`Token composition: ${a}`,className:"h-1.5 w-20 overflow-hidden rounded-full bg-[var(--otari-brand-tint)]",children:x.filter(o=>o.width>0).map(o=>s.jsx("rect",{x:o.x,y:0,width:o.width,height:4,fill:o.fill},o.key))})]})}function g({label:t,children:r}){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),s.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:r})]})}function Lt({entry:t}){var r;return s.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"}),s.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"This request failed. Inspect gateway logs for details."})]}):null,s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(g,{label:"Provider",children:t.provider??"—"}),s.jsx(g,{label:"Endpoint",children:t.endpoint}),s.jsx(g,{label:"Source",children:se(t.source)}),t.source_label?s.jsx(g,{label:"Session",children:t.source_label}):null,s.jsx(g,{label:"User",children:t.user_id??"—"}),s.jsx(g,{label:"API key",children:t.api_key_id??"—"}),s.jsx(g,{label:"Prompt tokens",children:y(t.prompt_tokens)}),s.jsx(g,{label:"Completion tokens",children:y(t.completion_tokens)}),s.jsx(g,{label:"Total tokens",children:y(t.total_tokens)}),s.jsx(g,{label:"Cost",children:L(t.cost)}),s.jsx(g,{label:"Cache read tokens",children:y(t.cache_read_tokens)}),s.jsx(g,{label:"Cache write tokens",children:y(t.cache_write_tokens)}),s.jsx(g,{label:"1h cache writes",children:y(t.cache_write_1h_tokens??null)}),s.jsx(g,{label:"Total time",children:Te(t.latency_ms)}),s.jsx(g,{label:"Request ID",children:t.id})]}),(r=t.pricing_breakdown)!=null&&r.length?s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(i=>s.jsxs(g,{label:i.meter.replaceAll("_"," "),children:[y(i.units)," at ",L(i.rate_per_million)," / 1M, ",L(i.cost)]},i.meter))})]}):null]})}function Jt(){var ke,ye,Se,je,we,Ce;const t=nt(),r=ot(),i=c.useMemo(()=>{const e=new Map;for(const n of r.data??[])e.set(n.id,n.key_name??`${n.id.slice(0,8)}…`);return e},[r.data]),a=wt(Mt),l=a.get("range"),x=a.get("start_date"),o=a.get("end_date"),d=a.get("status"),u=a.get("model"),p=a.get("user_id"),f=a.get("api_key_id"),v=a.get("priced"),h=a.get("source"),ae=Math.max(0,a.getNumber("page")),re=a.getNumber("size"),B=jt.reduce((e,n)=>Math.abs(n-re)U(l,x,o)),oe=c.useRef(F);c.useEffect(()=>{oe.current!==F&&(oe.current=F,ne(U(l,x,o)))},[F,l,x,o]);const[M,le]=c.useState(()=>te(l)),ie=c.useRef(l);c.useEffect(()=>{ie.current!==l&&(ie.current=l,le(te(l)))},[l]);const T=v==="true"?!0:v==="false"?!1:void 0,b=c.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,model:u.trim()||void 0,user_id:p||void 0,api_key_id:f||void 0,source:h||void 0,priced:T}),[m,d,u,p,f,h,T]),_=xt(),D=JSON.stringify(b),ce=c.useRef(D);c.useEffect(()=>{ce.current!==D&&(ce.current=D,a.patch({page:0}),_.clear())},[D,a,_]);const S=lt(b,ae,B),N=Pe(b),De=c.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,user_id:p||void 0,api_key_id:f||void 0,source:h||void 0}),[m,d,p,f,h]),K=J(De,"day"),q=((ye=(ke=K.data)==null?void 0:ke.by_model)==null?void 0:ye.filter(e=>!e.is_other&&e.key!==null).map(e=>e.key))??[],de=(r.data??[]).map(e=>({value:e.id,label:e.key_name??`${e.id.slice(0,8)}…`})),Oe=c.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,model:u.trim()||void 0,user_id:p||void 0,api_key_id:f||void 0}),[m,d,u,p,f]),ue=J(Oe,"day",!!h),me=(Se=h?ue.data:K.data)==null?void 0:Se.by_source,Ie=c.useMemo(()=>{const e=(me??[]).filter(n=>!n.is_other&&n.key!==null).map(n=>n.key);return h&&!e.includes(h)?[h,...e]:e},[me,h]),P=C(w,l)??C(w,$),A=!!(m.start&&M.start&&new Date(m.start).getTime()({start_date:A?m.start:M.start,end_date:A?m.end:void 0,status:d||void 0,model:u.trim()||void 0,user_id:p||void 0,api_key_id:f||void 0,source:h||void 0,priced:T}),[A,m,M,d,u,p,f,h,T]),z=J(Le,pe),Ue=(((je=z.data)==null?void 0:je.series)??[]).map(e=>({bucketStart:e.bucket_start,requests:e.requests})),j=S.data??[],$e=N.isSuccess&&!N.isPlaceholderData?((we=N.data)==null?void 0:we.total)??0:null,W=C(w,l),Be=!!(x||o)||l!==$&&(W==null?void 0:W.seconds)!=null,Ke=!!(d||u.trim()||p||f||v||h||Be),O=(e,n)=>{var Ne;return((Ne=e.find(at=>at.value===n))==null?void 0:Ne.label)??n},he=(t.data??[]).map(e=>({value:e.user_id,label:e.alias?`${e.alias} (${e.user_id})`:e.user_id})),qe=()=>a.patch({status:"",priced:"",model:"",user_id:"",api_key_id:"",source:""}),ze=[...d?[{key:"status",label:"Status",value:O(Ae,d),onClear:()=>a.patch({status:""})}]:[],...v?[{key:"priced",label:"Priced",value:O(Ee,v),onClear:()=>a.patch({priced:""})}]:[],...p?[{key:"user",label:"User",value:O(he,p),onClear:()=>a.patch({user_id:""})}]:[],...u.trim()?[{key:"model",label:"Model",value:u.trim(),onClear:()=>a.patch({model:""})}]:[],...f?[{key:"key",label:"API key",value:O(de,f),onClear:()=>a.patch({api_key_id:""})}]:[],...h?[{key:"source",label:"Source",value:se(h),onClear:()=>a.patch({source:""})}]:[]],Y=c.useMemo(()=>j.filter(e=>!e.counts_toward_budget).map(e=>e.id),[j]),We=c.useMemo(()=>j.filter(e=>e.counts_toward_budget).map(e=>e.id),[j]),ge=_t(_.selectedKeys,Y),E=ge.length,fe=_.allMatching||E>0,Ye=c.useMemo(()=>({...b,counts_toward_budget:!1}),[b]),xe=Pe(Ye,fe),I=xe.isSuccess?((Ce=xe.data)==null?void 0:Ce.total)??null:null,Ge=Y.length>0&&E===Y.length&&I!=null&&I>E,R=_.allMatching?I??E:E,G=ct(),H=dt(),[He,V]=c.useState(!1),[Ve,Z]=c.useState(!1),[Ze,_e]=c.useState(null),Je=c.useCallback(e=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[s.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Request detail"}),s.jsx(ee,{size:"sm",variant:"ghost",onPress:()=>_e(null),children:"Close"})]}),s.jsx(Lt,{entry:e})]}),[]),be=()=>_.allMatching?{by_filter:!0,model:b.model,user_id:b.user_id,api_key_id:b.api_key_id,status:b.status,start_date:b.start_date,end_date:b.end_date,priced:b.priced}:{ids:ge},Qe=()=>{G.mutate(be(),{onSuccess:()=>{V(!1),_.clear()}})},Xe=e=>{H.mutate({...be(),...e},{onSuccess:()=>{Z(!1),_.clear()}})},et=()=>{S.refetch(),N.refetch(),z.refetch(),K.refetch(),ue.refetch()},ve=e=>{if(e.key===l&&!x&&!o){ne(U(e.key,"","")),le(te(e.key));return}a.patch({range:e.key,start_date:"",end_date:""})},tt=(e,n)=>a.patch({start_date:e,end_date:n}),st=c.useMemo(()=>{const e=n=>n===null?"—":i.get(n)??`${n.slice(0,8)}…`;return[{id:"time",header:"Time",cell:n=>s.jsx("span",{title:Nt(n.timestamp),className:"text-[var(--otari-muted)]",children:Pt(n.timestamp)})},{id:"user",header:"User",cell:n=>n.user_id??"—"},{id:"model",header:"Model",isRowHeader:!0,cell:n=>n.model},{id:"api_key",header:"API key",cell:n=>s.jsx("span",{className:"text-[var(--otari-muted)]",children:e(n.api_key_id)})},{id:"tokens",header:"Tokens",align:"end",cell:n=>s.jsx(Rt,{entry:n})},{id:"cost",header:"Cost",align:"end",cell:n=>L(n.cost)},{id:"latency",header:"Total time",align:"end",cell:n=>Te(n.latency_ms)},{id:"status",header:"Status",cell:n=>s.jsx(Tt,{status:n.status})}]},[i]);return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(ut,{title:"Activity",description:"A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored."}),s.jsx(mt,{error:S.error??N.error}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(gt,{presets:w,extentKey:Re,onPreset:ve,onSelectRange:tt,onSelectFull:()=>P?ve(P):void 0,series:Ue,bucket:pe,windowStart:m.start,windowEnd:m.end,loading:z.isLoading,ariaLabel:"Activity request volume over the selected window",action:s.jsx(pt,{onRefresh:et,isFetching:S.isFetching,updatedAt:S.dataUpdatedAt})}),s.jsxs(ft,{chips:ze,onClearAll:qe,children:[s.jsx(Q,{id:"filter-status",label:"Status",value:d,onChange:e=>a.patch({status:e}),children:Ae.map(e=>s.jsx("option",{value:e.value,children:e.label},e.value))}),s.jsx(Q,{id:"filter-priced",label:"Priced?",value:v,onChange:e=>a.patch({priced:e}),children:Ee.map(e=>s.jsx("option",{value:e.value,children:e.label},e.value))}),s.jsxs(Q,{id:"filter-source",label:"Source",value:h,onChange:e=>a.patch({source:e}),children:[s.jsx("option",{value:"",children:"All"}),Ie.map(e=>s.jsx("option",{value:e,children:se(e)},e))]}),s.jsx(X,{label:"API key",value:f,onChange:e=>a.patch({api_key_id:e}),placeholder:"All keys",options:de}),s.jsx(X,{label:"User",value:p,onChange:e=>a.patch({user_id:e}),placeholder:"All users",options:he}),s.jsx(X,{label:"Model",value:u,onChange:e=>a.patch({model:e}),allowsCustom:!0,placeholder:"Any model",options:(u&&!q.includes(u)?[u,...q]:q).map(e=>({value:e,label:e}))})]})]}),fe?s.jsxs(bt,{selectedCount:R,allMatching:_.allMatching,matchingTotal:I,canSelectAllMatching:Ge,onSelectAllMatching:_.enableAllMatching,onClear:_.clear,children:[s.jsx(ee,{size:"sm",variant:"primary",onPress:()=>Z(!0),children:"Set price"}),s.jsx(ee,{size:"sm",variant:"danger",onPress:()=>V(!0),children:"Delete"})]}):null,s.jsx(kt,{ariaLabel:"Activity log",columns:st,rows:j,getRowKey:At,isLoading:S.isLoading,emptyContent:Ke?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:_.selectedKeys,onSelectionChange:_.onSelectionChange,disabledKeys:We,onRowAction:e=>_e(n=>n===e?null:e),rowClassName:Et,detailKey:Ze,renderDetail:Je}),s.jsx(yt,{page:ae,pageSize:B,total:$e,rowsOnPage:j.length,onPageChange:e=>a.patch({page:e}),onPageSizeChange:e=>a.patch({size:e,page:0}),isFetching:S.isFetching,hasNextFallback:j.length===B}),s.jsx(vt,{isOpen:He,onOpenChange:V,heading:"Delete usage rows",body:`Delete ${R.toLocaleString()} imported ${R===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:G.isPending,error:G.error,onConfirm:Qe}),s.jsx(St,{isOpen:Ve,onOpenChange:Z,targetCount:R,isPending:H.isPending,error:H.error,onSubmit:Xe})]})}export{Jt as ActivityPage}; diff --git a/src/gateway/static/dashboard/assets/ActivityPage-VQgwkhn4.js b/src/gateway/static/dashboard/assets/ActivityPage-VQgwkhn4.js new file mode 100644 index 000000000..92467af0f --- /dev/null +++ b/src/gateway/static/dashboard/assets/ActivityPage-VQgwkhn4.js @@ -0,0 +1 @@ +import{j as s}from"./tanstack-query-1t81HyiD.js";import{u as nt,r as i}from"./react-dgEcD0HR.js";import{u as lt,a as ot,b as it,c as Pe,d as J,f as C,e as ct,A as B,g as dt,h as ut,P as mt,E as pt,C as Ee,i as w,R as ht,F as Q,j as X,k as Me,Y as gt}from"./index-DsUY4UvK.js";import{A as xt,F as ft}from"./FilterChips-Dah6AI5Z.js";import{u as _t,r as bt,B as vt}from"./tableSelection-9hV37uhu.js";import{C as kt}from"./ConfirmDialog-NCJIhH2z.js";import{D as yt}from"./DataTable-Bmn_eYSV.js";import{T as St,S as jt,P as wt}from"./TablePagination-DgA36VXY.js";import{B as ee}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function Ct(t){const[r,c]=nt(),a=i.useCallback(l=>r.get(l)??t[l],[r,t]),o=i.useCallback(l=>{const d=Number.parseInt(r.get(l)??"",10);if(!Number.isNaN(d))return d;const u=Number.parseInt(t[l],10);return Number.isNaN(u)?0:u},[r,t]),f=i.useCallback(l=>{c(d=>{const u=new URLSearchParams(d);for(const[h,x]of Object.entries(l)){const v=String(x);v===""||v===t[h]?u.delete(h):u.set(h,v)}return u},{replace:!0})},[c,t]);return{get:a,getNumber:o,patch:f}}const Nt=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function L(t){return t===null?"—":Nt.format(t)}function k(t){return t===null?"—":t.toLocaleString()}function Te(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function Pt(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleString()}function At(t){const r=new Date(t).getTime();if(Number.isNaN(r))return t;const c=Math.max(0,Math.round((Date.now()-r)/1e3));if(c<60)return`${c}s ago`;const a=Math.round(c/60);if(a<60)return`${a}m ago`;const o=Math.round(a/60);return o<24?`${o}h ago`:`${Math.round(o/24)}d ago`}const Ft=t=>t.id,Et=t=>t.status==="error"?"bg-red-50":void 0,Ae=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],Fe=[{label:"All",value:""},{label:"Priced",value:"true"},{label:"Unpriced",value:"false"}],Mt=50,Tt={range:B,start_date:"",end_date:"",status:"",model:"",user_id:"",api_key_id:"",priced:"",source:"",page:"0",size:String(Mt)};function U(t,r,c){if(r||c)return{start:r||void 0,end:c||void 0};if(t===Ee)return{};const a=C(w,t)??C(w,B),o=(a==null?void 0:a.seconds)??null;return{start:o==null?void 0:Me(o),end:void 0}}function te(t){const r=U(t,"","");if(r.start)return r;const c=C(w,t);return(c==null?void 0:c.seconds)==null?{start:Me(gt)}:r}function Dt({status:t}){const r=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return s.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r}`,children:t})}const Ot={gateway:"Gateway",claude_code:"Claude Code",codex:"Codex"};function se(t){return Ot[t]??t}function y(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function De(t){const r=t.billing_meters??null,c=y(r?r.total_input_tokens:t.prompt_tokens),a=y(r?r.cache_read_tokens:t.cache_read_tokens),o=y(r?r.cache_write_tokens:t.cache_write_tokens),f=y(r?r.completion_tokens:t.completion_tokens),l=Math.max(0,c-a-o),d=l+a+o+f;return d>0?{fresh:l,cacheRead:a,cacheWrite:o,output:f,total:d}:null}const It=[{key:"fresh",label:"Fresh input",fill:"var(--otari-ink)"},{key:"cacheRead",label:"Cache read",fill:"var(--otari-brand)"},{key:"cacheWrite",label:"Cache write",fill:"var(--otari-brand-soft)"},{key:"output",label:"Output",fill:"var(--otari-brand-dark)"}];function Rt({entry:t}){const r=De(t);if(r===null)return s.jsx("span",{className:"tabular-nums",children:k(t.total_tokens)});const c=It.map(l=>({...l,value:r[l.key]})),a=c.filter(l=>l.value>0).map(l=>`${l.label} ${l.value.toLocaleString()}`).join(", ");let o=0;const f=c.map(l=>{const d=l.value/r.total*100,u={...l,x:o,width:d};return o+=d,u});return s.jsxs("span",{className:"inline-flex flex-col items-end gap-1",title:a,children:[s.jsx("span",{className:"tabular-nums",children:r.total.toLocaleString()}),s.jsx("svg",{viewBox:"0 0 100 4",preserveAspectRatio:"none",role:"img","aria-label":`Token composition: ${a}`,className:"h-1.5 w-20 overflow-hidden rounded-full bg-[var(--otari-brand-tint)]",children:f.filter(l=>l.width>0).map(l=>s.jsx("rect",{x:l.x,y:0,width:l.width,height:4,fill:l.fill},l.key))})]})}function p({label:t,children:r}){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),s.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:r})]})}function Lt({entry:t}){var r,c;return s.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"}),s.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"This request failed. Inspect gateway logs for details."})]}):null,s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(p,{label:"Provider",children:t.provider??"—"}),s.jsx(p,{label:"Endpoint",children:t.endpoint}),s.jsx(p,{label:"Source",children:se(t.source)}),t.source_label?s.jsx(p,{label:"Session",children:t.source_label}):null,s.jsx(p,{label:"User",children:t.user_id??"—"}),s.jsx(p,{label:"API key",children:t.api_key_id??"—"}),s.jsx(p,{label:"Prompt tokens",children:k(t.prompt_tokens)}),s.jsx(p,{label:"Completion tokens",children:k(t.completion_tokens)}),s.jsx(p,{label:"Total tokens",children:k(t.total_tokens)}),s.jsx(p,{label:"Billed tokens",children:s.jsx("span",{title:"Fresh input, cache reads and writes, and output: the tokens this request was priced on, and the total the activity row's bar splits.",children:k(((r=De(t))==null?void 0:r.total)??null)})}),s.jsx(p,{label:"Cost",children:L(t.cost)}),s.jsx(p,{label:"Cache read tokens",children:k(t.cache_read_tokens)}),s.jsx(p,{label:"Cache write tokens",children:k(t.cache_write_tokens)}),s.jsx(p,{label:"1h cache writes",children:k(t.cache_write_1h_tokens??null)}),s.jsx(p,{label:"Total time",children:Te(t.latency_ms)}),s.jsx(p,{label:"Request ID",children:t.id})]}),(c=t.pricing_breakdown)!=null&&c.length?s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(a=>s.jsxs(p,{label:a.meter.replaceAll("_"," "),children:[k(a.units)," at ",L(a.rate_per_million)," / 1M, ",L(a.cost)]},a.meter))})]}):null]})}function Jt(){var ke,ye,Se,je,we,Ce;const t=lt(),r=ot(),c=i.useMemo(()=>{const e=new Map;for(const n of r.data??[])e.set(n.id,n.key_name??`${n.id.slice(0,8)}…`);return e},[r.data]),a=Ct(Tt),o=a.get("range"),f=a.get("start_date"),l=a.get("end_date"),d=a.get("status"),u=a.get("model"),h=a.get("user_id"),x=a.get("api_key_id"),v=a.get("priced"),g=a.get("source"),ae=Math.max(0,a.getNumber("page")),re=a.getNumber("size"),$=wt.reduce((e,n)=>Math.abs(n-re)U(o,f,l)),le=i.useRef(E);i.useEffect(()=>{le.current!==E&&(le.current=E,ne(U(o,f,l)))},[E,o,f,l]);const[M,oe]=i.useState(()=>te(o)),ie=i.useRef(o);i.useEffect(()=>{ie.current!==o&&(ie.current=o,oe(te(o)))},[o]);const T=v==="true"?!0:v==="false"?!1:void 0,b=i.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,model:u.trim()||void 0,user_id:h||void 0,api_key_id:x||void 0,source:g||void 0,priced:T}),[m,d,u,h,x,g,T]),_=_t(),D=JSON.stringify(b),ce=i.useRef(D);i.useEffect(()=>{ce.current!==D&&(ce.current=D,a.patch({page:0}),_.clear())},[D,a,_]);const S=it(b,ae,$),N=Pe(b),Oe=i.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,user_id:h||void 0,api_key_id:x||void 0,source:g||void 0}),[m,d,h,x,g]),K=J(Oe,"day"),q=((ye=(ke=K.data)==null?void 0:ke.by_model)==null?void 0:ye.filter(e=>!e.is_other&&e.key!==null).map(e=>e.key))??[],de=(r.data??[]).map(e=>({value:e.id,label:e.key_name??`${e.id.slice(0,8)}…`})),Ie=i.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,model:u.trim()||void 0,user_id:h||void 0,api_key_id:x||void 0}),[m,d,u,h,x]),ue=J(Ie,"day",!!g),me=(Se=g?ue.data:K.data)==null?void 0:Se.by_source,Re=i.useMemo(()=>{const e=(me??[]).filter(n=>!n.is_other&&n.key!==null).map(n=>n.key);return g&&!e.includes(g)?[g,...e]:e},[me,g]),P=C(w,o)??C(w,B),A=!!(m.start&&M.start&&new Date(m.start).getTime()({start_date:A?m.start:M.start,end_date:A?m.end:void 0,status:d||void 0,model:u.trim()||void 0,user_id:h||void 0,api_key_id:x||void 0,source:g||void 0,priced:T}),[A,m,M,d,u,h,x,g,T]),z=J(Ue,pe),Be=(((je=z.data)==null?void 0:je.series)??[]).map(e=>({bucketStart:e.bucket_start,requests:e.requests})),j=S.data??[],$e=N.isSuccess&&!N.isPlaceholderData?((we=N.data)==null?void 0:we.total)??0:null,W=C(w,o),Ke=!!(f||l)||o!==B&&(W==null?void 0:W.seconds)!=null,qe=!!(d||u.trim()||h||x||v||g||Ke),O=(e,n)=>{var Ne;return((Ne=e.find(rt=>rt.value===n))==null?void 0:Ne.label)??n},he=(t.data??[]).map(e=>({value:e.user_id,label:e.alias?`${e.alias} (${e.user_id})`:e.user_id})),ze=()=>a.patch({status:"",priced:"",model:"",user_id:"",api_key_id:"",source:""}),We=[...d?[{key:"status",label:"Status",value:O(Ae,d),onClear:()=>a.patch({status:""})}]:[],...v?[{key:"priced",label:"Priced",value:O(Fe,v),onClear:()=>a.patch({priced:""})}]:[],...h?[{key:"user",label:"User",value:O(he,h),onClear:()=>a.patch({user_id:""})}]:[],...u.trim()?[{key:"model",label:"Model",value:u.trim(),onClear:()=>a.patch({model:""})}]:[],...x?[{key:"key",label:"API key",value:O(de,x),onClear:()=>a.patch({api_key_id:""})}]:[],...g?[{key:"source",label:"Source",value:se(g),onClear:()=>a.patch({source:""})}]:[]],Y=i.useMemo(()=>j.filter(e=>!e.counts_toward_budget).map(e=>e.id),[j]),Ye=i.useMemo(()=>j.filter(e=>e.counts_toward_budget).map(e=>e.id),[j]),ge=bt(_.selectedKeys,Y),F=ge.length,xe=_.allMatching||F>0,Ge=i.useMemo(()=>({...b,counts_toward_budget:!1}),[b]),fe=Pe(Ge,xe),I=fe.isSuccess?((Ce=fe.data)==null?void 0:Ce.total)??null:null,He=Y.length>0&&F===Y.length&&I!=null&&I>F,R=_.allMatching?I??F:F,G=dt(),H=ut(),[Ve,V]=i.useState(!1),[Ze,Z]=i.useState(!1),[Je,_e]=i.useState(null),Qe=i.useCallback(e=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[s.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Request detail"}),s.jsx(ee,{size:"sm",variant:"ghost",onPress:()=>_e(null),children:"Close"})]}),s.jsx(Lt,{entry:e})]}),[]),be=()=>_.allMatching?{by_filter:!0,model:b.model,user_id:b.user_id,api_key_id:b.api_key_id,status:b.status,start_date:b.start_date,end_date:b.end_date,priced:b.priced}:{ids:ge},Xe=()=>{G.mutate(be(),{onSuccess:()=>{V(!1),_.clear()}})},et=e=>{H.mutate({...be(),...e},{onSuccess:()=>{Z(!1),_.clear()}})},tt=()=>{S.refetch(),N.refetch(),z.refetch(),K.refetch(),ue.refetch()},ve=e=>{if(e.key===o&&!f&&!l){ne(U(e.key,"","")),oe(te(e.key));return}a.patch({range:e.key,start_date:"",end_date:""})},st=(e,n)=>a.patch({start_date:e,end_date:n}),at=i.useMemo(()=>{const e=n=>n===null?"—":c.get(n)??`${n.slice(0,8)}…`;return[{id:"time",header:"Time",cell:n=>s.jsx("span",{title:Pt(n.timestamp),className:"text-[var(--otari-muted)]",children:At(n.timestamp)})},{id:"user",header:"User",cell:n=>n.user_id??"—"},{id:"model",header:"Model",isRowHeader:!0,cell:n=>n.model},{id:"api_key",header:"API key",cell:n=>s.jsx("span",{className:"text-[var(--otari-muted)]",children:e(n.api_key_id)})},{id:"tokens",header:"Tokens",align:"end",cell:n=>s.jsx(Rt,{entry:n})},{id:"cost",header:"Cost",align:"end",cell:n=>L(n.cost)},{id:"latency",header:"Total time",align:"end",cell:n=>Te(n.latency_ms)},{id:"status",header:"Status",cell:n=>s.jsx(Dt,{status:n.status})}]},[c]);return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(mt,{title:"Activity",description:"A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored."}),s.jsx(pt,{error:S.error??N.error}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(xt,{presets:w,extentKey:Le,onPreset:ve,onSelectRange:st,onSelectFull:()=>P?ve(P):void 0,series:Be,bucket:pe,windowStart:m.start,windowEnd:m.end,loading:z.isLoading,ariaLabel:"Activity request volume over the selected window",action:s.jsx(ht,{onRefresh:tt,isFetching:S.isFetching,updatedAt:S.dataUpdatedAt})}),s.jsxs(ft,{chips:We,onClearAll:ze,children:[s.jsx(Q,{id:"filter-status",label:"Status",value:d,onChange:e=>a.patch({status:e}),children:Ae.map(e=>s.jsx("option",{value:e.value,children:e.label},e.value))}),s.jsx(Q,{id:"filter-priced",label:"Priced?",value:v,onChange:e=>a.patch({priced:e}),children:Fe.map(e=>s.jsx("option",{value:e.value,children:e.label},e.value))}),s.jsxs(Q,{id:"filter-source",label:"Source",value:g,onChange:e=>a.patch({source:e}),children:[s.jsx("option",{value:"",children:"All"}),Re.map(e=>s.jsx("option",{value:e,children:se(e)},e))]}),s.jsx(X,{label:"API key",value:x,onChange:e=>a.patch({api_key_id:e}),placeholder:"All keys",options:de}),s.jsx(X,{label:"User",value:h,onChange:e=>a.patch({user_id:e}),placeholder:"All users",options:he}),s.jsx(X,{label:"Model",value:u,onChange:e=>a.patch({model:e}),allowsCustom:!0,placeholder:"Any model",options:(u&&!q.includes(u)?[u,...q]:q).map(e=>({value:e,label:e}))})]})]}),xe?s.jsxs(vt,{selectedCount:R,allMatching:_.allMatching,matchingTotal:I,canSelectAllMatching:He,onSelectAllMatching:_.enableAllMatching,onClear:_.clear,children:[s.jsx(ee,{size:"sm",variant:"primary",onPress:()=>Z(!0),children:"Set price"}),s.jsx(ee,{size:"sm",variant:"danger",onPress:()=>V(!0),children:"Delete"})]}):null,s.jsx(yt,{ariaLabel:"Activity log",columns:at,rows:j,getRowKey:Ft,isLoading:S.isLoading,emptyContent:qe?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:_.selectedKeys,onSelectionChange:_.onSelectionChange,disabledKeys:Ye,onRowAction:e=>_e(n=>n===e?null:e),rowClassName:Et,detailKey:Je,renderDetail:Qe}),s.jsx(St,{page:ae,pageSize:$,total:$e,rowsOnPage:j.length,onPageChange:e=>a.patch({page:e}),onPageSizeChange:e=>a.patch({size:e,page:0}),isFetching:S.isFetching,hasNextFallback:j.length===$}),s.jsx(kt,{isOpen:Ve,onOpenChange:V,heading:"Delete usage rows",body:`Delete ${R.toLocaleString()} imported ${R===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:G.isPending,error:G.error,onConfirm:Xe}),s.jsx(jt,{isOpen:Ze,onOpenChange:Z,targetCount:R,isPending:H.isPending,error:H.error,onSubmit:et})]})}export{Jt as ActivityPage}; diff --git a/src/gateway/static/dashboard/assets/AliasesPage-BXueJgS_.js b/src/gateway/static/dashboard/assets/AliasesPage-nuRqwFaK.js similarity index 98% rename from src/gateway/static/dashboard/assets/AliasesPage-BXueJgS_.js rename to src/gateway/static/dashboard/assets/AliasesPage-nuRqwFaK.js index 06ac58e15..253507e52 100644 --- a/src/gateway/static/dashboard/assets/AliasesPage-BXueJgS_.js +++ b/src/gateway/static/dashboard/assets/AliasesPage-nuRqwFaK.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as L}from"./react-dgEcD0HR.js";import{l as T,m as I,n as M,o as R,P as K,E as w,p as P,u as F}from"./index-BCvb90M0.js";import{u as O,r as $,B as U}from"./tableSelection-9hV37uhu.js";import{C as q}from"./ConfirmDialog-BXAKoq6j.js";import{D as H}from"./DataTable-Bmn_eYSV.js";import{F as V}from"./Field-Dwp6u3t8.js";import{C as k,L as z,I as G,a as J,b as W,f as X,B as j,d as A}from"./heroui-BI50yK5B.js";import{U as Q}from"./UserComboBox-a9wxf8eF.js";const Y=50;function B({label:t,value:a,onChange:n,description:r,placeholder:c="provider:model",autoFocus:l,isRequired:d}){const o=T(),{visible:m,total:h,failed:x}=u.useMemo(()=>{var N;const i=a.trim().toLowerCase(),v=((N=o.data)==null?void 0:N.providers)??[],C=v.flatMap(f=>f.models),p=i?C.filter(f=>f.key.toLowerCase().includes(i)):C;return{visible:p.slice(0,Y),total:p.length,failed:v.filter(f=>!f.ok)}},[o.data,a]),g=o.isLoading?"Loading models from your providers…":x.length>0?`Could not list models for ${x.map(v=>v.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:h>m.length?`Showing ${m.length} of ${h} matches. Keep typing to narrow them.`:r;return e.jsxs(k.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:a,onInputChange:n,onSelectionChange:i=>{i!=null&&n(String(i))},isRequired:d,className:"flex max-w-md flex-col gap-1",children:[e.jsx(z,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(k.InputGroup,{children:[e.jsx(G,{placeholder:c,autoFocus:l}),e.jsx(k.Trigger,{})]}),e.jsx(k.Popover,{children:e.jsx(J,{items:m,className:"max-h-72 overflow-auto",children:i=>e.jsx(W,{id:i.key,textValue:i.key,children:i.key})})}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:g}):null]})}const S=t=>JSON.stringify([t.user_id,t.name]);function Z({userId:t,onChange:a}){const n=F(),r=t!==null,c=(l,d)=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>a(l?"":null),className:r===l?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:d});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Applies to"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"A global alias resolves for every caller. A user-scoped one resolves only for that user, and takes precedence over a global alias of the same name."})]}),e.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[c(!1,"Every caller"),c(!0,"One user")]}),r?e.jsx(Q,{label:"User",value:t??"",onChange:a,users:n.data??[],placeholder:"Pick a user…",description:"Only this user resolves the alias.",unknownHint:e.jsx("span",{className:"text-red-700",children:"No such user. Pick an existing one."})}):null]})}function ee({alias:t,onClose:a}){const n=P(),[r,c]=u.useState(t.target),l=r.trim()!==""&&r.trim()!==t.target,d=()=>{l&&n.mutate({name:t.name,target:r.trim(),user_id:t.user_id},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name}),t.user_id?e.jsxs(e.Fragment,{children:[" for user ",e.jsx("code",{children:t.user_id})]}):null]}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["The alias name and who it applies to (",t.user_id?e.jsx("code",{children:t.user_id}):"every caller",") are the key and cannot be changed here. Delete and recreate to change either."]})]}),e.jsx(B,{label:"Target",value:r,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!l||n.isPending,onPress:d,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function se({onClose:t,initialTarget:a=""}){const n=P(),[r,c]=u.useState(""),[l,d]=u.useState(a),[o,m]=u.useState(null),h=/[:/]/.test(r),x=o===null||o.trim()!=="",g=r.trim()!==""&&l.trim()!==""&&!h&&x,i=()=>{g&&n.mutate({name:r.trim(),target:l.trim(),user_id:o===null?null:o.trim()},{onSuccess:t})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(V,{label:"Alias name",value:r,onChange:c,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:h?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(B,{label:"Target",value:l,onChange:d,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsx(Z,{userId:o,onChange:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!g||n.isPending,onPress:i,children:n.isPending?"Creating…":"Create alias"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function me(){const t=I(),a=M(),[n]=L(),r=n.get("target")??"",[c,l]=u.useState(r!==""),[d,o]=u.useState(null),m=O(),[h,x]=u.useState(!1),[g,i]=u.useState(void 0),[v,C]=u.useState(!1),p=[...t.data??[]].sort((s,b)=>s.name.localeCompare(b.name)||(s.user_id??"").localeCompare(b.user_id??"")),N=p.filter(s=>s.source==="stored").map(S),f=p.filter(s=>s.source!=="stored").map(S),y=$(m.selectedKeys,N),D=new Map(p.map(s=>[S(s),s])),_=async()=>{C(!0),i(void 0);try{for(const s of y){const b=D.get(s);b!==void 0&&await a.mutateAsync({name:b.name,userId:b.user_id})}m.clear(),x(!1)}catch(s){i(s)}finally{C(!1)}},E=u.useMemo(()=>[{id:"alias",header:"Alias",isRowHeader:!0,cell:s=>e.jsx("span",{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name})},{id:"target",header:"Target",cell:s=>e.jsx("span",{className:"break-all text-[var(--otari-muted)]",children:s.target})},{id:"scope",header:"Applies to",cell:s=>s.user_id?e.jsx("code",{className:"break-all text-xs text-[var(--otari-ink)]",children:s.user_id}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Every caller"})},{id:"source",header:"Source",cell:s=>e.jsx(X,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})},{id:"actions",header:"Actions",align:"end",cell:s=>s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{l(!1),o(s)},children:"Edit"}),e.jsx(R,{confirmLabel:"Delete",isPending:a.isPending,onConfirm:()=>a.mutate({name:s.name,userId:s.user_id}),children:"Delete"})]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})}],[a.isPending,a.mutate]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(K,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:c||d?null:e.jsx(j,{variant:"primary",onPress:()=>{o(null),l(!0)},children:"New alias"})}),e.jsx(w,{error:t.error}),c?e.jsx(se,{initialTarget:r,onClose:()=>l(!1)}):null,d?e.jsx(ee,{alias:d,onClose:()=>o(null)}):null,a.error?e.jsx(w,{error:a.error}):null,y.length>0?e.jsx(U,{selectedCount:y.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:m.clear,children:e.jsx(j,{size:"sm",variant:"danger",onPress:()=>x(!0),children:"Delete"})}):null,e.jsx(H,{ariaLabel:"Aliases",columns:E,rows:p,getRowKey:S,isLoading:t.isLoading,emptyContent:"No aliases yet. Create one to give a model a friendly name.",selectionMode:"multiple",selectedKeys:m.selectedKeys,onSelectionChange:m.onSelectionChange,disabledKeys:f}),e.jsx(q,{isOpen:h,onOpenChange:x,heading:"Delete aliases",body:`Delete ${y.length} stored ${y.length===1?"alias":"aliases"}? Callers using ${y.length===1?"it":"them"} will get a model-not-found error.`,confirmLabel:"Delete",isPending:v,error:g,onConfirm:_})]})}export{me as AliasesPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as L}from"./react-dgEcD0HR.js";import{l as T,m as I,n as M,o as R,P as K,E as w,p as P,u as F}from"./index-DsUY4UvK.js";import{u as O,r as $,B as U}from"./tableSelection-9hV37uhu.js";import{C as q}from"./ConfirmDialog-NCJIhH2z.js";import{D as H}from"./DataTable-Bmn_eYSV.js";import{F as V}from"./Field-Dwp6u3t8.js";import{C as k,L as z,I as G,a as J,b as W,f as X,B as j,d as A}from"./heroui-BI50yK5B.js";import{U as Q}from"./UserComboBox-a9wxf8eF.js";const Y=50;function B({label:t,value:a,onChange:n,description:r,placeholder:c="provider:model",autoFocus:l,isRequired:d}){const o=T(),{visible:m,total:h,failed:x}=u.useMemo(()=>{var N;const i=a.trim().toLowerCase(),v=((N=o.data)==null?void 0:N.providers)??[],C=v.flatMap(f=>f.models),p=i?C.filter(f=>f.key.toLowerCase().includes(i)):C;return{visible:p.slice(0,Y),total:p.length,failed:v.filter(f=>!f.ok)}},[o.data,a]),g=o.isLoading?"Loading models from your providers…":x.length>0?`Could not list models for ${x.map(v=>v.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:h>m.length?`Showing ${m.length} of ${h} matches. Keep typing to narrow them.`:r;return e.jsxs(k.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:a,onInputChange:n,onSelectionChange:i=>{i!=null&&n(String(i))},isRequired:d,className:"flex max-w-md flex-col gap-1",children:[e.jsx(z,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(k.InputGroup,{children:[e.jsx(G,{placeholder:c,autoFocus:l}),e.jsx(k.Trigger,{})]}),e.jsx(k.Popover,{children:e.jsx(J,{items:m,className:"max-h-72 overflow-auto",children:i=>e.jsx(W,{id:i.key,textValue:i.key,children:i.key})})}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:g}):null]})}const S=t=>JSON.stringify([t.user_id,t.name]);function Z({userId:t,onChange:a}){const n=F(),r=t!==null,c=(l,d)=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>a(l?"":null),className:r===l?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:d});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Applies to"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"A global alias resolves for every caller. A user-scoped one resolves only for that user, and takes precedence over a global alias of the same name."})]}),e.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[c(!1,"Every caller"),c(!0,"One user")]}),r?e.jsx(Q,{label:"User",value:t??"",onChange:a,users:n.data??[],placeholder:"Pick a user…",description:"Only this user resolves the alias.",unknownHint:e.jsx("span",{className:"text-red-700",children:"No such user. Pick an existing one."})}):null]})}function ee({alias:t,onClose:a}){const n=P(),[r,c]=u.useState(t.target),l=r.trim()!==""&&r.trim()!==t.target,d=()=>{l&&n.mutate({name:t.name,target:r.trim(),user_id:t.user_id},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name}),t.user_id?e.jsxs(e.Fragment,{children:[" for user ",e.jsx("code",{children:t.user_id})]}):null]}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["The alias name and who it applies to (",t.user_id?e.jsx("code",{children:t.user_id}):"every caller",") are the key and cannot be changed here. Delete and recreate to change either."]})]}),e.jsx(B,{label:"Target",value:r,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!l||n.isPending,onPress:d,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function se({onClose:t,initialTarget:a=""}){const n=P(),[r,c]=u.useState(""),[l,d]=u.useState(a),[o,m]=u.useState(null),h=/[:/]/.test(r),x=o===null||o.trim()!=="",g=r.trim()!==""&&l.trim()!==""&&!h&&x,i=()=>{g&&n.mutate({name:r.trim(),target:l.trim(),user_id:o===null?null:o.trim()},{onSuccess:t})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(V,{label:"Alias name",value:r,onChange:c,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:h?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(B,{label:"Target",value:l,onChange:d,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsx(Z,{userId:o,onChange:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!g||n.isPending,onPress:i,children:n.isPending?"Creating…":"Create alias"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function me(){const t=I(),a=M(),[n]=L(),r=n.get("target")??"",[c,l]=u.useState(r!==""),[d,o]=u.useState(null),m=O(),[h,x]=u.useState(!1),[g,i]=u.useState(void 0),[v,C]=u.useState(!1),p=[...t.data??[]].sort((s,b)=>s.name.localeCompare(b.name)||(s.user_id??"").localeCompare(b.user_id??"")),N=p.filter(s=>s.source==="stored").map(S),f=p.filter(s=>s.source!=="stored").map(S),y=$(m.selectedKeys,N),D=new Map(p.map(s=>[S(s),s])),_=async()=>{C(!0),i(void 0);try{for(const s of y){const b=D.get(s);b!==void 0&&await a.mutateAsync({name:b.name,userId:b.user_id})}m.clear(),x(!1)}catch(s){i(s)}finally{C(!1)}},E=u.useMemo(()=>[{id:"alias",header:"Alias",isRowHeader:!0,cell:s=>e.jsx("span",{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name})},{id:"target",header:"Target",cell:s=>e.jsx("span",{className:"break-all text-[var(--otari-muted)]",children:s.target})},{id:"scope",header:"Applies to",cell:s=>s.user_id?e.jsx("code",{className:"break-all text-xs text-[var(--otari-ink)]",children:s.user_id}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Every caller"})},{id:"source",header:"Source",cell:s=>e.jsx(X,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})},{id:"actions",header:"Actions",align:"end",cell:s=>s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{l(!1),o(s)},children:"Edit"}),e.jsx(R,{confirmLabel:"Delete",isPending:a.isPending,onConfirm:()=>a.mutate({name:s.name,userId:s.user_id}),children:"Delete"})]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})}],[a.isPending,a.mutate]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(K,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:c||d?null:e.jsx(j,{variant:"primary",onPress:()=>{o(null),l(!0)},children:"New alias"})}),e.jsx(w,{error:t.error}),c?e.jsx(se,{initialTarget:r,onClose:()=>l(!1)}):null,d?e.jsx(ee,{alias:d,onClose:()=>o(null)}):null,a.error?e.jsx(w,{error:a.error}):null,y.length>0?e.jsx(U,{selectedCount:y.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:m.clear,children:e.jsx(j,{size:"sm",variant:"danger",onPress:()=>x(!0),children:"Delete"})}):null,e.jsx(H,{ariaLabel:"Aliases",columns:E,rows:p,getRowKey:S,isLoading:t.isLoading,emptyContent:"No aliases yet. Create one to give a model a friendly name.",selectionMode:"multiple",selectedKeys:m.selectedKeys,onSelectionChange:m.onSelectionChange,disabledKeys:f}),e.jsx(q,{isOpen:h,onOpenChange:x,heading:"Delete aliases",body:`Delete ${y.length} stored ${y.length===1?"alias":"aliases"}? Callers using ${y.length===1?"it":"them"} will get a model-not-found error.`,confirmLabel:"Delete",isPending:v,error:g,onConfirm:_})]})}export{me as AliasesPage}; diff --git a/src/gateway/static/dashboard/assets/BudgetsPage-BQktAQRZ.js b/src/gateway/static/dashboard/assets/BudgetsPage-_DPQrLj-.js similarity index 99% rename from src/gateway/static/dashboard/assets/BudgetsPage-BQktAQRZ.js rename to src/gateway/static/dashboard/assets/BudgetsPage-_DPQrLj-.js index 9add738f4..89090ae72 100644 --- a/src/gateway/static/dashboard/assets/BudgetsPage-BQktAQRZ.js +++ b/src/gateway/static/dashboard/assets/BudgetsPage-_DPQrLj-.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{q as ae,u as re,r as le,s as ie,t as oe,v as de,P as ue,E as T,I as ce,w as me,x as xe}from"./index-BCvb90M0.js";import{u as ge,r as he,B as pe}from"./tableSelection-9hV37uhu.js";import{C as fe}from"./ConfirmDialog-BXAKoq6j.js";import{D as be}from"./DataTable-Bmn_eYSV.js";import{F as z}from"./Field-Dwp6u3t8.js";import{C as E,I as je,a as ve,b as ye,B as x,d as k,S as Ne}from"./heroui-BI50yK5B.js";const Se=50;function _e({value:t,onChange:r,users:a,label:o,description:l}){const[g,h]=i.useState(""),d=i.useMemo(()=>a.filter(s=>!s.user_id.startsWith("apikey-")).map(s=>({id:s.user_id,label:s.alias?`${s.user_id} (${s.alias})`:s.user_id})),[a]),p=i.useMemo(()=>{const s=g.trim().toLowerCase();return d.filter(u=>!t.includes(u.id)).filter(u=>!s||u.id.toLowerCase().includes(s)||u.label.toLowerCase().includes(s)).slice(0,Se)},[d,t,g]),c=s=>{t.includes(s)||r([...t,s]),h("")},m=s=>r(t.filter(u=>u!==s));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:o}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[s,e.jsx("button",{type:"button","aria-label":`Remove ${s}`,onClick:()=>m(s),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},s))}):null,d.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:h,selectedKey:null,onSelectionChange:s=>{s!=null&&c(String(s))},className:"flex flex-col gap-1",children:[e.jsxs(E.InputGroup,{children:[e.jsx(je,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(ve,{items:p,className:"max-h-72 overflow-auto",children:s=>e.jsx(ye,{id:s.id,textValue:s.label,children:s.label})})})]})]})}const Ce=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function D(t){return Ce.format(t)}const j=86400,q=3600,O=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function we(t){if(t===null)return"No reset";const r=O.find(a=>a.seconds===t);return r?r.label:t%j===0?`Every ${t/j} days`:t%q===0?`Every ${t/q} hours`:`Every ${t}s`}function W(t){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function De(t){const r=t.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function Y(t){return t!==null&&t%j===0?String(t/j):""}function Be({value:t,onChange:r,onInvalidChange:a}){const o=O.some(s=>s.seconds===t),[l,g]=i.useState(!o),[h,d]=i.useState(()=>Y(t)),p=h.trim(),c=Number(p),m=p!==""&&(!Number.isSafeInteger(c)||c<=0);return i.useEffect(()=>{a==null||a(m)},[m,a]),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.map(s=>e.jsx(x,{size:"sm",variant:!l&&t===s.seconds?"primary":"outline",onPress:()=>{g(!1),d(Y(s.seconds)),r(s.seconds)},children:s.label},s.label)),e.jsx(x,{size:"sm",variant:l?"primary":"outline",onPress:()=>g(!0),children:"Custom"})]}),l?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(z,{label:"Every N days",value:h,onChange:s=>{d(s);const u=Number(s.trim());r(s.trim()===""||!Number.isSafeInteger(u)||u<=0?null:u*j)},placeholder:"14",description:m?e.jsx("span",{className:"text-red-700",children:"Enter a whole number of days."}):"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function G({title:t,submitLabel:r,initial:a,error:o,isPending:l,onSubmit:g,onClose:h,assignUsers:d}){const[p,c]=i.useState(a.name??""),[m,s]=i.useState(a.max_budget===null?"":String(a.max_budget)),[u,b]=i.useState(a.budget_duration_sec),[S,v]=i.useState(!1),[B,P]=i.useState([]),f=De(m),A=!l&&f.valid&&!S,C=()=>{A&&g({name:p.trim()||null,max_budget:f.value,budget_duration_sec:u},B)};return e.jsx(k,{children:e.jsxs(k.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(T,{error:o}),e.jsx(z,{label:"Name (optional)",value:p,onChange:c,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(z,{label:"Spending limit (USD)",value:m,onChange:s,placeholder:"100.00",description:f.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(Be,{value:u,onChange:b,onInvalidChange:v}),d?e.jsx(_e,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:B,onChange:P,users:d}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:!A,onPress:C,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:h,children:"Cancel"})]})]})})}function Pe({budget:t}){if(t.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=t.total_spend;if(t.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[D(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=t.max_budget*t.user_count,o=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:D(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",D(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(o,l?100:2)}%`}})})]})}function Ae({budgetId:t}){const r=xe(t);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(Ne,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:o.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:D(o.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:W(o.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:W(o.next_reset_at)})]},o.id))})]})})}function Ee({label:t,isPending:r,onConfirm:a}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:t}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}const ke=t=>t.budget_id;function Q(t){return t.split("-")[0]}function $(t){return t.name??Q(t.budget_id)}function Te(){const t=ae(),r=re(),a=le(),o=ie(),l=oe(),g=de(),[h,d]=i.useState(!1),[p,c]=i.useState(null),[m,s]=i.useState(null),[u,b]=i.useState(null),[S,v]=i.useState(null),[B,P]=i.useState(!1),f=ge(),[A,C]=i.useState(!1),[X,F]=i.useState(void 0),[J,H]=i.useState(!1),w=t.data??[],K=t.isLoading,y=w.find(n=>n.budget_id===p)??null,U=w.find(n=>n.budget_id===m)??null,L=!K&&w.length===0&&!h,Z=w.map(n=>n.budget_id),_=he(f.selectedKeys,Z),ee=async()=>{H(!0),F(void 0);try{for(const n of _)await l.mutateAsync(n);f.clear(),C(!1)}catch(n){F(n)}finally{H(!1)}},te=i.useMemo(()=>[{id:"budget",header:"Budget",isRowHeader:!0,cell:n=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:Q(n.budget_id)})]})},{id:"limit",header:"Limit (per user)",cell:n=>n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):D(n.max_budget)},{id:"reset",header:"Reset",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:we(n.budget_duration_sec)})},{id:"users",header:"Users",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:n.user_count})},{id:"usage",header:"Usage",cell:n=>e.jsx(Pe,{budget:n})},{id:"actions",header:"Actions",align:"end",cell:n=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(N=>N===n.budget_id?null:n.budget_id),children:m===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{d(!1),c(n.budget_id)},children:"Edit"}),e.jsx(Ee,{label:$(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})}],[m,l.isPending,l.mutate]),V=async(n,N)=>{P(!0),b(null);const I=await Promise.allSettled(N.map(M=>g.mutateAsync({id:M,body:{budget_id:n}})));P(!1);const R=I.flatMap((M,ne)=>M.status==="rejected"?[N[ne]]:[]);if(R.length>0){v({budgetId:n,userIds:R}),b(new Error(`Budget created, but could not assign it to: ${R.join(", ")}. Retry to try again.`));return}v(null),d(!1)},se=(n,N)=>{if(S){V(S.budgetId,S.userIds);return}b(null),a.mutate(n,{onSuccess:async I=>{if(N.length>0){await V(I.budget_id,N);return}d(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ue,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:h||L?null:e.jsx(x,{variant:"primary",onPress:()=>{c(null),b(null),v(null),d(!0)},children:"Create budget"})}),e.jsx(T,{error:t.error??a.error??o.error??l.error??g.error}),e.jsx(ce,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),L?e.jsx(me,{title:"No budgets yet",description:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit.",actionLabel:"Create your first budget",onAction:()=>{c(null),b(null),v(null),d(!0)}}):null,h?e.jsx(G,{title:"Create budget",submitLabel:S?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??u,isPending:a.isPending||B,assignUsers:r.data??[],onSubmit:se,onClose:()=>{b(null),v(null),d(!1)}}):null,y?e.jsx(G,{title:`Edit budget ${$(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:o.error,isPending:o.isPending,onSubmit:n=>o.mutate({id:y.budget_id,body:n},{onSuccess:()=>c(null)}),onClose:()=>c(null)},y.budget_id):null,_.length>0?e.jsx(pe,{selectedCount:_.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:f.clear,children:e.jsx(x,{size:"sm",variant:"danger",onPress:()=>C(!0),children:"Delete"})}):null,L?null:e.jsx(be,{ariaLabel:"Budgets",columns:te,rows:w,getRowKey:ke,isLoading:K,emptyContent:"No budgets yet. Create one to cap spending.",selectionMode:"multiple",selectedKeys:f.selectedKeys,onSelectionChange:f.onSelectionChange}),U?e.jsx(k,{children:e.jsxs(k.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsxs("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:["Reset history — ",$(U)]}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(null),children:"Close"})]}),e.jsx(Ae,{budgetId:U.budget_id})]})}):null,e.jsx(fe,{isOpen:A,onOpenChange:C,heading:"Delete budgets",body:`Delete ${_.length} ${_.length===1?"budget":"budgets"}? Users on ${_.length===1?"it":"them"} will no longer be capped.`,confirmLabel:"Delete",isPending:J,error:X,onConfirm:ee})]})}export{Te as BudgetsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{q as ae,u as re,r as le,s as ie,t as oe,v as de,P as ue,E as T,I as ce,w as me,x as xe}from"./index-DsUY4UvK.js";import{u as ge,r as he,B as pe}from"./tableSelection-9hV37uhu.js";import{C as fe}from"./ConfirmDialog-NCJIhH2z.js";import{D as be}from"./DataTable-Bmn_eYSV.js";import{F as z}from"./Field-Dwp6u3t8.js";import{C as E,I as je,a as ve,b as ye,B as x,d as k,S as Ne}from"./heroui-BI50yK5B.js";const Se=50;function _e({value:t,onChange:r,users:a,label:o,description:l}){const[g,h]=i.useState(""),d=i.useMemo(()=>a.filter(s=>!s.user_id.startsWith("apikey-")).map(s=>({id:s.user_id,label:s.alias?`${s.user_id} (${s.alias})`:s.user_id})),[a]),p=i.useMemo(()=>{const s=g.trim().toLowerCase();return d.filter(u=>!t.includes(u.id)).filter(u=>!s||u.id.toLowerCase().includes(s)||u.label.toLowerCase().includes(s)).slice(0,Se)},[d,t,g]),c=s=>{t.includes(s)||r([...t,s]),h("")},m=s=>r(t.filter(u=>u!==s));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:o}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[s,e.jsx("button",{type:"button","aria-label":`Remove ${s}`,onClick:()=>m(s),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},s))}):null,d.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:h,selectedKey:null,onSelectionChange:s=>{s!=null&&c(String(s))},className:"flex flex-col gap-1",children:[e.jsxs(E.InputGroup,{children:[e.jsx(je,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(ve,{items:p,className:"max-h-72 overflow-auto",children:s=>e.jsx(ye,{id:s.id,textValue:s.label,children:s.label})})})]})]})}const Ce=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function D(t){return Ce.format(t)}const j=86400,q=3600,O=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function we(t){if(t===null)return"No reset";const r=O.find(a=>a.seconds===t);return r?r.label:t%j===0?`Every ${t/j} days`:t%q===0?`Every ${t/q} hours`:`Every ${t}s`}function W(t){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function De(t){const r=t.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function Y(t){return t!==null&&t%j===0?String(t/j):""}function Be({value:t,onChange:r,onInvalidChange:a}){const o=O.some(s=>s.seconds===t),[l,g]=i.useState(!o),[h,d]=i.useState(()=>Y(t)),p=h.trim(),c=Number(p),m=p!==""&&(!Number.isSafeInteger(c)||c<=0);return i.useEffect(()=>{a==null||a(m)},[m,a]),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.map(s=>e.jsx(x,{size:"sm",variant:!l&&t===s.seconds?"primary":"outline",onPress:()=>{g(!1),d(Y(s.seconds)),r(s.seconds)},children:s.label},s.label)),e.jsx(x,{size:"sm",variant:l?"primary":"outline",onPress:()=>g(!0),children:"Custom"})]}),l?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(z,{label:"Every N days",value:h,onChange:s=>{d(s);const u=Number(s.trim());r(s.trim()===""||!Number.isSafeInteger(u)||u<=0?null:u*j)},placeholder:"14",description:m?e.jsx("span",{className:"text-red-700",children:"Enter a whole number of days."}):"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function G({title:t,submitLabel:r,initial:a,error:o,isPending:l,onSubmit:g,onClose:h,assignUsers:d}){const[p,c]=i.useState(a.name??""),[m,s]=i.useState(a.max_budget===null?"":String(a.max_budget)),[u,b]=i.useState(a.budget_duration_sec),[S,v]=i.useState(!1),[B,P]=i.useState([]),f=De(m),A=!l&&f.valid&&!S,C=()=>{A&&g({name:p.trim()||null,max_budget:f.value,budget_duration_sec:u},B)};return e.jsx(k,{children:e.jsxs(k.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(T,{error:o}),e.jsx(z,{label:"Name (optional)",value:p,onChange:c,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(z,{label:"Spending limit (USD)",value:m,onChange:s,placeholder:"100.00",description:f.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(Be,{value:u,onChange:b,onInvalidChange:v}),d?e.jsx(_e,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:B,onChange:P,users:d}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:!A,onPress:C,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:h,children:"Cancel"})]})]})})}function Pe({budget:t}){if(t.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=t.total_spend;if(t.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[D(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=t.max_budget*t.user_count,o=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:D(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",D(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(o,l?100:2)}%`}})})]})}function Ae({budgetId:t}){const r=xe(t);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(Ne,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:o.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:D(o.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:W(o.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:W(o.next_reset_at)})]},o.id))})]})})}function Ee({label:t,isPending:r,onConfirm:a}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:t}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}const ke=t=>t.budget_id;function Q(t){return t.split("-")[0]}function $(t){return t.name??Q(t.budget_id)}function Te(){const t=ae(),r=re(),a=le(),o=ie(),l=oe(),g=de(),[h,d]=i.useState(!1),[p,c]=i.useState(null),[m,s]=i.useState(null),[u,b]=i.useState(null),[S,v]=i.useState(null),[B,P]=i.useState(!1),f=ge(),[A,C]=i.useState(!1),[X,F]=i.useState(void 0),[J,H]=i.useState(!1),w=t.data??[],K=t.isLoading,y=w.find(n=>n.budget_id===p)??null,U=w.find(n=>n.budget_id===m)??null,L=!K&&w.length===0&&!h,Z=w.map(n=>n.budget_id),_=he(f.selectedKeys,Z),ee=async()=>{H(!0),F(void 0);try{for(const n of _)await l.mutateAsync(n);f.clear(),C(!1)}catch(n){F(n)}finally{H(!1)}},te=i.useMemo(()=>[{id:"budget",header:"Budget",isRowHeader:!0,cell:n=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:Q(n.budget_id)})]})},{id:"limit",header:"Limit (per user)",cell:n=>n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):D(n.max_budget)},{id:"reset",header:"Reset",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:we(n.budget_duration_sec)})},{id:"users",header:"Users",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:n.user_count})},{id:"usage",header:"Usage",cell:n=>e.jsx(Pe,{budget:n})},{id:"actions",header:"Actions",align:"end",cell:n=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(N=>N===n.budget_id?null:n.budget_id),children:m===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{d(!1),c(n.budget_id)},children:"Edit"}),e.jsx(Ee,{label:$(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})}],[m,l.isPending,l.mutate]),V=async(n,N)=>{P(!0),b(null);const I=await Promise.allSettled(N.map(M=>g.mutateAsync({id:M,body:{budget_id:n}})));P(!1);const R=I.flatMap((M,ne)=>M.status==="rejected"?[N[ne]]:[]);if(R.length>0){v({budgetId:n,userIds:R}),b(new Error(`Budget created, but could not assign it to: ${R.join(", ")}. Retry to try again.`));return}v(null),d(!1)},se=(n,N)=>{if(S){V(S.budgetId,S.userIds);return}b(null),a.mutate(n,{onSuccess:async I=>{if(N.length>0){await V(I.budget_id,N);return}d(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ue,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:h||L?null:e.jsx(x,{variant:"primary",onPress:()=>{c(null),b(null),v(null),d(!0)},children:"Create budget"})}),e.jsx(T,{error:t.error??a.error??o.error??l.error??g.error}),e.jsx(ce,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),L?e.jsx(me,{title:"No budgets yet",description:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit.",actionLabel:"Create your first budget",onAction:()=>{c(null),b(null),v(null),d(!0)}}):null,h?e.jsx(G,{title:"Create budget",submitLabel:S?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??u,isPending:a.isPending||B,assignUsers:r.data??[],onSubmit:se,onClose:()=>{b(null),v(null),d(!1)}}):null,y?e.jsx(G,{title:`Edit budget ${$(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:o.error,isPending:o.isPending,onSubmit:n=>o.mutate({id:y.budget_id,body:n},{onSuccess:()=>c(null)}),onClose:()=>c(null)},y.budget_id):null,_.length>0?e.jsx(pe,{selectedCount:_.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:f.clear,children:e.jsx(x,{size:"sm",variant:"danger",onPress:()=>C(!0),children:"Delete"})}):null,L?null:e.jsx(be,{ariaLabel:"Budgets",columns:te,rows:w,getRowKey:ke,isLoading:K,emptyContent:"No budgets yet. Create one to cap spending.",selectionMode:"multiple",selectedKeys:f.selectedKeys,onSelectionChange:f.onSelectionChange}),U?e.jsx(k,{children:e.jsxs(k.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsxs("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:["Reset history — ",$(U)]}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(null),children:"Close"})]}),e.jsx(Ae,{budgetId:U.budget_id})]})}):null,e.jsx(fe,{isOpen:A,onOpenChange:C,heading:"Delete budgets",body:`Delete ${_.length} ${_.length===1?"budget":"budgets"}? Users on ${_.length===1?"it":"them"} will no longer be capped.`,confirmLabel:"Delete",isPending:J,error:X,onConfirm:ee})]})}export{Te as BudgetsPage}; diff --git a/src/gateway/static/dashboard/assets/ConfirmDialog-BXAKoq6j.js b/src/gateway/static/dashboard/assets/ConfirmDialog-NCJIhH2z.js similarity index 92% rename from src/gateway/static/dashboard/assets/ConfirmDialog-BXAKoq6j.js rename to src/gateway/static/dashboard/assets/ConfirmDialog-NCJIhH2z.js index 62bab615c..54531e12a 100644 --- a/src/gateway/static/dashboard/assets/ConfirmDialog-BXAKoq6j.js +++ b/src/gateway/static/dashboard/assets/ConfirmDialog-NCJIhH2z.js @@ -1 +1 @@ -import{j as r}from"./tanstack-query-1t81HyiD.js";import{E as j}from"./index-BCvb90M0.js";import{A as e,B as l}from"./heroui-BI50yK5B.js";function p({isOpen:s,onOpenChange:a,heading:n,body:o,confirmLabel:t,confirmVariant:c="danger",isPending:i,error:d,onConfirm:x}){return r.jsx(e,{isOpen:s,onOpenChange:a,children:s?r.jsx(e.Backdrop,{children:r.jsx(e.Container,{placement:"center",size:"md",children:r.jsxs(e.Dialog,{children:[r.jsx(e.Header,{children:r.jsx(e.Heading,{children:n})}),r.jsxs(e.Body,{className:"flex flex-col gap-4",children:[r.jsx("div",{className:"text-sm text-[var(--otari-muted)]",children:o}),r.jsx(j,{error:d})]}),r.jsxs(e.Footer,{children:[r.jsx(l,{variant:"ghost",isDisabled:i,onPress:()=>a(!1),children:"Cancel"}),r.jsx(l,{variant:c,isPending:i,onPress:x,children:t})]})]})})}):null})}export{p as C}; +import{j as r}from"./tanstack-query-1t81HyiD.js";import{E as j}from"./index-DsUY4UvK.js";import{A as e,B as l}from"./heroui-BI50yK5B.js";function p({isOpen:s,onOpenChange:a,heading:n,body:o,confirmLabel:t,confirmVariant:c="danger",isPending:i,error:d,onConfirm:x}){return r.jsx(e,{isOpen:s,onOpenChange:a,children:s?r.jsx(e.Backdrop,{children:r.jsx(e.Container,{placement:"center",size:"md",children:r.jsxs(e.Dialog,{children:[r.jsx(e.Header,{children:r.jsx(e.Heading,{children:n})}),r.jsxs(e.Body,{className:"flex flex-col gap-4",children:[r.jsx("div",{className:"text-sm text-[var(--otari-muted)]",children:o}),r.jsx(j,{error:d})]}),r.jsxs(e.Footer,{children:[r.jsx(l,{variant:"ghost",isDisabled:i,onPress:()=>a(!1),children:"Cancel"}),r.jsx(l,{variant:c,isPending:i,onPress:x,children:t})]})]})})}):null})}export{p as C}; diff --git a/src/gateway/static/dashboard/assets/DocsPage-xJDqWRaA.js b/src/gateway/static/dashboard/assets/DocsPage-LBlDxv2S.js similarity index 99% rename from src/gateway/static/dashboard/assets/DocsPage-xJDqWRaA.js rename to src/gateway/static/dashboard/assets/DocsPage-LBlDxv2S.js index f802cc969..5d9136b48 100644 --- a/src/gateway/static/dashboard/assets/DocsPage-xJDqWRaA.js +++ b/src/gateway/static/dashboard/assets/DocsPage-LBlDxv2S.js @@ -1,4 +1,4 @@ -import{j as re}from"./tanstack-query-1t81HyiD.js";import{P as gi}from"./index-BCvb90M0.js";import{d as ct}from"./heroui-BI50yK5B.js";import{g as nr}from"./react-dgEcD0HR.js";function yi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi={};function ht(e,t){return(bi.jsx?xi:ki).test(e)}const wi=/[ \t\n\f\r]/g;function Si(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(wi,"")===""}class Ke{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function tr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ke(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ci=0;const L=Te(),Y=Te(),Dn=Te(),E=Te(),$=Te(),Ie=Te(),te=Te();function Te(){return 2**++Ci}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:Ie,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ai.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Di);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Ti,zi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function zi(e){return"-"+e.toLowerCase()}function Di(e){return e.charAt(1).toUpperCase()}const Li=tr([rr,Ei,or,ar,sr],"html"),qn=tr([rr,Ii,or,ar,sr],"svg");function _i(e){return e.join(" ").trim()}var De={},mn,dt;function Ri(){if(dt)return mn;dt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=` +import{j as re}from"./tanstack-query-1t81HyiD.js";import{P as gi}from"./index-DsUY4UvK.js";import{d as ct}from"./heroui-BI50yK5B.js";import{g as nr}from"./react-dgEcD0HR.js";function yi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi={};function ht(e,t){return(bi.jsx?xi:ki).test(e)}const wi=/[ \t\n\f\r]/g;function Si(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(wi,"")===""}class Ke{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function tr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ke(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ci=0;const L=Te(),Y=Te(),Dn=Te(),E=Te(),$=Te(),Ie=Te(),te=Te();function Te(){return 2**++Ci}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:Ie,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ai.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Di);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Ti,zi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function zi(e){return"-"+e.toLowerCase()}function Di(e){return e.charAt(1).toUpperCase()}const Li=tr([rr,Ei,or,ar,sr],"html"),qn=tr([rr,Ii,or,ar,sr],"svg");function _i(e){return e.join(" ").trim()}var De={},mn,dt;function Ri(){if(dt)return mn;dt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=` `,u="/",h="*",c="",p="comment",f="declaration";function g(S,y){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];y=y||{};var I=1,C=1;function R(D){var T=D.match(t);T&&(I+=T.length);var U=D.lastIndexOf(s);C=~U?D.length-U:C+D.length}function F(){var D={line:I,column:C};return function(T){return T.position=new b(D),j(),T}}function b(D){this.start=D,this.end={line:I,column:C},this.source=y.source}b.prototype.content=S;function M(D){var T=new Error(y.source+":"+I+":"+C+": "+D);if(T.reason=D,T.filename=y.source,T.line=I,T.column=C,T.source=S,!y.silent)throw T}function H(D){var T=D.exec(S);if(T){var U=T[0];return R(U),S=S.slice(U.length),T}}function j(){H(n)}function k(D){var T;for(D=D||[];T=A();)T!==!1&&D.push(T);return D}function A(){var D=F();if(!(u!=S.charAt(0)||h!=S.charAt(1))){for(var T=2;c!=S.charAt(T)&&(h!=S.charAt(T)||u!=S.charAt(T+1));)++T;if(T+=2,c===S.charAt(T-1))return M("End of comment missing");var U=S.slice(2,T-2);return C+=2,R(U),S=S.slice(T),C+=2,D({type:p,comment:U})}}function P(){var D=F(),T=H(r);if(T){if(A(),!H(i))return M("property missing ':'");var U=H(o),K=D({type:f,property:w(T[0].replace(e,c)),value:U?w(U[0].replace(e,c)):c});return H(l),K}}function q(){var D=[];k(D);for(var T;T=P();)T!==!1&&(D.push(T),k(D));return D}return j(),q()}function w(S){return S?S.replace(a,c):c}return mn=g,mn}var gt;function Fi(){if(gt)return De;gt=1;var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(De,"__esModule",{value:!0}),De.default=n;const t=e(Ri());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),a=typeof i=="function";return l.forEach(s=>{if(s.type!=="declaration")return;const{property:u,value:h}=s;a?i(u,h,s):h&&(o=o||{},o[u]=h)}),o}return De}var Be={},yt;function Oi(){if(yt)return Be;yt=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(u){return!u||n.test(u)||e.test(u)},l=function(u,h){return h.toUpperCase()},a=function(u,h){return"".concat(h,"-")},s=function(u,h){return h===void 0&&(h={}),o(u)?u:(u=u.toLowerCase(),h.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(t,l))};return Be.camelCase=s,Be}var je,kt;function Mi(){if(kt)return je;kt=1;var e=je&&je.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Fi()),n=Oi();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(a,s){a&&s&&(l[(0,n.camelCase)(a,o)]=s)}),l}return r.default=r,je=r,je}var Ni=Mi();const Bi=nr(Ni),ur=cr("end"),Un=cr("start");function cr(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ji(e){const t=Un(e),n=ur(e);if(t&&n)return{start:t,end:n}}function Ue(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xt(e.position):"start"in e||"end"in e?xt(e):"line"in e||"column"in e?_n(e):""}function _n(e){return bt(e&&e.line)+":"+bt(e&&e.column)}function xt(e){return _n(e&&e.start)+"-"+_n(e&&e.end)}function bt(e){return e&&typeof e=="number"?e:1}class G extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?o.ruleId=r:(o.source=r.slice(0,s),o.ruleId=r.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){const s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ue(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}G.prototype.file="";G.prototype.name="";G.prototype.reason="";G.prototype.message="";G.prototype.stack="";G.prototype.column=void 0;G.prototype.line=void 0;G.prototype.ancestors=void 0;G.prototype.cause=void 0;G.prototype.fatal=void 0;G.prototype.place=void 0;G.prototype.ruleId=void 0;G.prototype.source=void 0;const Vn={}.hasOwnProperty,Hi=new Map,qi=/[A-Z]/g,Ui=new Set(["table","tbody","thead","tfoot","tr"]),Vi=new Set(["td","th"]),hr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $i(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Zi(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ji(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qn:Li,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=fr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function fr(e,t,n){if(t.type==="element")return Wi(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Yi(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Qi(e,t,n);if(t.type==="mdxjsEsm")return Ki(e,t);if(t.type==="root")return Xi(e,t,n);if(t.type==="text")return Gi(e,t)}function Wi(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=qn,e.schema=i),e.ancestors.push(t);const o=mr(e,t.tagName,!1),l=el(e,t);let a=Wn(e,t);return Ui.has(t.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!Si(s):!0})),pr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Yi(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}We(e,t.position)}function Ki(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);We(e,t.position)}function Qi(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=qn,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:mr(e,t.name,!0),l=nl(e,t),a=Wn(e,t);return pr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Xi(e,t,n){const r={};return $n(r,Wn(e,t)),e.create(t,e.Fragment,r,n)}function Gi(e,t){return t.value}function pr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $n(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ji(e,t,n){return r;function r(i,o,l,a){const u=Array.isArray(l.children)?n:t;return a?u(o,l,a):u(o,l)}}function Zi(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),s=Un(r);return t(i,o,l,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function el(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Vn.call(t.properties,i)){const o=tl(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&Vi.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function nl(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else We(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else We(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Wn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Hi;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(ie(e,e.length,0,t),e):t}const Ct={}.hasOwnProperty;function gr(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ce(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const J=be(/[A-Za-z]/),X=be(/[\dA-Za-z]/),hl=be(/[#-'*+\--9=?A-Z^-~]/);function rn(e){return e!==null&&(e<32||e===127)}const Rn=be(/\d/),fl=be(/[\dA-Fa-f]/),pl=be(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function W(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}const sn=be(new RegExp("\\p{P}|\\p{S}","u")),ve=be(/\s/);function be(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fe(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function B(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(s){return O(s)?(e.enter(n),a(s)):t(s)}function a(s){return O(s)&&o++l))return;const M=t.events.length;let H=M,j,k;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(j){k=t.events[H][1].end;break}j=!0}for(y(r),b=M;bC;){const F=n[R];t.containerState=F[1],F[0].exit.call(t,e)}n.length=C}function I(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function kl(e,t,n){return B(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _e(e){if(e===null||W(e)||ve(e))return 1;if(sn(e))return 2}function un(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};It(c,-s),It(p,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:s>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=le(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=le(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=le(u,un(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=le(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,u=le(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,ie(e,r-1,n-r+3,u),n=r+u.length-h-2;break}}for(n=-1;++n0&&O(b)?B(e,I,"linePrefix",o+1)(b):I(b)}function I(b){return b===null||z(b)?e.check(vt,w,R)(b):(e.enter("codeFlowValue"),C(b))}function C(b){return b===null||z(b)?(e.exit("codeFlowValue"),I(b)):(e.consume(b),C)}function R(b){return e.exit("codeFenced"),t(b)}function F(b,M,H){let j=0;return k;function k(T){return b.enter("lineEnding"),b.consume(T),b.exit("lineEnding"),A}function A(T){return b.enter("codeFencedFence"),O(T)?B(b,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):P(T)}function P(T){return T===a?(b.enter("codeFencedFenceSequence"),q(T)):H(T)}function q(T){return T===a?(j++,b.consume(T),q):j>=l?(b.exit("codeFencedFenceSequence"),O(T)?B(b,D,"whitespace")(T):D(T)):H(T)}function D(T){return T===null||z(T)?(b.exit("codeFencedFence"),M(T)):H(T)}}}function zl(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const gn={name:"codeIndented",tokenize:Ll},Dl={partial:!0,tokenize:_l};function Ll(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),B(e,o,"linePrefix",5)(u)}function o(u){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?s(u):z(u)?e.attempt(Dl,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||z(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),t(u)}}function _l(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):B(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):z(l)?i(l):n(l)}}const Rl={name:"codeText",previous:Ol,resolve:Fl,tokenize:Ml};function Fl(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&He(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),He(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),He(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Sr(e,t,n,r,i,o,l,a,s){const u=s||Number.POSITIVE_INFINITY;let h=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||rn(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||z(y)?n(y):(e.consume(y),y===92?g:f)}function g(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function w(y){return!h&&(y===null||y===41||W(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):h999||f===null||f===91||f===93&&!s||f===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===null||f===91||f===93||z(f)||a++>999?(e.exit("chunkString"),h(f)):(e.consume(f),s||(s=!O(f)),f===92?p:c)}function p(f){return f===91||f===92||f===93?(e.consume(f),a++,c):c(f)}}function Er(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,s):n(p)}function s(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),s(l)):p===null?n(p):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),B(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===l||p===null||z(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:h)}function c(p){return p===l||p===92?(e.consume(p),h):h(p)}}function Ve(e,t){let n;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):O(i)?B(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const $l={name:"definition",tokenize:Yl},Wl={partial:!0,tokenize:Kl};function Yl(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),l(f)}function l(f){return Cr.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=ce(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),s):n(f)}function s(f){return W(f)?Ve(e,u)(f):u(f)}function u(f){return Sr(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function h(f){return e.attempt(Wl,c,c)(f)}function c(f){return O(f)?B(e,p,"whitespace")(f):p(f)}function p(f){return f===null||z(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function Kl(e,t,n){return r;function r(a){return W(a)?Ve(e,i)(a):n(a)}function i(a){return Er(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return O(a)?B(e,l,"whitespace")(a):l(a)}function l(a){return a===null||z(a)?t(a):n(a)}}const Ql={name:"hardBreakEscape",tokenize:Xl};function Xl(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return z(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Gl={name:"headingAtx",resolve:Jl,tokenize:Zl};function Jl(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ie(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Zl(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),o(h)}function o(h){return e.enter("atxHeadingSequence"),l(h)}function l(h){return h===35&&r++<6?(e.consume(h),l):h===null||W(h)?(e.exit("atxHeadingSequence"),a(h)):n(h)}function a(h){return h===35?(e.enter("atxHeadingSequence"),s(h)):h===null||z(h)?(e.exit("atxHeading"),t(h)):O(h)?B(e,a,"whitespace")(h):(e.enter("atxHeadingText"),u(h))}function s(h){return h===35?(e.consume(h),s):(e.exit("atxHeadingSequence"),a(h))}function u(h){return h===null||h===35||W(h)?(e.exit("atxHeadingText"),a(h)):(e.consume(h),u)}}const eo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],At=["pre","script","style","textarea"],no={concrete:!0,name:"htmlFlow",resolveTo:io,tokenize:lo},to={partial:!0,tokenize:ao},ro={partial:!0,tokenize:oo};function io(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function lo(e,t,n){const r=this;let i,o,l,a,s;return u;function u(d){return h(d)}function h(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,w):d===63?(e.consume(d),i=3,r.interrupt?t:m):J(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function p(d){return d===45?(e.consume(d),i=2,f):d===91?(e.consume(d),i=5,a=0,g):J(d)?(e.consume(d),i=4,r.interrupt?t:m):n(d)}function f(d){return d===45?(e.consume(d),r.interrupt?t:m):n(d)}function g(d){const se="CDATA[";return d===se.charCodeAt(a++)?(e.consume(d),a===se.length?r.interrupt?t:P:g):n(d)}function w(d){return J(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function S(d){if(d===null||d===47||d===62||W(d)){const se=d===47,we=l.toLowerCase();return!se&&!o&&At.includes(we)?(i=1,r.interrupt?t(d):P(d)):eo.includes(l.toLowerCase())?(i=6,se?(e.consume(d),y):r.interrupt?t(d):P(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(d):o?I(d):C(d))}return d===45||X(d)?(e.consume(d),l+=String.fromCharCode(d),S):n(d)}function y(d){return d===62?(e.consume(d),r.interrupt?t:P):n(d)}function I(d){return O(d)?(e.consume(d),I):k(d)}function C(d){return d===47?(e.consume(d),k):d===58||d===95||J(d)?(e.consume(d),R):O(d)?(e.consume(d),C):k(d)}function R(d){return d===45||d===46||d===58||d===95||X(d)?(e.consume(d),R):F(d)}function F(d){return d===61?(e.consume(d),b):O(d)?(e.consume(d),F):C(d)}function b(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),s=d,M):O(d)?(e.consume(d),b):H(d)}function M(d){return d===s?(e.consume(d),s=null,j):d===null||z(d)?n(d):(e.consume(d),M)}function H(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||W(d)?F(d):(e.consume(d),H)}function j(d){return d===47||d===62||O(d)?C(d):n(d)}function k(d){return d===62?(e.consume(d),A):n(d)}function A(d){return d===null||z(d)?P(d):O(d)?(e.consume(d),A):n(d)}function P(d){return d===45&&i===2?(e.consume(d),U):d===60&&i===1?(e.consume(d),K):d===62&&i===4?(e.consume(d),ae):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),pe):z(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(to,me,q)(d)):d===null||z(d)?(e.exit("htmlFlowData"),q(d)):(e.consume(d),P)}function q(d){return e.check(ro,D,me)(d)}function D(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),T}function T(d){return d===null||z(d)?q(d):(e.enter("htmlFlowData"),P(d))}function U(d){return d===45?(e.consume(d),m):P(d)}function K(d){return d===47?(e.consume(d),l="",oe):P(d)}function oe(d){if(d===62){const se=l.toLowerCase();return At.includes(se)?(e.consume(d),ae):P(d)}return J(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),oe):P(d)}function pe(d){return d===93?(e.consume(d),m):P(d)}function m(d){return d===62?(e.consume(d),ae):d===45&&i===2?(e.consume(d),m):P(d)}function ae(d){return d===null||z(d)?(e.exit("htmlFlowData"),me(d)):(e.consume(d),ae)}function me(d){return e.exit("htmlFlow"),t(d)}}function oo(e,t,n){const r=this;return i;function i(l){return z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ao(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Qe,t,n)}}const so={name:"htmlText",tokenize:uo};function uo(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),s}function s(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),F):m===63?(e.consume(m),C):J(m)?(e.consume(m),H):n(m)}function u(m){return m===45?(e.consume(m),h):m===91?(e.consume(m),o=0,g):J(m)?(e.consume(m),I):n(m)}function h(m){return m===45?(e.consume(m),f):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):z(m)?(l=c,K(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),f):c(m)}function f(m){return m===62?U(m):m===45?p(m):c(m)}function g(m){const ae="CDATA[";return m===ae.charCodeAt(o++)?(e.consume(m),o===ae.length?w:g):n(m)}function w(m){return m===null?n(m):m===93?(e.consume(m),S):z(m)?(l=w,K(m)):(e.consume(m),w)}function S(m){return m===93?(e.consume(m),y):w(m)}function y(m){return m===62?U(m):m===93?(e.consume(m),y):w(m)}function I(m){return m===null||m===62?U(m):z(m)?(l=I,K(m)):(e.consume(m),I)}function C(m){return m===null?n(m):m===63?(e.consume(m),R):z(m)?(l=C,K(m)):(e.consume(m),C)}function R(m){return m===62?U(m):C(m)}function F(m){return J(m)?(e.consume(m),b):n(m)}function b(m){return m===45||X(m)?(e.consume(m),b):M(m)}function M(m){return z(m)?(l=M,K(m)):O(m)?(e.consume(m),M):U(m)}function H(m){return m===45||X(m)?(e.consume(m),H):m===47||m===62||W(m)?j(m):n(m)}function j(m){return m===47?(e.consume(m),U):m===58||m===95||J(m)?(e.consume(m),k):z(m)?(l=j,K(m)):O(m)?(e.consume(m),j):U(m)}function k(m){return m===45||m===46||m===58||m===95||X(m)?(e.consume(m),k):A(m)}function A(m){return m===61?(e.consume(m),P):z(m)?(l=A,K(m)):O(m)?(e.consume(m),A):j(m)}function P(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,q):z(m)?(l=P,K(m)):O(m)?(e.consume(m),P):(e.consume(m),D)}function q(m){return m===i?(e.consume(m),i=void 0,T):m===null?n(m):z(m)?(l=q,K(m)):(e.consume(m),q)}function D(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||W(m)?j(m):(e.consume(m),D)}function T(m){return m===47||m===62||W(m)?j(m):n(m)}function U(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function K(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),oe}function oe(m){return O(m)?B(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):pe(m)}function pe(m){return e.enter("htmlTextData"),l(m)}}const Qn={name:"labelEnd",resolveAll:po,resolveTo:mo,tokenize:go},co={tokenize:yo},ho={tokenize:ko},fo={tokenize:xo};function po(e){let t=-1;const n=[];for(;++t=3&&(u===null||z(u))?(e.exit("thematicBreak"),t(u)):n(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),O(u)?B(e,a,"whitespace")(u):a(u))}}const Z={continuation:{tokenize:Po},exit:Do,name:"list",tokenize:Ao},vo={partial:!0,tokenize:Lo},To={partial:!0,tokenize:zo};function Ao(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(f){const g=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Rn(f)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(tn,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(f)}return n(f)}function s(f){return Rn(f)&&++l<10?(e.consume(f),s):(!r.interrupt||l<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Qe,r.interrupt?n:h,e.attempt(vo,p,c))}function h(f){return r.containerState.initialBlankLine=!0,o++,p(f)}function c(f){return O(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Po(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Qe,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,B(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!O(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(To,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,B(e,e.attempt(Z,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function zo(e,t,n){const r=this;return B(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function Do(e){e.exit(this.containerState.type)}function Lo(e,t,n){const r=this;return B(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!O(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Pt={name:"setextUnderline",resolveTo:_o,tokenize:Ro};function _o(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Ro(e,t,n){const r=this;let i;return o;function o(u){let h=r.events.length,c;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){c=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),O(u)?B(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||z(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Fo={tokenize:Oo};function Oo(e){const t=this,n=e.attempt(Qe,r,e.attempt(this.parser.constructs.flowInitial,i,B(e,e.attempt(this.parser.constructs.flow,i,e.attempt(jl,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Mo={resolveAll:vr()},No=Ir("string"),Bo=Ir("text");function Ir(e){return{resolveAll:vr(e==="text"?jo:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(h){return u(h)?o(h):a(h)}function a(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),s}function s(h){return u(h)?(n.exit("data"),o(h)):(n.consume(h),s)}function u(h){if(h===null)return!0;const c=i[h];let p=-1;if(c)for(;++p-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Zo(e,t){let n=-1;const r=[];let i;for(;++n0){const ue=_.tokenStack[_.tokenStack.length-1];(ue[1]||Dt).call(_,void 0,ue[0])}for(v.position={start:xe(x.length>0?x[0][1].start:{line:1,column:1,offset:0}),end:xe(x.length>0?x[x.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++Ve.bucketStart),X=x.map(e=>({x:e.bucketStart,requests:e.requests})),r=x.length,H=oe(C,S),z=()=>{if(r===0)return[0,1];const{startIndex:e,endIndex:s}=ce(w,C,S);return[e,s+1]},[T,Z]=p.useState(z),y=p.useRef(T),v=e=>{y.current=e,Z(e)},N=p.useRef(!1);p.useEffect(()=>{N.current||v(z())},[C,S,r,w[0],w[r-1]]);const b=([e,s])=>{if(N.current=!1,r===0)return;const i=Math.max(0,Math.min(r-1,Math.floor(e+1e-6))),a=Math.max(i,Math.min(r-1,Math.ceil(s-1e-6)-1));if(i===0&&a===r-1){j(),v([0,r]);return}const n=de(w,i,a,l);n&&g(n.startIso,n.endIso)},k=o.findIndex(e=>e.key===m),B=k>=0?o[k].seconds:r*le(l)/1e3,A=k>=0?o[k+1]:o.find(e=>e.seconds===null||B!==null&&e.seconds>B),[d,u]=T,P=d<=.01&&u>=r-.01,L=e=>{const s=Math.max(1,Math.min(r,e)),i=(d+u)/2;let a=i-s/2,n=i+s/2;a<0&&(n-=a,a=0),n>r&&(a-=n-r,n=r);const f=[Math.max(0,a),Math.min(r,n)];v(f),b(f)},V=()=>{if(P){A&&c(A);return}L((u-d)*2)},G=()=>L((u-d)/2),J=(e,s)=>{const[i,a]=y.current,n=e===0?[Math.max(0,Math.min(a-1,Math.round(i)+s)),a]:[i,Math.min(r,Math.max(i+1,Math.round(a)+s))];v(n),b(n)},Q=e=>{var n,f;const s=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:0;if(s===0)return;const i=(f=(n=e.target).getAttribute)==null?void 0:f.call(n,"aria-label"),a=F.indexOf(i);a<0||(e.preventDefault(),e.stopPropagation(),J(a,s))},R=p.useRef(null),h=p.useRef(null),Y=e=>{if(!h.current||!R.current)return;const s=R.current.getBoundingClientRect().width;if(s<=0)return;const i=(e.clientX-h.current.x)/s*r,a=h.current.sel[1]-h.current.sel[0],n=Math.max(0,Math.min(r-a,h.current.sel[0]+i));v([n,n+a])},ee=e=>{const[s,i]=y.current,a=i-s,n=Math.max(0,Math.min(r-a,Math.round(s)+e)),f=[n,n+a];v(f),b(f)},te=e=>{if(P)return;const[s,i]=y.current,a=Math.max(1,Math.round(i-s)),n=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:e.key==="PageUp"?a:e.key==="PageDown"?-a:e.key==="Home"?-r:e.key==="End"?r:0;n!==0&&(e.preventDefault(),ee(n))},I=r?Math.min(d,u)/r*100:0,E=r?Math.max(d,u)/r*100:100,D=!P,re=Math.max(1,Math.round(u-d)),U=Math.max(0,r-re),q=Math.min(Math.max(0,Math.round(Math.min(d,u))),U);return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.map(e=>t.jsx(M,{size:"sm",variant:m===e.key?"primary":"outline",onPress:()=>c(e),children:e.label},e.key)),t.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[t.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",H," · UTC"]}),O]})]}),t.jsxs("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-2",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[t.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:["Requests / ",l==="hour"?"hour":"day"]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"hidden text-[11px] text-[var(--otari-muted)] sm:inline",children:"drag the edges to zoom · the bottom strip to pan"}),t.jsx(M,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom in",isDisabled:r===0,onPress:G,children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:t.jsx("path",{d:"M12 5v14M5 12h14",strokeLinecap:"round"})})}),t.jsx(M,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom out",isDisabled:r===0||P&&!A,onPress:V,children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:t.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})})}),D?t.jsx(M,{size:"sm",variant:"ghost",onPress:()=>b([0,r]),children:"Reset"}):null]})]}),K&&r===0?t.jsx("div",{className:"flex h-[90px] items-center justify-center",children:t.jsx(ae,{size:"sm"})}):r===0?t.jsx("div",{className:"flex h-[90px] items-center justify-center text-xs text-[var(--otari-muted)]",children:"No activity in this range."}):t.jsxs("div",{ref:R,className:"relative w-full",children:[t.jsx("div",{role:"img","aria-label":_,className:"w-full touch-pan-y select-none",children:t.jsx(ue,{width:"100%",height:90,children:t.jsxs(me,{data:X,margin:{top:4,right:0,left:0,bottom:0},children:[t.jsx(xe,{dataKey:"x",tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:40,tickFormatter:e=>$(e,l),tick:{fontSize:10,fill:"var(--otari-muted)"}}),t.jsx(he,{cursor:{fill:"var(--otari-line)",opacity:.35},content:t.jsx(be,{bucket:l})}),t.jsx(fe,{dataKey:"requests",fill:pe,radius:[2,2,0,0],isAnimationActive:!1})]})})}),D?t.jsxs(t.Fragment,{children:[t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-0 bg-[var(--otari-bg)] opacity-70",style:{width:`${I}%`}}),t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 right-0 bg-[var(--otari-bg)] opacity-70",style:{width:`${100-E}%`}})]}):null,t.jsx("div",{role:"slider","aria-label":"Pan the selected window","aria-valuemin":0,"aria-valuemax":U,"aria-valuenow":q,"aria-valuetext":`Window starting at ${$(w[Math.min(q,r-1)]??w[0],l)}`,"aria-disabled":!D,tabIndex:0,className:"absolute bottom-0 z-[1] cursor-grab touch-none rounded bg-[var(--otari-brand)]/10 outline-none hover:bg-[var(--otari-brand)]/20 focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)] active:cursor-grabbing",style:{left:`${I}%`,width:`${Math.max(0,E-I)}%`,height:ve},onKeyDown:te,onPointerDown:e=>{e.stopPropagation(),e.preventDefault(),N.current=!0,h.current={x:e.clientX,sel:[Math.min(d,u),Math.max(d,u)]},e.currentTarget.setPointerCapture(e.pointerId)},onPointerMove:Y,onPointerUp:e=>{e.currentTarget.releasePointerCapture(e.pointerId),h.current=null,b(y.current)},onPointerCancel:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),h.current=null,b(y.current)}}),t.jsx("div",{className:"pointer-events-none absolute inset-0 z-[2]",onKeyDownCapture:Q,children:t.jsx(ne,{"aria-label":"Selected time range",minValue:0,maxValue:r,step:1/ge,value:T,onChange:e=>{N.current=!0,Array.isArray(e)&&e.length===2&&v([e[0],e[1]])},onChangeEnd:e=>{Array.isArray(e)&&e.length===2&&b([e[0],e[1]])},className:"pointer-events-none h-full w-full",children:t.jsxs(se,{className:"pointer-events-none relative h-full w-full",children:[t.jsx(W,{index:0}),t.jsx(W,{index:1})]})})})]})]})]})}function Ce({chips:o,children:m,onClearAll:c}){const[g,j]=p.useState(!1),x=p.useId();return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(M,{size:"sm",variant:"outline",onPress:()=>j(l=>!l),"aria-expanded":g,"aria-controls":x,children:g?"Done":"Add filter"}),o.map(l=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] py-0.5 pl-2.5 pr-1 text-xs text-[var(--otari-brand-dark)]",children:[t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[l.label,":"]}),t.jsx("span",{className:"font-medium",children:l.value}),t.jsx("button",{type:"button",onClick:l.onClear,"aria-label":`Remove ${l.label} filter`,className:"ml-0.5 inline-flex h-4 w-4 items-center justify-center rounded-full text-[var(--otari-muted)] outline-none hover:bg-[var(--otari-line)] hover:text-[var(--otari-ink)] focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)]",children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"h-3 w-3","aria-hidden":"true",children:t.jsx("path",{d:"M6 6l12 12M18 6L6 18",strokeLinecap:"round"})})})]},l.key)),o.length>0&&c?t.jsx(M,{size:"sm",variant:"ghost",onPress:c,children:"Clear all"}):null]}),t.jsx("div",{id:x,className:g?"flex flex-wrap items-end gap-3":"hidden",children:m})]})}export{Pe as A,Ce as F}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as p}from"./react-dgEcD0HR.js";import{B as M,S as ae,$ as ne,h as se,i as ie}from"./heroui-BI50yK5B.js";import{an as oe,ao as le,ap as ce,aq as de}from"./index-DsUY4UvK.js";import{R as ue,B as me,X as xe,T as he,a as fe}from"./recharts-C4kRDmvS.js";const pe="var(--otari-brand)",ge=10,ve=22;function $(o,m){const c=new Date(o);return Number.isNaN(c.getTime())?o:m==="hour"?c.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):c.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function be({active:o,label:m,payload:c,bucket:g}){var x;const j=(x=c==null?void 0:c[0])==null?void 0:x.value;return!o||typeof j!="number"||typeof m!="string"?null:t.jsxs("div",{className:"rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-xs shadow-sm",children:[t.jsxs("div",{className:"text-[var(--otari-muted)]",children:[$(m,g)," · UTC"]}),t.jsxs("div",{className:"font-medium tabular-nums text-[var(--otari-ink)]",children:[j.toLocaleString()," requests"]})]})}const je="group top-1/2 h-full w-3 cursor-ew-resize outline-none",F=["Window start","Window end"];function W({index:o}){return t.jsxs(ie,{index:o,"aria-label":F[o],className:`${je} pointer-events-auto`,children:[t.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-1/2 w-0.5 -translate-x-1/2 bg-[var(--otari-brand)]"}),t.jsx("span",{"aria-hidden":!0,className:"absolute left-1/2 top-1/2 h-6 w-2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-surface)] shadow-sm group-focus-visible:ring-2 group-focus-visible:ring-[var(--otari-brand)]"})]})}function Pe({presets:o,extentKey:m,onPreset:c,onSelectRange:g,onSelectFull:j,series:x,bucket:l,windowStart:C,windowEnd:S,loading:K=!1,ariaLabel:_="Request volume over the selected window",action:O}){const w=x.map(e=>e.bucketStart),X=x.map(e=>({x:e.bucketStart,requests:e.requests})),r=x.length,H=oe(C,S),z=()=>{if(r===0)return[0,1];const{startIndex:e,endIndex:s}=ce(w,C,S);return[e,s+1]},[T,Z]=p.useState(z),y=p.useRef(T),v=e=>{y.current=e,Z(e)},N=p.useRef(!1);p.useEffect(()=>{N.current||v(z())},[C,S,r,w[0],w[r-1]]);const b=([e,s])=>{if(N.current=!1,r===0)return;const i=Math.max(0,Math.min(r-1,Math.floor(e+1e-6))),a=Math.max(i,Math.min(r-1,Math.ceil(s-1e-6)-1));if(i===0&&a===r-1){j(),v([0,r]);return}const n=de(w,i,a,l);n&&g(n.startIso,n.endIso)},k=o.findIndex(e=>e.key===m),B=k>=0?o[k].seconds:r*le(l)/1e3,A=k>=0?o[k+1]:o.find(e=>e.seconds===null||B!==null&&e.seconds>B),[d,u]=T,P=d<=.01&&u>=r-.01,L=e=>{const s=Math.max(1,Math.min(r,e)),i=(d+u)/2;let a=i-s/2,n=i+s/2;a<0&&(n-=a,a=0),n>r&&(a-=n-r,n=r);const f=[Math.max(0,a),Math.min(r,n)];v(f),b(f)},V=()=>{if(P){A&&c(A);return}L((u-d)*2)},G=()=>L((u-d)/2),J=(e,s)=>{const[i,a]=y.current,n=e===0?[Math.max(0,Math.min(a-1,Math.round(i)+s)),a]:[i,Math.min(r,Math.max(i+1,Math.round(a)+s))];v(n),b(n)},Q=e=>{var n,f;const s=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:0;if(s===0)return;const i=(f=(n=e.target).getAttribute)==null?void 0:f.call(n,"aria-label"),a=F.indexOf(i);a<0||(e.preventDefault(),e.stopPropagation(),J(a,s))},R=p.useRef(null),h=p.useRef(null),Y=e=>{if(!h.current||!R.current)return;const s=R.current.getBoundingClientRect().width;if(s<=0)return;const i=(e.clientX-h.current.x)/s*r,a=h.current.sel[1]-h.current.sel[0],n=Math.max(0,Math.min(r-a,h.current.sel[0]+i));v([n,n+a])},ee=e=>{const[s,i]=y.current,a=i-s,n=Math.max(0,Math.min(r-a,Math.round(s)+e)),f=[n,n+a];v(f),b(f)},te=e=>{if(P)return;const[s,i]=y.current,a=Math.max(1,Math.round(i-s)),n=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:e.key==="PageUp"?a:e.key==="PageDown"?-a:e.key==="Home"?-r:e.key==="End"?r:0;n!==0&&(e.preventDefault(),ee(n))},I=r?Math.min(d,u)/r*100:0,E=r?Math.max(d,u)/r*100:100,D=!P,re=Math.max(1,Math.round(u-d)),U=Math.max(0,r-re),q=Math.min(Math.max(0,Math.round(Math.min(d,u))),U);return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.map(e=>t.jsx(M,{size:"sm",variant:m===e.key?"primary":"outline",onPress:()=>c(e),children:e.label},e.key)),t.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[t.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",H," · UTC"]}),O]})]}),t.jsxs("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-2",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[t.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:["Requests / ",l==="hour"?"hour":"day"]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"hidden text-[11px] text-[var(--otari-muted)] sm:inline",children:"drag the edges to zoom · the bottom strip to pan"}),t.jsx(M,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom in",isDisabled:r===0,onPress:G,children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:t.jsx("path",{d:"M12 5v14M5 12h14",strokeLinecap:"round"})})}),t.jsx(M,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom out",isDisabled:r===0||P&&!A,onPress:V,children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:t.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})})}),D?t.jsx(M,{size:"sm",variant:"ghost",onPress:()=>b([0,r]),children:"Reset"}):null]})]}),K&&r===0?t.jsx("div",{className:"flex h-[90px] items-center justify-center",children:t.jsx(ae,{size:"sm"})}):r===0?t.jsx("div",{className:"flex h-[90px] items-center justify-center text-xs text-[var(--otari-muted)]",children:"No activity in this range."}):t.jsxs("div",{ref:R,className:"relative w-full",children:[t.jsx("div",{role:"img","aria-label":_,className:"w-full touch-pan-y select-none",children:t.jsx(ue,{width:"100%",height:90,children:t.jsxs(me,{data:X,margin:{top:4,right:0,left:0,bottom:0},children:[t.jsx(xe,{dataKey:"x",tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:40,tickFormatter:e=>$(e,l),tick:{fontSize:10,fill:"var(--otari-muted)"}}),t.jsx(he,{cursor:{fill:"var(--otari-line)",opacity:.35},content:t.jsx(be,{bucket:l})}),t.jsx(fe,{dataKey:"requests",fill:pe,radius:[2,2,0,0],isAnimationActive:!1})]})})}),D?t.jsxs(t.Fragment,{children:[t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-0 bg-[var(--otari-bg)] opacity-70",style:{width:`${I}%`}}),t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 right-0 bg-[var(--otari-bg)] opacity-70",style:{width:`${100-E}%`}})]}):null,t.jsx("div",{role:"slider","aria-label":"Pan the selected window","aria-valuemin":0,"aria-valuemax":U,"aria-valuenow":q,"aria-valuetext":`Window starting at ${$(w[Math.min(q,r-1)]??w[0],l)}`,"aria-disabled":!D,tabIndex:0,className:"absolute bottom-0 z-[1] cursor-grab touch-none rounded bg-[var(--otari-brand)]/10 outline-none hover:bg-[var(--otari-brand)]/20 focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)] active:cursor-grabbing",style:{left:`${I}%`,width:`${Math.max(0,E-I)}%`,height:ve},onKeyDown:te,onPointerDown:e=>{e.stopPropagation(),e.preventDefault(),N.current=!0,h.current={x:e.clientX,sel:[Math.min(d,u),Math.max(d,u)]},e.currentTarget.setPointerCapture(e.pointerId)},onPointerMove:Y,onPointerUp:e=>{e.currentTarget.releasePointerCapture(e.pointerId),h.current=null,b(y.current)},onPointerCancel:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),h.current=null,b(y.current)}}),t.jsx("div",{className:"pointer-events-none absolute inset-0 z-[2]",onKeyDownCapture:Q,children:t.jsx(ne,{"aria-label":"Selected time range",minValue:0,maxValue:r,step:1/ge,value:T,onChange:e=>{N.current=!0,Array.isArray(e)&&e.length===2&&v([e[0],e[1]])},onChangeEnd:e=>{Array.isArray(e)&&e.length===2&&b([e[0],e[1]])},className:"pointer-events-none h-full w-full",children:t.jsxs(se,{className:"pointer-events-none relative h-full w-full",children:[t.jsx(W,{index:0}),t.jsx(W,{index:1})]})})})]})]})]})}function Ce({chips:o,children:m,onClearAll:c}){const[g,j]=p.useState(!1),x=p.useId();return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(M,{size:"sm",variant:"outline",onPress:()=>j(l=>!l),"aria-expanded":g,"aria-controls":x,children:g?"Done":"Add filter"}),o.map(l=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] py-0.5 pl-2.5 pr-1 text-xs text-[var(--otari-brand-dark)]",children:[t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[l.label,":"]}),t.jsx("span",{className:"font-medium",children:l.value}),t.jsx("button",{type:"button",onClick:l.onClear,"aria-label":`Remove ${l.label} filter`,className:"ml-0.5 inline-flex h-4 w-4 items-center justify-center rounded-full text-[var(--otari-muted)] outline-none hover:bg-[var(--otari-line)] hover:text-[var(--otari-ink)] focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)]",children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"h-3 w-3","aria-hidden":"true",children:t.jsx("path",{d:"M6 6l12 12M18 6L6 18",strokeLinecap:"round"})})})]},l.key)),o.length>0&&c?t.jsx(M,{size:"sm",variant:"ghost",onPress:c,children:"Clear all"}):null]}),t.jsx("div",{id:x,className:g?"flex flex-wrap items-end gap-3":"hidden",children:m})]})}export{Pe as A,Ce as F}; diff --git a/src/gateway/static/dashboard/assets/KeysPage-DVB0fG8n.js b/src/gateway/static/dashboard/assets/KeysPage-C7uXJfSL.js similarity index 98% rename from src/gateway/static/dashboard/assets/KeysPage-DVB0fG8n.js rename to src/gateway/static/dashboard/assets/KeysPage-C7uXJfSL.js index 39aa3688f..8761c49ca 100644 --- a/src/gateway/static/dashboard/assets/KeysPage-DVB0fG8n.js +++ b/src/gateway/static/dashboard/assets/KeysPage-C7uXJfSL.js @@ -1,4 +1,4 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{a as J,y as U,z as Q,B as X,P as Z,E as O,w as ee,D as te,u as V,I as se}from"./index-BCvb90M0.js";import{u as ae,r as ne,B as re}from"./tableSelection-9hV37uhu.js";import{C as ie}from"./ConfirmDialog-BXAKoq6j.js";import{D as le}from"./DataTable-Bmn_eYSV.js";import{F as A}from"./Field-Dwp6u3t8.js";import{a as F,M as q}from"./ModelScopeControl-CuclfKO5.js";import{U as oe}from"./UserComboBox-a9wxf8eF.js";import{f as P,B as f,d as D}from"./heroui-BI50yK5B.js";function $(t){if(!t)return"—";const a=new Date(t);return Number.isNaN(a.getTime())?"—":a.toLocaleDateString()}function ce(t){if(!t)return null;const a=new Date(t).getTime();if(Number.isNaN(a))return null;const n=Math.round((a-Date.now())/1e3),r=Math.abs(n),d=[["day",86400],["hour",3600],["minute",60]],o=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[l,x]of d)if(r>=x)return o.format(Math.round(n/x),l);return o.format(n,"second")}function de(t){if(!t.expires_at)return!1;const a=new Date(t.expires_at).getTime();return!Number.isNaN(a)&&aString(r).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}T${n(a.getHours())}:${n(a.getMinutes())}`}const me=t=>(t??"").startsWith("apikey-"),M=t=>t.key_name??t.id,xe=t=>t.id;function K({label:t,value:a,multiline:n=!1,fieldRef:r}){const d=i.useRef(null),o=r??d,[l,x]=i.useState(!1),[g,p]=i.useState(!1),c=async()=>{var m,y,h;(m=o.current)==null||m.focus(),(y=o.current)==null||y.select();try{if((h=navigator.clipboard)!=null&&h.writeText){await navigator.clipboard.writeText(a),x(!0),p(!1),window.setTimeout(()=>x(!1),2e3);return}}catch{}p(!0)},u="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(f,{size:"sm",variant:"outline",onPress:c,children:l?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:o,readOnly:!0,rows:a.split(` +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{a as J,y as U,z as Q,B as X,P as Z,E as O,w as ee,D as te,u as V,I as se}from"./index-DsUY4UvK.js";import{u as ae,r as ne,B as re}from"./tableSelection-9hV37uhu.js";import{C as ie}from"./ConfirmDialog-NCJIhH2z.js";import{D as le}from"./DataTable-Bmn_eYSV.js";import{F as A}from"./Field-Dwp6u3t8.js";import{a as F,M as q}from"./ModelScopeControl-B4eI_pm-.js";import{U as oe}from"./UserComboBox-a9wxf8eF.js";import{f as P,B as f,d as D}from"./heroui-BI50yK5B.js";function $(t){if(!t)return"—";const a=new Date(t);return Number.isNaN(a.getTime())?"—":a.toLocaleDateString()}function ce(t){if(!t)return null;const a=new Date(t).getTime();if(Number.isNaN(a))return null;const n=Math.round((a-Date.now())/1e3),r=Math.abs(n),d=[["day",86400],["hour",3600],["minute",60]],o=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[l,x]of d)if(r>=x)return o.format(Math.round(n/x),l);return o.format(n,"second")}function de(t){if(!t.expires_at)return!1;const a=new Date(t.expires_at).getTime();return!Number.isNaN(a)&&aString(r).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}T${n(a.getHours())}:${n(a.getMinutes())}`}const me=t=>(t??"").startsWith("apikey-"),M=t=>t.key_name??t.id,xe=t=>t.id;function K({label:t,value:a,multiline:n=!1,fieldRef:r}){const d=i.useRef(null),o=r??d,[l,x]=i.useState(!1),[g,p]=i.useState(!1),c=async()=>{var m,y,h;(m=o.current)==null||m.focus(),(y=o.current)==null||y.select();try{if((h=navigator.clipboard)!=null&&h.writeText){await navigator.clipboard.writeText(a),x(!0),p(!1),window.setTimeout(()=>x(!1),2e3);return}}catch{}p(!0)},u="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(f,{size:"sm",variant:"outline",onPress:c,children:l?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:o,readOnly:!0,rows:a.split(` `).length,value:a,onFocus:m=>m.currentTarget.select(),className:`${u} resize-none whitespace-pre`}):e.jsx("input",{ref:o,readOnly:!0,value:a,onFocus:m=>m.currentTarget.select(),className:u}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-green-700",children:l?"Copied to clipboard.":""}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function he({title:t,result:a,onClose:n}){const r=i.useRef(null),d=i.useRef(null),o=typeof window<"u"?window.location.origin:"",l=a.key;i.useEffect(()=>{var c,u;(c=d.current)==null||c.focus(),(u=d.current)==null||u.select()},[]);const x=c=>{var h;if(c.key!=="Tab")return;const u=(h=r.current)==null?void 0:h.querySelectorAll('button, input, textarea, a[href], [tabindex]:not([tabindex="-1"])');if(!u||u.length===0)return;const m=u[0],y=u[u.length-1];c.shiftKey&&document.activeElement===m?(c.preventDefault(),y.focus()):!c.shiftKey&&document.activeElement===y&&(c.preventDefault(),m.focus())},g=[`curl ${o}/v1/chat/completions \\`,` -H "Otari-Key: ${l}" \\`,' -H "Content-Type: application/json" \\',` -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'`].join(` `),p=["from openai import OpenAI","",`client = OpenAI(base_url="${o}/v1", api_key="${l}")`,"resp = client.chat.completions.create(",' model="your-model",',' messages=[{"role": "user", "content": "Hello"}],',")","print(resp.choices[0].message.content)"].join(` `);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:x,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(se,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",F(a.allowed_models).text,"."]}),e.jsx(K,{label:"Secret key",value:l,fieldRef:d}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(K,{label:"curl",value:g,multiline:!0}),e.jsx(K,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(f,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function H({trigger:t,message:a,confirmLabel:n,isPending:r,onConfirm:d}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:a}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(f,{size:"sm",variant:"danger",isDisabled:r,onPress:d,children:n}),e.jsx(f,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(f,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:t})}function W({userId:t,users:a}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const r=a.find(l=>l.user_id===n);if(!r)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:d}=F(r.allowed_models),o=r.allowed_models&&r.allowed_models.length>0?r.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:d.toLowerCase()}),o?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:o}),")"]}):null,". This key inherits that, or narrows within it."]})}function Y({checked:t,onChange:a}){return e.jsxs("label",{className:"flex items-start gap-2 rounded-lg border border-[var(--otari-line)] p-3 text-sm",children:[e.jsx("input",{type:"checkbox",checked:t,onChange:n=>a(n.target.checked),className:"mt-0.5 h-4 w-4 accent-[var(--otari-brand)]","aria-label":"Exempt this key from budget"}),e.jsxs("span",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:"Exempt from budget"}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Requests on this key are logged with their cost but never counted toward the owner's budget or spend, and never blocked by it."})]})]})}function fe({onClose:t,onCreated:a}){const n=te(),r=V(),[d,o]=i.useState(""),[l,x]=i.useState(""),[g,p]=i.useState(!1),[c,u]=i.useState(""),[m,y]=i.useState(null),[h,N]=i.useState(!1),[v,I]=i.useState(!0),C=l!==""&&new Date(l).getTime(){if(n.isPending||!v||w)return;const b={key_name:d.trim()||null,user_id:c.trim(),expires_at:l?new Date(l).toISOString():null,allowed_models:m,exclude_from_budget:h};n.mutate(b,{onSuccess:j=>{a(j),t()}})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(A,{label:"Expires (optional)",value:l,onChange:x,type:"datetime-local",description:C?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(oe,{value:c,onChange:u,users:r.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(b=>!b),children:g?"Hide advanced":"Advanced"}),g?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(W,{userId:c,users:r.data??[]}),e.jsx(q,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(b,j)=>{y(b),I(j)}}),e.jsx(Y,{checked:h,onChange:N})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!v||w,onPress:S,children:n.isPending?"Creating…":"Create key"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ge({apiKey:t,onClose:a}){const n=U(),r=V(),[d,o]=i.useState(t.key_name??""),[l,x]=i.useState(ue(t.expires_at)),[g,p]=i.useState(t.allowed_models),[c,u]=i.useState(t.exclude_from_budget),[m,y]=i.useState(!0),h=()=>{n.isPending||!m||n.mutate({id:t.id,body:{key_name:d.trim()||null,expires_at:l?new Date(l).toISOString():null,allowed_models:g,exclude_from_budget:c}},{onSuccess:a})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot"}),e.jsx(A,{label:"Expires",value:l,onChange:x,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(W,{userId:t.user_id,users:r.data??[]}):null,e.jsx(q,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(N,v)=>{p(N),y(v)}}),e.jsx(Y,{checked:c,onChange:u}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!m,onPress:h,children:n.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function pe({apiKey:t}){return t.is_active?de(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function ye({allowed:t}){const{text:a,tone:n}=F(t),r=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",d=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${r}`,title:d,children:a})}function Ae(){const t=J(),a=U(),n=Q(),r=X(),[d,o]=i.useState(!1),[l,x]=i.useState(null),[g,p]=i.useState(null),c=t.data??[],u=t.isLoading,m=c.find(s=>s.id===l)??null,y=!u&&c.length===0&&!d,h=ae(),[N,v]=i.useState(!1),[I,C]=i.useState(void 0),[w,S]=i.useState(!1),b=c.map(s=>s.id),j=ne(h.selectedKeys,b),E=c.filter(s=>j.includes(s.id)),z=i.useCallback((s,k)=>a.mutate({id:s.id,body:{is_active:k}}),[a.mutate]),L=i.useCallback(s=>n.mutate(s.id,{onSuccess:k=>p({title:`New secret for ${M(s)}`,result:k})}),[n.mutate]),R=async(s,k,T)=>{S(!0),C(void 0);try{for(const B of s)await k(B);h.clear(),T==null||T()}catch(B){C(B)}finally{S(!1)}},G=i.useMemo(()=>[{id:"name",header:"Name",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:s.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx(ye,{allowed:s.allowed_models}),s.exclude_from_budget?e.jsx("span",{className:"inline-flex items-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] px-2 py-0.5 text-xs font-medium text-[var(--otari-brand-dark)]",title:"Requests on this key are logged with cost but never counted toward budget",children:"Budget-exempt"}):null]})]})},{id:"status",header:"Status",cell:s=>e.jsx(pe,{apiKey:s})},{id:"owner",header:"Owner",cell:s=>me(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.user_id??"—"})},{id:"key",header:"Key",cell:s=>e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.key_prefix?`${s.key_prefix}…`:"—"})},{id:"created",header:"Created",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:$(s.created_at)})},{id:"last_used",header:"Last used",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:ce(s.last_used_at)??"never"})},{id:"expires",header:"Expires",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.expires_at?new Date(s.expires_at).toLocaleString():void 0,children:s.expires_at?$(s.expires_at):"never"})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:a.isPending,onPress:()=>z(s,!s.is_active),children:s.is_active?"Disable":"Enable"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{o(!1),x(s.id)},children:"Edit"}),e.jsx(H,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:M(s)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>L(s)}),s.is_active?null:e.jsx(H,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:r.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:M(s)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>r.mutate(s.id)})]})}],[a.isPending,n.isPending,r.isPending,r.mutate,z,L]),_=E.filter(s=>!s.is_active);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:d?null:e.jsx(f,{variant:"primary",onPress:()=>{x(null),o(!0)},children:"Create key"})}),e.jsx(O,{error:t.error??a.error??n.error??r.error}),y?e.jsx(ee,{title:"No API keys yet",description:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe.",actionLabel:"Create your first key",onAction:()=>{x(null),o(!0)}}):null,d?e.jsx(fe,{onClose:()=>o(!1),onCreated:s=>p({title:"API key created",result:s})}):null,m?e.jsx(ge,{apiKey:m,onClose:()=>x(null)},m.id):null,j.length>0?e.jsxs(re,{selectedCount:j.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:h.clear,children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{is_active:!1}})),children:"Disable"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{exclude_from_budget:!0}})),children:"Budget-exempt"}),e.jsx(f,{size:"sm",variant:"danger",isDisabled:_.length===0,onPress:()=>v(!0),children:"Delete"})]}):null,y?null:e.jsx(le,{ariaLabel:"API keys",columns:G,rows:c,getRowKey:xe,isLoading:u,emptyContent:"No API keys yet. Create one to authenticate a caller.",selectionMode:"multiple",selectedKeys:h.selectedKeys,onSelectionChange:h.onSelectionChange}),e.jsx(ie,{isOpen:N,onOpenChange:v,heading:"Delete API keys",body:`Permanently delete ${_.length} disabled ${_.length===1?"key":"keys"}? This removes them and unlinks their usage history. Cannot be undone. Active keys in the selection are skipped; disable them first.`,confirmLabel:"Delete permanently",isPending:w,error:I,onConfirm:()=>void R(_,s=>r.mutateAsync(s.id),()=>v(!1))}),g?e.jsx(he,{title:g.title,result:g.result,onClose:()=>{p(null),n.reset()}}):null]})}export{Ae as KeysPage}; diff --git a/src/gateway/static/dashboard/assets/ModelScopeControl-CuclfKO5.js b/src/gateway/static/dashboard/assets/ModelScopeControl-B4eI_pm-.js similarity index 98% rename from src/gateway/static/dashboard/assets/ModelScopeControl-CuclfKO5.js rename to src/gateway/static/dashboard/assets/ModelScopeControl-B4eI_pm-.js index f3a2039e7..4d2afafac 100644 --- a/src/gateway/static/dashboard/assets/ModelScopeControl-CuclfKO5.js +++ b/src/gateway/static/dashboard/assets/ModelScopeControl-B4eI_pm-.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{T as A,l as $,m as T}from"./index-BCvb90M0.js";import{C as d,I as P,a as R,b as V}from"./heroui-BI50yK5B.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function W({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=T(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(P,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(R,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function X(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{W as M,X as a}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{T as A,l as $,m as T}from"./index-DsUY4UvK.js";import{C as d,I as P,a as R,b as V}from"./heroui-BI50yK5B.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function W({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=T(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(P,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(R,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function X(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{W as M,X as a}; diff --git a/src/gateway/static/dashboard/assets/ModelsPage-D-sOtTsj.js b/src/gateway/static/dashboard/assets/ModelsPage-Dgku-JK2.js similarity index 99% rename from src/gateway/static/dashboard/assets/ModelsPage-D-sOtTsj.js rename to src/gateway/static/dashboard/assets/ModelsPage-Dgku-JK2.js index 5703466f6..65f366341 100644 --- a/src/gateway/static/dashboard/assets/ModelsPage-D-sOtTsj.js +++ b/src/gateway/static/dashboard/assets/ModelsPage-Dgku-JK2.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as gt,u as vt,r as c}from"./react-dgEcD0HR.js";import{G as _t,H as bt,l as jt,J as yt,K as je,P as Pt,E as Nt,F as K,I as St,L as ae,M as Re,o as we,N as be,O as Ct,Q as kt,S as E}from"./index-BCvb90M0.js";import{u as Mt,r as Wt,B as It}from"./tableSelection-9hV37uhu.js";import{D as Tt}from"./DataTable-Bmn_eYSV.js";import{T as Lt,S as $t}from"./TablePagination-DSU6cRH7.js";import{B as $,d as se,f as V}from"./heroui-BI50yK5B.js";function Oe(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function At(t,i=Date.now()){const r=new Map;for(const n of t){const l=r.get(n.model_key)??[];l.push(n),r.set(n.model_key,l)}const s=[];for(const n of r.values()){const l=[...n].sort((p,u)=>Date.parse(p.effective_at)-Date.parse(u.effective_at)),m=[...l].reverse().find(p=>Date.parse(p.effective_at)<=i);s.push(m??l[0])}return s.sort((n,l)=>n.model_key.localeCompare(l.model_key))}const Et="otari",De=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],Ot=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Fe={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Dt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],Ft=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Kt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],Bt=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Rt=1440*60*1e3,wt=t=>t.key;function Ke(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function Be(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,l)=>l.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ce(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function z(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function Y(t){return t.trim()===""?null:Number(t)}function ze(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Ve(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(l=>l.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(z))})}function Ye(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function b({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function qe({tiers:t,onChange:i}){const r=(n,l,m)=>{i(t.map(p=>p.id===n?{...p,[l]:m}:p))},s=()=>{const n=t.reduce((l,m)=>Math.max(l,m.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx($,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:l=>r(n.id,"minInputTokens",l.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(b,{value:n.input,onChange:l=>r(n.id,"input",l),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(b,{value:n.output,onChange:l=>r(n.id,"output",l),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(b,{value:n.cacheRead,onChange:l=>r(n.id,"cacheRead",l),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(b,{value:n.cacheWrite,onChange:l=>r(n.id,"cacheWrite",l),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(b,{value:n.cacheWrite1h,onChange:l=>r(n.id,"cacheWrite1h",l),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(l=>l.id!==n.id)),children:"Remove"})]},n.id))]})}function zt({source:t}){return t==="configured"?e.jsx(V,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(V,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function oe({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Vt(){const t=kt();return t.data?t.data.default_pricing?e.jsx(oe,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(oe,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function I({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function le({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Yt({row:t}){const i=je(),r=Re(),[s,n]=c.useState(!1),[l,m]=c.useState(""),[p,u]=c.useState(""),[P,j]=c.useState(""),[k,T]=c.useState(""),[y,h]=c.useState(""),[N,O]=c.useState([]),S=()=>{m(t.inputPrice==null?"":String(t.inputPrice)),u(t.outputPrice==null?"":String(t.outputPrice)),j(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),T(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),h(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),O(ze(t.pricingTiers)),n(!0)},X=ce(l)&&ce(p)&&z(P)&&z(k)&&z(y)&&Ve(N),W=()=>{X&&i.mutate({model_key:t.key,input_price_per_million:Number(l),output_price_per_million:Number(p),cache_read_price_per_million:Y(P),cache_write_price_per_million:Y(k),cache_write_1h_price_per_million:Y(y),pricing_tiers:Ye(N)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(b,{value:l,onChange:m,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(b,{value:p,onChange:u,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(b,{value:P,onChange:j,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(b,{value:k,onChange:T,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(b,{value:y,onChange:h,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(qe,{tiers:N,onChange:O}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:"sm",variant:"primary",isDisabled:i.isPending||!X,onPress:W,children:"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:be(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(I,{label:"Input",value:t.inputPrice==null?"—":`${E(t.inputPrice)} / 1M`}),e.jsx(I,{label:"Output",value:t.outputPrice==null?"—":`${E(t.outputPrice)} / 1M`}),e.jsx(I,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${E(t.cacheReadPrice)} / 1M`}),e.jsx(I,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${E(t.cacheWritePrice)} / 1M`}),e.jsx(I,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${E(t.cacheWrite1hPrice)} / 1M`}),e.jsx(I,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx($,{size:"sm",variant:"outline",onPress:S,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(we,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error)}):null]})]})}function qt({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const l=(i==null?void 0:i.input_modalities)??[],m=(i==null?void 0:i.output_modalities)??[],p=Ot.filter(({key:u})=>i==null?void 0:i[u]);return e.jsx(se,{children:e.jsxs(se.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(V,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(le,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Yt,{row:t},t.key),e.jsx($,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(le,{title:"Specs",children:[e.jsx(I,{label:"Context window",value:ae(t.contextWindow)}),e.jsx(I,{label:"Max output",value:ae((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(I,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(I,{label:"Released",value:Ct(i==null?void 0:i.release_date)}),e.jsx(I,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(le,{title:"Modalities",children:l.length===0&&m.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),l.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),m.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]})]})}),e.jsx(le,{title:"Capabilities",children:p.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(({key:u,label:P})=>e.jsx(V,{size:"sm",color:"default",children:P},u))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Ht=15;function Ut({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}const He="otari.dashboard.modelsSort",_e={col:"model",dir:"asc"},Gt=["model","released","input","output"];function Jt(){if(typeof window>"u")return _e;try{const t=window.localStorage.getItem(He);if(!t)return _e;const i=JSON.parse(t);if(Gt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return _e}function Qt({row:t,onClose:i}){const r=je(),s=Re(),[n,l]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[m,p]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[u,P]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[j,k]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[T,y]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[h,N]=c.useState(ze(t.pricingTiers)),O=ce(n)&&ce(m)&&z(u)&&z(j)&&z(T)&&Ve(h),S=()=>{O&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(m),cache_read_price_per_million:Y(u),cache_write_price_per_million:Y(j),cache_write_1h_price_per_million:Y(T),pricing_tiers:Ye(h)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(b,{value:n,onChange:l,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(b,{value:m,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(b,{value:u,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(b,{value:j,onChange:k,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(b,{value:T,onChange:y,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx($,{size:"sm",variant:"primary",isDisabled:r.isPending||!O,onPress:S,children:r.isPending?"Saving…":"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(we,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error??s.error)}):null]}),e.jsx(qe,{tiers:h,onChange:N})]})}function Xt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:l}){const m=(p,u)=>e.jsx("button",{type:"button","aria-label":`Edit ${u} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:P=>{P.stopPropagation(),l()},children:p==null?"—":E(p)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[m(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),m(i,n)]})}function Zt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${E(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${E(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${E(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function ei({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,l)=>n.min_input_tokens-l.min_input_tokens).map(n=>ae(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function ti({rows:t,isLoading:i,empty:r,sortDescriptor:s,onSortChange:n,selectedKey:l,onSelect:m,onEditPricing:p,comparisonContextTokens:u,selectedKeys:P,onSelectionChange:j}){const k=c.useMemo(()=>{const y=u==null?"Base":`at ${ae(u)}`;return[{id:"model",header:"Model",isRowHeader:!0,allowsSorting:!0,cell:h=>e.jsxs("span",{className:"font-medium break-all",children:[h.model,e.jsx("span",{className:"sr-only",children:h.key})]})},{id:"provider",header:"Provider",cell:h=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:h.provider})},{id:"input",header:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[`${y} in / out $ / 1M`,e.jsx(Vt,{})]}),align:"end",allowsSorting:!0,cell:h=>{const N=Be(h,u);return e.jsx(Xt,{primary:N.inputPrice,secondary:N.outputPrice,rowKey:h.key,primaryLabel:"input",secondaryLabel:"output",onEdit:()=>p(h.key)})}},{id:"caching",header:`Caching ${u==null?"policy":y}`,align:"end",cell:h=>e.jsx(Zt,{rates:Be(h,u),rowKey:h.key,onEdit:()=>p(h.key)})},{id:"policy",header:"Pricing policy",align:"end",cell:h=>e.jsx(ei,{row:h,onEdit:()=>p(h.key)})}]},[u,p]),T=c.useCallback(y=>y.key===l?"bg-[var(--otari-brand-tint)]":void 0,[l]);return e.jsx(Tt,{ariaLabel:"Models",columns:k,rows:t,getRowKey:wt,isLoading:i,emptyContent:r,selectionMode:"multiple",selectedKeys:P,onSelectionChange:j,sortDescriptor:s,onSortChange:n,onRowAction:m,rowClassName:T})}function ii({providers:t}){if(t.length===0)return null;const i=t.filter(l=>!l.discovery_unsupported),r=t.filter(l=>l.discovery_unsupported),s=l=>l.map(m=>m.provider).join(", "),n=l=>l.length===1;return e.jsxs(St,{tone:"warning",children:[i.length>0?e.jsxs("span",{className:"block",children:["Could not list ",s(i),". Check ",n(i)?"that provider's":"those providers'"," ","credentials in config.yml; ",n(i)?"its":"their"," models are missing from the list below."]}):null,r.length>0?e.jsxs("span",{className:"block",children:[s(r)," ",n(r)?"does":"do"," not offer model discovery, so"," ",n(r)?"its":"their"," models are missing from the list below."," ",n(r)?"The provider":"They"," may still serve requests; declare the model ids"," ",n(r)?"it serves":"they serve"," under the ",e.jsx("code",{children:"models:"})," key in config.yml to list them here."]}):null]})}function pi(){var Te,Le,$e;const t=gt(),[i]=vt(),r=_t(),s=bt(),n=jt(),l=yt(),m=je(),[p,u]=c.useState(""),[P,j]=c.useState(0),[k,T]=c.useState(Ht),[y,h]=c.useState(null),[N,O]=c.useState(null),[S,X]=c.useState(Jt),W=Mt(),[Ue,ue]=c.useState(!1),[Ge,ye]=c.useState(!1),[Je,Pe]=c.useState(void 0);c.useEffect(()=>{try{window.localStorage.setItem(He,JSON.stringify(S))}catch{}},[S]);const[D,Ne]=c.useState(i.get("provider")||"all"),[B,Qe]=c.useState("all"),[q,Xe]=c.useState("all"),[H,Ze]=c.useState("all"),[de,et]=c.useState("0"),[Z,tt]=c.useState(""),[ee,it]=c.useState("all"),[pe,rt]=c.useState(""),F=((Te=l.data)==null?void 0:Te.models)??{},nt=((Le=l.data)==null?void 0:Le.available)??!1,Se=c.useMemo(()=>{var a;return new Set((((a=n.data)==null?void 0:a.providers)??[]).flatMap(x=>x.models.map(o=>o.key)))},[n.data]),lt=a=>{u(a),j(0)},R=a=>x=>{a(x),j(0)},te=c.useMemo(()=>{var M,v,_,A,L,w,Ae;const a=new Map(At(s.data??[]).map(d=>[d.model_key,d])),x=[],o=new Set,g=(d,ve,Ee,f)=>{if(o.has(d))return;o.add(d);const C=a.get(d);x.push({key:d,model:Ke(ve,Ee),provider:Ee,isDiscovered:Se.has(d),contextWindow:(f==null?void 0:f.contextWindow)??null,inputPrice:C?C.input_price_per_million:(f==null?void 0:f.inputPrice)??null,outputPrice:C?C.output_price_per_million:(f==null?void 0:f.outputPrice)??null,cacheReadPrice:C?C.cache_read_price_per_million:(f==null?void 0:f.cacheReadPrice)??null,cacheWritePrice:C?C.cache_write_price_per_million:(f==null?void 0:f.cacheWritePrice)??null,cacheWrite1hPrice:C?C.cache_write_1h_price_per_million??null:(f==null?void 0:f.cacheWrite1hPrice)??null,pricingTiers:C?C.pricing_tiers??[]:(f==null?void 0:f.pricingTiers)??[],source:C?"configured":(f==null?void 0:f.source)??"none"})};for(const d of((M=r.data)==null?void 0:M.data)??[]){if(d.owned_by===Et)continue;const ve=d.pricing_source==="default"?"default":d.pricing?"configured":"none";g(d.id,d.id,d.owned_by||Oe(d.id),{key:d.id,model:d.id,provider:d.owned_by,contextWindow:d.context_window,inputPrice:((v=d.pricing)==null?void 0:v.input_price_per_million)??null,outputPrice:((_=d.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:((A=d.pricing)==null?void 0:A.cache_read_price_per_million)??null,cacheWritePrice:((L=d.pricing)==null?void 0:L.cache_write_price_per_million)??null,cacheWrite1hPrice:((w=d.pricing)==null?void 0:w.cache_write_1h_price_per_million)??null,pricingTiers:((Ae=d.pricing)==null?void 0:Ae.pricing_tiers)??[],source:ve})}for(const d of a.keys())g(d,d,Oe(d));return x},[r.data,s.data,Se]),Ce=c.useMemo(()=>new Map(te.map(a=>[a.key,a])),[te]),ie=c.useMemo(()=>{var o,g,M;const a=te.map(v=>{var _,A;return{...v,contextWindow:v.contextWindow??((_=F[v.key])==null?void 0:_.context_window)??null,releaseDate:((A=F[v.key])==null?void 0:A.release_date)??null}}),x=new Set(a.map(v=>v.key));for(const v of((o=n.data)==null?void 0:o.providers)??[])for(const _ of v.models)x.has(_.key)||(x.add(_.key),a.push({key:_.key,model:Ke(_.key,v.provider),provider:v.provider,isDiscovered:!0,contextWindow:((g=F[_.key])==null?void 0:g.context_window)??null,releaseDate:((M=F[_.key])==null?void 0:M.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return a},[te,n.data,F]),at=((($e=n.data)==null?void 0:$e.providers)??[]).filter(a=>!a.ok),re=c.useMemo(()=>{const a=Array.from(new Set(ie.map(x=>x.provider))).sort((x,o)=>x.localeCompare(o));return[{value:"all",label:"All providers"},...a.map(x=>({value:x,label:x}))]},[ie]);c.useEffect(()=>{D==="all"||re.length<=1||re.some(a=>a.value===D)||Ne("all")},[re,D]);const U=p.trim().toLowerCase(),he=Number(de)||0,me=Z===""?Number.POSITIVE_INFINITY:Number(Z),st=pe===""?null:Number(pe),xe=ee==="all"?null:Date.now()-Number(ee)*Rt,G=c.useMemo(()=>{const a=o=>{if(U&&!o.key.toLowerCase().includes(U)&&!o.provider.toLowerCase().includes(U)||D!=="all"&&o.provider!==D||B==="configured"&&o.source!=="configured"||B==="default"&&o.source!=="default"||B==="priced"&&o.inputPrice==null||B==="unpriced"&&o.inputPrice!=null||q==="discovered"&&!o.isDiscovered||q==="custom"&&o.isDiscovered)return!1;if(H!=="all"){const g=De.find(v=>v.value===H),M=F[o.key];if(!g||!M||!g.test(M))return!1}if(he>0&&(o.contextWindow==null||o.contextWindowme))return!1;if(xe!=null){const g=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(g)||g{const M=S.dir==="asc"?1:-1;if(S.col==="model")return o.model.localeCompare(g.model)*M;if(S.col==="released"){const L=o.releaseDate??null,w=g.releaseDate??null;return!L&&!w?o.model.localeCompare(g.model):L?w?(Lw?1:0)*M||o.model.localeCompare(g.model):-1:1}const v=L=>S.col==="input"?L.inputPrice:L.outputPrice,_=v(o),A=v(g);return _==null&&A==null?o.model.localeCompare(g.model):_==null?1:A==null?-1:(_-A)*M||o.model.localeCompare(g.model)};return ie.filter(a).sort(x)},[ie,U,D,B,q,H,he,me,xe,F,S]),J=G.length,ct=Math.max(1,Math.ceil(J/k)),ke=Math.min(P,ct-1),Me=ke*k,fe=G.slice(Me,Me+k),ot={column:S.col,direction:S.dir==="asc"?"ascending":"descending"},ut=a=>{X({col:String(a.column),dir:a.direction==="ascending"?"asc":"desc"}),j(0)},dt=c.useCallback(a=>h(x=>x===a?null:a),[]),ge=fe.map(a=>a.key),Q=Wt(W.selectedKeys,ge),pt=ge.length>0&&Q.length===ge.length&&J>Q.length,ht=W.allMatching?G.map(a=>a.key):Q,We=W.allMatching?J:Q.length,Ie=y?G.find(a=>a.key===y)??Ce.get(y)??null:null,mt=async a=>{ye(!0),Pe(void 0);try{for(const x of ht)await m.mutateAsync({model_key:x,input_price_per_million:a.input_price_per_million,output_price_per_million:a.output_price_per_million,cache_read_price_per_million:a.cache_read_price_per_million??null,cache_write_price_per_million:a.cache_write_price_per_million??null,cache_write_1h_price_per_million:null,pricing_tiers:[]});W.clear(),ue(!1)}catch(x){Pe(x)}finally{ye(!1)}},xt=r.isLoading||s.isLoading||n.isLoading,ft=U!==""||D!=="all"||B!=="all"||q!=="all"||H!=="all"||de!=="0"||Z!==""||ee!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",ne=N?G.find(a=>a.key===N)??Ce.get(N)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Pt,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(Nt,{error:r.error??s.error??n.error??l.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${ne?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ut,{value:p,onChange:lt,placeholder:"Search models…"}),e.jsx(K,{ariaLabel:"Filter by provider",value:D,onChange:R(Ne),options:re}),e.jsx(K,{ariaLabel:"Filter by pricing",value:B,onChange:R(Qe),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(K,{ariaLabel:"Filter by source",value:q,onChange:R(Xe),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(K,{ariaLabel:"Filter by capability",value:H,onChange:R(Ze),options:[{value:"all",label:"Any capability"},...De.map(a=>({value:a.value,label:a.label}))]}),e.jsx(K,{ariaLabel:"Minimum context window",value:de,onChange:R(et),options:Dt}),e.jsx(K,{ariaLabel:"Maximum input price",value:Z,onChange:R(tt),options:Ft}),e.jsx(K,{ariaLabel:"Compare prices at context",value:pe,onChange:rt,options:Kt}),e.jsx(K,{ariaLabel:"Filter by release date",value:ee,onChange:R(it),options:Bt})]}),e.jsx(ii,{providers:at}),Q.length>0?e.jsx(It,{selectedCount:We,allMatching:W.allMatching,matchingTotal:J,canSelectAllMatching:pt,onSelectAllMatching:W.enableAllMatching,onClear:W.clear,children:e.jsx($,{size:"sm",variant:"primary",onPress:()=>ue(!0),children:"Set pricing"})}):null,e.jsx(ti,{rows:fe,isLoading:xt,empty:ft,sortDescriptor:ot,onSortChange:ut,selectedKey:N,onSelect:O,onEditPricing:dt,comparisonContextTokens:st,selectedKeys:W.selectedKeys,onSelectionChange:W.onSelectionChange}),Ie?e.jsx(se,{children:e.jsxs(se.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Edit pricing"}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>h(null),children:"Close"})]}),e.jsx(Qt,{row:Ie,onClose:()=>h(null)})]})}):null,e.jsx(Lt,{page:ke,pageSize:k,total:J,rowsOnPage:fe.length,onPageChange:j,onPageSizeChange:a=>{T(a),j(0)},pageSizeOptions:[15,25,50]})]}),ne?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(qt,{row:ne,metadata:F[ne.key],metadataAvailable:nt,onMakeAlias:a=>t(`/aliases?target=${encodeURIComponent(a)}`),onClose:()=>O(null)})}):null]}),e.jsx($t,{isOpen:Ue,onOpenChange:ue,targetCount:We,isPending:Ge,error:Je,onSubmit:mt,title:"Set pricing",description:a=>`Apply these per-1M rates to ${a.toLocaleString()} selected ${a===1?"model":"models"}. This replaces each model's price; pricing tiers and the 1h cache rate are cleared. Edit a single model for tiers.`})]})}export{pi as ModelsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as gt,u as vt,r as c}from"./react-dgEcD0HR.js";import{G as _t,H as bt,l as jt,J as yt,K as je,P as Pt,E as Nt,F as K,I as St,L as ae,M as Re,o as we,N as be,O as Ct,Q as kt,S as E}from"./index-DsUY4UvK.js";import{u as Mt,r as Wt,B as It}from"./tableSelection-9hV37uhu.js";import{D as Tt}from"./DataTable-Bmn_eYSV.js";import{T as Lt,S as $t}from"./TablePagination-DgA36VXY.js";import{B as $,d as se,f as V}from"./heroui-BI50yK5B.js";function Oe(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function At(t,i=Date.now()){const r=new Map;for(const n of t){const l=r.get(n.model_key)??[];l.push(n),r.set(n.model_key,l)}const s=[];for(const n of r.values()){const l=[...n].sort((p,u)=>Date.parse(p.effective_at)-Date.parse(u.effective_at)),m=[...l].reverse().find(p=>Date.parse(p.effective_at)<=i);s.push(m??l[0])}return s.sort((n,l)=>n.model_key.localeCompare(l.model_key))}const Et="otari",De=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],Ot=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Fe={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Dt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],Ft=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Kt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],Bt=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Rt=1440*60*1e3,wt=t=>t.key;function Ke(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function Be(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,l)=>l.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ce(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function z(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function Y(t){return t.trim()===""?null:Number(t)}function ze(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Ve(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(l=>l.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(z))})}function Ye(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function b({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function qe({tiers:t,onChange:i}){const r=(n,l,m)=>{i(t.map(p=>p.id===n?{...p,[l]:m}:p))},s=()=>{const n=t.reduce((l,m)=>Math.max(l,m.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx($,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:l=>r(n.id,"minInputTokens",l.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(b,{value:n.input,onChange:l=>r(n.id,"input",l),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(b,{value:n.output,onChange:l=>r(n.id,"output",l),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(b,{value:n.cacheRead,onChange:l=>r(n.id,"cacheRead",l),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(b,{value:n.cacheWrite,onChange:l=>r(n.id,"cacheWrite",l),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(b,{value:n.cacheWrite1h,onChange:l=>r(n.id,"cacheWrite1h",l),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(l=>l.id!==n.id)),children:"Remove"})]},n.id))]})}function zt({source:t}){return t==="configured"?e.jsx(V,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(V,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function oe({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Vt(){const t=kt();return t.data?t.data.default_pricing?e.jsx(oe,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(oe,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function I({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function le({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Yt({row:t}){const i=je(),r=Re(),[s,n]=c.useState(!1),[l,m]=c.useState(""),[p,u]=c.useState(""),[P,j]=c.useState(""),[k,T]=c.useState(""),[y,h]=c.useState(""),[N,O]=c.useState([]),S=()=>{m(t.inputPrice==null?"":String(t.inputPrice)),u(t.outputPrice==null?"":String(t.outputPrice)),j(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),T(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),h(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),O(ze(t.pricingTiers)),n(!0)},X=ce(l)&&ce(p)&&z(P)&&z(k)&&z(y)&&Ve(N),W=()=>{X&&i.mutate({model_key:t.key,input_price_per_million:Number(l),output_price_per_million:Number(p),cache_read_price_per_million:Y(P),cache_write_price_per_million:Y(k),cache_write_1h_price_per_million:Y(y),pricing_tiers:Ye(N)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(b,{value:l,onChange:m,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(b,{value:p,onChange:u,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(b,{value:P,onChange:j,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(b,{value:k,onChange:T,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(b,{value:y,onChange:h,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(qe,{tiers:N,onChange:O}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:"sm",variant:"primary",isDisabled:i.isPending||!X,onPress:W,children:"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:be(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(I,{label:"Input",value:t.inputPrice==null?"—":`${E(t.inputPrice)} / 1M`}),e.jsx(I,{label:"Output",value:t.outputPrice==null?"—":`${E(t.outputPrice)} / 1M`}),e.jsx(I,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${E(t.cacheReadPrice)} / 1M`}),e.jsx(I,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${E(t.cacheWritePrice)} / 1M`}),e.jsx(I,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${E(t.cacheWrite1hPrice)} / 1M`}),e.jsx(I,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx($,{size:"sm",variant:"outline",onPress:S,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(we,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error)}):null]})]})}function qt({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const l=(i==null?void 0:i.input_modalities)??[],m=(i==null?void 0:i.output_modalities)??[],p=Ot.filter(({key:u})=>i==null?void 0:i[u]);return e.jsx(se,{children:e.jsxs(se.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(V,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(le,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Yt,{row:t},t.key),e.jsx($,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(le,{title:"Specs",children:[e.jsx(I,{label:"Context window",value:ae(t.contextWindow)}),e.jsx(I,{label:"Max output",value:ae((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(I,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(I,{label:"Released",value:Ct(i==null?void 0:i.release_date)}),e.jsx(I,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(le,{title:"Modalities",children:l.length===0&&m.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),l.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),m.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]})]})}),e.jsx(le,{title:"Capabilities",children:p.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(({key:u,label:P})=>e.jsx(V,{size:"sm",color:"default",children:P},u))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Ht=15;function Ut({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}const He="otari.dashboard.modelsSort",_e={col:"model",dir:"asc"},Gt=["model","released","input","output"];function Jt(){if(typeof window>"u")return _e;try{const t=window.localStorage.getItem(He);if(!t)return _e;const i=JSON.parse(t);if(Gt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return _e}function Qt({row:t,onClose:i}){const r=je(),s=Re(),[n,l]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[m,p]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[u,P]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[j,k]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[T,y]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[h,N]=c.useState(ze(t.pricingTiers)),O=ce(n)&&ce(m)&&z(u)&&z(j)&&z(T)&&Ve(h),S=()=>{O&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(m),cache_read_price_per_million:Y(u),cache_write_price_per_million:Y(j),cache_write_1h_price_per_million:Y(T),pricing_tiers:Ye(h)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(b,{value:n,onChange:l,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(b,{value:m,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(b,{value:u,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(b,{value:j,onChange:k,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(b,{value:T,onChange:y,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx($,{size:"sm",variant:"primary",isDisabled:r.isPending||!O,onPress:S,children:r.isPending?"Saving…":"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(we,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error??s.error)}):null]}),e.jsx(qe,{tiers:h,onChange:N})]})}function Xt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:l}){const m=(p,u)=>e.jsx("button",{type:"button","aria-label":`Edit ${u} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:P=>{P.stopPropagation(),l()},children:p==null?"—":E(p)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[m(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),m(i,n)]})}function Zt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${E(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${E(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${E(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function ei({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,l)=>n.min_input_tokens-l.min_input_tokens).map(n=>ae(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function ti({rows:t,isLoading:i,empty:r,sortDescriptor:s,onSortChange:n,selectedKey:l,onSelect:m,onEditPricing:p,comparisonContextTokens:u,selectedKeys:P,onSelectionChange:j}){const k=c.useMemo(()=>{const y=u==null?"Base":`at ${ae(u)}`;return[{id:"model",header:"Model",isRowHeader:!0,allowsSorting:!0,cell:h=>e.jsxs("span",{className:"font-medium break-all",children:[h.model,e.jsx("span",{className:"sr-only",children:h.key})]})},{id:"provider",header:"Provider",cell:h=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:h.provider})},{id:"input",header:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[`${y} in / out $ / 1M`,e.jsx(Vt,{})]}),align:"end",allowsSorting:!0,cell:h=>{const N=Be(h,u);return e.jsx(Xt,{primary:N.inputPrice,secondary:N.outputPrice,rowKey:h.key,primaryLabel:"input",secondaryLabel:"output",onEdit:()=>p(h.key)})}},{id:"caching",header:`Caching ${u==null?"policy":y}`,align:"end",cell:h=>e.jsx(Zt,{rates:Be(h,u),rowKey:h.key,onEdit:()=>p(h.key)})},{id:"policy",header:"Pricing policy",align:"end",cell:h=>e.jsx(ei,{row:h,onEdit:()=>p(h.key)})}]},[u,p]),T=c.useCallback(y=>y.key===l?"bg-[var(--otari-brand-tint)]":void 0,[l]);return e.jsx(Tt,{ariaLabel:"Models",columns:k,rows:t,getRowKey:wt,isLoading:i,emptyContent:r,selectionMode:"multiple",selectedKeys:P,onSelectionChange:j,sortDescriptor:s,onSortChange:n,onRowAction:m,rowClassName:T})}function ii({providers:t}){if(t.length===0)return null;const i=t.filter(l=>!l.discovery_unsupported),r=t.filter(l=>l.discovery_unsupported),s=l=>l.map(m=>m.provider).join(", "),n=l=>l.length===1;return e.jsxs(St,{tone:"warning",children:[i.length>0?e.jsxs("span",{className:"block",children:["Could not list ",s(i),". Check ",n(i)?"that provider's":"those providers'"," ","credentials in config.yml; ",n(i)?"its":"their"," models are missing from the list below."]}):null,r.length>0?e.jsxs("span",{className:"block",children:[s(r)," ",n(r)?"does":"do"," not offer model discovery, so"," ",n(r)?"its":"their"," models are missing from the list below."," ",n(r)?"The provider":"They"," may still serve requests; declare the model ids"," ",n(r)?"it serves":"they serve"," under the ",e.jsx("code",{children:"models:"})," key in config.yml to list them here."]}):null]})}function pi(){var Te,Le,$e;const t=gt(),[i]=vt(),r=_t(),s=bt(),n=jt(),l=yt(),m=je(),[p,u]=c.useState(""),[P,j]=c.useState(0),[k,T]=c.useState(Ht),[y,h]=c.useState(null),[N,O]=c.useState(null),[S,X]=c.useState(Jt),W=Mt(),[Ue,ue]=c.useState(!1),[Ge,ye]=c.useState(!1),[Je,Pe]=c.useState(void 0);c.useEffect(()=>{try{window.localStorage.setItem(He,JSON.stringify(S))}catch{}},[S]);const[D,Ne]=c.useState(i.get("provider")||"all"),[B,Qe]=c.useState("all"),[q,Xe]=c.useState("all"),[H,Ze]=c.useState("all"),[de,et]=c.useState("0"),[Z,tt]=c.useState(""),[ee,it]=c.useState("all"),[pe,rt]=c.useState(""),F=((Te=l.data)==null?void 0:Te.models)??{},nt=((Le=l.data)==null?void 0:Le.available)??!1,Se=c.useMemo(()=>{var a;return new Set((((a=n.data)==null?void 0:a.providers)??[]).flatMap(x=>x.models.map(o=>o.key)))},[n.data]),lt=a=>{u(a),j(0)},R=a=>x=>{a(x),j(0)},te=c.useMemo(()=>{var M,v,_,A,L,w,Ae;const a=new Map(At(s.data??[]).map(d=>[d.model_key,d])),x=[],o=new Set,g=(d,ve,Ee,f)=>{if(o.has(d))return;o.add(d);const C=a.get(d);x.push({key:d,model:Ke(ve,Ee),provider:Ee,isDiscovered:Se.has(d),contextWindow:(f==null?void 0:f.contextWindow)??null,inputPrice:C?C.input_price_per_million:(f==null?void 0:f.inputPrice)??null,outputPrice:C?C.output_price_per_million:(f==null?void 0:f.outputPrice)??null,cacheReadPrice:C?C.cache_read_price_per_million:(f==null?void 0:f.cacheReadPrice)??null,cacheWritePrice:C?C.cache_write_price_per_million:(f==null?void 0:f.cacheWritePrice)??null,cacheWrite1hPrice:C?C.cache_write_1h_price_per_million??null:(f==null?void 0:f.cacheWrite1hPrice)??null,pricingTiers:C?C.pricing_tiers??[]:(f==null?void 0:f.pricingTiers)??[],source:C?"configured":(f==null?void 0:f.source)??"none"})};for(const d of((M=r.data)==null?void 0:M.data)??[]){if(d.owned_by===Et)continue;const ve=d.pricing_source==="default"?"default":d.pricing?"configured":"none";g(d.id,d.id,d.owned_by||Oe(d.id),{key:d.id,model:d.id,provider:d.owned_by,contextWindow:d.context_window,inputPrice:((v=d.pricing)==null?void 0:v.input_price_per_million)??null,outputPrice:((_=d.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:((A=d.pricing)==null?void 0:A.cache_read_price_per_million)??null,cacheWritePrice:((L=d.pricing)==null?void 0:L.cache_write_price_per_million)??null,cacheWrite1hPrice:((w=d.pricing)==null?void 0:w.cache_write_1h_price_per_million)??null,pricingTiers:((Ae=d.pricing)==null?void 0:Ae.pricing_tiers)??[],source:ve})}for(const d of a.keys())g(d,d,Oe(d));return x},[r.data,s.data,Se]),Ce=c.useMemo(()=>new Map(te.map(a=>[a.key,a])),[te]),ie=c.useMemo(()=>{var o,g,M;const a=te.map(v=>{var _,A;return{...v,contextWindow:v.contextWindow??((_=F[v.key])==null?void 0:_.context_window)??null,releaseDate:((A=F[v.key])==null?void 0:A.release_date)??null}}),x=new Set(a.map(v=>v.key));for(const v of((o=n.data)==null?void 0:o.providers)??[])for(const _ of v.models)x.has(_.key)||(x.add(_.key),a.push({key:_.key,model:Ke(_.key,v.provider),provider:v.provider,isDiscovered:!0,contextWindow:((g=F[_.key])==null?void 0:g.context_window)??null,releaseDate:((M=F[_.key])==null?void 0:M.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return a},[te,n.data,F]),at=((($e=n.data)==null?void 0:$e.providers)??[]).filter(a=>!a.ok),re=c.useMemo(()=>{const a=Array.from(new Set(ie.map(x=>x.provider))).sort((x,o)=>x.localeCompare(o));return[{value:"all",label:"All providers"},...a.map(x=>({value:x,label:x}))]},[ie]);c.useEffect(()=>{D==="all"||re.length<=1||re.some(a=>a.value===D)||Ne("all")},[re,D]);const U=p.trim().toLowerCase(),he=Number(de)||0,me=Z===""?Number.POSITIVE_INFINITY:Number(Z),st=pe===""?null:Number(pe),xe=ee==="all"?null:Date.now()-Number(ee)*Rt,G=c.useMemo(()=>{const a=o=>{if(U&&!o.key.toLowerCase().includes(U)&&!o.provider.toLowerCase().includes(U)||D!=="all"&&o.provider!==D||B==="configured"&&o.source!=="configured"||B==="default"&&o.source!=="default"||B==="priced"&&o.inputPrice==null||B==="unpriced"&&o.inputPrice!=null||q==="discovered"&&!o.isDiscovered||q==="custom"&&o.isDiscovered)return!1;if(H!=="all"){const g=De.find(v=>v.value===H),M=F[o.key];if(!g||!M||!g.test(M))return!1}if(he>0&&(o.contextWindow==null||o.contextWindowme))return!1;if(xe!=null){const g=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(g)||g{const M=S.dir==="asc"?1:-1;if(S.col==="model")return o.model.localeCompare(g.model)*M;if(S.col==="released"){const L=o.releaseDate??null,w=g.releaseDate??null;return!L&&!w?o.model.localeCompare(g.model):L?w?(Lw?1:0)*M||o.model.localeCompare(g.model):-1:1}const v=L=>S.col==="input"?L.inputPrice:L.outputPrice,_=v(o),A=v(g);return _==null&&A==null?o.model.localeCompare(g.model):_==null?1:A==null?-1:(_-A)*M||o.model.localeCompare(g.model)};return ie.filter(a).sort(x)},[ie,U,D,B,q,H,he,me,xe,F,S]),J=G.length,ct=Math.max(1,Math.ceil(J/k)),ke=Math.min(P,ct-1),Me=ke*k,fe=G.slice(Me,Me+k),ot={column:S.col,direction:S.dir==="asc"?"ascending":"descending"},ut=a=>{X({col:String(a.column),dir:a.direction==="ascending"?"asc":"desc"}),j(0)},dt=c.useCallback(a=>h(x=>x===a?null:a),[]),ge=fe.map(a=>a.key),Q=Wt(W.selectedKeys,ge),pt=ge.length>0&&Q.length===ge.length&&J>Q.length,ht=W.allMatching?G.map(a=>a.key):Q,We=W.allMatching?J:Q.length,Ie=y?G.find(a=>a.key===y)??Ce.get(y)??null:null,mt=async a=>{ye(!0),Pe(void 0);try{for(const x of ht)await m.mutateAsync({model_key:x,input_price_per_million:a.input_price_per_million,output_price_per_million:a.output_price_per_million,cache_read_price_per_million:a.cache_read_price_per_million??null,cache_write_price_per_million:a.cache_write_price_per_million??null,cache_write_1h_price_per_million:null,pricing_tiers:[]});W.clear(),ue(!1)}catch(x){Pe(x)}finally{ye(!1)}},xt=r.isLoading||s.isLoading||n.isLoading,ft=U!==""||D!=="all"||B!=="all"||q!=="all"||H!=="all"||de!=="0"||Z!==""||ee!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",ne=N?G.find(a=>a.key===N)??Ce.get(N)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Pt,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(Nt,{error:r.error??s.error??n.error??l.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${ne?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ut,{value:p,onChange:lt,placeholder:"Search models…"}),e.jsx(K,{ariaLabel:"Filter by provider",value:D,onChange:R(Ne),options:re}),e.jsx(K,{ariaLabel:"Filter by pricing",value:B,onChange:R(Qe),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(K,{ariaLabel:"Filter by source",value:q,onChange:R(Xe),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(K,{ariaLabel:"Filter by capability",value:H,onChange:R(Ze),options:[{value:"all",label:"Any capability"},...De.map(a=>({value:a.value,label:a.label}))]}),e.jsx(K,{ariaLabel:"Minimum context window",value:de,onChange:R(et),options:Dt}),e.jsx(K,{ariaLabel:"Maximum input price",value:Z,onChange:R(tt),options:Ft}),e.jsx(K,{ariaLabel:"Compare prices at context",value:pe,onChange:rt,options:Kt}),e.jsx(K,{ariaLabel:"Filter by release date",value:ee,onChange:R(it),options:Bt})]}),e.jsx(ii,{providers:at}),Q.length>0?e.jsx(It,{selectedCount:We,allMatching:W.allMatching,matchingTotal:J,canSelectAllMatching:pt,onSelectAllMatching:W.enableAllMatching,onClear:W.clear,children:e.jsx($,{size:"sm",variant:"primary",onPress:()=>ue(!0),children:"Set pricing"})}):null,e.jsx(ti,{rows:fe,isLoading:xt,empty:ft,sortDescriptor:ot,onSortChange:ut,selectedKey:N,onSelect:O,onEditPricing:dt,comparisonContextTokens:st,selectedKeys:W.selectedKeys,onSelectionChange:W.onSelectionChange}),Ie?e.jsx(se,{children:e.jsxs(se.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Edit pricing"}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>h(null),children:"Close"})]}),e.jsx(Qt,{row:Ie,onClose:()=>h(null)})]})}):null,e.jsx(Lt,{page:ke,pageSize:k,total:J,rowsOnPage:fe.length,onPageChange:j,onPageSizeChange:a=>{T(a),j(0)},pageSizeOptions:[15,25,50]})]}),ne?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(qt,{row:ne,metadata:F[ne.key],metadataAvailable:nt,onMakeAlias:a=>t(`/aliases?target=${encodeURIComponent(a)}`),onClose:()=>O(null)})}):null]}),e.jsx($t,{isOpen:Ue,onOpenChange:ue,targetCount:We,isPending:Ge,error:Je,onSubmit:mt,title:"Set pricing",description:a=>`Apply these per-1M rates to ${a.toLocaleString()} selected ${a===1?"model":"models"}. This replaces each model's price; pricing tiers and the 1h cache rate are cleared. Edit a single model for tiers.`})]})}export{pi as ModelsPage}; diff --git a/src/gateway/static/dashboard/assets/OverviewPage-BluitD8r.js b/src/gateway/static/dashboard/assets/OverviewPage-C5sP44tb.js similarity index 99% rename from src/gateway/static/dashboard/assets/OverviewPage-BluitD8r.js rename to src/gateway/static/dashboard/assets/OverviewPage-C5sP44tb.js index 9b4c3b093..088fe5967 100644 --- a/src/gateway/static/dashboard/assets/OverviewPage-BluitD8r.js +++ b/src/gateway/static/dashboard/assets/OverviewPage-C5sP44tb.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as y,i as st,N as I}from"./react-dgEcD0HR.js";import{T as at,U as nt,d as S,V as ot,q as it,a as lt,u as dt,b as ct,W as w,P as ut,R as mt,E as Y,X as b,Z as _,_ as N,$ as R,a0 as D,a1 as vt}from"./index-BCvb90M0.js";import{S as H}from"./charts-DIsd9m--.js";import{D as ht}from"./DataTable-Bmn_eYSV.js";import{d as B,B as xt}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function M(e){return e==="neutral"?void 0:e}const ft=.02,pt=.1;function W(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,s=n>=pt?"alert":n>=ft?"warn":"ok";return{rate:n,status:s}}function gt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy+e.degraded===0?"alert":"warn"}const bt=.8;function yt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(o=>o.max_budget!==null&&o.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let s=0,l=0,r,m=-1;for(const o of n){const a=o.max_budget*o.user_count,i=a>0?o.total_spend/a:0;i>=1?s+=1:i>=bt&&(l+=1),i>m&&(m=i,r={name:o.name??o.budget_id,spent:o.total_spend,allocated:a,pct:i})}const d=s>0?"alert":l>0?"warn":"ok",h=s>0?`${s} over limit`:l>0?`${l} near limit`:"All within budget";return{status:d,label:h,overCount:s,nearCount:l,cappedCount:n.length,worst:r}}const K=864e5,T=30;function G(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function jt(){const[e,n]=y.useState(G);return y.useEffect(()=>{const s=()=>{if(document.visibilityState==="visible"){const l=G();n(r=>r===l?r:l)}};return document.addEventListener("visibilitychange",s),window.addEventListener("focus",s),()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("focus",s)}},[]),y.useMemo(()=>{const s=Date.now(),l=new Date(s);return{today:new Date(l.getFullYear(),l.getMonth(),l.getDate()).toISOString(),periodStart:new Date(s-T*K).toISOString(),prevStart:new Date(s-2*T*K).toISOString()}},[e])}const St={ok:"Healthy",warn:"Elevated",alert:"High"},wt={ok:"On track",warn:"Near limit",alert:"Over budget"};function qt(){const e=at();return e.isLoading?t.jsx(nt,{}):t.jsx(Nt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function Nt({needsSetup:e=!1}){var $,L,O,A,F,P,q,U;const n=jt(),s=y.useMemo(()=>({start_date:n.today}),[n]),l=y.useMemo(()=>({start_date:n.periodStart}),[n]),r=y.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=S(s,"hour"),d=S(l,"day"),h=S(r,"day"),o=ot(),a=it(),i=lt(),x=dt(),f=ct({},0,5),E=($=m.data)==null?void 0:$.totals,v=(L=d.data)==null?void 0:L.totals,p=(O=h.data)==null?void 0:O.totals,j=((A=d.data)==null?void 0:A.series)??[],C=j.length>1,c=W(v),k=W(p),V=c.rate!==null&&k.rate!==null?w(c.rate,k.rate):null,u=yt(a.data??[]),X=gt(o.data),Z=(i.data??[]).filter(g=>g.is_active).length,z=(x.data??[]).filter(g=>!g.blocked).length,J=(((F=f.data)==null?void 0:F.length)??0)>0,Q=e&&f.isSuccess&&!J,tt=m.error??d.error??o.error??a.error??i.error??x.error,et=()=>{m.refetch(),d.refetch(),h.refetch(),o.refetch(),a.refetch(),i.refetch(),x.refetch(),f.refetch()},rt=m.isFetching||d.isFetching||h.isFetching||o.isFetching||a.isFetching||i.isFetching||x.isFetching||f.isFetching;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ut,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway.",action:t.jsx(mt,{onRefresh:et,isFetching:rt,updatedAt:d.dataUpdatedAt})}),Q?t.jsx(Rt,{}):null,t.jsx(Y,{error:tt}),t.jsx(Dt,{providerHealth:X,healthy:((P=o.data)==null?void 0:P.healthy)??0,degraded:((q=o.data)==null?void 0:q.degraded)??0,total:((U=o.data)==null?void 0:U.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:o.isSuccess&&a.isSuccess&&d.isSuccess,failed:o.isError||a.isError||d.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(b,{label:"Spend today",value:E?_(E.cost):"—"}),t.jsx(b,{label:"Spend, last 30 days",value:v?_(v.cost):"—",hint:v?t.jsx(N,{fraction:w(v.cost,p==null?void 0:p.cost)}):null,chart:C?t.jsx(H,{values:j.map(g=>g.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Requests, last 30 days",value:v?R(v.request_count):"—",hint:v?t.jsx(N,{fraction:w(v.request_count,p==null?void 0:p.request_count)}):null,chart:C?t.jsx(H,{values:j.map(g=>g.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Error rate, last 30 days",value:c.rate===null?"—":D(c.rate),status:M(c.status),statusLabel:c.status==="neutral"?void 0:St[c.status],hint:c.rate!==null?t.jsx(N,{fraction:V}):null}),t.jsx(b,{label:"Budget health",value:a.data&&u.worst?D(u.worst.pct):"—",status:a.data?M(u.status):void 0,statusLabel:a.data&&u.status!=="neutral"?wt[u.status]:void 0,hint:a.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(b,{label:"Active keys",value:i.data?R(Z):"—",to:"/keys"}),t.jsx(b,{label:"Active users",value:x.data?R(z):"—",to:"/users"})]}),t.jsx(Ct,{entries:f.data??[],loading:f.isLoading,error:f.error})]})}function Rt(){const e=st();return t.jsx(B,{children:t.jsxs(B.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(xt,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function _t({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function Dt({providerHealth:e,healthy:n,degraded:s,total:l,budget:r,errStatus:m,errRate:d,ready:h,failed:o}){if(o)return t.jsx(_t,{text:"Some status data could not be loaded."});if(!h)return null;const a=[];if((e==="warn"||e==="alert")&&l>0){const i=l-n-s;i>0&&a.push({text:`${i} provider${i===1?"":"s"} unreachable`,to:"/providers"}),s>0&&a.push({text:`${s} provider${s===1?"":"s"} without model discovery`,to:"/providers"})}return r.overCount>0?a.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&a.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),m==="alert"&&d!==null&&a.push({text:`error rate ${D(d)}`,to:"/activity?status=error"}),a.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),a.map((i,x)=>t.jsxs("span",{className:"flex items-center gap-2",children:[x>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(I,{to:i.to,className:"underline underline-offset-2 hover:text-amber-950",children:i.text})]},i.to+i.text))]})}function Et(e){return e==="error"?"error":"ok"}function Ct({entries:e,loading:n,error:s}){const l=[{id:"time",header:"Time",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(r.timestamp).toLocaleString(),children:vt(r.timestamp)})},{id:"model",header:"Model",isRowHeader:!0,cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:r.model})},{id:"cost",header:"Cost",align:"end",cell:r=>r.cost===null?"—":_(r.cost)},{id:"status",header:"Status",cell:r=>t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Et(r.status)})}];return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(I,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(Y,{error:s}),t.jsx(ht,{ariaLabel:"Recent activity",columns:l,rows:e,getRowKey:r=>r.id,isLoading:n,emptyContent:"No requests yet. Once the gateway serves traffic, it appears here."})]})}export{qt as OverviewIndex,Nt as OverviewPage,G as localDayKey}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as y,i as st,N as I}from"./react-dgEcD0HR.js";import{T as at,U as nt,d as S,V as ot,q as it,a as lt,u as dt,b as ct,W as w,P as ut,R as mt,E as Y,X as b,Z as _,_ as N,$ as R,a0 as D,a1 as vt}from"./index-DsUY4UvK.js";import{S as H}from"./charts-DIsd9m--.js";import{D as ht}from"./DataTable-Bmn_eYSV.js";import{d as B,B as xt}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function M(e){return e==="neutral"?void 0:e}const ft=.02,pt=.1;function W(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,s=n>=pt?"alert":n>=ft?"warn":"ok";return{rate:n,status:s}}function gt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy+e.degraded===0?"alert":"warn"}const bt=.8;function yt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(o=>o.max_budget!==null&&o.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let s=0,l=0,r,m=-1;for(const o of n){const a=o.max_budget*o.user_count,i=a>0?o.total_spend/a:0;i>=1?s+=1:i>=bt&&(l+=1),i>m&&(m=i,r={name:o.name??o.budget_id,spent:o.total_spend,allocated:a,pct:i})}const d=s>0?"alert":l>0?"warn":"ok",h=s>0?`${s} over limit`:l>0?`${l} near limit`:"All within budget";return{status:d,label:h,overCount:s,nearCount:l,cappedCount:n.length,worst:r}}const K=864e5,T=30;function G(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function jt(){const[e,n]=y.useState(G);return y.useEffect(()=>{const s=()=>{if(document.visibilityState==="visible"){const l=G();n(r=>r===l?r:l)}};return document.addEventListener("visibilitychange",s),window.addEventListener("focus",s),()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("focus",s)}},[]),y.useMemo(()=>{const s=Date.now(),l=new Date(s);return{today:new Date(l.getFullYear(),l.getMonth(),l.getDate()).toISOString(),periodStart:new Date(s-T*K).toISOString(),prevStart:new Date(s-2*T*K).toISOString()}},[e])}const St={ok:"Healthy",warn:"Elevated",alert:"High"},wt={ok:"On track",warn:"Near limit",alert:"Over budget"};function qt(){const e=at();return e.isLoading?t.jsx(nt,{}):t.jsx(Nt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function Nt({needsSetup:e=!1}){var $,L,O,A,F,P,q,U;const n=jt(),s=y.useMemo(()=>({start_date:n.today}),[n]),l=y.useMemo(()=>({start_date:n.periodStart}),[n]),r=y.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=S(s,"hour"),d=S(l,"day"),h=S(r,"day"),o=ot(),a=it(),i=lt(),x=dt(),f=ct({},0,5),E=($=m.data)==null?void 0:$.totals,v=(L=d.data)==null?void 0:L.totals,p=(O=h.data)==null?void 0:O.totals,j=((A=d.data)==null?void 0:A.series)??[],C=j.length>1,c=W(v),k=W(p),V=c.rate!==null&&k.rate!==null?w(c.rate,k.rate):null,u=yt(a.data??[]),X=gt(o.data),Z=(i.data??[]).filter(g=>g.is_active).length,z=(x.data??[]).filter(g=>!g.blocked).length,J=(((F=f.data)==null?void 0:F.length)??0)>0,Q=e&&f.isSuccess&&!J,tt=m.error??d.error??o.error??a.error??i.error??x.error,et=()=>{m.refetch(),d.refetch(),h.refetch(),o.refetch(),a.refetch(),i.refetch(),x.refetch(),f.refetch()},rt=m.isFetching||d.isFetching||h.isFetching||o.isFetching||a.isFetching||i.isFetching||x.isFetching||f.isFetching;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ut,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway.",action:t.jsx(mt,{onRefresh:et,isFetching:rt,updatedAt:d.dataUpdatedAt})}),Q?t.jsx(Rt,{}):null,t.jsx(Y,{error:tt}),t.jsx(Dt,{providerHealth:X,healthy:((P=o.data)==null?void 0:P.healthy)??0,degraded:((q=o.data)==null?void 0:q.degraded)??0,total:((U=o.data)==null?void 0:U.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:o.isSuccess&&a.isSuccess&&d.isSuccess,failed:o.isError||a.isError||d.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(b,{label:"Spend today",value:E?_(E.cost):"—"}),t.jsx(b,{label:"Spend, last 30 days",value:v?_(v.cost):"—",hint:v?t.jsx(N,{fraction:w(v.cost,p==null?void 0:p.cost)}):null,chart:C?t.jsx(H,{values:j.map(g=>g.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Requests, last 30 days",value:v?R(v.request_count):"—",hint:v?t.jsx(N,{fraction:w(v.request_count,p==null?void 0:p.request_count)}):null,chart:C?t.jsx(H,{values:j.map(g=>g.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Error rate, last 30 days",value:c.rate===null?"—":D(c.rate),status:M(c.status),statusLabel:c.status==="neutral"?void 0:St[c.status],hint:c.rate!==null?t.jsx(N,{fraction:V}):null}),t.jsx(b,{label:"Budget health",value:a.data&&u.worst?D(u.worst.pct):"—",status:a.data?M(u.status):void 0,statusLabel:a.data&&u.status!=="neutral"?wt[u.status]:void 0,hint:a.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(b,{label:"Active keys",value:i.data?R(Z):"—",to:"/keys"}),t.jsx(b,{label:"Active users",value:x.data?R(z):"—",to:"/users"})]}),t.jsx(Ct,{entries:f.data??[],loading:f.isLoading,error:f.error})]})}function Rt(){const e=st();return t.jsx(B,{children:t.jsxs(B.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(xt,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function _t({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function Dt({providerHealth:e,healthy:n,degraded:s,total:l,budget:r,errStatus:m,errRate:d,ready:h,failed:o}){if(o)return t.jsx(_t,{text:"Some status data could not be loaded."});if(!h)return null;const a=[];if((e==="warn"||e==="alert")&&l>0){const i=l-n-s;i>0&&a.push({text:`${i} provider${i===1?"":"s"} unreachable`,to:"/providers"}),s>0&&a.push({text:`${s} provider${s===1?"":"s"} without model discovery`,to:"/providers"})}return r.overCount>0?a.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&a.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),m==="alert"&&d!==null&&a.push({text:`error rate ${D(d)}`,to:"/activity?status=error"}),a.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),a.map((i,x)=>t.jsxs("span",{className:"flex items-center gap-2",children:[x>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(I,{to:i.to,className:"underline underline-offset-2 hover:text-amber-950",children:i.text})]},i.to+i.text))]})}function Et(e){return e==="error"?"error":"ok"}function Ct({entries:e,loading:n,error:s}){const l=[{id:"time",header:"Time",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(r.timestamp).toLocaleString(),children:vt(r.timestamp)})},{id:"model",header:"Model",isRowHeader:!0,cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:r.model})},{id:"cost",header:"Cost",align:"end",cell:r=>r.cost===null?"—":_(r.cost)},{id:"status",header:"Status",cell:r=>t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Et(r.status)})}];return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(I,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(Y,{error:s}),t.jsx(ht,{ariaLabel:"Recent activity",columns:l,rows:e,getRowKey:r=>r.id,isLoading:n,emptyContent:"No requests yet. Once the gateway serves traffic, it appears here."})]})}export{qt as OverviewIndex,Nt as OverviewPage,G as localDayKey}; diff --git a/src/gateway/static/dashboard/assets/ProvidersPage-Bf-7xbup.js b/src/gateway/static/dashboard/assets/ProvidersPage-CYSSSf8R.js similarity index 99% rename from src/gateway/static/dashboard/assets/ProvidersPage-Bf-7xbup.js rename to src/gateway/static/dashboard/assets/ProvidersPage-CYSSSf8R.js index 875fb9f26..31a8369ee 100644 --- a/src/gateway/static/dashboard/assets/ProvidersPage-Bf-7xbup.js +++ b/src/gateway/static/dashboard/assets/ProvidersPage-CYSSSf8R.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,L as M}from"./react-dgEcD0HR.js";import{T as Y,a2 as V,Q as G,V as Q,a3 as W,a4 as J,a5 as X,P as Z,E as I,I as ee,a6 as te,a7 as se,a1 as q,o as ae,a8 as $,a9 as re,N as O,aa as ne,ab as ie}from"./index-BCvb90M0.js";import{F as _}from"./Field-Dwp6u3t8.js";import{D as oe}from"./DataTable-Bmn_eYSV.js";import{B as f,d as S,f as de,T as le,L as F,I as H,D as ce,S as me,C as T,a as ue,b as xe}from"./heroui-BI50yK5B.js";function E({value:t,onChange:s,label:a,placeholder:n,description:i}){return e.jsxs(le,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(H,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),i?e.jsx(ce,{className:"text-xs text-[var(--otari-muted)]",children:i}):null]})}function z({label:t,value:s,onChange:a,description:n,placeholder:i,extra:d=[],includeCatalog:l=!0}){var k;const g=ne(),u=x.useMemo(()=>l?[...d,...(g.data??[]).map(o=>({id:o.id,name:o.name}))]:d,[g.data,d,l]),[p,m]=x.useState(()=>{var o;return((o=u.find(b=>b.id===s))==null?void 0:o.name)??""}),j=((k=u.find(o=>o.id===s))==null?void 0:k.name)??"",h=p.trim()===j.trim()?"":p.trim().toLowerCase(),c=u.filter(o=>!h||o.name.toLowerCase().includes(h)||o.id.toLowerCase().includes(h)).slice(0,50);return e.jsxs(T.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:p,onInputChange:m,onSelectionChange:o=>{var b;o!=null?(a(String(o)),m(((b=u.find(N=>N.id===String(o)))==null?void 0:b.name)??"")):(a(""),m(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(T.InputGroup,{children:[e.jsx(H,{placeholder:i??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:o=>o.currentTarget.select()}),e.jsx(T.Trigger,{})]}),e.jsx(T.Popover,{children:e.jsx(ue,{items:c,className:"max-h-72 overflow-auto",children:o=>e.jsx(xe,{id:o.id,textValue:o.name,children:o.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function U({getPayload:t}){const s=ie(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:O(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):s.data.discovery_unsupported?e.jsxs("span",{className:"block max-w-md break-words text-xs text-amber-800",children:["This provider does not list models, so the key could not be verified here. Save it and use the provider; declare its model ids under ",e.jsx("code",{children:"models:"})," to have them show up in the catalogue. If you did not expect this, check the provider's reply below.",s.data.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:s.data.error}):null]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function pe({onClose:t}){var A;const s=$(),[a,n]=x.useState(""),[i,d]=x.useState(""),[l,g]=x.useState(!1),[u,p]=x.useState(""),[m,j]=x.useState(""),h=re(a),c=((A=h.data)==null?void 0:A.id)===a?h.data:void 0;x.useEffect(()=>{c&&p(c.default_api_base??"")},[c]);const k=(c==null?void 0:c.env_key_present)??!1,o=((c==null?void 0:c.requires_api_key)??!0)&&!k,b=m.trim()!==""&&m.trim()!==a,N=/[:/]/.test(m),P=a!==""&&!N&&(!o||i.trim()!=="")&&!s.isPending,C=()=>{P&&s.mutate({instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsx(z,{label:"Provider",value:a,onChange:w=>{n(w),j(""),p("")},description:"Its endpoint is built in."}),e.jsx(E,{value:i,onChange:d,label:c&&!o?"API key (optional)":"API key",description:c?o?`${c.name}'s endpoint is built in — just add your key.`:k?`${c.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${c.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>g(w=>!w),children:l?"Hide advanced":"Advanced (API base, rename)"}),l?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:u,onChange:p,placeholder:(c==null?void 0:c.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:m,onChange:j,placeholder:a||"instance name",description:N?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!P,onPress:C,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a===""?null:{instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null}})]})]})}function he({onClose:t}){const s=$(),[a,n]=x.useState(""),[i,d]=x.useState("openai-compatible"),[l,g]=x.useState(""),[u,p]=x.useState(""),m=/[:/]/.test(a),j=a.trim()!==""&&!m&&l.trim()!==""&&!s.isPending,h=()=>{j&&s.mutate({instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:m?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(z,{label:"Compatible with",value:i,onChange:d,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:l,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(E,{value:u,onChange:p,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!j,onPress:h,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a.trim()===""||l.trim()===""?null:{instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null}})]})]})}function ve({onClose:t}){const[s,a]=x.useState("known");return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,i])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:i},n))})}),s==="known"?e.jsx(pe,{onClose:t}):e.jsx(he,{onClose:t})]})})}function ge({provider:t,onClose:s}){const a=te(),[n,i]=x.useState(t.provider_type??""),[d,l]=x.useState(t.api_base??""),[g,u]=x.useState(!1),[p,m]=x.useState(""),j=()=>{if(a.isPending)return;const h={provider_type:n.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};g&&p.trim()&&(h.api_key=p.trim()),a.mutate({instance:t.instance,body:h},{onSuccess:s})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(I,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:i,placeholder:"openai"}),e.jsx(_,{label:"API base",value:d,onChange:l,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(E,{value:p,onChange:m,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),m("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(f,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:a.isPending,onPress:j,children:a.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function fe(t,s){const a=new Map((s??[]).map(d=>[d.instance,d])),n=new Map((t??[]).map(d=>[d.instance,d]));return[...new Set([...a.keys(),...n.keys()])].sort().map(d=>{const l=a.get(d);return{instance:d,source:l?"stored":"config",stored:l,meta:n.get(d)}})}function je({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(me,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):t.discovery_unsupported?e.jsxs("span",{className:"block max-w-xs break-words text-xs text-amber-800",children:["Could not list models, so the key could not be verified. It may still work for requests.",t.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:t.error}):null]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function be({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=!t.ok&&t.discovery_unsupported,a=t.ok?"border-green-200 bg-green-50 text-green-700":s?"border-amber-200 bg-amber-50 text-amber-800":"border-red-200 bg-red-50 text-red-700",n=t.ok?"bg-green-500":s?"bg-amber-500":"bg-red-500",i=t.checked_at?`Last checked ${q(t.checked_at)}`:"Not checked yet",d=s?`${t.error??"This provider does not list models."} Requests to it may still work.`:t.error??"Unreachable",l=t.ok?i:`${d} · ${i}`;return e.jsxs("span",{title:l,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${n}`}),t.ok?"Reachable":s?"No model discovery":"Unreachable"]})}function ye({healthy:t,degraded:s,total:a,checkedAt:n}){const d=t===a?"bg-green-500":t+s===a?"bg-amber-500":"bg-red-500",l=se();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${d}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s>0?e.jsxs("span",{className:"text-amber-800",children:[s," without model discovery"]}):null,n?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",q(n)]}):null,e.jsx(f,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function R({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function ke({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n,secretKeyConfigured:i}){return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(R,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(R,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(R,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(f,{variant:"primary",isDisabled:!i,onPress:t,children:"Add your first provider"})})]})})}function Ae(){var K,B,D,L;const t=Y(),s=V(),a=G(),n=Q(),i=W(),d=J(),l=X(),[g,u]=x.useState(!1),[p,m]=x.useState(null),[j,h]=x.useState({}),c=fe((K=t.data)==null?void 0:K.providers,s.data),k=new Map((((B=n.data)==null?void 0:B.providers)??[]).map(r=>[r.instance,r])),o=t.isLoading||s.isLoading,b=((D=s.data)==null?void 0:D.find(r=>r.instance===p))??null,N=((L=a.data)==null?void 0:L.require_pricing)===!0&&a.data.default_pricing===!1,P=a.data?a.data.secret_key_configured!==!1:!a.isError,C=!o&&c.length===0&&!g,A=r=>{h(v=>({...v,[r]:{status:"pending"}})),d.mutate(r,{onSuccess:v=>h(y=>({...y,[r]:{status:"done",...v}})),onError:v=>h(y=>({...y,[r]:{status:"done",ok:!1,model_count:0,error:O(v),discovery_unsupported:!1}}))})},w=[{id:"provider",header:"Provider",isRowHeader:!0,cell:r=>e.jsx(M,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"font-medium text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})},{id:"type",header:"Type",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:((v=r.meta)==null?void 0:v.provider_type)??((y=r.stored)==null?void 0:y.provider_type)??r.instance})}},{id:"source",header:"Source",cell:r=>e.jsx(de,{size:"sm",color:r.source==="stored"?"accent":"default",children:r.source==="stored"?"stored":"config"})},{id:"api_key",header:"API key",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:(v=r.stored)!=null&&v.last4?`••••${r.stored.last4}`:"none set"}):(y=r.meta)!=null&&y.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"})}},{id:"status",header:"Status",cell:r=>e.jsx(be,{health:k.get(r.instance)})},{id:"actions",header:"Actions",align:"end",cell:r=>{var v,y;return r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:((v=j[r.instance])==null?void 0:v.status)==="pending"||((y=r.stored)==null?void 0:y.decryptable)===!1,onPress:()=>A(r.instance),children:"Test"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{u(!1),m(r.instance)},children:"Edit"}),e.jsx(ae,{confirmLabel:"Delete",isPending:i.isPending,onConfirm:()=>i.mutate(r.instance),children:"Delete"})]}),e.jsx(je,{state:j[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})}}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||C?null:e.jsx(f,{variant:"primary",isDisabled:!P,onPress:()=>{m(null),u(!0)},children:"Add provider"})}),e.jsx(I,{error:t.error??s.error??a.error??n.error??l.error??i.error}),P?null:e.jsxs(ee,{tone:"warning",children:[e.jsx("code",{children:"OTARI_SECRET_KEY"})," is not set, so provider keys can't be encrypted at rest and adding providers from the dashboard is disabled. Set it on the server and restart to add providers here. Providers defined in"," ",e.jsx("code",{children:"config.yml"})," keep working without it."]}),C?e.jsx(ke,{onAddProvider:()=>{m(null),u(!0)},needsPricing:N,onEnablePricing:()=>l.mutate({default_pricing:!0}),enabling:l.isPending,secretKeyConfigured:P}):null,g&&P?e.jsx(ve,{onClose:()=>u(!1)}):null,b?e.jsx(ge,{provider:b,onClose:()=>m(null)}):null,!o&&c.length>0&&n.data&&n.data.total>0?e.jsx(ye,{healthy:n.data.healthy,degraded:n.data.degraded,total:n.data.total,checkedAt:n.data.checked_at}):null,C?null:e.jsx(oe,{ariaLabel:"Providers",columns:w,rows:c,getRowKey:r=>r.instance,isLoading:o,emptyContent:"No providers yet. Add your first provider to start serving models."})]})}export{Ae as ProvidersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,L as M}from"./react-dgEcD0HR.js";import{T as Y,a2 as V,Q as G,V as Q,a3 as W,a4 as J,a5 as X,P as Z,E as I,I as ee,a6 as te,a7 as se,a1 as q,o as ae,a8 as $,a9 as re,N as O,aa as ne,ab as ie}from"./index-DsUY4UvK.js";import{F as _}from"./Field-Dwp6u3t8.js";import{D as oe}from"./DataTable-Bmn_eYSV.js";import{B as f,d as S,f as de,T as le,L as F,I as H,D as ce,S as me,C as T,a as ue,b as xe}from"./heroui-BI50yK5B.js";function E({value:t,onChange:s,label:a,placeholder:n,description:i}){return e.jsxs(le,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(H,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),i?e.jsx(ce,{className:"text-xs text-[var(--otari-muted)]",children:i}):null]})}function z({label:t,value:s,onChange:a,description:n,placeholder:i,extra:d=[],includeCatalog:l=!0}){var k;const g=ne(),u=x.useMemo(()=>l?[...d,...(g.data??[]).map(o=>({id:o.id,name:o.name}))]:d,[g.data,d,l]),[p,m]=x.useState(()=>{var o;return((o=u.find(b=>b.id===s))==null?void 0:o.name)??""}),j=((k=u.find(o=>o.id===s))==null?void 0:k.name)??"",h=p.trim()===j.trim()?"":p.trim().toLowerCase(),c=u.filter(o=>!h||o.name.toLowerCase().includes(h)||o.id.toLowerCase().includes(h)).slice(0,50);return e.jsxs(T.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:p,onInputChange:m,onSelectionChange:o=>{var b;o!=null?(a(String(o)),m(((b=u.find(N=>N.id===String(o)))==null?void 0:b.name)??"")):(a(""),m(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(T.InputGroup,{children:[e.jsx(H,{placeholder:i??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:o=>o.currentTarget.select()}),e.jsx(T.Trigger,{})]}),e.jsx(T.Popover,{children:e.jsx(ue,{items:c,className:"max-h-72 overflow-auto",children:o=>e.jsx(xe,{id:o.id,textValue:o.name,children:o.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function U({getPayload:t}){const s=ie(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:O(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):s.data.discovery_unsupported?e.jsxs("span",{className:"block max-w-md break-words text-xs text-amber-800",children:["This provider does not list models, so the key could not be verified here. Save it and use the provider; declare its model ids under ",e.jsx("code",{children:"models:"})," to have them show up in the catalogue. If you did not expect this, check the provider's reply below.",s.data.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:s.data.error}):null]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function pe({onClose:t}){var A;const s=$(),[a,n]=x.useState(""),[i,d]=x.useState(""),[l,g]=x.useState(!1),[u,p]=x.useState(""),[m,j]=x.useState(""),h=re(a),c=((A=h.data)==null?void 0:A.id)===a?h.data:void 0;x.useEffect(()=>{c&&p(c.default_api_base??"")},[c]);const k=(c==null?void 0:c.env_key_present)??!1,o=((c==null?void 0:c.requires_api_key)??!0)&&!k,b=m.trim()!==""&&m.trim()!==a,N=/[:/]/.test(m),P=a!==""&&!N&&(!o||i.trim()!=="")&&!s.isPending,C=()=>{P&&s.mutate({instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsx(z,{label:"Provider",value:a,onChange:w=>{n(w),j(""),p("")},description:"Its endpoint is built in."}),e.jsx(E,{value:i,onChange:d,label:c&&!o?"API key (optional)":"API key",description:c?o?`${c.name}'s endpoint is built in — just add your key.`:k?`${c.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${c.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>g(w=>!w),children:l?"Hide advanced":"Advanced (API base, rename)"}),l?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:u,onChange:p,placeholder:(c==null?void 0:c.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:m,onChange:j,placeholder:a||"instance name",description:N?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!P,onPress:C,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a===""?null:{instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null}})]})]})}function he({onClose:t}){const s=$(),[a,n]=x.useState(""),[i,d]=x.useState("openai-compatible"),[l,g]=x.useState(""),[u,p]=x.useState(""),m=/[:/]/.test(a),j=a.trim()!==""&&!m&&l.trim()!==""&&!s.isPending,h=()=>{j&&s.mutate({instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:m?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(z,{label:"Compatible with",value:i,onChange:d,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:l,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(E,{value:u,onChange:p,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!j,onPress:h,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a.trim()===""||l.trim()===""?null:{instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null}})]})]})}function ve({onClose:t}){const[s,a]=x.useState("known");return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,i])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:i},n))})}),s==="known"?e.jsx(pe,{onClose:t}):e.jsx(he,{onClose:t})]})})}function ge({provider:t,onClose:s}){const a=te(),[n,i]=x.useState(t.provider_type??""),[d,l]=x.useState(t.api_base??""),[g,u]=x.useState(!1),[p,m]=x.useState(""),j=()=>{if(a.isPending)return;const h={provider_type:n.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};g&&p.trim()&&(h.api_key=p.trim()),a.mutate({instance:t.instance,body:h},{onSuccess:s})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(I,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:i,placeholder:"openai"}),e.jsx(_,{label:"API base",value:d,onChange:l,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(E,{value:p,onChange:m,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),m("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(f,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:a.isPending,onPress:j,children:a.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function fe(t,s){const a=new Map((s??[]).map(d=>[d.instance,d])),n=new Map((t??[]).map(d=>[d.instance,d]));return[...new Set([...a.keys(),...n.keys()])].sort().map(d=>{const l=a.get(d);return{instance:d,source:l?"stored":"config",stored:l,meta:n.get(d)}})}function je({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(me,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):t.discovery_unsupported?e.jsxs("span",{className:"block max-w-xs break-words text-xs text-amber-800",children:["Could not list models, so the key could not be verified. It may still work for requests.",t.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:t.error}):null]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function be({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=!t.ok&&t.discovery_unsupported,a=t.ok?"border-green-200 bg-green-50 text-green-700":s?"border-amber-200 bg-amber-50 text-amber-800":"border-red-200 bg-red-50 text-red-700",n=t.ok?"bg-green-500":s?"bg-amber-500":"bg-red-500",i=t.checked_at?`Last checked ${q(t.checked_at)}`:"Not checked yet",d=s?`${t.error??"This provider does not list models."} Requests to it may still work.`:t.error??"Unreachable",l=t.ok?i:`${d} · ${i}`;return e.jsxs("span",{title:l,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${n}`}),t.ok?"Reachable":s?"No model discovery":"Unreachable"]})}function ye({healthy:t,degraded:s,total:a,checkedAt:n}){const d=t===a?"bg-green-500":t+s===a?"bg-amber-500":"bg-red-500",l=se();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${d}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s>0?e.jsxs("span",{className:"text-amber-800",children:[s," without model discovery"]}):null,n?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",q(n)]}):null,e.jsx(f,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function R({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function ke({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n,secretKeyConfigured:i}){return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(R,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(R,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(R,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(f,{variant:"primary",isDisabled:!i,onPress:t,children:"Add your first provider"})})]})})}function Ae(){var K,B,D,L;const t=Y(),s=V(),a=G(),n=Q(),i=W(),d=J(),l=X(),[g,u]=x.useState(!1),[p,m]=x.useState(null),[j,h]=x.useState({}),c=fe((K=t.data)==null?void 0:K.providers,s.data),k=new Map((((B=n.data)==null?void 0:B.providers)??[]).map(r=>[r.instance,r])),o=t.isLoading||s.isLoading,b=((D=s.data)==null?void 0:D.find(r=>r.instance===p))??null,N=((L=a.data)==null?void 0:L.require_pricing)===!0&&a.data.default_pricing===!1,P=a.data?a.data.secret_key_configured!==!1:!a.isError,C=!o&&c.length===0&&!g,A=r=>{h(v=>({...v,[r]:{status:"pending"}})),d.mutate(r,{onSuccess:v=>h(y=>({...y,[r]:{status:"done",...v}})),onError:v=>h(y=>({...y,[r]:{status:"done",ok:!1,model_count:0,error:O(v),discovery_unsupported:!1}}))})},w=[{id:"provider",header:"Provider",isRowHeader:!0,cell:r=>e.jsx(M,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"font-medium text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})},{id:"type",header:"Type",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:((v=r.meta)==null?void 0:v.provider_type)??((y=r.stored)==null?void 0:y.provider_type)??r.instance})}},{id:"source",header:"Source",cell:r=>e.jsx(de,{size:"sm",color:r.source==="stored"?"accent":"default",children:r.source==="stored"?"stored":"config"})},{id:"api_key",header:"API key",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:(v=r.stored)!=null&&v.last4?`••••${r.stored.last4}`:"none set"}):(y=r.meta)!=null&&y.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"})}},{id:"status",header:"Status",cell:r=>e.jsx(be,{health:k.get(r.instance)})},{id:"actions",header:"Actions",align:"end",cell:r=>{var v,y;return r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:((v=j[r.instance])==null?void 0:v.status)==="pending"||((y=r.stored)==null?void 0:y.decryptable)===!1,onPress:()=>A(r.instance),children:"Test"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{u(!1),m(r.instance)},children:"Edit"}),e.jsx(ae,{confirmLabel:"Delete",isPending:i.isPending,onConfirm:()=>i.mutate(r.instance),children:"Delete"})]}),e.jsx(je,{state:j[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})}}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||C?null:e.jsx(f,{variant:"primary",isDisabled:!P,onPress:()=>{m(null),u(!0)},children:"Add provider"})}),e.jsx(I,{error:t.error??s.error??a.error??n.error??l.error??i.error}),P?null:e.jsxs(ee,{tone:"warning",children:[e.jsx("code",{children:"OTARI_SECRET_KEY"})," is not set, so provider keys can't be encrypted at rest and adding providers from the dashboard is disabled. Set it on the server and restart to add providers here. Providers defined in"," ",e.jsx("code",{children:"config.yml"})," keep working without it."]}),C?e.jsx(ke,{onAddProvider:()=>{m(null),u(!0)},needsPricing:N,onEnablePricing:()=>l.mutate({default_pricing:!0}),enabling:l.isPending,secretKeyConfigured:P}):null,g&&P?e.jsx(ve,{onClose:()=>u(!1)}):null,b?e.jsx(ge,{provider:b,onClose:()=>m(null)}):null,!o&&c.length>0&&n.data&&n.data.total>0?e.jsx(ye,{healthy:n.data.healthy,degraded:n.data.degraded,total:n.data.total,checkedAt:n.data.checked_at}):null,C?null:e.jsx(oe,{ariaLabel:"Providers",columns:w,rows:c,getRowKey:r=>r.instance,isLoading:o,emptyContent:"No providers yet. Add your first provider to start serving models."})]})}export{Ae as ProvidersPage}; diff --git a/src/gateway/static/dashboard/assets/SettingsPage-OsrEeYZu.js b/src/gateway/static/dashboard/assets/SettingsPage-DaOqG5a9.js similarity index 99% rename from src/gateway/static/dashboard/assets/SettingsPage-OsrEeYZu.js rename to src/gateway/static/dashboard/assets/SettingsPage-DaOqG5a9.js index 23a943f7d..09fe89f26 100644 --- a/src/gateway/static/dashboard/assets/SettingsPage-OsrEeYZu.js +++ b/src/gateway/static/dashboard/assets/SettingsPage-DaOqG5a9.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{Q as R,a5 as C,P,E as y,U as E,ac as T,ad as _,ae as D,F as A,af as O,a2 as F,ag as I,I as w}from"./index-BCvb90M0.js";import{d as v,B as h,A as d,g as K,I as z}from"./heroui-BI50yK5B.js";function b(t,r){return{[t]:r}}function M(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function L(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||M(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(A,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function U({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function V({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(V,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function Q({source:t}){const r=O(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:K({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(G,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function X(){var o;const t=F(),r=I(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(Q,{source:t}),e.jsx(X,{})]})})]})}function W({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=T(),r=_(),s=D(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(W,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&L(l,n)),k=ee(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,t.isLoading?e.jsx(E,{}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(U,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,L as fieldMatches}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{Q as R,a5 as C,P,E as y,U as E,ac as T,ad as _,ae as D,F as A,af as O,a2 as F,ag as I,I as w}from"./index-DsUY4UvK.js";import{d as v,B as h,A as d,g as K,I as z}from"./heroui-BI50yK5B.js";function b(t,r){return{[t]:r}}function M(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function L(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||M(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(A,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function U({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function V({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(V,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function Q({source:t}){const r=O(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:K({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(G,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function X(){var o;const t=F(),r=I(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(Q,{source:t}),e.jsx(X,{})]})})]})}function W({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=T(),r=_(),s=D(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(W,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&L(l,n)),k=ee(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,t.isLoading?e.jsx(E,{}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(U,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,L as fieldMatches}; diff --git a/src/gateway/static/dashboard/assets/TablePagination-DSU6cRH7.js b/src/gateway/static/dashboard/assets/TablePagination-DgA36VXY.js similarity index 98% rename from src/gateway/static/dashboard/assets/TablePagination-DSU6cRH7.js rename to src/gateway/static/dashboard/assets/TablePagination-DgA36VXY.js index 4865d5f46..e3b563a5f 100644 --- a/src/gateway/static/dashboard/assets/TablePagination-DSU6cRH7.js +++ b/src/gateway/static/dashboard/assets/TablePagination-DgA36VXY.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{I as w,E as M,F as D}from"./index-BCvb90M0.js";import{A as o,B as x,T as F,L as $,I as T,S as y}from"./heroui-BI50yK5B.js";function _({label:t,value:r,onChange:a,isRequired:c,autoFocus:i}){return e.jsxs(F,{value:r,onChange:a,isRequired:c,className:"flex flex-col gap-1",children:[e.jsx($,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsx(T,{inputMode:"decimal",placeholder:"0.00",autoFocus:i})]})}function R(t){const r=t.trim();if(r==="")return null;const a=Number(r);return Number.isFinite(a)&&a>=0?a:Number.NaN}const C=t=>`Recompute cost for ${t.toLocaleString()} imported ${t===1?"row":"rows"} from each row's own token counts at these per-1M rates. Enforced gateway rows are never affected.`;function W({isOpen:t,onOpenChange:r,targetCount:a,isPending:c,error:i,onSubmit:E,title:I="Set price",description:L=C}){const[j,p]=u.useState(""),[n,h]=u.useState(""),[b,N]=u.useState(""),[f,v]=u.useState("");u.useEffect(()=>{t&&(p(""),h(""),N(""),v(""))},[t]);const m=R(j),l=R(n),d=R(b),s=R(f),g=m===null||Number.isNaN(m)||l===null||Number.isNaN(l)||Number.isNaN(d??0)||Number.isNaN(s??0),S=()=>{g||m===null||l===null||E({input_price_per_million:m,output_price_per_million:l,...d!==null&&!Number.isNaN(d)?{cache_read_price_per_million:d}:{},...s!==null&&!Number.isNaN(s)?{cache_write_price_per_million:s}:{}})};return e.jsx(o,{isOpen:t,onOpenChange:r,children:t?e.jsx(o.Backdrop,{children:e.jsx(o.Container,{placement:"center",size:"lg",children:e.jsxs(o.Dialog,{children:[e.jsx(o.Header,{children:e.jsx(o.Heading,{children:I})}),e.jsxs(o.Body,{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:L(a)}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(_,{label:"Input $ / 1M",value:j,onChange:p,isRequired:!0,autoFocus:!0}),e.jsx(_,{label:"Output $ / 1M",value:n,onChange:h,isRequired:!0}),e.jsx(_,{label:"Cache read $ / 1M",value:b,onChange:N}),e.jsx(_,{label:"Cache write $ / 1M",value:f,onChange:v})]}),e.jsx(w,{tone:"info",children:"Leave a cache rate blank to bill those tokens at the input rate."}),e.jsx(M,{error:i})]}),e.jsxs(o.Footer,{children:[e.jsx(x,{variant:"ghost",isDisabled:c,onPress:()=>r(!1),children:"Cancel"}),e.jsx(x,{variant:"primary",isDisabled:g,isPending:c,onPress:S,children:"Set price"})]})]})})}):null})}const P=[25,50,100];function q({page:t,pageSize:r,total:a,rowsOnPage:c,onPageChange:i,onPageSizeChange:E,pageSizeOptions:I=P,isFetching:L=!1,hasNextFallback:j=!1}){const p=u.useId(),n=a!=null?Math.max(1,Math.ceil(a/r)):null,h=t===0,b=n!=null?t>=n-1:!j,N=c>0?t*r+1:0,f=t*r+c,v=a!=null?a===0?"0 of 0":`${N.toLocaleString()}–${f.toLocaleString()} of ${a.toLocaleString()}`:c>0?`${N.toLocaleString()}–${f.toLocaleString()}`:"0",[m,l]=u.useState(String(t+1));u.useEffect(()=>{l(String(t+1))},[t]);const d=()=>{const s=Number.parseInt(m,10);if(Number.isNaN(s)){l(String(t+1));return}const g=n??Number.MAX_SAFE_INTEGER,S=Math.min(Math.max(s,1),g);S-1!==t?i(S-1):l(String(t+1))};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:p,className:"text-sm text-[var(--otari-muted)]",children:"Rows"}),e.jsx(D,{id:p,ariaLabel:"Rows per page",value:String(r),onChange:s=>E(Number.parseInt(s,10)),options:I.map(s=>({value:String(s),label:String(s)}))}),L?e.jsx(y,{size:"sm"}):null]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[var(--otari-muted)] tabular-nums",children:v}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"outline","aria-label":"First page",isDisabled:h,onPress:()=>i(0),children:"«"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Previous page",isDisabled:h,onPress:()=>i(t-1),children:"‹"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{"aria-label":"Page number",inputMode:"numeric",value:m,onChange:s=>l(s.target.value.replace(/[^0-9]/g,"")),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()},onBlur:d,className:"w-12 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-2 py-1 text-center text-sm text-[var(--otari-ink)] tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"}),n!=null?e.jsxs("span",{className:"tabular-nums",children:["/ ",n.toLocaleString()]}):null]}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Next page",isDisabled:b,onPress:()=>i(t+1),children:"›"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Last page",isDisabled:n==null||b,onPress:()=>n!=null&&i(n-1),children:"»"})]})]})]})}export{P,W as S,q as T}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{I as w,E as M,F as D}from"./index-DsUY4UvK.js";import{A as o,B as x,T as F,L as $,I as T,S as y}from"./heroui-BI50yK5B.js";function _({label:t,value:r,onChange:a,isRequired:c,autoFocus:i}){return e.jsxs(F,{value:r,onChange:a,isRequired:c,className:"flex flex-col gap-1",children:[e.jsx($,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsx(T,{inputMode:"decimal",placeholder:"0.00",autoFocus:i})]})}function R(t){const r=t.trim();if(r==="")return null;const a=Number(r);return Number.isFinite(a)&&a>=0?a:Number.NaN}const C=t=>`Recompute cost for ${t.toLocaleString()} imported ${t===1?"row":"rows"} from each row's own token counts at these per-1M rates. Enforced gateway rows are never affected.`;function W({isOpen:t,onOpenChange:r,targetCount:a,isPending:c,error:i,onSubmit:E,title:I="Set price",description:L=C}){const[j,p]=u.useState(""),[n,h]=u.useState(""),[b,N]=u.useState(""),[f,v]=u.useState("");u.useEffect(()=>{t&&(p(""),h(""),N(""),v(""))},[t]);const m=R(j),l=R(n),d=R(b),s=R(f),g=m===null||Number.isNaN(m)||l===null||Number.isNaN(l)||Number.isNaN(d??0)||Number.isNaN(s??0),S=()=>{g||m===null||l===null||E({input_price_per_million:m,output_price_per_million:l,...d!==null&&!Number.isNaN(d)?{cache_read_price_per_million:d}:{},...s!==null&&!Number.isNaN(s)?{cache_write_price_per_million:s}:{}})};return e.jsx(o,{isOpen:t,onOpenChange:r,children:t?e.jsx(o.Backdrop,{children:e.jsx(o.Container,{placement:"center",size:"lg",children:e.jsxs(o.Dialog,{children:[e.jsx(o.Header,{children:e.jsx(o.Heading,{children:I})}),e.jsxs(o.Body,{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:L(a)}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(_,{label:"Input $ / 1M",value:j,onChange:p,isRequired:!0,autoFocus:!0}),e.jsx(_,{label:"Output $ / 1M",value:n,onChange:h,isRequired:!0}),e.jsx(_,{label:"Cache read $ / 1M",value:b,onChange:N}),e.jsx(_,{label:"Cache write $ / 1M",value:f,onChange:v})]}),e.jsx(w,{tone:"info",children:"Leave a cache rate blank to bill those tokens at the input rate."}),e.jsx(M,{error:i})]}),e.jsxs(o.Footer,{children:[e.jsx(x,{variant:"ghost",isDisabled:c,onPress:()=>r(!1),children:"Cancel"}),e.jsx(x,{variant:"primary",isDisabled:g,isPending:c,onPress:S,children:"Set price"})]})]})})}):null})}const P=[25,50,100];function q({page:t,pageSize:r,total:a,rowsOnPage:c,onPageChange:i,onPageSizeChange:E,pageSizeOptions:I=P,isFetching:L=!1,hasNextFallback:j=!1}){const p=u.useId(),n=a!=null?Math.max(1,Math.ceil(a/r)):null,h=t===0,b=n!=null?t>=n-1:!j,N=c>0?t*r+1:0,f=t*r+c,v=a!=null?a===0?"0 of 0":`${N.toLocaleString()}–${f.toLocaleString()} of ${a.toLocaleString()}`:c>0?`${N.toLocaleString()}–${f.toLocaleString()}`:"0",[m,l]=u.useState(String(t+1));u.useEffect(()=>{l(String(t+1))},[t]);const d=()=>{const s=Number.parseInt(m,10);if(Number.isNaN(s)){l(String(t+1));return}const g=n??Number.MAX_SAFE_INTEGER,S=Math.min(Math.max(s,1),g);S-1!==t?i(S-1):l(String(t+1))};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:p,className:"text-sm text-[var(--otari-muted)]",children:"Rows"}),e.jsx(D,{id:p,ariaLabel:"Rows per page",value:String(r),onChange:s=>E(Number.parseInt(s,10)),options:I.map(s=>({value:String(s),label:String(s)}))}),L?e.jsx(y,{size:"sm"}):null]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[var(--otari-muted)] tabular-nums",children:v}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"outline","aria-label":"First page",isDisabled:h,onPress:()=>i(0),children:"«"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Previous page",isDisabled:h,onPress:()=>i(t-1),children:"‹"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{"aria-label":"Page number",inputMode:"numeric",value:m,onChange:s=>l(s.target.value.replace(/[^0-9]/g,"")),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()},onBlur:d,className:"w-12 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-2 py-1 text-center text-sm text-[var(--otari-ink)] tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"}),n!=null?e.jsxs("span",{className:"tabular-nums",children:["/ ",n.toLocaleString()]}):null]}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Next page",isDisabled:b,onPress:()=>i(t+1),children:"›"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Last page",isDisabled:n==null||b,onPress:()=>n!=null&&i(n-1),children:"»"})]})]})]})}export{P,W as S,q as T}; diff --git a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-CSxGfHtw.js b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-B5j54QGf.js similarity index 99% rename from src/gateway/static/dashboard/assets/ToolsGuardrailsPage-CSxGfHtw.js rename to src/gateway/static/dashboard/assets/ToolsGuardrailsPage-B5j54QGf.js index 392561c0e..3c4c714ac 100644 --- a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-CSxGfHtw.js +++ b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-B5j54QGf.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x}from"./react-dgEcD0HR.js";import{ah as L,ai as C,P,E,U as R,N as w,aj as D,F as U}from"./index-BCvb90M0.js";import{d as N,B as g}from"./heroui-BI50yK5B.js";function M(s,t){return{[s]:t}}const B=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=x.useState(null),a=x.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function z({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",b="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r),[m,p]=x.useState(null),c=D();x.useEffect(()=>{i(r)},[r]);const o=l.trim()!==r,d=l.trim(),h=m!==null&&m===d;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:l,disabled:n,placeholder:"unset",onChange:v=>{i(v.target.value),c.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(d===""?null:d),children:"Save"}),e.jsx(g,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:d===""||c.isPending,onPress:()=>{p(d),c.mutate({service:s.service,url:d})},children:c.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:c.isPending||!h?null:c.error?e.jsx("span",{className:"text-red-700",children:w(c.error)}):c.data?e.jsx("span",{className:c.data.ok?"font-medium text-green-700":"text-red-700",children:c.data.reason}):null}),e.jsx(j,{message:a})]})]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:p=>i(p.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(l.trim()===""?null:l.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l.trim(),p=Number(m),o=(m===""||Number.isInteger(p)&&p>=1)&&m!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:d=>i(d.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(m===""?null:p),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(U,{ariaLabel:s.key,value:r,onChange:l=>t(l==="default"?null:l==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function O({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(F,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n})}function V(){const s=L(),t=C(),[a,n]=$(),[r,l]=x.useState({}),i=s.data,m=!i||t.isPending,p=new Map(((i==null?void 0:i.fields)??[]).map(o=>[o.key,o])),c=(o,d)=>{l(h=>{const{[o.key]:v,...u}=h;return u}),t.mutate(M(o.key,d),{onSuccess:()=>n(`${o.key} saved`),onError:h=>l(v=>({...v,[o.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(E,{error:s.error}),s.isLoading?e.jsx(R,{}):null,B.map(o=>{const d=o.order.map(u=>p.get(u)).filter(u=>u!==void 0),h=((i==null?void 0:i.fields)??[]).filter(u=>u.service===o.key&&!o.order.includes(u.key)),v=[...d,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:o.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:o.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(O,{field:u,onSave:T=>c(u,T),saveError:r[u.key],disabled:m},u.key))})})]},o.key)}),e.jsx(z,{message:a})]})}export{V as ToolsGuardrailsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x}from"./react-dgEcD0HR.js";import{ah as L,ai as C,P,E,U as R,N as w,aj as D,F as U}from"./index-DsUY4UvK.js";import{d as N,B as g}from"./heroui-BI50yK5B.js";function M(s,t){return{[s]:t}}const B=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=x.useState(null),a=x.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function z({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",b="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r),[m,p]=x.useState(null),c=D();x.useEffect(()=>{i(r)},[r]);const o=l.trim()!==r,d=l.trim(),h=m!==null&&m===d;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:l,disabled:n,placeholder:"unset",onChange:v=>{i(v.target.value),c.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(d===""?null:d),children:"Save"}),e.jsx(g,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:d===""||c.isPending,onPress:()=>{p(d),c.mutate({service:s.service,url:d})},children:c.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:c.isPending||!h?null:c.error?e.jsx("span",{className:"text-red-700",children:w(c.error)}):c.data?e.jsx("span",{className:c.data.ok?"font-medium text-green-700":"text-red-700",children:c.data.reason}):null}),e.jsx(j,{message:a})]})]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:p=>i(p.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(l.trim()===""?null:l.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l.trim(),p=Number(m),o=(m===""||Number.isInteger(p)&&p>=1)&&m!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:d=>i(d.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(m===""?null:p),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(U,{ariaLabel:s.key,value:r,onChange:l=>t(l==="default"?null:l==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function O({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(F,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n})}function V(){const s=L(),t=C(),[a,n]=$(),[r,l]=x.useState({}),i=s.data,m=!i||t.isPending,p=new Map(((i==null?void 0:i.fields)??[]).map(o=>[o.key,o])),c=(o,d)=>{l(h=>{const{[o.key]:v,...u}=h;return u}),t.mutate(M(o.key,d),{onSuccess:()=>n(`${o.key} saved`),onError:h=>l(v=>({...v,[o.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(E,{error:s.error}),s.isLoading?e.jsx(R,{}):null,B.map(o=>{const d=o.order.map(u=>p.get(u)).filter(u=>u!==void 0),h=((i==null?void 0:i.fields)??[]).filter(u=>u.service===o.key&&!o.order.includes(u.key)),v=[...d,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:o.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:o.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(O,{field:u,onSave:T=>c(u,T),saveError:r[u.key],disabled:m},u.key))})})]},o.key)}),e.jsx(z,{message:a})]})}export{V as ToolsGuardrailsPage}; diff --git a/src/gateway/static/dashboard/assets/UsagePage-CtRIjZgb.js b/src/gateway/static/dashboard/assets/UsagePage-DQoRJkY3.js similarity index 98% rename from src/gateway/static/dashboard/assets/UsagePage-CtRIjZgb.js rename to src/gateway/static/dashboard/assets/UsagePage-DQoRJkY3.js index 56e6de883..2264caf5d 100644 --- a/src/gateway/static/dashboard/assets/UsagePage-CtRIjZgb.js +++ b/src/gateway/static/dashboard/assets/UsagePage-DQoRJkY3.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as Ae,r as i}from"./react-dgEcD0HR.js";import{u as Ue,a as Re,k as te,e as Oe,d as Y,W as T,ak as ke,P as Ke,E as ye,al as je,R as $e,j as se,w as Be,X as q,_ as A,Z as V,a0 as Ie,am as B,f as ze,g as He,h as Ze,b as Ge,c as xe}from"./index-BCvb90M0.js";import{A as We,F as Ye}from"./FilterChips-EkMEVflY.js";import{u as Qe,r as Ve,B as Je}from"./tableSelection-9hV37uhu.js";import{S as ae,B as Xe}from"./charts-DIsd9m--.js";import{C as et}from"./ConfirmDialog-BXAKoq6j.js";import{D as we}from"./DataTable-Bmn_eYSV.js";import{T as tt,S as st}from"./TablePagination-DSU6cRH7.js";import{B as I,S as pe}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function Q(t){return t.toLocaleString()}function at(t){return t===null?"—":t<1e3?`${Math.round(t)} ms`:`${(t/1e3).toFixed(2)} s`}const fe=ze(je,ke),ne=15,_e="__other__",ve="__unknown__";function Se({title:t,rows:r,totalCost:h,emptyLabel:n,onDrill:v,loading:m}){const[c,x]=i.useState(!1),j=c?r:r.slice(0,ne),U=r.length-j.length,N=o=>o.is_other?_e:o.key??ve,R=[{id:"name",header:t.replace("Spend by ",""),isRowHeader:!0,cell:o=>{const d=h>0?o.cost/h:0;return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate text-[var(--otari-ink)]",children:o.is_other?`Other (${o.requests.toLocaleString()} req)`:o.key===null?"(unknown)":o.key}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,d*100)}%`}})})]})}},{id:"requests",header:"Requests",align:"end",cell:o=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:Q(o.requests)})},{id:"spend",header:"Spend",align:"end",cell:o=>e.jsx("span",{className:"text-[var(--otari-ink)]",children:V(o.cost)})}];return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(we,{ariaLabel:t,columns:R,rows:j,getRowKey:N,isLoading:m,emptyContent:n,onRowAction:o=>{o!==_e&&o!==ve&&v(o)}}),!m&&U>0?e.jsxs(I,{size:"sm",variant:"ghost",onPress:()=>x(!0),children:["Show all ",r.length]}):null,!m&&c&&r.length>ne?e.jsxs(I,{size:"sm",variant:"ghost",onPress:()=>x(!1),children:["Show top ",ne]}):null]})}const nt=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function ot(t,r){return r==="cost"?t.cost:r==="tokens"?t.tokens:t.requests}function be(t,r){return r==="cost"?V(t):r==="tokens"?B(t):Q(t)}function rt(t,r){const h=new Date(t);return Number.isNaN(h.getTime())?t:r==="hour"?h.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):h.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function lt(t,r,h){const n=t.map(m=>({label:rt(m.bucket_start,h),value:ot(m,r)})),v=n.length?Math.max(...n.map(m=>m.value)):0;return{points:n,peak:v,count:t.length}}const it=50;function ct(t){const r=new Date(t).getTime();if(Number.isNaN(r))return t;const h=Math.max(0,Math.round((Date.now()-r)/1e3));if(h<60)return`${h}s ago`;const n=Math.round(h/60);if(n<60)return`${n}m ago`;const v=Math.round(n/60);return v<24?`${v}h ago`:`${Math.round(v/24)}d ago`}function dt({status:t}){return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:t})}const ut=[{id:"time",header:"Time",isRowHeader:!0,cell:t=>e.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(t.timestamp).toLocaleString(),children:ct(t.timestamp)})},{id:"model",header:"Model",cell:t=>e.jsx("span",{className:"text-[var(--otari-ink)]",children:t.model})},{id:"user",header:"User",cell:t=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:t.user_id??"—"})},{id:"tokens",header:"Tokens",align:"end",cell:t=>t.total_tokens===null?"—":t.total_tokens.toLocaleString()},{id:"cost",header:"Cost",align:"end",cell:t=>t.cost===null?"—":V(t.cost)},{id:"status",header:"Status",cell:t=>e.jsx(dt,{status:t.status})}],mt=t=>t.id;function ht({filters:t,anyFilter:r}){var $,H;const[h,n]=i.useState(0),[v,m]=i.useState(it),c=Qe(),x=He(),j=Ze(),[U,N]=i.useState(!1),[R,o]=i.useState(!1),d=JSON.stringify(t),L=i.useRef(d);i.useEffect(()=>{L.current!==d&&(L.current=d,n(0),c.clear())},[d,c]);const p=Ge(t,h,v),C=xe(t),g=p.data??[],P=C.isSuccess&&!C.isPlaceholderData?(($=C.data)==null?void 0:$.total)??0:null,O=g.filter(_=>!_.counts_toward_budget).map(_=>_.id),f=g.filter(_=>_.counts_toward_budget).map(_=>_.id),S=Ve(c.selectedKeys,O),b=S.length,y=c.allMatching||b>0,D=i.useMemo(()=>({...t,counts_toward_budget:!1}),[t]),k=xe(D,y),E=k.isSuccess?((H=k.data)==null?void 0:H.total)??null:null,K=O.length>0&&b===O.length&&E!=null&&E>b,F=c.allMatching?E??b:b,l=()=>c.allMatching?{by_filter:!0,model:t.model,user_id:t.user_id,api_key_id:t.api_key_id,start_date:t.start_date,end_date:t.end_date,priced:t.priced}:{ids:S},a=()=>x.mutate(l(),{onSuccess:()=>{N(!1),c.clear()}}),u=_=>j.mutate({...l(),..._},{onSuccess:()=>{o(!1),c.clear()}});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Individual requests"}),e.jsx(ye,{error:p.error??C.error}),y?e.jsxs(Je,{selectedCount:F,allMatching:c.allMatching,matchingTotal:E,canSelectAllMatching:K,onSelectAllMatching:c.enableAllMatching,onClear:c.clear,children:[e.jsx(I,{size:"sm",variant:"primary",onPress:()=>o(!0),children:"Set price"}),e.jsx(I,{size:"sm",variant:"danger",onPress:()=>N(!0),children:"Delete"})]}):null,e.jsx(we,{ariaLabel:"Individual requests",columns:ut,rows:g,getRowKey:mt,isLoading:p.isLoading,emptyContent:r?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:c.selectedKeys,onSelectionChange:c.onSelectionChange,disabledKeys:f}),e.jsx(tt,{page:h,pageSize:v,total:P,rowsOnPage:g.length,onPageChange:n,onPageSizeChange:_=>{m(_),n(0)},isFetching:p.isFetching,hasNextFallback:g.length===v}),e.jsx(et,{isOpen:U,onOpenChange:N,heading:"Delete usage rows",body:`Delete ${F.toLocaleString()} imported ${F===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:x.isPending,error:x.error,onConfirm:a}),e.jsx(st,{isOpen:R,onOpenChange:o,targetCount:F,isPending:j.isPending,error:j.error,onSubmit:u})]})}function wt(){var ue,me,he,ge;const t=Ae(),r=Ue(),h=Re(),[n,v]=i.useState(fe),[m,c]=i.useState(()=>te(fe.seconds??0)),[x,j]=i.useState(!1),[U,N]=i.useState(),[R,o]=i.useState(),[d,L]=i.useState(""),[p,C]=i.useState(""),[g,z]=i.useState(""),[P,O]=i.useState("cost"),f=x?U:m,S=x?R:void 0,b=x?f?Oe(f,S):"day":n.bucket,y=i.useMemo(()=>({start_date:f,end_date:S,model:d.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0}),[f,S,d,p,g]),D=i.useMemo(()=>{if(x){if(!f||!S)return null;const s=new Date(S).getTime()-new Date(f).getTime();return s>0?{...y,start_date:new Date(new Date(f).getTime()-s).toISOString(),end_date:f}:null}return!m||n.seconds===null?null:{...y,start_date:new Date(new Date(m).getTime()-n.seconds*1e3).toISOString(),end_date:m}},[x,f,S,y,n.seconds,m]),k=Y(y,b),E=Y(D??y,b,D!==null),oe=i.useMemo(()=>({start_date:m,model:d.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0}),[m,d,p,g]),K=Y(oe,n.bucket),F=(((ue=K.data)==null?void 0:ue.series)??[]).map(s=>({bucketStart:s.bucket_start,requests:s.requests})),l=k.data,a=l==null?void 0:l.totals,u=D!==null?(me=E.data)==null?void 0:me.totals:void 0,$=a?T(a.cost,u==null?void 0:u.cost):null,H=i.useMemo(()=>({...y,model:void 0}),[y]),_=Y(H,b),J=((ge=(he=_.data)==null?void 0:he.by_model)==null?void 0:ge.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],re=(r.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),le=(h.data??[]).map(s=>({value:s.id,label:s.key_name??`${s.id.slice(0,8)}…`})),Ne=(d&&!J.includes(d)?[d,...J]:J).map(s=>({value:s,label:s})),Ce=x||n.key!==ke,Z=!!(d.trim()||p||g||Ce),ie=(s,w)=>{var G;return((G=s.find(W=>W.value===w))==null?void 0:G.label)??w},Pe=()=>{L(""),C(""),z("")},Ee=[...p?[{key:"user",label:"User",value:ie(re,p),onClear:()=>C("")}]:[],...d.trim()?[{key:"model",label:"Model",value:d.trim(),onClear:()=>L("")}]:[],...g?[{key:"key",label:"API key",value:ie(le,g),onClear:()=>z("")}]:[]],qe=!!(l&&a&&a.request_count===0&&!Z),Le=(l==null?void 0:l.start_date)??f,De=(l==null?void 0:l.end_date)??S,ce=s=>{j(!1),v(s),c(te(s.seconds??0)),N(void 0),o(void 0)},Fe=(s,w)=>{j(!0),N(s),o(w)},Me=()=>{x||c(te(n.seconds??0)),k.refetch(),K.refetch(),_.refetch(),D!==null&&E.refetch()},de=s=>{const w=new URLSearchParams;f&&w.set("start_date",f),S&&w.set("end_date",S);for(const[G,W]of Object.entries(s))W&&w.set(G,W);t(`/activity?${w.toString()}`)},Te=a&&a.request_count>0?a.error_count/a.request_count:0,M=(l==null?void 0:l.series)??[],X=M.length>1,ee=lt(M,P,b);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Ke,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log."}),e.jsx(ye,{error:k.error}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(We,{presets:je,extentKey:n.key,onPreset:ce,onSelectRange:Fe,onSelectFull:()=>ce(n),series:F,bucket:n.bucket,windowStart:Le,windowEnd:De,loading:K.isLoading,ariaLabel:"Usage request volume over the selected window",action:e.jsx($e,{onRefresh:Me,isFetching:k.isFetching,updatedAt:k.dataUpdatedAt})}),e.jsxs(Ye,{chips:Ee,onClearAll:Pe,children:[e.jsx(se,{label:"User",value:p,onChange:C,options:re,placeholder:"All users"}),e.jsx(se,{label:"Model",value:d,onChange:L,options:Ne,placeholder:"All models"}),e.jsx(se,{label:"API key",value:g,onChange:z,options:le,placeholder:"All keys"})]})]}),qe?e.jsx(Be,{title:"No usage yet",description:"Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[e.jsx(q,{label:"Tracked cost",value:a?V(a.cost):"—",hint:a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[e.jsx(A,{fraction:$}),a.unpriced_requests?`${$!==null?" · ":""}${Q(a.unpriced_requests)} unpriced`:null]}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),e.jsx(q,{label:"Requests",value:a?Q(a.request_count):"—",hint:a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Ie(Te)," errors",u?e.jsxs(e.Fragment,{children:[" · ",e.jsx(A,{fraction:T(a.request_count,u.request_count)})]}):null]}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),e.jsx(q,{label:"Tokens",value:a?B(a.total_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.total_tokens,u==null?void 0:u.total_tokens)}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.tokens),ariaLabel:"Token usage trend over the selected window"}):void 0}),e.jsx(q,{label:"Cache read",value:a?B(a.cache_read_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.cache_read_tokens,u==null?void 0:u.cache_read_tokens)}):null}),e.jsx(q,{label:"Cache write",value:a?B(a.cache_write_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.cache_write_tokens,u==null?void 0:u.cache_write_tokens)}):null}),e.jsx(q,{label:"1h cache write",value:a?B(a.cache_write_1h_tokens??0):"—",hint:a?e.jsx(A,{fraction:T(a.cache_write_1h_tokens??0,(u==null?void 0:u.cache_write_1h_tokens)??0)}):null}),e.jsx(q,{label:"Avg latency",value:a?at(a.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(Se,{title:"Spend by model",rows:(l==null?void 0:l.by_model)??[],totalCost:(a==null?void 0:a.cost)??0,emptyLabel:Z?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>de({model:s,user_id:p||void 0,api_key_id:g||void 0}),loading:k.isLoading}),e.jsx(Se,{title:"Spend by user",rows:(l==null?void 0:l.by_user)??[],totalCost:(a==null?void 0:a.cost)??0,emptyLabel:Z?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>de({user_id:s,model:d.trim()||void 0,api_key_id:g||void 0}),loading:k.isLoading})]}),e.jsx(ht,{filters:y,anyFilter:Z}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[nt.map(s=>e.jsx(I,{size:"sm",variant:P===s.key?"primary":"outline",onPress:()=>O(s.key),children:s.label},s.key)),k.isFetching?e.jsx(pe,{size:"sm"}):null]})]}),k.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(pe,{size:"sm"})}):M.length===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsx(Xe,{data:ee.points,formatValue:s=>be(s,P),ariaLabel:`${P} per ${b}`}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[be(ee.peak,P)," peak · ",ee.count," ",b==="hour"?"hours":"days"," (times in UTC)"]})]})]})]})]})}export{wt as UsagePage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as Ae,r as i}from"./react-dgEcD0HR.js";import{u as Ue,a as Re,k as te,e as Oe,d as Y,W as T,ak as ke,P as Ke,E as ye,al as je,R as $e,j as se,w as Be,X as q,_ as A,Z as V,a0 as Ie,am as B,f as ze,g as He,h as Ze,b as Ge,c as xe}from"./index-DsUY4UvK.js";import{A as We,F as Ye}from"./FilterChips-Dah6AI5Z.js";import{u as Qe,r as Ve,B as Je}from"./tableSelection-9hV37uhu.js";import{S as ae,B as Xe}from"./charts-DIsd9m--.js";import{C as et}from"./ConfirmDialog-NCJIhH2z.js";import{D as we}from"./DataTable-Bmn_eYSV.js";import{T as tt,S as st}from"./TablePagination-DgA36VXY.js";import{B as I,S as pe}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function Q(t){return t.toLocaleString()}function at(t){return t===null?"—":t<1e3?`${Math.round(t)} ms`:`${(t/1e3).toFixed(2)} s`}const fe=ze(je,ke),ne=15,_e="__other__",ve="__unknown__";function Se({title:t,rows:r,totalCost:h,emptyLabel:n,onDrill:v,loading:m}){const[c,x]=i.useState(!1),j=c?r:r.slice(0,ne),U=r.length-j.length,N=o=>o.is_other?_e:o.key??ve,R=[{id:"name",header:t.replace("Spend by ",""),isRowHeader:!0,cell:o=>{const d=h>0?o.cost/h:0;return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate text-[var(--otari-ink)]",children:o.is_other?`Other (${o.requests.toLocaleString()} req)`:o.key===null?"(unknown)":o.key}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,d*100)}%`}})})]})}},{id:"requests",header:"Requests",align:"end",cell:o=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:Q(o.requests)})},{id:"spend",header:"Spend",align:"end",cell:o=>e.jsx("span",{className:"text-[var(--otari-ink)]",children:V(o.cost)})}];return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(we,{ariaLabel:t,columns:R,rows:j,getRowKey:N,isLoading:m,emptyContent:n,onRowAction:o=>{o!==_e&&o!==ve&&v(o)}}),!m&&U>0?e.jsxs(I,{size:"sm",variant:"ghost",onPress:()=>x(!0),children:["Show all ",r.length]}):null,!m&&c&&r.length>ne?e.jsxs(I,{size:"sm",variant:"ghost",onPress:()=>x(!1),children:["Show top ",ne]}):null]})}const nt=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function ot(t,r){return r==="cost"?t.cost:r==="tokens"?t.tokens:t.requests}function be(t,r){return r==="cost"?V(t):r==="tokens"?B(t):Q(t)}function rt(t,r){const h=new Date(t);return Number.isNaN(h.getTime())?t:r==="hour"?h.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):h.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function lt(t,r,h){const n=t.map(m=>({label:rt(m.bucket_start,h),value:ot(m,r)})),v=n.length?Math.max(...n.map(m=>m.value)):0;return{points:n,peak:v,count:t.length}}const it=50;function ct(t){const r=new Date(t).getTime();if(Number.isNaN(r))return t;const h=Math.max(0,Math.round((Date.now()-r)/1e3));if(h<60)return`${h}s ago`;const n=Math.round(h/60);if(n<60)return`${n}m ago`;const v=Math.round(n/60);return v<24?`${v}h ago`:`${Math.round(v/24)}d ago`}function dt({status:t}){return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:t})}const ut=[{id:"time",header:"Time",isRowHeader:!0,cell:t=>e.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(t.timestamp).toLocaleString(),children:ct(t.timestamp)})},{id:"model",header:"Model",cell:t=>e.jsx("span",{className:"text-[var(--otari-ink)]",children:t.model})},{id:"user",header:"User",cell:t=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:t.user_id??"—"})},{id:"tokens",header:"Tokens",align:"end",cell:t=>t.total_tokens===null?"—":t.total_tokens.toLocaleString()},{id:"cost",header:"Cost",align:"end",cell:t=>t.cost===null?"—":V(t.cost)},{id:"status",header:"Status",cell:t=>e.jsx(dt,{status:t.status})}],mt=t=>t.id;function ht({filters:t,anyFilter:r}){var $,H;const[h,n]=i.useState(0),[v,m]=i.useState(it),c=Qe(),x=He(),j=Ze(),[U,N]=i.useState(!1),[R,o]=i.useState(!1),d=JSON.stringify(t),L=i.useRef(d);i.useEffect(()=>{L.current!==d&&(L.current=d,n(0),c.clear())},[d,c]);const p=Ge(t,h,v),C=xe(t),g=p.data??[],P=C.isSuccess&&!C.isPlaceholderData?(($=C.data)==null?void 0:$.total)??0:null,O=g.filter(_=>!_.counts_toward_budget).map(_=>_.id),f=g.filter(_=>_.counts_toward_budget).map(_=>_.id),S=Ve(c.selectedKeys,O),b=S.length,y=c.allMatching||b>0,D=i.useMemo(()=>({...t,counts_toward_budget:!1}),[t]),k=xe(D,y),E=k.isSuccess?((H=k.data)==null?void 0:H.total)??null:null,K=O.length>0&&b===O.length&&E!=null&&E>b,F=c.allMatching?E??b:b,l=()=>c.allMatching?{by_filter:!0,model:t.model,user_id:t.user_id,api_key_id:t.api_key_id,start_date:t.start_date,end_date:t.end_date,priced:t.priced}:{ids:S},a=()=>x.mutate(l(),{onSuccess:()=>{N(!1),c.clear()}}),u=_=>j.mutate({...l(),..._},{onSuccess:()=>{o(!1),c.clear()}});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Individual requests"}),e.jsx(ye,{error:p.error??C.error}),y?e.jsxs(Je,{selectedCount:F,allMatching:c.allMatching,matchingTotal:E,canSelectAllMatching:K,onSelectAllMatching:c.enableAllMatching,onClear:c.clear,children:[e.jsx(I,{size:"sm",variant:"primary",onPress:()=>o(!0),children:"Set price"}),e.jsx(I,{size:"sm",variant:"danger",onPress:()=>N(!0),children:"Delete"})]}):null,e.jsx(we,{ariaLabel:"Individual requests",columns:ut,rows:g,getRowKey:mt,isLoading:p.isLoading,emptyContent:r?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:c.selectedKeys,onSelectionChange:c.onSelectionChange,disabledKeys:f}),e.jsx(tt,{page:h,pageSize:v,total:P,rowsOnPage:g.length,onPageChange:n,onPageSizeChange:_=>{m(_),n(0)},isFetching:p.isFetching,hasNextFallback:g.length===v}),e.jsx(et,{isOpen:U,onOpenChange:N,heading:"Delete usage rows",body:`Delete ${F.toLocaleString()} imported ${F===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:x.isPending,error:x.error,onConfirm:a}),e.jsx(st,{isOpen:R,onOpenChange:o,targetCount:F,isPending:j.isPending,error:j.error,onSubmit:u})]})}function wt(){var ue,me,he,ge;const t=Ae(),r=Ue(),h=Re(),[n,v]=i.useState(fe),[m,c]=i.useState(()=>te(fe.seconds??0)),[x,j]=i.useState(!1),[U,N]=i.useState(),[R,o]=i.useState(),[d,L]=i.useState(""),[p,C]=i.useState(""),[g,z]=i.useState(""),[P,O]=i.useState("cost"),f=x?U:m,S=x?R:void 0,b=x?f?Oe(f,S):"day":n.bucket,y=i.useMemo(()=>({start_date:f,end_date:S,model:d.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0}),[f,S,d,p,g]),D=i.useMemo(()=>{if(x){if(!f||!S)return null;const s=new Date(S).getTime()-new Date(f).getTime();return s>0?{...y,start_date:new Date(new Date(f).getTime()-s).toISOString(),end_date:f}:null}return!m||n.seconds===null?null:{...y,start_date:new Date(new Date(m).getTime()-n.seconds*1e3).toISOString(),end_date:m}},[x,f,S,y,n.seconds,m]),k=Y(y,b),E=Y(D??y,b,D!==null),oe=i.useMemo(()=>({start_date:m,model:d.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0}),[m,d,p,g]),K=Y(oe,n.bucket),F=(((ue=K.data)==null?void 0:ue.series)??[]).map(s=>({bucketStart:s.bucket_start,requests:s.requests})),l=k.data,a=l==null?void 0:l.totals,u=D!==null?(me=E.data)==null?void 0:me.totals:void 0,$=a?T(a.cost,u==null?void 0:u.cost):null,H=i.useMemo(()=>({...y,model:void 0}),[y]),_=Y(H,b),J=((ge=(he=_.data)==null?void 0:he.by_model)==null?void 0:ge.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],re=(r.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),le=(h.data??[]).map(s=>({value:s.id,label:s.key_name??`${s.id.slice(0,8)}…`})),Ne=(d&&!J.includes(d)?[d,...J]:J).map(s=>({value:s,label:s})),Ce=x||n.key!==ke,Z=!!(d.trim()||p||g||Ce),ie=(s,w)=>{var G;return((G=s.find(W=>W.value===w))==null?void 0:G.label)??w},Pe=()=>{L(""),C(""),z("")},Ee=[...p?[{key:"user",label:"User",value:ie(re,p),onClear:()=>C("")}]:[],...d.trim()?[{key:"model",label:"Model",value:d.trim(),onClear:()=>L("")}]:[],...g?[{key:"key",label:"API key",value:ie(le,g),onClear:()=>z("")}]:[]],qe=!!(l&&a&&a.request_count===0&&!Z),Le=(l==null?void 0:l.start_date)??f,De=(l==null?void 0:l.end_date)??S,ce=s=>{j(!1),v(s),c(te(s.seconds??0)),N(void 0),o(void 0)},Fe=(s,w)=>{j(!0),N(s),o(w)},Me=()=>{x||c(te(n.seconds??0)),k.refetch(),K.refetch(),_.refetch(),D!==null&&E.refetch()},de=s=>{const w=new URLSearchParams;f&&w.set("start_date",f),S&&w.set("end_date",S);for(const[G,W]of Object.entries(s))W&&w.set(G,W);t(`/activity?${w.toString()}`)},Te=a&&a.request_count>0?a.error_count/a.request_count:0,M=(l==null?void 0:l.series)??[],X=M.length>1,ee=lt(M,P,b);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Ke,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log."}),e.jsx(ye,{error:k.error}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(We,{presets:je,extentKey:n.key,onPreset:ce,onSelectRange:Fe,onSelectFull:()=>ce(n),series:F,bucket:n.bucket,windowStart:Le,windowEnd:De,loading:K.isLoading,ariaLabel:"Usage request volume over the selected window",action:e.jsx($e,{onRefresh:Me,isFetching:k.isFetching,updatedAt:k.dataUpdatedAt})}),e.jsxs(Ye,{chips:Ee,onClearAll:Pe,children:[e.jsx(se,{label:"User",value:p,onChange:C,options:re,placeholder:"All users"}),e.jsx(se,{label:"Model",value:d,onChange:L,options:Ne,placeholder:"All models"}),e.jsx(se,{label:"API key",value:g,onChange:z,options:le,placeholder:"All keys"})]})]}),qe?e.jsx(Be,{title:"No usage yet",description:"Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[e.jsx(q,{label:"Tracked cost",value:a?V(a.cost):"—",hint:a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[e.jsx(A,{fraction:$}),a.unpriced_requests?`${$!==null?" · ":""}${Q(a.unpriced_requests)} unpriced`:null]}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),e.jsx(q,{label:"Requests",value:a?Q(a.request_count):"—",hint:a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Ie(Te)," errors",u?e.jsxs(e.Fragment,{children:[" · ",e.jsx(A,{fraction:T(a.request_count,u.request_count)})]}):null]}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),e.jsx(q,{label:"Tokens",value:a?B(a.total_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.total_tokens,u==null?void 0:u.total_tokens)}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.tokens),ariaLabel:"Token usage trend over the selected window"}):void 0}),e.jsx(q,{label:"Cache read",value:a?B(a.cache_read_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.cache_read_tokens,u==null?void 0:u.cache_read_tokens)}):null}),e.jsx(q,{label:"Cache write",value:a?B(a.cache_write_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.cache_write_tokens,u==null?void 0:u.cache_write_tokens)}):null}),e.jsx(q,{label:"1h cache write",value:a?B(a.cache_write_1h_tokens??0):"—",hint:a?e.jsx(A,{fraction:T(a.cache_write_1h_tokens??0,(u==null?void 0:u.cache_write_1h_tokens)??0)}):null}),e.jsx(q,{label:"Avg latency",value:a?at(a.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(Se,{title:"Spend by model",rows:(l==null?void 0:l.by_model)??[],totalCost:(a==null?void 0:a.cost)??0,emptyLabel:Z?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>de({model:s,user_id:p||void 0,api_key_id:g||void 0}),loading:k.isLoading}),e.jsx(Se,{title:"Spend by user",rows:(l==null?void 0:l.by_user)??[],totalCost:(a==null?void 0:a.cost)??0,emptyLabel:Z?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>de({user_id:s,model:d.trim()||void 0,api_key_id:g||void 0}),loading:k.isLoading})]}),e.jsx(ht,{filters:y,anyFilter:Z}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[nt.map(s=>e.jsx(I,{size:"sm",variant:P===s.key?"primary":"outline",onPress:()=>O(s.key),children:s.label},s.key)),k.isFetching?e.jsx(pe,{size:"sm"}):null]})]}),k.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(pe,{size:"sm"})}):M.length===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsx(Xe,{data:ee.points,formatValue:s=>be(s,P),ariaLabel:`${P} per ${b}`}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[be(ee.peak,P)," peak · ",ee.count," ",b==="hour"?"hours":"days"," (times in UTC)"]})]})]})]})]})}export{wt as UsagePage}; diff --git a/src/gateway/static/dashboard/assets/UsersPage-T4PK8YrW.js b/src/gateway/static/dashboard/assets/UsersPage-DUd7-214.js similarity index 98% rename from src/gateway/static/dashboard/assets/UsersPage-T4PK8YrW.js rename to src/gateway/static/dashboard/assets/UsersPage-DUd7-214.js index f90860577..b16ceefdc 100644 --- a/src/gateway/static/dashboard/assets/UsersPage-T4PK8YrW.js +++ b/src/gateway/static/dashboard/assets/UsersPage-DUd7-214.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r}from"./react-dgEcD0HR.js";import{u as Q,q as M,v as K,ar as X,P as Y,E as A,w as Z,as as ee,F as se}from"./index-BCvb90M0.js";import{u as te,r as ae,B as ne}from"./tableSelection-9hV37uhu.js";import{C as re}from"./ConfirmDialog-BXAKoq6j.js";import{D as le}from"./DataTable-Bmn_eYSV.js";import{F as B}from"./Field-Dwp6u3t8.js";import{a as ie,M as R}from"./ModelScopeControl-CuclfKO5.js";import{f as I,B as d,d as S,A as f}from"./heroui-BI50yK5B.js";const de=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return de.format(t)}const oe=t=>t.user_id,D=t=>t.startsWith("apikey-");function H(t){return t.split("-")[0]}function E(t){return t.name??H(t.budget_id)}function $({value:t,onChange:l,budgets:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>l(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),n.map(a=>e.jsxs("option",{value:a.budget_id,children:[E(a),a.max_budget===null?" · no limit":` · ${U(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function ce({onClose:t}){const l=ee(),n=M(),[a,i]=r.useState(""),[o,u]=r.useState(""),[c,g]=r.useState(null),[p,m]=r.useState(null),[b,j]=r.useState(!0),x=()=>{if(l.isPending||!b||a.trim()==="")return;const h={user_id:a.trim(),alias:o.trim()||null,budget_id:c,allowed_models:p};l.mutate(h,{onSuccess:t})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:l.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(B,{label:"User ID",value:a,onChange:i,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(B,{label:"Alias (optional)",value:o,onChange:u,placeholder:"Alice"})]}),e.jsx($,{value:c,onChange:g,budgets:n.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{m(h),j(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:l.isPending||!b||a.trim()==="",onPress:x,children:l.isPending?"Creating…":"Create user"}),e.jsx(d,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ue({user:t,onClose:l}){const n=K(),a=M(),[i,o]=r.useState(t.alias??""),[u,c]=r.useState(t.budget_id),[g,p]=r.useState(t.allowed_models),[m,b]=r.useState(!0),j=()=>{if(n.isPending||!m)return;const x={alias:i.trim()||null,budget_id:u,allowed_models:g};n.mutate({id:t.user_id,body:x},{onSuccess:l})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:n.error}),e.jsx(B,{label:"Alias",value:i,onChange:o,placeholder:"Alice"}),e.jsx($,{value:u,onChange:c,budgets:a.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(x,h)=>{p(x),b(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:n.isPending||!m,onPress:j,children:n.isPending?"Saving…":"Save changes"}),e.jsx(d,{variant:"ghost",onPress:l,children:"Cancel"})]})]})})}function ge({trigger:t,message:l,confirmLabel:n,isPending:a,onConfirm:i}){const[o,u]=r.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:l}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(d,{size:"sm",variant:"danger",isDisabled:a,onPress:i,children:n}),e.jsx(d,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>u(!1),children:"Cancel"})]})]}):e.jsx(d,{size:"sm",variant:"danger-soft",onPress:()=>u(!0),children:t})}function me({user:t}){return t.blocked?e.jsx(I,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(I,{size:"sm",color:"accent",children:"Active"})}function xe({allowed:t}){const{text:l,tone:n}=ie(t),a=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",i=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:i,children:l})}function he({isOpen:t,onOpenChange:l,budgets:n,count:a,isPending:i,error:o,onAssign:u}){const[c,g]=r.useState("");return r.useEffect(()=>{t&&g("")},[t]),e.jsx(f,{isOpen:t,onOpenChange:l,children:t?e.jsx(f.Backdrop,{children:e.jsx(f.Container,{placement:"center",size:"md",children:e.jsxs(f.Dialog,{children:[e.jsx(f.Header,{children:e.jsx(f.Heading,{children:"Assign budget"})}),e.jsxs(f.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Assign a budget to ",a," selected ",a===1?"user":"users","."]}),e.jsx(se,{label:"Budget",value:c,onChange:g,options:[{value:"",label:"Select a budget…"},...n.map(p=>({value:p.budget_id,label:E(p)}))]}),e.jsx(A,{error:o})]}),e.jsxs(f.Footer,{children:[e.jsx(d,{variant:"ghost",isDisabled:i,onPress:()=>l(!1),children:"Cancel"}),e.jsx(d,{variant:"primary",isDisabled:!c,isPending:i,onPress:()=>u(c),children:"Assign"})]})]})})}):null})}function Ae(){const t=Q(),l=M(),n=K(),a=X(),[i,o]=r.useState(!1),[u,c]=r.useState(null),[g,p]=r.useState(!1),m=t.data??[],b=t.isLoading,j=m.filter(s=>D(s.user_id)).length,x=g?m:m.filter(s=>!D(s.user_id)),h=m.find(s=>s.user_id===u)??null,C=!b&&x.length===0&&!i,P=r.useMemo(()=>new Map((l.data??[]).map(s=>[s.budget_id,s])),[l.data]),y=te(),[q,_]=r.useState(!1),[W,N]=r.useState(!1),[F,z]=r.useState(void 0),[T,L]=r.useState(!1),G=x.map(s=>s.user_id),v=ae(y.selectedKeys,G),O=r.useCallback((s,k)=>n.mutate({id:s.user_id,body:{blocked:k}}),[n.mutate]),V=async(s,k)=>{L(!0),z(void 0);try{for(const w of v)await s(w);y.clear(),k()}catch(w){z(w)}finally{L(!1)}},J=r.useMemo(()=>[{id:"user",header:"User",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-medium text-[var(--otari-ink)]",children:s.user_id}),D(s.user_id)?e.jsx(I,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})},{id:"status",header:"Status",cell:s=>e.jsx(me,{user:s})},{id:"budget",header:"Budget",cell:s=>s.budget_id?e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.budget_id,children:P.get(s.budget_id)?E(P.get(s.budget_id)):H(s.budget_id)}):e.jsx("span",{className:"text-[var(--otari-muted)]",children:"—"})},{id:"spend",header:"Spend",cell:s=>e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[U(s.spend),s.reserved>0?e.jsxs("span",{children:[" (+",U(s.reserved)," held)"]}):null]})},{id:"access",header:"Model access",cell:s=>e.jsx(xe,{allowed:s.allowed_models})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(d,{size:"sm",variant:"outline",isDisabled:n.isPending,onPress:()=>O(s,!s.blocked),children:s.blocked?"Unblock":"Block"}),e.jsx(d,{size:"sm",variant:"ghost",onPress:()=>{o(!1),c(s.user_id)},children:"Edit"}),e.jsx(ge,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})}],[P,n.isPending,a.isPending,a.mutate,O]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:i?null:e.jsx(d,{variant:"primary",onPress:()=>{c(null),o(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??n.error??a.error}),C?e.jsx(Z,{title:"No users yet",description:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page.",actionLabel:"Create your first user",onAction:()=>{c(null),o(!0)}}):null,j>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>p(s.target.checked)}),"Show auto-created (virtual) users (",j,")"]}):null,i?e.jsx(ce,{onClose:()=>o(!1)}):null,h?e.jsx(ue,{user:h,onClose:()=>c(null)},h.user_id):null,v.length>0?e.jsxs(ne,{selectedCount:v.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:y.clear,children:[e.jsx(d,{size:"sm",variant:"primary",onPress:()=>N(!0),children:"Assign budget"}),e.jsx(d,{size:"sm",variant:"danger",onPress:()=>_(!0),children:"Delete"})]}):null,C?null:e.jsx(le,{ariaLabel:"Users",columns:J,rows:x,getRowKey:oe,isLoading:b,emptyContent:"No users yet. Create one, or create an API key to auto-create one.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange}),e.jsx(re,{isOpen:q,onOpenChange:_,heading:"Delete users",body:`Delete ${v.length} ${v.length===1?"user":"users"}? This deactivates their API keys and hides them; usage history is preserved.`,confirmLabel:"Delete",isPending:T,error:F,onConfirm:()=>V(s=>a.mutateAsync(s),()=>_(!1))}),e.jsx(he,{isOpen:W,onOpenChange:N,budgets:l.data??[],count:v.length,isPending:T,error:F,onAssign:s=>V(k=>n.mutateAsync({id:k,body:{budget_id:s}}),()=>N(!1))})]})}export{Ae as UsersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r}from"./react-dgEcD0HR.js";import{u as Q,q as M,v as K,ar as X,P as Y,E as A,w as Z,as as ee,F as se}from"./index-DsUY4UvK.js";import{u as te,r as ae,B as ne}from"./tableSelection-9hV37uhu.js";import{C as re}from"./ConfirmDialog-NCJIhH2z.js";import{D as le}from"./DataTable-Bmn_eYSV.js";import{F as B}from"./Field-Dwp6u3t8.js";import{a as ie,M as R}from"./ModelScopeControl-B4eI_pm-.js";import{f as I,B as d,d as S,A as f}from"./heroui-BI50yK5B.js";const de=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return de.format(t)}const oe=t=>t.user_id,D=t=>t.startsWith("apikey-");function H(t){return t.split("-")[0]}function E(t){return t.name??H(t.budget_id)}function $({value:t,onChange:l,budgets:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>l(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),n.map(a=>e.jsxs("option",{value:a.budget_id,children:[E(a),a.max_budget===null?" · no limit":` · ${U(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function ce({onClose:t}){const l=ee(),n=M(),[a,i]=r.useState(""),[o,u]=r.useState(""),[c,g]=r.useState(null),[p,m]=r.useState(null),[b,j]=r.useState(!0),x=()=>{if(l.isPending||!b||a.trim()==="")return;const h={user_id:a.trim(),alias:o.trim()||null,budget_id:c,allowed_models:p};l.mutate(h,{onSuccess:t})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:l.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(B,{label:"User ID",value:a,onChange:i,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(B,{label:"Alias (optional)",value:o,onChange:u,placeholder:"Alice"})]}),e.jsx($,{value:c,onChange:g,budgets:n.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{m(h),j(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:l.isPending||!b||a.trim()==="",onPress:x,children:l.isPending?"Creating…":"Create user"}),e.jsx(d,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ue({user:t,onClose:l}){const n=K(),a=M(),[i,o]=r.useState(t.alias??""),[u,c]=r.useState(t.budget_id),[g,p]=r.useState(t.allowed_models),[m,b]=r.useState(!0),j=()=>{if(n.isPending||!m)return;const x={alias:i.trim()||null,budget_id:u,allowed_models:g};n.mutate({id:t.user_id,body:x},{onSuccess:l})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:n.error}),e.jsx(B,{label:"Alias",value:i,onChange:o,placeholder:"Alice"}),e.jsx($,{value:u,onChange:c,budgets:a.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(x,h)=>{p(x),b(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:n.isPending||!m,onPress:j,children:n.isPending?"Saving…":"Save changes"}),e.jsx(d,{variant:"ghost",onPress:l,children:"Cancel"})]})]})})}function ge({trigger:t,message:l,confirmLabel:n,isPending:a,onConfirm:i}){const[o,u]=r.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:l}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(d,{size:"sm",variant:"danger",isDisabled:a,onPress:i,children:n}),e.jsx(d,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>u(!1),children:"Cancel"})]})]}):e.jsx(d,{size:"sm",variant:"danger-soft",onPress:()=>u(!0),children:t})}function me({user:t}){return t.blocked?e.jsx(I,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(I,{size:"sm",color:"accent",children:"Active"})}function xe({allowed:t}){const{text:l,tone:n}=ie(t),a=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",i=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:i,children:l})}function he({isOpen:t,onOpenChange:l,budgets:n,count:a,isPending:i,error:o,onAssign:u}){const[c,g]=r.useState("");return r.useEffect(()=>{t&&g("")},[t]),e.jsx(f,{isOpen:t,onOpenChange:l,children:t?e.jsx(f.Backdrop,{children:e.jsx(f.Container,{placement:"center",size:"md",children:e.jsxs(f.Dialog,{children:[e.jsx(f.Header,{children:e.jsx(f.Heading,{children:"Assign budget"})}),e.jsxs(f.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Assign a budget to ",a," selected ",a===1?"user":"users","."]}),e.jsx(se,{label:"Budget",value:c,onChange:g,options:[{value:"",label:"Select a budget…"},...n.map(p=>({value:p.budget_id,label:E(p)}))]}),e.jsx(A,{error:o})]}),e.jsxs(f.Footer,{children:[e.jsx(d,{variant:"ghost",isDisabled:i,onPress:()=>l(!1),children:"Cancel"}),e.jsx(d,{variant:"primary",isDisabled:!c,isPending:i,onPress:()=>u(c),children:"Assign"})]})]})})}):null})}function Ae(){const t=Q(),l=M(),n=K(),a=X(),[i,o]=r.useState(!1),[u,c]=r.useState(null),[g,p]=r.useState(!1),m=t.data??[],b=t.isLoading,j=m.filter(s=>D(s.user_id)).length,x=g?m:m.filter(s=>!D(s.user_id)),h=m.find(s=>s.user_id===u)??null,C=!b&&x.length===0&&!i,P=r.useMemo(()=>new Map((l.data??[]).map(s=>[s.budget_id,s])),[l.data]),y=te(),[q,_]=r.useState(!1),[W,N]=r.useState(!1),[F,z]=r.useState(void 0),[T,L]=r.useState(!1),G=x.map(s=>s.user_id),v=ae(y.selectedKeys,G),O=r.useCallback((s,k)=>n.mutate({id:s.user_id,body:{blocked:k}}),[n.mutate]),V=async(s,k)=>{L(!0),z(void 0);try{for(const w of v)await s(w);y.clear(),k()}catch(w){z(w)}finally{L(!1)}},J=r.useMemo(()=>[{id:"user",header:"User",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-medium text-[var(--otari-ink)]",children:s.user_id}),D(s.user_id)?e.jsx(I,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})},{id:"status",header:"Status",cell:s=>e.jsx(me,{user:s})},{id:"budget",header:"Budget",cell:s=>s.budget_id?e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.budget_id,children:P.get(s.budget_id)?E(P.get(s.budget_id)):H(s.budget_id)}):e.jsx("span",{className:"text-[var(--otari-muted)]",children:"—"})},{id:"spend",header:"Spend",cell:s=>e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[U(s.spend),s.reserved>0?e.jsxs("span",{children:[" (+",U(s.reserved)," held)"]}):null]})},{id:"access",header:"Model access",cell:s=>e.jsx(xe,{allowed:s.allowed_models})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(d,{size:"sm",variant:"outline",isDisabled:n.isPending,onPress:()=>O(s,!s.blocked),children:s.blocked?"Unblock":"Block"}),e.jsx(d,{size:"sm",variant:"ghost",onPress:()=>{o(!1),c(s.user_id)},children:"Edit"}),e.jsx(ge,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})}],[P,n.isPending,a.isPending,a.mutate,O]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:i?null:e.jsx(d,{variant:"primary",onPress:()=>{c(null),o(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??n.error??a.error}),C?e.jsx(Z,{title:"No users yet",description:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page.",actionLabel:"Create your first user",onAction:()=>{c(null),o(!0)}}):null,j>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>p(s.target.checked)}),"Show auto-created (virtual) users (",j,")"]}):null,i?e.jsx(ce,{onClose:()=>o(!1)}):null,h?e.jsx(ue,{user:h,onClose:()=>c(null)},h.user_id):null,v.length>0?e.jsxs(ne,{selectedCount:v.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:y.clear,children:[e.jsx(d,{size:"sm",variant:"primary",onPress:()=>N(!0),children:"Assign budget"}),e.jsx(d,{size:"sm",variant:"danger",onPress:()=>_(!0),children:"Delete"})]}):null,C?null:e.jsx(le,{ariaLabel:"Users",columns:J,rows:x,getRowKey:oe,isLoading:b,emptyContent:"No users yet. Create one, or create an API key to auto-create one.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange}),e.jsx(re,{isOpen:q,onOpenChange:_,heading:"Delete users",body:`Delete ${v.length} ${v.length===1?"user":"users"}? This deactivates their API keys and hides them; usage history is preserved.`,confirmLabel:"Delete",isPending:T,error:F,onConfirm:()=>V(s=>a.mutateAsync(s),()=>_(!1))}),e.jsx(he,{isOpen:W,onOpenChange:N,budgets:l.data??[],count:v.length,isPending:T,error:F,onAssign:s=>V(k=>n.mutateAsync({id:k,body:{budget_id:s}}),()=>N(!1))})]})}export{Ae as UsersPage}; diff --git a/src/gateway/static/dashboard/assets/index-BCvb90M0.js b/src/gateway/static/dashboard/assets/index-DsUY4UvK.js similarity index 96% rename from src/gateway/static/dashboard/assets/index-BCvb90M0.js rename to src/gateway/static/dashboard/assets/index-DsUY4UvK.js index fd7d18747..37fb1da7d 100644 --- a/src/gateway/static/dashboard/assets/index-BCvb90M0.js +++ b/src/gateway/static/dashboard/assets/index-DsUY4UvK.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-Dd5_lVjd.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/FilterChips-EkMEVflY.js","assets/heroui-BI50yK5B.js","assets/recharts-C4kRDmvS.js","assets/tableSelection-9hV37uhu.js","assets/ConfirmDialog-BXAKoq6j.js","assets/DataTable-Bmn_eYSV.js","assets/TablePagination-DSU6cRH7.js","assets/AliasesPage-BXueJgS_.js","assets/Field-Dwp6u3t8.js","assets/UserComboBox-a9wxf8eF.js","assets/BudgetsPage-BQktAQRZ.js","assets/DocsPage-xJDqWRaA.js","assets/KeysPage-DVB0fG8n.js","assets/ModelScopeControl-CuclfKO5.js","assets/ModelsPage-D-sOtTsj.js","assets/OverviewPage-BluitD8r.js","assets/charts-DIsd9m--.js","assets/ProvidersPage-Bf-7xbup.js","assets/SettingsPage-OsrEeYZu.js","assets/ToolsGuardrailsPage-CSxGfHtw.js","assets/UsagePage-CtRIjZgb.js","assets/UsersPage-T4PK8YrW.js"])))=>i.map(i=>d[i]); -var Ie=Object.defineProperty;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>qe(e,typeof t!="symbol"?t+"":t,r);import{u as g,j as n,a as p,b as x,k as ne,Q as Re,c as Oe}from"./tanstack-query-1t81HyiD.js";import{d as Me,r as o,N as Z,L as Fe,O as Ue,H as Ke,e as Be,f as j,h as $e}from"./react-dgEcD0HR.js";import{B as C,C as U,L as xe,I as ye,a as ze,b as Qe,d as I,S as Ve,c as T,T as We,e as He}from"./heroui-BI50yK5B.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ge=Me();const Je="modulepreload",Ye=function(e){return"/"+e},ue={},P=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let u=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(r.map(y=>{if(y=Ye(y),y in ue)return;ue[y]=!0;const h=y.endsWith(".css"),b=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Je,h||(m.as="script"),m.crossOrigin="",m.href=y,f&&m.setAttribute("nonce",f),document.head.appendChild(m),h)return new Promise((N,M)=>{m.addEventListener("load",N),m.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};class L extends Error{constructor(r,s){super(s);ce(this,"status");this.name="ApiError",this.status=r}}let K=null;function de(e){K=e}async function ee(e){try{const t=await e.json();if(typeof t.detail=="string")return t.detail;if(t.detail!=null)return JSON.stringify(t.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Xe(e){let t;try{t=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(t.status===401||t.status===403)return!1;if(!t.ok)throw new L(t.status,await ee(t));return!0}async function Ze(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function c(e,t={}){const r=new Headers(t.headers);r.set("Accept","application/json"),t.body!=null&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let s;try{s=await fetch(e,{...t,headers:r})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(s.status===401||s.status===403)throw K==null||K(),new L(s.status,await ee(s));if(!s.ok)throw new L(s.status,await ee(s));if(s.status!==204)return await s.json()}const te="otari.dashboard.hasSession",ve=o.createContext(null);function et(){try{return window.localStorage.getItem(te)==="1"}catch{return!1}}function tt({children:e}){const t=g(),[r,s]=o.useState(et),a=o.useCallback(()=>{Ze(),s(!1),t.clear();try{window.localStorage.removeItem(te)}catch{}},[t]),i=o.useCallback(()=>{t.clear(),s(!0);try{window.localStorage.setItem(te,"1")}catch{}},[t]);o.useEffect(()=>(de(a),()=>de(null)),[a]);const u=o.useMemo(()=>({isAuthenticated:r,login:i,logout:a}),[r,i,a]);return n.jsx(ve.Provider,{value:u,children:e})}function re(){const e=o.useContext(ve);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function nt(e){return e instanceof L&&e.status===0}function rt(){const e=g(),[t,r]=o.useState(!1);return o.useEffect(()=>{const s=e.getQueryCache(),a=()=>s.getAll().some(i=>i.state.status==="error"&&nt(i.state.error));return r(a()),s.subscribe(()=>r(a()))},[e]),t}function st(){return rt()?n.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const $=3600,_=86400,at=365*_,dn=[{key:"1h",label:"Last hour",seconds:$,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"90d",label:"90d",seconds:90*_,bucket:"day"},{key:"12mo",label:"12mo",seconds:at,bucket:"day"}],mn="30d",fn=[{key:"1h",label:"1h",seconds:$,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"all",label:"All",seconds:null,bucket:"day"}],hn="24h",xn="custom";function yn(e,t){return e.find(r=>r.key===t)}function it(e,t=Date.now()){return new Date(t-e*1e3).toISOString()}function ot(e){return(e==="hour"?$:_)*1e3}function vn(e,t,r=Date.now()){const s=new Date(e).getTime();return(t?new Date(t).getTime():r)-s<=_*1e3?"hour":"day"}function gn(e,t,r,s){if(e.length===0)return null;const a=Math.max(0,Math.min(t,r)),i=Math.min(e.length-1,Math.max(t,r)),u=new Date(e[a]).getTime(),d=new Date(e[i]).getTime()+ot(s);return{startIso:new Date(u).toISOString(),endIso:new Date(d).toISOString()}}function pn(e,t,r){const s=e.length;if(s===0)return{startIndex:0,endIndex:0};const a=e.map(d=>new Date(d).getTime());let i=0;if(t){const d=new Date(t).getTime();for(let f=0;fc("/v1/models"),staleTime:6e4})}function dt(){return p({queryKey:[ct],queryFn:()=>c("/dashboard-build.json"),refetchInterval:ut,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function jn(){return p({queryKey:[ae],queryFn:()=>c("/v1/models/discoverable"),staleTime:5*6e4})}function Sn(){return p({queryKey:[ie],queryFn:()=>c("/v1/providers"),staleTime:5*6e4})}function kn(){return p({queryKey:["provider-catalog"],queryFn:()=>c("/v1/providers/catalog"),staleTime:1/0})}function En(e){return p({queryKey:["provider-catalog",e],queryFn:()=>c(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Pn(){return p({queryKey:[oe],queryFn:()=>c("/v1/providers/health"),staleTime:me,refetchInterval:me})}function Nn(){const e=g();return x({mutationFn:()=>c("/v1/providers/health?refresh=true"),onSuccess:t=>e.setQueryData([oe],t)})}function Cn(){return p({queryKey:[be],queryFn:()=>c("/v1/provider-credentials"),staleTime:6e4})}function Q(e){e.invalidateQueries({queryKey:[be]}),e.invalidateQueries({queryKey:[ie]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]}),e.invalidateQueries({queryKey:[oe]})}function Tn(){const e=g();return x({mutationFn:t=>c("/v1/provider-credentials",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>Q(e)})}function _n(){const e=g();return x({mutationFn:({instance:t,body:r})=>c(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>Q(e)})}function Ln(){const e=g();return x({mutationFn:t=>c(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>Q(e)})}function Dn(){const e=g();return x({mutationFn:()=>c("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>Q(e)})}function An(){return x({mutationFn:e=>c(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function In(){return x({mutationFn:e=>c("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function qn(){return p({queryKey:[lt],queryFn:()=>c("/v1/models/metadata"),staleTime:10*6e4})}function Rn(){return p({queryKey:[se],queryFn:()=>c("/v1/aliases"),staleTime:6e4})}function On(){const e=g();return x({mutationFn:t=>c("/v1/aliases",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function Mn(){const e=g();return x({mutationFn:({name:t,userId:r})=>{const s=r==null?"":`?user_id=${encodeURIComponent(r)}`;return c(`/v1/aliases/${encodeURIComponent(t)}${s}`,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function mt(){return p({queryKey:[ge],queryFn:()=>c("/v1/settings"),staleTime:6e4})}function ft(){const e=g();return x({mutationFn:t=>c("/v1/settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([ge],t),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]})}})}function Fn(){return x({mutationFn:()=>c("/v1/settings/master-key/rotate",{method:"POST"})})}function Un(){return p({queryKey:[pe],queryFn:()=>c("/v1/tool-settings"),staleTime:6e4})}function Kn(){const e=g();return x({mutationFn:t=>c("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([pe],t)}})}function Bn(){return x({mutationFn:({service:e,url:t})=>c(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:t})})})}const H=1e3,ht=100;async function xt(){const e=[];for(let t=0;tc("/v1/pricing",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]})}})}function Qn(){const e=g();return x({mutationFn:t=>c(`/v1/pricing/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]})}})}function Vn(){return x({mutationFn:()=>c("/v1/pricing/refresh",{method:"POST"})})}function Wn(){const e=g();return x({mutationFn:()=>c("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ie]})}})}function Hn(){return x({mutationFn:()=>c("/v1/pricing/refresh/reject",{method:"POST"})})}const G=1e3,yt=100;async function vt(){const e=[];for(let t=0;tc("/v1/keys",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Yn(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/keys/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Xn(){const e=g();return x({mutationFn:t=>c(`/v1/keys/${encodeURIComponent(t)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Zn(){const e=g();return x({mutationFn:t=>c(`/v1/keys/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}const J=1e3,gt=100;async function pt(){const e=[];for(let t=0;tc(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function nr(){const e=g();return x({mutationFn:t=>c("/v1/budgets",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function rr(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/budgets/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function sr(){const e=g();return x({mutationFn:t=>c(`/v1/budgets/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}const Y=1e3,bt=100;async function wt(){const e=[];for(let t=0;tc("/v1/users",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>le(e)})}function or(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/users/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>le(e)})}function lr(){const e=g();return x({mutationFn:t=>c(`/v1/users/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{le(e),e.invalidateQueries({queryKey:[q]})}})}function V(e){const t=new URLSearchParams;return e.start_date&&t.set("start_date",e.start_date),e.end_date&&t.set("end_date",e.end_date),e.status&&t.set("status",e.status),e.model&&t.set("model",e.model),e.endpoint&&t.set("endpoint",e.endpoint),e.user_id&&t.set("user_id",e.user_id),e.api_key_id&&t.set("api_key_id",e.api_key_id),e.source&&t.set("source",e.source),e.priced!==void 0&&t.set("priced",String(e.priced)),e.counts_toward_budget!==void 0&&t.set("counts_toward_budget",String(e.counts_toward_budget)),t}function cr(e,t,r){return p({queryKey:[O,"list",e,t,r],queryFn:()=>{const s=V(e);return s.set("skip",String(t*r)),s.set("limit",String(r)),c(`/v1/usage?${s.toString()}`)},placeholderData:ne,staleTime:1e4})}function ur(e,t=!0){return p({queryKey:[O,"count",e],queryFn:()=>c(`/v1/usage/count?${V(e).toString()}`),enabled:t,placeholderData:ne,staleTime:1e4})}const jt=6e4;function St(e,t=!0){return p({queryKey:[O,"count","failures",e],queryFn:()=>{const r={status:"error",source:"gateway",start_date:it(e)};return c(`/v1/usage/count?${V(r).toString()}`)},enabled:t,refetchInterval:jt,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function dr(){const e=g();return x({mutationFn:t=>c("/v1/usage",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]})}})}function mr(){const e=g();return x({mutationFn:t=>c("/v1/usage/set-price",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]})}})}function fr(e,t,r=!0){return p({queryKey:[O,"summary",e,t],queryFn:()=>{const s=V(e);return s.set("bucket",t),c(`/v1/usage/summary?${s.toString()}`)},enabled:r,placeholderData:ne,staleTime:3e4})}function hr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function xr(e){if(e==null)return"$0.00";const t=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}function yr(e){if(e==null)return"—";if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){const t=Math.round(e/1e3);return t>=1e3?"1M":`${t}K`}return String(e)}const kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function vr(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})/.exec(e);if(!t)return e;const r=Number(t[2])-1;return r<0||r>11?t[1]:`${kt[r]} ${t[1]}`}const Et=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function gr(e){return Et.format(e)}function pr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Pt(e){return`${(e*100).toFixed(1)}%`}function br(e,t){return t===void 0||t===0?null:(e-t)/t}function Nt(e,t=Date.now()){if(!e)return"never";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const s=Math.round((t-r.getTime())/1e3),a=s<0,i=Math.abs(s),u=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let d=i,f="second";for(const[h,b]of u){if(f=h,d0?"▲":e<0?"▼":"•";return n.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t," ",Pt(Math.abs(e))," vs prev"]})}function Ct(e){return e instanceof L||e instanceof Error?e.message:"Something went wrong."}function Tt({error:e}){return e?n.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:Ct(e)}):null}function _t({tone:e="info",children:t}){const r=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return n.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${r}`,children:t})}function Sr({title:e,description:t,action:r}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),r?n.jsx("div",{className:"flex flex-wrap gap-2",children:r}):null]})}function Lt(e){const[t,r]=o.useState(()=>Date.now());return o.useEffect(()=>{let s;const a=()=>{s===void 0&&(s=setInterval(()=>r(Date.now()),e))},i=()=>{s!==void 0&&(clearInterval(s),s=void 0)},u=()=>{r(Date.now()),document.visibilityState==="visible"?a():i()};return u(),document.addEventListener("visibilitychange",u),()=>{i(),document.removeEventListener("visibilitychange",u)}},[e]),t}function kr({onRefresh:e,isFetching:t=!1,updatedAt:r,label:s="Refresh"}){const a=Lt(15e3),i=r?Nt(new Date(r).toISOString(),a):null;return n.jsxs("span",{className:"inline-flex items-center gap-2",children:[i?n.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Updated ",i]}):null,n.jsx(C,{variant:"outline",size:"sm",isIconOnly:!0,isDisabled:t,onPress:e,"aria-label":s,children:n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`h-4 w-4 ${t?"animate-spin":""}`,"aria-hidden":"true",children:[n.jsx("path",{d:"M20 11a8 8 0 1 0-.5 4",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M20 4v5h-5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function Er({title:e,description:t,actionLabel:r,onAction:s,isActionDisabled:a,children:i}){return n.jsx(I,{children:n.jsxs(I.Content,{className:"flex flex-col gap-4 p-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),i,r&&s?n.jsx("div",{children:n.jsx(C,{variant:"primary",isDisabled:a,onPress:s,children:r})}):null]})})}function Pr({label:e="Loading…"}){return n.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 px-4 py-10 text-sm text-[var(--otari-muted)]",children:[n.jsx(Ve,{size:"sm"}),n.jsx("span",{children:e})]})}function Nr({children:e,confirmLabel:t,onConfirm:r,isPending:s}){const[a,i]=o.useState(!1);return a?n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(C,{size:"sm",variant:"danger",isDisabled:s,onPress:r,children:t}),n.jsx(C,{size:"sm",variant:"ghost",isDisabled:s,onPress:()=>i(!1),children:"Cancel"})]}):n.jsx(C,{size:"sm",variant:"danger-soft",onPress:()=>i(!0),children:e})}const Dt="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Cr({id:e,label:t,ariaLabel:r,value:s,onChange:a,options:i,children:u,disabled:d}){const f=o.useId(),y=e??(t?f:void 0),h=n.jsx("select",{id:y,"aria-label":t?void 0:r,value:s,disabled:d,onChange:b=>a(b.target.value),className:Dt,children:i?i.map(b=>n.jsx("option",{value:b.value,children:b.label},b.value)):u});return t?n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),h]}):h}function Tr({label:e,value:t,onChange:r,options:s,placeholder:a,maxVisible:i=50,allowsCustom:u=!1}){const d=m=>{var N;return((N=s.find(M=>M.value===m))==null?void 0:N.label)??m},[f,y]=o.useState(()=>d(t));o.useEffect(()=>{y(d(t))},[t]);const h=f.trim().toLowerCase(),b=s.filter(m=>!h||m.value.toLowerCase().includes(h)||m.label.toLowerCase().includes(h)).slice(0,i);return n.jsxs(U.Root,{allowsEmptyCollection:!0,allowsCustomValue:u,menuTrigger:"focus",inputValue:f,onInputChange:m=>{y(m),u?r(m.trim()):m.trim()===""&&r("")},onSelectionChange:m=>{m!=null&&r(String(m))},className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),n.jsxs(U.InputGroup,{children:[n.jsx(ye,{placeholder:a,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),n.jsx(U.Trigger,{})]}),n.jsx(U.Popover,{children:n.jsx(ze,{items:b,className:"max-h-72 overflow-auto",children:m=>n.jsx(Qe,{id:m.value,textValue:m.label,children:m.label})})})]})}function At(){var f,y;const e=mt(),t=ft(),[r,s]=o.useState(!1),i=((f=e.data)==null?void 0:f.require_pricing)===!0&&e.data.default_pricing===!1&&!r,d=((y=St($,i).data)==null?void 0:y.total)??0;return i?n.jsx("div",{className:"shrink-0 px-6 pt-3",children:n.jsx(_t,{tone:"warning",children:n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("span",{children:["Requests are rejected until pricing is set (",n.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away.",d>0?n.jsxs(n.Fragment,{children:[" ",n.jsxs("strong",{className:"font-semibold",children:[d.toLocaleString()," ",d===1?"request":"requests"," failed in the last hour."]})," ",n.jsx(Fe,{to:"/activity?status=error&range=1h&source=gateway",className:"underline underline-offset-2",children:"View failed requests"})]}):null]}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(C,{size:"sm",variant:"primary",isDisabled:t.isPending,onPress:()=>t.mutate({default_pricing:!0}),children:t.isPending?"Enabling…":"Enable default pricing"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Dismiss"})]})]})})}):null}function It(){const{data:e}=dt(),t=o.useRef(null);return e&&t.current===null&&(t.current=e.build),e!=null&&t.current!=null&&e.build!==t.current}function qt(){const e=It(),[t,r]=o.useState(!1);return!e||t?null:n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:n.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),n.jsx(C,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>r(!0),children:"Later"})]})})}const je=200,Se=480,X=240,Rt=60,ke="otari.dashboard.sidebarWidth",Ee="otari.dashboard.sidebarCollapsed",he=16,Pe="(max-width: 767px)",B=e=>Math.min(Se,Math.max(je,e));function Ot(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(Pe).matches}const Mt='a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ft(e){return e?Array.from(e.querySelectorAll(Mt)).filter(t=>t.offsetParent!==null||t===document.activeElement):[]}function Ut(){if(typeof window>"u")return X;try{const e=window.localStorage.getItem(ke),t=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(t)?X:B(t)}catch{return X}}function Kt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ee)==="1"}catch{return!1}}const Bt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],$t=[{to:"/",section:"home",label:"Overview",end:!0,icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),n.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),n.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),n.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),n.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function zt(){const{logout:e}=re(),t=o.useRef(null),r=o.useRef(null),s=o.useRef(null),[a,i]=o.useState(Ut),[u,d]=o.useState(Kt),[f,y]=o.useState(!1),[h,b]=o.useState(Ot),[m,N]=o.useState(!1);o.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const l=window.matchMedia(Pe),v=w=>{b(w.matches),w.matches||N(!1)};return typeof l.addEventListener=="function"?(l.addEventListener("change",v),()=>l.removeEventListener("change",v)):(l.addListener(v),()=>l.removeListener(v))},[]),o.useEffect(()=>{if(!m)return;const l=v=>{v.key==="Escape"&&N(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[m]),o.useEffect(()=>{var l,v,w;h&&(m?(l=t.current)==null||l.focus():(v=t.current)!=null&&v.contains(document.activeElement)&&((w=s.current)==null||w.focus()))},[h,m]);const M=o.useCallback(l=>{if(l.key!=="Tab")return;const v=Ft(t.current);if(v.length===0)return;const w=v[0],k=v[v.length-1],F=document.activeElement;l.shiftKey&&(F===w||F===t.current)?(l.preventDefault(),k.focus()):!l.shiftKey&&F===k&&(l.preventDefault(),w.focus())},[]);o.useEffect(()=>{const l=window.setTimeout(()=>{try{window.localStorage.setItem(ke,String(Math.round(a)))}catch{}},200);return()=>window.clearTimeout(l)},[a]),o.useEffect(()=>{try{window.localStorage.setItem(Ee,u?"1":"0")}catch{}},[u]);const Ce=o.useCallback(l=>{l.preventDefault(),l.currentTarget.setPointerCapture(l.pointerId),y(!0)},[]),Te=o.useCallback(l=>{var w;if(!l.currentTarget.hasPointerCapture(l.pointerId))return;const v=((w=t.current)==null?void 0:w.getBoundingClientRect().left)??0;i(B(l.clientX-v))},[]),_e=o.useCallback(l=>{l.currentTarget.hasPointerCapture(l.pointerId)&&l.currentTarget.releasePointerCapture(l.pointerId),y(!1)},[]),Le=o.useCallback(l=>{var v;l.preventDefault(),(v=r.current)==null||v.focus()},[]),De=o.useCallback(l=>{l.key==="ArrowLeft"?(l.preventDefault(),i(v=>B(v-he))):l.key==="ArrowRight"&&(l.preventDefault(),i(v=>B(v+he)))},[]),Ae=u?Rt:a,S=h?!1:u,W=h&&m?!0:void 0;return n.jsxs("div",{className:T("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[n.jsx("button",{type:"button",inert:W,onClick:Le,className:"sr-only focus:not-sr-only focus:absolute focus:top-3 focus:left-3 focus:z-50 focus:rounded-lg focus:border focus:border-[var(--otari-brand)] focus:bg-[var(--otari-surface)] focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-[var(--otari-brand-dark)] focus:shadow-md focus:outline-none",children:"Skip to main content"}),n.jsxs("header",{inert:W,className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("button",{type:"button",ref:s,onClick:()=>N(l=>!l),"aria-label":m?"Close navigation":"Open navigation","aria-expanded":m,"aria-controls":"app-sidebar",className:"-ml-1 flex h-8 w-8 items-center justify-center rounded-lg text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)] md:hidden",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5",children:n.jsx("path",{d:"M4 6h16M4 12h16M4 18h16",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),n.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),n.jsx(C,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),n.jsx(qt,{}),n.jsx(st,{}),n.jsx(At,{}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[h&&m?n.jsx("div",{"aria-hidden":"true",onClick:()=>N(!1),className:"fixed inset-0 z-30 bg-black/40 md:hidden"}):null,n.jsxs("aside",{ref:t,id:"app-sidebar",role:h?"dialog":void 0,"aria-modal":h&&m?!0:void 0,"aria-label":h?"Navigation":void 0,tabIndex:h?-1:void 0,inert:h&&!m?!0:void 0,onKeyDown:h&&m?M:void 0,style:h?void 0:{width:Ae},className:T("flex flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)] focus:outline-none",h?T("fixed inset-y-0 left-0 z-40 w-[17rem] shadow-xl transition-transform duration-200",m?"translate-x-0":"-translate-x-full"):T("relative shrink-0",!f&&"transition-[width] duration-150")),children:[n.jsx("button",{type:"button",onClick:()=>d(l=>!l),"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-pressed":u,title:u?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 hidden h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)] md:flex",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:T("h-3.5 w-3.5 transition-transform",u&&"rotate-180"),children:n.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("nav",{className:T("flex flex-col py-4",S?"px-2":"px-3"),children:Bt.map((l,v)=>{const w=$t.filter(k=>k.section===l.key);return w.length===0?null:n.jsxs("div",{className:v>0?"mt-4":void 0,children:[!S&&l.label?n.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:l.label}):null,v>0&&(S||!l.label)?n.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,n.jsx("div",{className:"flex flex-col gap-1",children:w.map(k=>n.jsxs(Z,{to:k.to,end:k.end,onClick:()=>N(!1),"aria-label":S?k.label:void 0,title:S?k.label:void 0,className:({isActive:F})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"justify-center px-0":"gap-3 px-3",F?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,S?null:k.label]},k.to))})]},l.key)})}),n.jsxs("div",{className:"mt-auto flex flex-col gap-1 pb-3",children:[n.jsxs(Z,{to:"/docs",onClick:()=>N(!1),"aria-label":S?"User guide":void 0,title:S?"User guide":void 0,className:({isActive:l})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"mx-2 justify-center px-0":"mx-3 gap-3 px-3",l?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[n.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.5V18c4 0 6.5.5 8 2 1.5-1.5 4-2 8-2V4.5c-4 0-6.5.5-8 2z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 6.5V20",strokeLinecap:"round"})]}),S?null:"User guide"]}),n.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai: the hosted Otari gateway",className:T("flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",S?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),S?null:n.jsxs("span",{className:"flex-1",children:["otari.ai ",n.jsx("span",{"aria-hidden":!0,children:"↗"})]})]})]}),u||h?null:n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(a),"aria-valuemin":je,"aria-valuemax":Se,tabIndex:0,onPointerDown:Ce,onPointerMove:Te,onPointerUp:_e,onKeyDown:De,className:T("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),n.jsx("main",{ref:r,id:"main-content",tabIndex:-1,inert:W,className:"flex-1 overflow-y-auto focus:outline-none",children:n.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-4 py-5 md:px-6 md:py-6",children:n.jsx(Ue,{})})})]})]})}function Qt(){const{login:e}=re(),[t,r]=o.useState(""),[s,a]=o.useState(null),[i,u]=o.useState(!1),d=async()=>{const f=t.trim();if(!(!f||i)){u(!0),a(null);try{await Xe(f)?e():a(new Error("Invalid master key."))}catch(y){a(y)}finally{u(!1)}}};return n.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:n.jsx(I,{className:"w-full max-w-md",children:n.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),n.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),d()},children:[n.jsxs(We,{value:t,onChange:f=>{r(f),s&&a(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),n.jsx(ye,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),n.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[n.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),n.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",n.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",n.jsx("code",{children:"Your master key:"})," (for example, run"," ",n.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),n.jsx(Tt,{error:s}),n.jsx(C,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!t.trim()||i,children:i?"Signing in…":"Sign in"})]}),n.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),n.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:n.jsx(He,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const Vt=o.lazy(async()=>({default:(await P(async()=>{const{ActivityPage:e}=await import("./ActivityPage-Dd5_lVjd.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))).ActivityPage})),Wt=o.lazy(async()=>({default:(await P(async()=>{const{AliasesPage:e}=await import("./AliasesPage-BXueJgS_.js");return{AliasesPage:e}},__vite__mapDeps([10,1,2,6,4,7,8,11,12]))).AliasesPage})),Ht=o.lazy(async()=>({default:(await P(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-BQktAQRZ.js");return{BudgetsPage:e}},__vite__mapDeps([13,1,2,6,4,7,8,11]))).BudgetsPage})),Gt=o.lazy(async()=>({default:(await P(async()=>{const{DocsPage:e}=await import("./DocsPage-xJDqWRaA.js");return{DocsPage:e}},__vite__mapDeps([14,1,2,4]))).DocsPage})),Jt=o.lazy(async()=>({default:(await P(async()=>{const{KeysPage:e}=await import("./KeysPage-DVB0fG8n.js");return{KeysPage:e}},__vite__mapDeps([15,1,2,6,4,7,8,11,16,12]))).KeysPage})),Yt=o.lazy(async()=>({default:(await P(async()=>{const{ModelsPage:e}=await import("./ModelsPage-D-sOtTsj.js");return{ModelsPage:e}},__vite__mapDeps([17,1,2,6,4,8,9]))).ModelsPage})),Xt=o.lazy(async()=>({default:(await P(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-BluitD8r.js");return{OverviewIndex:e}},__vite__mapDeps([18,1,2,19,5,4,8]))).OverviewIndex})),Zt=o.lazy(async()=>({default:(await P(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-Bf-7xbup.js");return{ProvidersPage:e}},__vite__mapDeps([20,1,2,11,4,8]))).ProvidersPage})),en=o.lazy(async()=>({default:(await P(async()=>{const{SettingsPage:e}=await import("./SettingsPage-OsrEeYZu.js");return{SettingsPage:e}},__vite__mapDeps([21,1,2,4]))).SettingsPage})),tn=o.lazy(async()=>({default:(await P(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-CSxGfHtw.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([22,1,2,4]))).ToolsGuardrailsPage})),nn=o.lazy(async()=>({default:(await P(async()=>{const{UsagePage:e}=await import("./UsagePage-CtRIjZgb.js");return{UsagePage:e}},__vite__mapDeps([23,1,2,3,4,5,6,19,7,8,9]))).UsagePage})),rn=o.lazy(async()=>({default:(await P(async()=>{const{UsersPage:e}=await import("./UsersPage-T4PK8YrW.js");return{UsersPage:e}},__vite__mapDeps([24,1,2,6,4,7,8,11,16]))).UsersPage}));function E(e){return n.jsx(o.Suspense,{fallback:n.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function sn(){const{isAuthenticated:e}=re();return e?n.jsx(Ke,{children:n.jsx(Be,{children:n.jsxs(j,{element:n.jsx(zt,{}),children:[n.jsx(j,{index:!0,element:E(n.jsx(Xt,{}))}),n.jsx(j,{path:"providers",element:E(n.jsx(Zt,{}))}),n.jsx(j,{path:"keys",element:E(n.jsx(Jt,{}))}),n.jsx(j,{path:"users",element:E(n.jsx(rn,{}))}),n.jsx(j,{path:"budgets",element:E(n.jsx(Ht,{}))}),n.jsx(j,{path:"activity",element:E(n.jsx(Vt,{}))}),n.jsx(j,{path:"usage",element:E(n.jsx(nn,{}))}),n.jsx(j,{path:"models",element:E(n.jsx(Yt,{}))}),n.jsx(j,{path:"aliases",element:E(n.jsx(Wt,{}))}),n.jsx(j,{path:"tools",element:E(n.jsx(tn,{}))}),n.jsx(j,{path:"settings",element:E(n.jsx(en,{}))}),n.jsx(j,{path:"docs",element:E(n.jsx(Gt,{}))}),n.jsx(j,{path:"*",element:n.jsx($e,{to:"/",replace:!0})})]})})}):n.jsx(Qt,{})}function an({children:e}){const[t]=o.useState(()=>new Re({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(r,s)=>s instanceof L&&(s.status===401||s.status===403)?!1:r<2}}}));return n.jsx(Oe,{client:t,children:n.jsx(tt,{children:e})})}const Ne=document.getElementById("root");if(!Ne)throw new Error("Root element #root not found");Ge.createRoot(Ne).render(n.jsx(o.StrictMode,{children:n.jsx(an,{children:n.jsx(sn,{})})}));export{hr as $,hn as A,Zn as B,xn as C,Jn as D,Tt as E,Cr as F,wn as G,$n as H,_t as I,qn as J,zn as K,yr as L,Qn as M,Ct as N,vr as O,Sr as P,mt as Q,kr as R,xr as S,Sn as T,Pr as U,Pn as V,br as W,wr as X,at as Y,gr as Z,jr as _,Gn as a,Pt as a0,Nt as a1,Cn as a2,Ln as a3,An as a4,ft as a5,_n as a6,Nn as a7,Tn as a8,En as a9,kn as aa,In as ab,Vn as ac,Wn as ad,Hn as ae,Fn as af,Dn as ag,Un as ah,Kn as ai,Bn as aj,mn as ak,dn as al,pr as am,bn as an,ot as ao,pn as ap,gn as aq,lr as ar,ir as as,cr as b,ur as c,fr as d,vn as e,yn as f,dr as g,mr as h,fn as i,Tr as j,it as k,jn as l,Rn as m,Mn as n,Nr as o,On as p,er as q,nr as r,rr as s,sr as t,ar as u,or as v,Er as w,tr as x,Yn as y,Xn as z}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-VQgwkhn4.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/FilterChips-Dah6AI5Z.js","assets/heroui-BI50yK5B.js","assets/recharts-C4kRDmvS.js","assets/tableSelection-9hV37uhu.js","assets/ConfirmDialog-NCJIhH2z.js","assets/DataTable-Bmn_eYSV.js","assets/TablePagination-DgA36VXY.js","assets/AliasesPage-nuRqwFaK.js","assets/Field-Dwp6u3t8.js","assets/UserComboBox-a9wxf8eF.js","assets/BudgetsPage-_DPQrLj-.js","assets/DocsPage-LBlDxv2S.js","assets/KeysPage-C7uXJfSL.js","assets/ModelScopeControl-B4eI_pm-.js","assets/ModelsPage-Dgku-JK2.js","assets/OverviewPage-C5sP44tb.js","assets/charts-DIsd9m--.js","assets/ProvidersPage-CYSSSf8R.js","assets/SettingsPage-DaOqG5a9.js","assets/ToolsGuardrailsPage-B5j54QGf.js","assets/UsagePage-DQoRJkY3.js","assets/UsersPage-DUd7-214.js"])))=>i.map(i=>d[i]); +var Ie=Object.defineProperty;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>qe(e,typeof t!="symbol"?t+"":t,r);import{u as g,j as n,a as p,b as x,k as ne,Q as Re,c as Oe}from"./tanstack-query-1t81HyiD.js";import{d as Me,r as o,N as Z,L as Fe,O as Ue,H as Ke,e as Be,f as j,h as $e}from"./react-dgEcD0HR.js";import{B as C,C as U,L as xe,I as ye,a as ze,b as Qe,d as I,S as Ve,c as T,T as We,e as He}from"./heroui-BI50yK5B.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ge=Me();const Je="modulepreload",Ye=function(e){return"/"+e},ue={},P=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let u=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(r.map(y=>{if(y=Ye(y),y in ue)return;ue[y]=!0;const h=y.endsWith(".css"),b=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Je,h||(m.as="script"),m.crossOrigin="",m.href=y,f&&m.setAttribute("nonce",f),document.head.appendChild(m),h)return new Promise((N,M)=>{m.addEventListener("load",N),m.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};class L extends Error{constructor(r,s){super(s);ce(this,"status");this.name="ApiError",this.status=r}}let K=null;function de(e){K=e}async function ee(e){try{const t=await e.json();if(typeof t.detail=="string")return t.detail;if(t.detail!=null)return JSON.stringify(t.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Xe(e){let t;try{t=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(t.status===401||t.status===403)return!1;if(!t.ok)throw new L(t.status,await ee(t));return!0}async function Ze(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function c(e,t={}){const r=new Headers(t.headers);r.set("Accept","application/json"),t.body!=null&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let s;try{s=await fetch(e,{...t,headers:r})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(s.status===401||s.status===403)throw K==null||K(),new L(s.status,await ee(s));if(!s.ok)throw new L(s.status,await ee(s));if(s.status!==204)return await s.json()}const te="otari.dashboard.hasSession",ve=o.createContext(null);function et(){try{return window.localStorage.getItem(te)==="1"}catch{return!1}}function tt({children:e}){const t=g(),[r,s]=o.useState(et),a=o.useCallback(()=>{Ze(),s(!1),t.clear();try{window.localStorage.removeItem(te)}catch{}},[t]),i=o.useCallback(()=>{t.clear(),s(!0);try{window.localStorage.setItem(te,"1")}catch{}},[t]);o.useEffect(()=>(de(a),()=>de(null)),[a]);const u=o.useMemo(()=>({isAuthenticated:r,login:i,logout:a}),[r,i,a]);return n.jsx(ve.Provider,{value:u,children:e})}function re(){const e=o.useContext(ve);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function nt(e){return e instanceof L&&e.status===0}function rt(){const e=g(),[t,r]=o.useState(!1);return o.useEffect(()=>{const s=e.getQueryCache(),a=()=>s.getAll().some(i=>i.state.status==="error"&&nt(i.state.error));return r(a()),s.subscribe(()=>r(a()))},[e]),t}function st(){return rt()?n.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const $=3600,_=86400,at=365*_,dn=[{key:"1h",label:"Last hour",seconds:$,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"90d",label:"90d",seconds:90*_,bucket:"day"},{key:"12mo",label:"12mo",seconds:at,bucket:"day"}],mn="30d",fn=[{key:"1h",label:"1h",seconds:$,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"all",label:"All",seconds:null,bucket:"day"}],hn="24h",xn="custom";function yn(e,t){return e.find(r=>r.key===t)}function it(e,t=Date.now()){return new Date(t-e*1e3).toISOString()}function ot(e){return(e==="hour"?$:_)*1e3}function vn(e,t,r=Date.now()){const s=new Date(e).getTime();return(t?new Date(t).getTime():r)-s<=_*1e3?"hour":"day"}function gn(e,t,r,s){if(e.length===0)return null;const a=Math.max(0,Math.min(t,r)),i=Math.min(e.length-1,Math.max(t,r)),u=new Date(e[a]).getTime(),d=new Date(e[i]).getTime()+ot(s);return{startIso:new Date(u).toISOString(),endIso:new Date(d).toISOString()}}function pn(e,t,r){const s=e.length;if(s===0)return{startIndex:0,endIndex:0};const a=e.map(d=>new Date(d).getTime());let i=0;if(t){const d=new Date(t).getTime();for(let f=0;fc("/v1/models"),staleTime:6e4})}function dt(){return p({queryKey:[ct],queryFn:()=>c("/dashboard-build.json"),refetchInterval:ut,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function jn(){return p({queryKey:[ae],queryFn:()=>c("/v1/models/discoverable"),staleTime:5*6e4})}function Sn(){return p({queryKey:[ie],queryFn:()=>c("/v1/providers"),staleTime:5*6e4})}function kn(){return p({queryKey:["provider-catalog"],queryFn:()=>c("/v1/providers/catalog"),staleTime:1/0})}function En(e){return p({queryKey:["provider-catalog",e],queryFn:()=>c(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Pn(){return p({queryKey:[oe],queryFn:()=>c("/v1/providers/health"),staleTime:me,refetchInterval:me})}function Nn(){const e=g();return x({mutationFn:()=>c("/v1/providers/health?refresh=true"),onSuccess:t=>e.setQueryData([oe],t)})}function Cn(){return p({queryKey:[be],queryFn:()=>c("/v1/provider-credentials"),staleTime:6e4})}function Q(e){e.invalidateQueries({queryKey:[be]}),e.invalidateQueries({queryKey:[ie]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]}),e.invalidateQueries({queryKey:[oe]})}function Tn(){const e=g();return x({mutationFn:t=>c("/v1/provider-credentials",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>Q(e)})}function _n(){const e=g();return x({mutationFn:({instance:t,body:r})=>c(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>Q(e)})}function Ln(){const e=g();return x({mutationFn:t=>c(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>Q(e)})}function Dn(){const e=g();return x({mutationFn:()=>c("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>Q(e)})}function An(){return x({mutationFn:e=>c(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function In(){return x({mutationFn:e=>c("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function qn(){return p({queryKey:[lt],queryFn:()=>c("/v1/models/metadata"),staleTime:10*6e4})}function Rn(){return p({queryKey:[se],queryFn:()=>c("/v1/aliases"),staleTime:6e4})}function On(){const e=g();return x({mutationFn:t=>c("/v1/aliases",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function Mn(){const e=g();return x({mutationFn:({name:t,userId:r})=>{const s=r==null?"":`?user_id=${encodeURIComponent(r)}`;return c(`/v1/aliases/${encodeURIComponent(t)}${s}`,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function mt(){return p({queryKey:[ge],queryFn:()=>c("/v1/settings"),staleTime:6e4})}function ft(){const e=g();return x({mutationFn:t=>c("/v1/settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([ge],t),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]})}})}function Fn(){return x({mutationFn:()=>c("/v1/settings/master-key/rotate",{method:"POST"})})}function Un(){return p({queryKey:[pe],queryFn:()=>c("/v1/tool-settings"),staleTime:6e4})}function Kn(){const e=g();return x({mutationFn:t=>c("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([pe],t)}})}function Bn(){return x({mutationFn:({service:e,url:t})=>c(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:t})})})}const H=1e3,ht=100;async function xt(){const e=[];for(let t=0;tc("/v1/pricing",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]})}})}function Qn(){const e=g();return x({mutationFn:t=>c(`/v1/pricing/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]})}})}function Vn(){return x({mutationFn:()=>c("/v1/pricing/refresh",{method:"POST"})})}function Wn(){const e=g();return x({mutationFn:()=>c("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ie]})}})}function Hn(){return x({mutationFn:()=>c("/v1/pricing/refresh/reject",{method:"POST"})})}const G=1e3,yt=100;async function vt(){const e=[];for(let t=0;tc("/v1/keys",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Yn(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/keys/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Xn(){const e=g();return x({mutationFn:t=>c(`/v1/keys/${encodeURIComponent(t)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Zn(){const e=g();return x({mutationFn:t=>c(`/v1/keys/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}const J=1e3,gt=100;async function pt(){const e=[];for(let t=0;tc(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function nr(){const e=g();return x({mutationFn:t=>c("/v1/budgets",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function rr(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/budgets/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function sr(){const e=g();return x({mutationFn:t=>c(`/v1/budgets/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}const Y=1e3,bt=100;async function wt(){const e=[];for(let t=0;tc("/v1/users",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>le(e)})}function or(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/users/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>le(e)})}function lr(){const e=g();return x({mutationFn:t=>c(`/v1/users/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{le(e),e.invalidateQueries({queryKey:[q]})}})}function V(e){const t=new URLSearchParams;return e.start_date&&t.set("start_date",e.start_date),e.end_date&&t.set("end_date",e.end_date),e.status&&t.set("status",e.status),e.model&&t.set("model",e.model),e.endpoint&&t.set("endpoint",e.endpoint),e.user_id&&t.set("user_id",e.user_id),e.api_key_id&&t.set("api_key_id",e.api_key_id),e.source&&t.set("source",e.source),e.priced!==void 0&&t.set("priced",String(e.priced)),e.counts_toward_budget!==void 0&&t.set("counts_toward_budget",String(e.counts_toward_budget)),t}function cr(e,t,r){return p({queryKey:[O,"list",e,t,r],queryFn:()=>{const s=V(e);return s.set("skip",String(t*r)),s.set("limit",String(r)),c(`/v1/usage?${s.toString()}`)},placeholderData:ne,staleTime:1e4})}function ur(e,t=!0){return p({queryKey:[O,"count",e],queryFn:()=>c(`/v1/usage/count?${V(e).toString()}`),enabled:t,placeholderData:ne,staleTime:1e4})}const jt=6e4;function St(e,t=!0){return p({queryKey:[O,"count","failures",e],queryFn:()=>{const r={status:"error",source:"gateway",start_date:it(e)};return c(`/v1/usage/count?${V(r).toString()}`)},enabled:t,refetchInterval:jt,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function dr(){const e=g();return x({mutationFn:t=>c("/v1/usage",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]})}})}function mr(){const e=g();return x({mutationFn:t=>c("/v1/usage/set-price",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]})}})}function fr(e,t,r=!0){return p({queryKey:[O,"summary",e,t],queryFn:()=>{const s=V(e);return s.set("bucket",t),c(`/v1/usage/summary?${s.toString()}`)},enabled:r,placeholderData:ne,staleTime:3e4})}function hr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function xr(e){if(e==null)return"$0.00";const t=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}function yr(e){if(e==null)return"—";if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){const t=Math.round(e/1e3);return t>=1e3?"1M":`${t}K`}return String(e)}const kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function vr(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})/.exec(e);if(!t)return e;const r=Number(t[2])-1;return r<0||r>11?t[1]:`${kt[r]} ${t[1]}`}const Et=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function gr(e){return Et.format(e)}function pr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Pt(e){return`${(e*100).toFixed(1)}%`}function br(e,t){return t===void 0||t===0?null:(e-t)/t}function Nt(e,t=Date.now()){if(!e)return"never";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const s=Math.round((t-r.getTime())/1e3),a=s<0,i=Math.abs(s),u=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let d=i,f="second";for(const[h,b]of u){if(f=h,d0?"▲":e<0?"▼":"•";return n.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t," ",Pt(Math.abs(e))," vs prev"]})}function Ct(e){return e instanceof L||e instanceof Error?e.message:"Something went wrong."}function Tt({error:e}){return e?n.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:Ct(e)}):null}function _t({tone:e="info",children:t}){const r=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return n.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${r}`,children:t})}function Sr({title:e,description:t,action:r}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),r?n.jsx("div",{className:"flex flex-wrap gap-2",children:r}):null]})}function Lt(e){const[t,r]=o.useState(()=>Date.now());return o.useEffect(()=>{let s;const a=()=>{s===void 0&&(s=setInterval(()=>r(Date.now()),e))},i=()=>{s!==void 0&&(clearInterval(s),s=void 0)},u=()=>{r(Date.now()),document.visibilityState==="visible"?a():i()};return u(),document.addEventListener("visibilitychange",u),()=>{i(),document.removeEventListener("visibilitychange",u)}},[e]),t}function kr({onRefresh:e,isFetching:t=!1,updatedAt:r,label:s="Refresh"}){const a=Lt(15e3),i=r?Nt(new Date(r).toISOString(),a):null;return n.jsxs("span",{className:"inline-flex items-center gap-2",children:[i?n.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Updated ",i]}):null,n.jsx(C,{variant:"outline",size:"sm",isIconOnly:!0,isDisabled:t,onPress:e,"aria-label":s,children:n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`h-4 w-4 ${t?"animate-spin":""}`,"aria-hidden":"true",children:[n.jsx("path",{d:"M20 11a8 8 0 1 0-.5 4",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M20 4v5h-5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function Er({title:e,description:t,actionLabel:r,onAction:s,isActionDisabled:a,children:i}){return n.jsx(I,{children:n.jsxs(I.Content,{className:"flex flex-col gap-4 p-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),i,r&&s?n.jsx("div",{children:n.jsx(C,{variant:"primary",isDisabled:a,onPress:s,children:r})}):null]})})}function Pr({label:e="Loading…"}){return n.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 px-4 py-10 text-sm text-[var(--otari-muted)]",children:[n.jsx(Ve,{size:"sm"}),n.jsx("span",{children:e})]})}function Nr({children:e,confirmLabel:t,onConfirm:r,isPending:s}){const[a,i]=o.useState(!1);return a?n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(C,{size:"sm",variant:"danger",isDisabled:s,onPress:r,children:t}),n.jsx(C,{size:"sm",variant:"ghost",isDisabled:s,onPress:()=>i(!1),children:"Cancel"})]}):n.jsx(C,{size:"sm",variant:"danger-soft",onPress:()=>i(!0),children:e})}const Dt="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Cr({id:e,label:t,ariaLabel:r,value:s,onChange:a,options:i,children:u,disabled:d}){const f=o.useId(),y=e??(t?f:void 0),h=n.jsx("select",{id:y,"aria-label":t?void 0:r,value:s,disabled:d,onChange:b=>a(b.target.value),className:Dt,children:i?i.map(b=>n.jsx("option",{value:b.value,children:b.label},b.value)):u});return t?n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),h]}):h}function Tr({label:e,value:t,onChange:r,options:s,placeholder:a,maxVisible:i=50,allowsCustom:u=!1}){const d=m=>{var N;return((N=s.find(M=>M.value===m))==null?void 0:N.label)??m},[f,y]=o.useState(()=>d(t));o.useEffect(()=>{y(d(t))},[t]);const h=f.trim().toLowerCase(),b=s.filter(m=>!h||m.value.toLowerCase().includes(h)||m.label.toLowerCase().includes(h)).slice(0,i);return n.jsxs(U.Root,{allowsEmptyCollection:!0,allowsCustomValue:u,menuTrigger:"focus",inputValue:f,onInputChange:m=>{y(m),u?r(m.trim()):m.trim()===""&&r("")},onSelectionChange:m=>{m!=null&&r(String(m))},className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),n.jsxs(U.InputGroup,{children:[n.jsx(ye,{placeholder:a,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),n.jsx(U.Trigger,{})]}),n.jsx(U.Popover,{children:n.jsx(ze,{items:b,className:"max-h-72 overflow-auto",children:m=>n.jsx(Qe,{id:m.value,textValue:m.label,children:m.label})})})]})}function At(){var f,y;const e=mt(),t=ft(),[r,s]=o.useState(!1),i=((f=e.data)==null?void 0:f.require_pricing)===!0&&e.data.default_pricing===!1&&!r,d=((y=St($,i).data)==null?void 0:y.total)??0;return i?n.jsx("div",{className:"shrink-0 px-6 pt-3",children:n.jsx(_t,{tone:"warning",children:n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("span",{children:["Requests are rejected until pricing is set (",n.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away.",d>0?n.jsxs(n.Fragment,{children:[" ",n.jsxs("strong",{className:"font-semibold",children:[d.toLocaleString()," ",d===1?"request":"requests"," failed in the last hour."]})," ",n.jsx(Fe,{to:"/activity?status=error&range=1h&source=gateway",className:"underline underline-offset-2",children:"View failed requests"})]}):null]}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(C,{size:"sm",variant:"primary",isDisabled:t.isPending,onPress:()=>t.mutate({default_pricing:!0}),children:t.isPending?"Enabling…":"Enable default pricing"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Dismiss"})]})]})})}):null}function It(){const{data:e}=dt(),t=o.useRef(null);return e&&t.current===null&&(t.current=e.build),e!=null&&t.current!=null&&e.build!==t.current}function qt(){const e=It(),[t,r]=o.useState(!1);return!e||t?null:n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:n.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),n.jsx(C,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>r(!0),children:"Later"})]})})}const je=200,Se=480,X=240,Rt=60,ke="otari.dashboard.sidebarWidth",Ee="otari.dashboard.sidebarCollapsed",he=16,Pe="(max-width: 767px)",B=e=>Math.min(Se,Math.max(je,e));function Ot(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(Pe).matches}const Mt='a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ft(e){return e?Array.from(e.querySelectorAll(Mt)).filter(t=>t.offsetParent!==null||t===document.activeElement):[]}function Ut(){if(typeof window>"u")return X;try{const e=window.localStorage.getItem(ke),t=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(t)?X:B(t)}catch{return X}}function Kt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ee)==="1"}catch{return!1}}const Bt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],$t=[{to:"/",section:"home",label:"Overview",end:!0,icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),n.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),n.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),n.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),n.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function zt(){const{logout:e}=re(),t=o.useRef(null),r=o.useRef(null),s=o.useRef(null),[a,i]=o.useState(Ut),[u,d]=o.useState(Kt),[f,y]=o.useState(!1),[h,b]=o.useState(Ot),[m,N]=o.useState(!1);o.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const l=window.matchMedia(Pe),v=w=>{b(w.matches),w.matches||N(!1)};return typeof l.addEventListener=="function"?(l.addEventListener("change",v),()=>l.removeEventListener("change",v)):(l.addListener(v),()=>l.removeListener(v))},[]),o.useEffect(()=>{if(!m)return;const l=v=>{v.key==="Escape"&&N(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[m]),o.useEffect(()=>{var l,v,w;h&&(m?(l=t.current)==null||l.focus():(v=t.current)!=null&&v.contains(document.activeElement)&&((w=s.current)==null||w.focus()))},[h,m]);const M=o.useCallback(l=>{if(l.key!=="Tab")return;const v=Ft(t.current);if(v.length===0)return;const w=v[0],k=v[v.length-1],F=document.activeElement;l.shiftKey&&(F===w||F===t.current)?(l.preventDefault(),k.focus()):!l.shiftKey&&F===k&&(l.preventDefault(),w.focus())},[]);o.useEffect(()=>{const l=window.setTimeout(()=>{try{window.localStorage.setItem(ke,String(Math.round(a)))}catch{}},200);return()=>window.clearTimeout(l)},[a]),o.useEffect(()=>{try{window.localStorage.setItem(Ee,u?"1":"0")}catch{}},[u]);const Ce=o.useCallback(l=>{l.preventDefault(),l.currentTarget.setPointerCapture(l.pointerId),y(!0)},[]),Te=o.useCallback(l=>{var w;if(!l.currentTarget.hasPointerCapture(l.pointerId))return;const v=((w=t.current)==null?void 0:w.getBoundingClientRect().left)??0;i(B(l.clientX-v))},[]),_e=o.useCallback(l=>{l.currentTarget.hasPointerCapture(l.pointerId)&&l.currentTarget.releasePointerCapture(l.pointerId),y(!1)},[]),Le=o.useCallback(l=>{var v;l.preventDefault(),(v=r.current)==null||v.focus()},[]),De=o.useCallback(l=>{l.key==="ArrowLeft"?(l.preventDefault(),i(v=>B(v-he))):l.key==="ArrowRight"&&(l.preventDefault(),i(v=>B(v+he)))},[]),Ae=u?Rt:a,S=h?!1:u,W=h&&m?!0:void 0;return n.jsxs("div",{className:T("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[n.jsx("button",{type:"button",inert:W,onClick:Le,className:"sr-only focus:not-sr-only focus:absolute focus:top-3 focus:left-3 focus:z-50 focus:rounded-lg focus:border focus:border-[var(--otari-brand)] focus:bg-[var(--otari-surface)] focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-[var(--otari-brand-dark)] focus:shadow-md focus:outline-none",children:"Skip to main content"}),n.jsxs("header",{inert:W,className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("button",{type:"button",ref:s,onClick:()=>N(l=>!l),"aria-label":m?"Close navigation":"Open navigation","aria-expanded":m,"aria-controls":"app-sidebar",className:"-ml-1 flex h-8 w-8 items-center justify-center rounded-lg text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)] md:hidden",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5",children:n.jsx("path",{d:"M4 6h16M4 12h16M4 18h16",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),n.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),n.jsx(C,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),n.jsx(qt,{}),n.jsx(st,{}),n.jsx(At,{}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[h&&m?n.jsx("div",{"aria-hidden":"true",onClick:()=>N(!1),className:"fixed inset-0 z-30 bg-black/40 md:hidden"}):null,n.jsxs("aside",{ref:t,id:"app-sidebar",role:h?"dialog":void 0,"aria-modal":h&&m?!0:void 0,"aria-label":h?"Navigation":void 0,tabIndex:h?-1:void 0,inert:h&&!m?!0:void 0,onKeyDown:h&&m?M:void 0,style:h?void 0:{width:Ae},className:T("flex flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)] focus:outline-none",h?T("fixed inset-y-0 left-0 z-40 w-[17rem] shadow-xl transition-transform duration-200",m?"translate-x-0":"-translate-x-full"):T("relative shrink-0",!f&&"transition-[width] duration-150")),children:[n.jsx("button",{type:"button",onClick:()=>d(l=>!l),"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-pressed":u,title:u?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 hidden h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)] md:flex",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:T("h-3.5 w-3.5 transition-transform",u&&"rotate-180"),children:n.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("nav",{className:T("flex flex-col py-4",S?"px-2":"px-3"),children:Bt.map((l,v)=>{const w=$t.filter(k=>k.section===l.key);return w.length===0?null:n.jsxs("div",{className:v>0?"mt-4":void 0,children:[!S&&l.label?n.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:l.label}):null,v>0&&(S||!l.label)?n.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,n.jsx("div",{className:"flex flex-col gap-1",children:w.map(k=>n.jsxs(Z,{to:k.to,end:k.end,onClick:()=>N(!1),"aria-label":S?k.label:void 0,title:S?k.label:void 0,className:({isActive:F})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"justify-center px-0":"gap-3 px-3",F?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,S?null:k.label]},k.to))})]},l.key)})}),n.jsxs("div",{className:"mt-auto flex flex-col gap-1 pb-3",children:[n.jsxs(Z,{to:"/docs",onClick:()=>N(!1),"aria-label":S?"User guide":void 0,title:S?"User guide":void 0,className:({isActive:l})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"mx-2 justify-center px-0":"mx-3 gap-3 px-3",l?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[n.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.5V18c4 0 6.5.5 8 2 1.5-1.5 4-2 8-2V4.5c-4 0-6.5.5-8 2z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 6.5V20",strokeLinecap:"round"})]}),S?null:"User guide"]}),n.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai: the hosted Otari gateway",className:T("flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",S?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),S?null:n.jsxs("span",{className:"flex-1",children:["otari.ai ",n.jsx("span",{"aria-hidden":!0,children:"↗"})]})]})]}),u||h?null:n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(a),"aria-valuemin":je,"aria-valuemax":Se,tabIndex:0,onPointerDown:Ce,onPointerMove:Te,onPointerUp:_e,onKeyDown:De,className:T("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),n.jsx("main",{ref:r,id:"main-content",tabIndex:-1,inert:W,className:"flex-1 overflow-y-auto focus:outline-none",children:n.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-4 py-5 md:px-6 md:py-6",children:n.jsx(Ue,{})})})]})]})}function Qt(){const{login:e}=re(),[t,r]=o.useState(""),[s,a]=o.useState(null),[i,u]=o.useState(!1),d=async()=>{const f=t.trim();if(!(!f||i)){u(!0),a(null);try{await Xe(f)?e():a(new Error("Invalid master key."))}catch(y){a(y)}finally{u(!1)}}};return n.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:n.jsx(I,{className:"w-full max-w-md",children:n.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),n.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),d()},children:[n.jsxs(We,{value:t,onChange:f=>{r(f),s&&a(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),n.jsx(ye,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),n.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[n.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),n.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",n.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",n.jsx("code",{children:"Your master key:"})," (for example, run"," ",n.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),n.jsx(Tt,{error:s}),n.jsx(C,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!t.trim()||i,children:i?"Signing in…":"Sign in"})]}),n.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),n.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:n.jsx(He,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const Vt=o.lazy(async()=>({default:(await P(async()=>{const{ActivityPage:e}=await import("./ActivityPage-VQgwkhn4.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))).ActivityPage})),Wt=o.lazy(async()=>({default:(await P(async()=>{const{AliasesPage:e}=await import("./AliasesPage-nuRqwFaK.js");return{AliasesPage:e}},__vite__mapDeps([10,1,2,6,4,7,8,11,12]))).AliasesPage})),Ht=o.lazy(async()=>({default:(await P(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-_DPQrLj-.js");return{BudgetsPage:e}},__vite__mapDeps([13,1,2,6,4,7,8,11]))).BudgetsPage})),Gt=o.lazy(async()=>({default:(await P(async()=>{const{DocsPage:e}=await import("./DocsPage-LBlDxv2S.js");return{DocsPage:e}},__vite__mapDeps([14,1,2,4]))).DocsPage})),Jt=o.lazy(async()=>({default:(await P(async()=>{const{KeysPage:e}=await import("./KeysPage-C7uXJfSL.js");return{KeysPage:e}},__vite__mapDeps([15,1,2,6,4,7,8,11,16,12]))).KeysPage})),Yt=o.lazy(async()=>({default:(await P(async()=>{const{ModelsPage:e}=await import("./ModelsPage-Dgku-JK2.js");return{ModelsPage:e}},__vite__mapDeps([17,1,2,6,4,8,9]))).ModelsPage})),Xt=o.lazy(async()=>({default:(await P(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-C5sP44tb.js");return{OverviewIndex:e}},__vite__mapDeps([18,1,2,19,5,4,8]))).OverviewIndex})),Zt=o.lazy(async()=>({default:(await P(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-CYSSSf8R.js");return{ProvidersPage:e}},__vite__mapDeps([20,1,2,11,4,8]))).ProvidersPage})),en=o.lazy(async()=>({default:(await P(async()=>{const{SettingsPage:e}=await import("./SettingsPage-DaOqG5a9.js");return{SettingsPage:e}},__vite__mapDeps([21,1,2,4]))).SettingsPage})),tn=o.lazy(async()=>({default:(await P(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-B5j54QGf.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([22,1,2,4]))).ToolsGuardrailsPage})),nn=o.lazy(async()=>({default:(await P(async()=>{const{UsagePage:e}=await import("./UsagePage-DQoRJkY3.js");return{UsagePage:e}},__vite__mapDeps([23,1,2,3,4,5,6,19,7,8,9]))).UsagePage})),rn=o.lazy(async()=>({default:(await P(async()=>{const{UsersPage:e}=await import("./UsersPage-DUd7-214.js");return{UsersPage:e}},__vite__mapDeps([24,1,2,6,4,7,8,11,16]))).UsersPage}));function E(e){return n.jsx(o.Suspense,{fallback:n.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function sn(){const{isAuthenticated:e}=re();return e?n.jsx(Ke,{children:n.jsx(Be,{children:n.jsxs(j,{element:n.jsx(zt,{}),children:[n.jsx(j,{index:!0,element:E(n.jsx(Xt,{}))}),n.jsx(j,{path:"providers",element:E(n.jsx(Zt,{}))}),n.jsx(j,{path:"keys",element:E(n.jsx(Jt,{}))}),n.jsx(j,{path:"users",element:E(n.jsx(rn,{}))}),n.jsx(j,{path:"budgets",element:E(n.jsx(Ht,{}))}),n.jsx(j,{path:"activity",element:E(n.jsx(Vt,{}))}),n.jsx(j,{path:"usage",element:E(n.jsx(nn,{}))}),n.jsx(j,{path:"models",element:E(n.jsx(Yt,{}))}),n.jsx(j,{path:"aliases",element:E(n.jsx(Wt,{}))}),n.jsx(j,{path:"tools",element:E(n.jsx(tn,{}))}),n.jsx(j,{path:"settings",element:E(n.jsx(en,{}))}),n.jsx(j,{path:"docs",element:E(n.jsx(Gt,{}))}),n.jsx(j,{path:"*",element:n.jsx($e,{to:"/",replace:!0})})]})})}):n.jsx(Qt,{})}function an({children:e}){const[t]=o.useState(()=>new Re({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(r,s)=>s instanceof L&&(s.status===401||s.status===403)?!1:r<2}}}));return n.jsx(Oe,{client:t,children:n.jsx(tt,{children:e})})}const Ne=document.getElementById("root");if(!Ne)throw new Error("Root element #root not found");Ge.createRoot(Ne).render(n.jsx(o.StrictMode,{children:n.jsx(an,{children:n.jsx(sn,{})})}));export{hr as $,hn as A,Zn as B,xn as C,Jn as D,Tt as E,Cr as F,wn as G,$n as H,_t as I,qn as J,zn as K,yr as L,Qn as M,Ct as N,vr as O,Sr as P,mt as Q,kr as R,xr as S,Sn as T,Pr as U,Pn as V,br as W,wr as X,at as Y,gr as Z,jr as _,Gn as a,Pt as a0,Nt as a1,Cn as a2,Ln as a3,An as a4,ft as a5,_n as a6,Nn as a7,Tn as a8,En as a9,kn as aa,In as ab,Vn as ac,Wn as ad,Hn as ae,Fn as af,Dn as ag,Un as ah,Kn as ai,Bn as aj,mn as ak,dn as al,pr as am,bn as an,ot as ao,pn as ap,gn as aq,lr as ar,ir as as,cr as b,ur as c,fr as d,vn as e,yn as f,dr as g,mr as h,fn as i,Tr as j,it as k,jn as l,Rn as m,Mn as n,Nr as o,On as p,er as q,nr as r,rr as s,sr as t,ar as u,or as v,Er as w,tr as x,Yn as y,Xn as z}; diff --git a/src/gateway/static/dashboard/index.html b/src/gateway/static/dashboard/index.html index 6690ff3e0..b64713493 100644 --- a/src/gateway/static/dashboard/index.html +++ b/src/gateway/static/dashboard/index.html @@ -19,7 +19,7 @@ insets to sit out of the way. --> Otari Dashboard - + diff --git a/web/src/pages/ActivityPage.test.tsx b/web/src/pages/ActivityPage.test.tsx index aa07ea115..f7fa39bd2 100644 --- a/web/src/pages/ActivityPage.test.tsx +++ b/web/src/pages/ActivityPage.test.tsx @@ -339,6 +339,42 @@ describe("ActivityPage", () => { expect(widths.reduce((a, b) => a + b, 0)).toBeCloseTo(100, 5); }); + it("explains the column's total in the detail panel when it exceeds the raw one", async () => { + // An additive-convention row reports its cache buckets outside the prompt, so + // the billed total the column shows is far above the stored `total_tokens`. + // Both are spelled out, or the two numbers look like a bug. + const user = userEvent.setup(); + mockApi({ + rows: [ + entry({ + prompt_tokens: 1_000, + completion_tokens: 200, + total_tokens: 1_200, + cache_read_tokens: 98_000, + cache_write_tokens: 1_500, + billing_meters: { + total_input_tokens: 100_500, + fresh_input_tokens: 1_000, + cache_read_tokens: 98_000, + cache_write_tokens: 1_500, + cache_write_1h_tokens: 0, + completion_tokens: 200, + }, + }), + ], + }); + renderPage(); + + const row = (await screen.findByText("gpt-4o")).closest("tr")!; + await user.click(row); + + const field = (label: string): string => screen.getByText(label).parentElement!.textContent ?? ""; + expect(field("Total tokens")).toContain("1,200"); + expect(field("Billed tokens")).toContain("100,700"); + // Which is the number the row itself shows. + expect(within(row).getByText("100,700")).toBeInTheDocument(); + }); + it("splits an unmetered row from its raw columns, and shows no bar without usage", async () => { // An unpriced row carries no billing meters, so the composition falls back to // the raw columns (cache read counted inside the prompt). diff --git a/web/src/pages/ActivityPage.tsx b/web/src/pages/ActivityPage.tsx index d124cc03f..d63efcf7e 100644 --- a/web/src/pages/ActivityPage.tsx +++ b/web/src/pages/ActivityPage.tsx @@ -322,6 +322,14 @@ function RequestDetail({ entry }: { entry: UsageEntry }) { {formatTokens(entry.prompt_tokens)} {formatTokens(entry.completion_tokens)} {formatTokens(entry.total_tokens)} + {/* The Tokens column's number, spelled out here because it can exceed the + provider-reported total above: the row's composition counts the cache + buckets, which an additive-convention provider reports outside the prompt. */} + + + {formatTokens(tokenComposition(entry)?.total ?? null)} + + {formatUSD(entry.cost)} {formatTokens(entry.cache_read_tokens)} {formatTokens(entry.cache_write_tokens)} From dec6d2d3fdeac64298742312de700b81f0b681e6 Mon Sep 17 00:00:00 2001 From: Nathan Brake Date: Mon, 3 Aug 2026 14:36:00 +0000 Subject: [PATCH 4/9] feat(usage): rebuild analytics around a metric-by-dimension chart and a standard drag-to-zoom histogram The Usage page now follows the model the OpenAI usage dashboard and the Anthropic console converged on: one main time-series chart with metric tabs (Cost, Tokens, Requests) and a group-by dimension (model, user, API key, source) that splits it into stacked bars, on a fixed categorical palette validated for CVD separation and surface contrast. Ungrouped views use the richest encoding each metric has: tokens stack their billed composition (fresh input, cache read, cache write, output; the same encoding as the Activity token bar), requests split succeeded/failed. Tiles trade the three raw cache counters for a cache hit rate, and the per-request table moves wholly to the Activity page (an "Open activity log" action carries the current view across). The timeline histogram drops its edge-handle slider and pan strip for the standard interaction: drag across the plot to zoom (via recharts' own event coordinates, so no more pixel math against axis margins), a minimap rail to pan when zoomed, and failed requests as a red segment. Backend: summary series points carry per-bucket error counts and billed token composition, totals carry billed input tokens, breakdown tokens are billed (input incl. cache plus output) everywhere, and a new GET /v1/usage/series returns a top-8-plus-other grouped series for the stacked charts. Co-Authored-By: Claude Opus 5 (1M context) --- docs/public/openapi.json | 394 ++++++++- docs/public/otari.postman_collection.json | 97 +- src/gateway/api/routes/usage.py | 255 +++++- .../dashboard/assets/ActivityPage-BSXD7oi2.js | 1 + .../dashboard/assets/ActivityPage-VQgwkhn4.js | 1 - ...ge-nuRqwFaK.js => AliasesPage-DFSg4QUS.js} | 2 +- ...ge-_DPQrLj-.js => BudgetsPage-CnOzEeql.js} | 2 +- ...-NCJIhH2z.js => ConfirmDialog-DawcDVEg.js} | 2 +- ...able-Bmn_eYSV.js => DataTable-CrQq0sYf.js} | 2 +- ...sPage-LBlDxv2S.js => DocsPage-CgRlIVtI.js} | 2 +- .../{Field-Dwp6u3t8.js => Field-DEJ6Wjg9.js} | 2 +- .../dashboard/assets/FilterChips-BlzD0qFP.js | 1 + .../dashboard/assets/FilterChips-Dah6AI5Z.js | 1 - ...sPage-C7uXJfSL.js => KeysPage-HexHbKWR.js} | 4 +- ...I_pm-.js => ModelScopeControl-Bs976Tb8.js} | 2 +- ...age-Dgku-JK2.js => ModelsPage-Cwjl8fM-.js} | 2 +- .../dashboard/assets/OverviewPage-C0SW-na1.js | 1 + .../dashboard/assets/OverviewPage-C5sP44tb.js | 1 - ...-CYSSSf8R.js => ProvidersPage-17Tj43ca.js} | 2 +- ...e-DaOqG5a9.js => SettingsPage-CY71vadM.js} | 2 +- ...gA36VXY.js => TablePagination-BYC0DnfO.js} | 2 +- ...QGf.js => ToolsGuardrailsPage-D_8zOvld.js} | 2 +- .../dashboard/assets/UsagePage-DQoRJkY3.js | 1 - .../dashboard/assets/UsagePage-r45FObnV.js | 1 + ...x-a9wxf8eF.js => UserComboBox-nt7pHfqn.js} | 2 +- ...Page-DUd7-214.js => UsersPage-DJTKoEIl.js} | 2 +- .../dashboard/assets/charts-BI8Uczg4.js | 1 + .../dashboard/assets/charts-DIsd9m--.js | 1 - .../dashboard/assets/heroui-BI50yK5B.js | 20 - .../dashboard/assets/heroui-DZj66Arc.js | 20 + ...{index-Bu_MKbvb.css => index-BTjXME2B.css} | 2 +- .../static/dashboard/assets/index-Dhxz7Eyv.js | 2 + .../static/dashboard/assets/index-DsUY4UvK.js | 2 - .../dashboard/assets/recharts-BwTTRGtj.js | 79 ++ .../dashboard/assets/recharts-C4kRDmvS.js | 79 -- ...9hV37uhu.js => tableSelection-CojkFPwd.js} | 2 +- src/gateway/static/dashboard/index.html | 6 +- tests/integration/test_usage_summary.py | 193 +++- web/src/api/hooks.ts | 25 + web/src/api/types.ts | 41 +- web/src/components/ActivityTimeline.test.tsx | 61 +- web/src/components/ActivityTimeline.tsx | 439 +++------- web/src/components/charts.test.tsx | 94 +- web/src/components/charts.tsx | 244 +++++- web/src/pages/ActivityPage.tsx | 3 + web/src/pages/UsagePage.test.tsx | 166 ++-- web/src/pages/UsagePage.tsx | 826 +++++++++--------- web/src/styles/globals.css | 19 + 48 files changed, 2114 insertions(+), 997 deletions(-) create mode 100644 src/gateway/static/dashboard/assets/ActivityPage-BSXD7oi2.js delete mode 100644 src/gateway/static/dashboard/assets/ActivityPage-VQgwkhn4.js rename src/gateway/static/dashboard/assets/{AliasesPage-nuRqwFaK.js => AliasesPage-DFSg4QUS.js} (94%) rename src/gateway/static/dashboard/assets/{BudgetsPage-_DPQrLj-.js => BudgetsPage-CnOzEeql.js} (91%) rename src/gateway/static/dashboard/assets/{ConfirmDialog-NCJIhH2z.js => ConfirmDialog-DawcDVEg.js} (84%) rename src/gateway/static/dashboard/assets/{DataTable-Bmn_eYSV.js => DataTable-CrQq0sYf.js} (69%) rename src/gateway/static/dashboard/assets/{DocsPage-LBlDxv2S.js => DocsPage-CgRlIVtI.js} (99%) rename src/gateway/static/dashboard/assets/{Field-Dwp6u3t8.js => Field-DEJ6Wjg9.js} (88%) create mode 100644 src/gateway/static/dashboard/assets/FilterChips-BlzD0qFP.js delete mode 100644 src/gateway/static/dashboard/assets/FilterChips-Dah6AI5Z.js rename src/gateway/static/dashboard/assets/{KeysPage-C7uXJfSL.js => KeysPage-HexHbKWR.js} (90%) rename src/gateway/static/dashboard/assets/{ModelScopeControl-B4eI_pm-.js => ModelScopeControl-Bs976Tb8.js} (85%) rename src/gateway/static/dashboard/assets/{ModelsPage-Dgku-JK2.js => ModelsPage-Cwjl8fM-.js} (71%) create mode 100644 src/gateway/static/dashboard/assets/OverviewPage-C0SW-na1.js delete mode 100644 src/gateway/static/dashboard/assets/OverviewPage-C5sP44tb.js rename src/gateway/static/dashboard/assets/{ProvidersPage-CYSSSf8R.js => ProvidersPage-17Tj43ca.js} (97%) rename src/gateway/static/dashboard/assets/{SettingsPage-DaOqG5a9.js => SettingsPage-CY71vadM.js} (94%) rename src/gateway/static/dashboard/assets/{TablePagination-DgA36VXY.js => TablePagination-BYC0DnfO.js} (97%) rename src/gateway/static/dashboard/assets/{ToolsGuardrailsPage-B5j54QGf.js => ToolsGuardrailsPage-D_8zOvld.js} (77%) delete mode 100644 src/gateway/static/dashboard/assets/UsagePage-DQoRJkY3.js create mode 100644 src/gateway/static/dashboard/assets/UsagePage-r45FObnV.js rename src/gateway/static/dashboard/assets/{UserComboBox-a9wxf8eF.js => UserComboBox-nt7pHfqn.js} (95%) rename src/gateway/static/dashboard/assets/{UsersPage-DUd7-214.js => UsersPage-DJTKoEIl.js} (85%) create mode 100644 src/gateway/static/dashboard/assets/charts-BI8Uczg4.js delete mode 100644 src/gateway/static/dashboard/assets/charts-DIsd9m--.js delete mode 100644 src/gateway/static/dashboard/assets/heroui-BI50yK5B.js create mode 100644 src/gateway/static/dashboard/assets/heroui-DZj66Arc.js rename src/gateway/static/dashboard/assets/{index-Bu_MKbvb.css => index-BTjXME2B.css} (92%) create mode 100644 src/gateway/static/dashboard/assets/index-Dhxz7Eyv.js delete mode 100644 src/gateway/static/dashboard/assets/index-DsUY4UvK.js create mode 100644 src/gateway/static/dashboard/assets/recharts-BwTTRGtj.js delete mode 100644 src/gateway/static/dashboard/assets/recharts-C4kRDmvS.js rename src/gateway/static/dashboard/assets/{tableSelection-9hV37uhu.js => tableSelection-CojkFPwd.js} (95%) diff --git a/docs/public/openapi.json b/docs/public/openapi.json index 1ebbe3cd1..fcb27fc4a 100644 --- a/docs/public/openapi.json +++ b/docs/public/openapi.json @@ -5362,6 +5362,107 @@ "title": "UsageGroupRow", "type": "object" }, + "UsageGroupedSeries": { + "description": "A per-group time series for the dashboard's stacked charts.\n\n``groups`` ranks the window's top groups by spend (plus the reconciling\n``other`` fold), in the order a chart should stack and color them; ``points``\nis sparse (only populated cells), keyed by canonical UTC ``bucket_start``.", + "properties": { + "bucket": { + "enum": [ + "hour", + "day" + ], + "title": "Bucket", + "type": "string" + }, + "end_date": { + "title": "End Date", + "type": "string" + }, + "group_by": { + "enum": [ + "model", + "user_id", + "api_key_id", + "source" + ], + "title": "Group By", + "type": "string" + }, + "groups": { + "items": { + "$ref": "#/components/schemas/UsageGroupRow" + }, + "title": "Groups", + "type": "array" + }, + "points": { + "items": { + "$ref": "#/components/schemas/UsageGroupedSeriesPoint" + }, + "title": "Points", + "type": "array" + }, + "start_date": { + "title": "Start Date", + "type": "string" + } + }, + "required": [ + "start_date", + "end_date", + "bucket", + "group_by", + "groups", + "points" + ], + "title": "UsageGroupedSeries", + "type": "object" + }, + "UsageGroupedSeriesPoint": { + "description": "One (time bucket, group) cell of a grouped series.\n\n``key``/``is_other`` follow the ``UsageGroupRow`` convention: ``key=None``\nwith ``is_other=True`` is the fold of groups outside the top N, ``key=None``\nwith ``is_other=False`` is a real NULL group (e.g. a deleted user).\n``tokens`` is the *billed* total (input including cache, plus output), the\nsame quantity the ungrouped series' composition fields sum to.", + "properties": { + "bucket_start": { + "title": "Bucket Start", + "type": "string" + }, + "cost": { + "title": "Cost", + "type": "number" + }, + "is_other": { + "default": false, + "title": "Is Other", + "type": "boolean" + }, + "key": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Key" + }, + "requests": { + "title": "Requests", + "type": "integer" + }, + "tokens": { + "title": "Tokens", + "type": "integer" + } + }, + "required": [ + "bucket_start", + "key", + "cost", + "tokens", + "requests" + ], + "title": "UsageGroupedSeriesPoint", + "type": "object" + }, "UsageLogResponse": { "description": "Response model for usage log.", "properties": { @@ -5505,16 +5606,41 @@ "type": "object" }, "UsageSeriesPoint": { - "description": "One time bucket. ``bucket_start`` is canonical ISO-8601 UTC (``...Z``),\nidentical across SQLite and PostgreSQL for the same underlying instant.", + "description": "One time bucket. ``bucket_start`` is canonical ISO-8601 UTC (``...Z``),\nidentical across SQLite and PostgreSQL for the same underlying instant.\n\n``tokens`` stays the raw provider-reported total (the field predates the\ncomposition split and external consumers may read it). The billed\ncomposition fields are normalized via billing meters (see ``_billed_expr``):\n``input_tokens`` includes both cache buckets, so a chart derives fresh input\nas ``max(0, input_tokens - cache_read_tokens - cache_write_tokens)`` and the\nbilled total as ``fresh + cache_read + cache_write + output``.", "properties": { "bucket_start": { "title": "Bucket Start", "type": "string" }, + "cache_read_tokens": { + "default": 0, + "title": "Cache Read Tokens", + "type": "integer" + }, + "cache_write_tokens": { + "default": 0, + "title": "Cache Write Tokens", + "type": "integer" + }, "cost": { "title": "Cost", "type": "number" }, + "errors": { + "default": 0, + "title": "Errors", + "type": "integer" + }, + "input_tokens": { + "default": 0, + "title": "Input Tokens", + "type": "integer" + }, + "output_tokens": { + "default": 0, + "title": "Output Tokens", + "type": "integer" + }, "requests": { "title": "Requests", "type": "integer" @@ -5807,6 +5933,11 @@ ], "title": "Avg Latency Ms" }, + "billed_input_tokens": { + "default": 0, + "title": "Billed Input Tokens", + "type": "integer" + }, "cache_read_tokens": { "title": "Cache Read Tokens", "type": "integer" @@ -10056,6 +10187,263 @@ ] } }, + "/v1/usage/series": { + "get": { + "description": "Time series split by one dimension, for the dashboard's stacked charts.\n\nSame filters and window bounds as ``/summary``. The window's top groups by\nspend are returned as their own series; everything past the top eight folds\ninto a single ``other`` series per bucket, so the stack always reconciles\nwith the summary totals. Points are sparse (populated cells only).", + "operationId": "usage_series_v1_usage_series_get", + "parameters": [ + { + "description": "Dimension to split the series by", + "in": "query", + "name": "group_by", + "required": true, + "schema": { + "description": "Dimension to split the series by", + "enum": [ + "model", + "user_id", + "api_key_id", + "source" + ], + "title": "Group By", + "type": "string" + } + }, + { + "description": "Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds)", + "in": "query", + "name": "start_date", + "required": false, + "schema": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds)", + "title": "Start Date" + } + }, + { + "description": "Return logs with timestamp < end_date (ISO 8601 or Unix epoch seconds)", + "in": "query", + "name": "end_date", + "required": false, + "schema": { + "anyOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Return logs with timestamp < end_date (ISO 8601 or Unix epoch seconds)", + "title": "End Date" + } + }, + { + "description": "Filter to a single user", + "in": "query", + "name": "user_id", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter to a single user", + "title": "User Id" + } + }, + { + "description": "Filter to a single status (e.g. 'success' or 'error')", + "in": "query", + "name": "status", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter to a single status (e.g. 'success' or 'error')", + "title": "Status" + } + }, + { + "description": "Filter to a single model", + "in": "query", + "name": "model", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter to a single model", + "title": "Model" + } + }, + { + "description": "Filter to a single endpoint (e.g. '/v1/chat/completions')", + "in": "query", + "name": "endpoint", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter to a single endpoint (e.g. '/v1/chat/completions')", + "title": "Endpoint" + } + }, + { + "description": "Filter to a single provenance source (e.g. 'gateway' or 'claude_code')", + "in": "query", + "name": "source", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter to a single provenance source (e.g. 'gateway' or 'claude_code')", + "title": "Source" + } + }, + { + "description": "Filter to a single API key id", + "in": "query", + "name": "api_key_id", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter to a single API key id", + "title": "Api Key Id" + } + }, + { + "description": "Filter by pricing state: true = only rows with a cost, false = only unpriced rows (cost is null)", + "in": "query", + "name": "priced", + "required": false, + "schema": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Filter by pricing state: true = only rows with a cost, false = only unpriced rows (cost is null)", + "title": "Priced" + } + }, + { + "description": "Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget", + "in": "query", + "name": "counts_toward_budget", + "required": false, + "schema": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget", + "title": "Counts Toward Budget" + } + }, + { + "description": "Time-series granularity: 'hour' or 'day'", + "in": "query", + "name": "bucket", + "required": false, + "schema": { + "default": "day", + "description": "Time-series granularity: 'hour' or 'day'", + "enum": [ + "hour", + "day" + ], + "title": "Bucket", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UsageGroupedSeries" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "XApiKeyAuth": [] + } + ], + "summary": "Usage Series", + "tags": [ + "usage" + ] + } + }, "/v1/usage/set-price": { "post": { "description": "Set the cost of imported usage rows from manual per-1M rates (standalone).\n\nTarget either the current selection (``ids``) or everything matching a filter\n(``by_filter: true``). Cost / billing meters / pricing breakdown are recomputed\nfrom each row's own token counts at the supplied ``input`` / ``output`` /\n``cache_read`` / ``cache_write`` per-1M rates (manual rates, not a recompute from\nconfigured pricing). Only imported rows (``counts_toward_budget = false``) are\ntouched, so ``users.spend`` is never affected. Master-key only.", @@ -10108,7 +10496,7 @@ }, "/v1/usage/summary": { "get": { - "description": "Aggregate spend, tokens, and request volume for the dashboard Usage page.\n\nRange-bounded (default last 30 days, hard-capped): unlike the raw ``/v1/usage``\nlist, every aggregate is scoped to a bounded window so it stays served by the\ntimestamp index. Returns grand totals, breakdowns by model / user / API key\n(top rows plus a reconciling ``other`` fold), and a UTC-bucketed time series.", + "description": "Aggregate spend, tokens, and request volume for the dashboard Usage page.\n\nRange-bounded (default last 30 days, hard-capped): unlike the raw ``/v1/usage``\nlist, every aggregate is scoped to a bounded window so it stays served by the\ntimestamp index. Returns grand totals, breakdowns by model / user / API key /\nsource (top rows plus a reconciling ``other`` fold, billed token counts), and\na UTC-bucketed time series carrying each bucket's error count and billed\ntoken composition (input incl. cache, cache read/write, output).", "operationId": "usage_summary_v1_usage_summary_get", "parameters": [ { @@ -10348,7 +10736,7 @@ }, "/v1/usage/summary.csv": { "get": { - "description": "Download the per-model / per-user / per-key / per-source breakdown as CSV.\n\nA dedicated route rather than a ``format=csv`` flag on ``/summary`` so that\nendpoint keeps a single JSON response model and a clean OpenAPI schema. The\nexport is **uncapped** (no top-N fold): finance wants every row. Kept separate\nfrom the bare-array ``/v1/usage`` contract, which is untouched.", + "description": "Download the per-model / per-user / per-key / per-source breakdown as CSV.\n\nA dedicated route rather than a ``format=csv`` flag on ``/summary`` so that\nendpoint keeps a single JSON response model and a clean OpenAPI schema. The\nexport is **uncapped** (no top-N fold): finance wants every row. ``tokens``\nis the billed total (fresh input, both cache buckets, and output), matching\nthe dashboard's analytics. Kept separate from the bare-array ``/v1/usage``\ncontract, which is untouched.", "operationId": "usage_summary_csv_v1_usage_summary_csv_get", "parameters": [ { diff --git a/docs/public/otari.postman_collection.json b/docs/public/otari.postman_collection.json index d5fdea228..2de62d9a8 100644 --- a/docs/public/otari.postman_collection.json +++ b/docs/public/otari.postman_collection.json @@ -2352,6 +2352,99 @@ } } }, + { + "name": "Usage Series", + "request": { + "description": "Time series split by one dimension, for the dashboard's stacked charts.\n\nSame filters and window bounds as ``/summary``. The window's top groups by\nspend are returned as their own series; everything past the top eight folds\ninto a single ``other`` series per bucket, so the stack always reconciles\nwith the summary totals. Points are sparse (populated cells only).", + "header": [], + "method": "GET", + "url": { + "host": [ + "{{baseUrl}}" + ], + "path": [ + "v1", + "usage", + "series" + ], + "query": [ + { + "description": "Dimension to split the series by", + "disabled": false, + "key": "group_by", + "value": "" + }, + { + "description": "Return logs with timestamp >= start_date (ISO 8601 or Unix epoch seconds)", + "disabled": true, + "key": "start_date", + "value": "" + }, + { + "description": "Return logs with timestamp < end_date (ISO 8601 or Unix epoch seconds)", + "disabled": true, + "key": "end_date", + "value": "" + }, + { + "description": "Filter to a single user", + "disabled": true, + "key": "user_id", + "value": "" + }, + { + "description": "Filter to a single status (e.g. 'success' or 'error')", + "disabled": true, + "key": "status", + "value": "" + }, + { + "description": "Filter to a single model", + "disabled": true, + "key": "model", + "value": "" + }, + { + "description": "Filter to a single endpoint (e.g. '/v1/chat/completions')", + "disabled": true, + "key": "endpoint", + "value": "" + }, + { + "description": "Filter to a single provenance source (e.g. 'gateway' or 'claude_code')", + "disabled": true, + "key": "source", + "value": "" + }, + { + "description": "Filter to a single API key id", + "disabled": true, + "key": "api_key_id", + "value": "" + }, + { + "description": "Filter by pricing state: true = only rows with a cost, false = only unpriced rows (cost is null)", + "disabled": true, + "key": "priced", + "value": "" + }, + { + "description": "Filter by budget participation: true = only enforced gateway rows, false = only imported rows that never touch a budget", + "disabled": true, + "key": "counts_toward_budget", + "value": "" + }, + { + "description": "Time-series granularity: 'hour' or 'day'", + "disabled": true, + "key": "bucket", + "value": "" + } + ], + "raw": "{{baseUrl}}/v1/usage/series?group_by=&start_date=&end_date=&user_id=&status=&model=&endpoint=&source=&api_key_id=&priced=&counts_toward_budget=&bucket=" + } + } + }, { "name": "Set Usage Price Rows", "request": { @@ -2388,7 +2481,7 @@ { "name": "Usage Summary", "request": { - "description": "Aggregate spend, tokens, and request volume for the dashboard Usage page.\n\nRange-bounded (default last 30 days, hard-capped): unlike the raw ``/v1/usage``\nlist, every aggregate is scoped to a bounded window so it stays served by the\ntimestamp index. Returns grand totals, breakdowns by model / user / API key\n(top rows plus a reconciling ``other`` fold), and a UTC-bucketed time series.", + "description": "Aggregate spend, tokens, and request volume for the dashboard Usage page.\n\nRange-bounded (default last 30 days, hard-capped): unlike the raw ``/v1/usage``\nlist, every aggregate is scoped to a bounded window so it stays served by the\ntimestamp index. Returns grand totals, breakdowns by model / user / API key /\nsource (top rows plus a reconciling ``other`` fold, billed token counts), and\na UTC-bucketed time series carrying each bucket's error count and billed\ntoken composition (input incl. cache, cache read/write, output).", "header": [], "method": "GET", "url": { @@ -2475,7 +2568,7 @@ { "name": "Usage Summary Csv", "request": { - "description": "Download the per-model / per-user / per-key / per-source breakdown as CSV.\n\nA dedicated route rather than a ``format=csv`` flag on ``/summary`` so that\nendpoint keeps a single JSON response model and a clean OpenAPI schema. The\nexport is **uncapped** (no top-N fold): finance wants every row. Kept separate\nfrom the bare-array ``/v1/usage`` contract, which is untouched.", + "description": "Download the per-model / per-user / per-key / per-source breakdown as CSV.\n\nA dedicated route rather than a ``format=csv`` flag on ``/summary`` so that\nendpoint keeps a single JSON response model and a clean OpenAPI schema. The\nexport is **uncapped** (no top-N fold): finance wants every row. ``tokens``\nis the billed total (fresh input, both cache buckets, and output), matching\nthe dashboard's analytics. Kept separate from the bare-array ``/v1/usage``\ncontract, which is untouched.", "header": [], "method": "GET", "url": { diff --git a/src/gateway/api/routes/usage.py b/src/gateway/api/routes/usage.py index 558f51bf8..8589e33ce 100644 --- a/src/gateway/api/routes/usage.py +++ b/src/gateway/api/routes/usage.py @@ -12,7 +12,7 @@ from fastapi import APIRouter, Depends, Query, Response from pydantic import BaseModel -from sqlalchemy import ColumnElement, case, func, select +from sqlalchemy import ColumnElement, case, func, null, select from sqlalchemy.ext.asyncio import AsyncSession from gateway.api.deps import get_config, get_db, verify_api_key_or_master_key, verify_master_key @@ -44,7 +44,14 @@ # single synthesized "other" row (so the tables still reconcile with the totals). _BREAKDOWN_TOP_N = 100 +# How many groups a grouped time series carries before the remainder folds into +# "other". Eight is the ceiling a stacked chart can keep legible (and the size of +# the dashboard's fixed categorical palette); the breakdown tables, not the chart, +# are the place to read a longer tail. +_SERIES_TOP_N = 8 + Bucket = Literal["hour", "day"] +SeriesGroupBy = Literal["model", "user_id", "api_key_id", "source"] def _utc_iso(value: datetime) -> str: @@ -353,6 +360,11 @@ class UsageTotals(BaseModel): # Rows with no configured price (cost is NULL), e.g. imported usage for an # unpriced model. Surfaced so a $0 cost is not mistaken for free usage. unpriced_requests: int = 0 + # Billed input tokens (fresh input plus both cache buckets), normalized via + # each row's billing meters where present (see ``_billed_expr``). Unlike + # ``prompt_tokens`` this is convention-independent, so cache hit rate + # (cache_read_tokens / billed_input_tokens) is meaningful across providers. + billed_input_tokens: int = 0 class UsageGroupRow(BaseModel): @@ -373,12 +385,25 @@ class UsageGroupRow(BaseModel): class UsageSeriesPoint(BaseModel): """One time bucket. ``bucket_start`` is canonical ISO-8601 UTC (``...Z``), - identical across SQLite and PostgreSQL for the same underlying instant.""" + identical across SQLite and PostgreSQL for the same underlying instant. + + ``tokens`` stays the raw provider-reported total (the field predates the + composition split and external consumers may read it). The billed + composition fields are normalized via billing meters (see ``_billed_expr``): + ``input_tokens`` includes both cache buckets, so a chart derives fresh input + as ``max(0, input_tokens - cache_read_tokens - cache_write_tokens)`` and the + billed total as ``fresh + cache_read + cache_write + output``. + """ bucket_start: str cost: float tokens: int requests: int + errors: int = 0 + input_tokens: int = 0 + cache_read_tokens: int = 0 + cache_write_tokens: int = 0 + output_tokens: int = 0 class UsageSummary(BaseModel): @@ -395,6 +420,40 @@ class UsageSummary(BaseModel): series: list[UsageSeriesPoint] +class UsageGroupedSeriesPoint(BaseModel): + """One (time bucket, group) cell of a grouped series. + + ``key``/``is_other`` follow the ``UsageGroupRow`` convention: ``key=None`` + with ``is_other=True`` is the fold of groups outside the top N, ``key=None`` + with ``is_other=False`` is a real NULL group (e.g. a deleted user). + ``tokens`` is the *billed* total (input including cache, plus output), the + same quantity the ungrouped series' composition fields sum to. + """ + + bucket_start: str + key: str | None + is_other: bool = False + cost: float + tokens: int + requests: int + + +class UsageGroupedSeries(BaseModel): + """A per-group time series for the dashboard's stacked charts. + + ``groups`` ranks the window's top groups by spend (plus the reconciling + ``other`` fold), in the order a chart should stack and color them; ``points`` + is sparse (only populated cells), keyed by canonical UTC ``bucket_start``. + """ + + start_date: str + end_date: str + bucket: Bucket + group_by: SeriesGroupBy + groups: list[UsageGroupRow] + points: list[UsageGroupedSeriesPoint] + + def _resolve_window(start_date: datetime | None, end_date: datetime | None) -> tuple[datetime, datetime]: """Clamp the requested window to a bounded, forward-ordered range. @@ -452,6 +511,32 @@ def _dialect_name(db: AsyncSession) -> str: return bind.dialect.name +def _billed_expr(meter: str, fallback: Any) -> Any: + """A per-row billed token meter, as a summable SQL expression. + + Providers disagree on whether cache tokens are counted inside + ``prompt_tokens`` (see ``services/metered_pricing.billable_usage``), so raw + column sums cannot be split into a billed composition. The pricing writers + resolve that into ``billing_meters`` when a row is priced; prefer that, and + fall back to the raw column under the subset convention for meterless rows, + the same fallback the dashboard's per-row token bar applies. JSON extraction + of a missing key and a NULL column both yield NULL, so the fallback chain + covers both, ending at 0. ``as_integer`` compiles to the dialect's JSON + number cast on SQLite and PostgreSQL alike. + """ + return func.coalesce(UsageLog.billing_meters[meter].as_integer(), fallback, 0) + + +# The billed composition aggregates shared by the summary series, the grand +# totals, and the grouped series, so all three reconcile by construction. +def _billed_input_sum() -> Any: + return func.coalesce(func.sum(_billed_expr("total_input_tokens", UsageLog.prompt_tokens)), 0) + + +def _billed_output_sum() -> Any: + return func.coalesce(func.sum(_billed_expr("completion_tokens", UsageLog.completion_tokens)), 0) + + async def _totals(db: AsyncSession, conditions: list[ColumnElement[bool]]) -> UsageTotals: row = ( await db.execute( @@ -467,6 +552,7 @@ async def _totals(db: AsyncSession, conditions: list[ColumnElement[bool]]) -> Us func.coalesce(func.sum(case((UsageLog.status == "error", 1), else_=0)), 0), func.avg(UsageLog.latency_ms), func.coalesce(func.sum(case((UsageLog.cost.is_(None), 1), else_=0)), 0), + _billed_input_sum(), ).where(*conditions) ) ).one() @@ -482,6 +568,7 @@ async def _totals(db: AsyncSession, conditions: list[ColumnElement[bool]]) -> Us error_count=int(row[8]), avg_latency_ms=float(row[9]) if row[9] is not None else None, unpriced_requests=int(row[10]), + billed_input_tokens=int(row[11]), ) @@ -495,17 +582,21 @@ async def _breakdown( ) -> list[UsageGroupRow]: """Spend/tokens/requests grouped by ``column``, biggest spend first. - When ``limit`` is set, only the top rows are returned and the remainder is - folded into a synthesized ``other`` row derived from the grand totals, so the - breakdown always reconciles with the tiles. ``limit=None`` returns every group - (used by the CSV export, which must not truncate). + ``tokens`` is the *billed* total (input including both cache buckets, plus + output, via ``_billed_expr``), the same quantity the series composition and + the grouped series report, so every analytics surface agrees on what a + token count means. When ``limit`` is set, only the top rows are returned and + the remainder is folded into a synthesized ``other`` row derived from the + grand totals, so the breakdown always reconciles with the tiles. + ``limit=None`` returns every group (used by the CSV export, which must not + truncate). """ cost_sum = func.coalesce(func.sum(UsageLog.cost), 0.0) stmt = ( select( column, cost_sum, - func.coalesce(func.sum(UsageLog.total_tokens), 0), + _billed_input_sum() + _billed_output_sum(), func.count(), ) .where(*conditions) @@ -524,11 +615,12 @@ async def _breakdown( # signal that groups were folded; cost/tokens residuals follow from totals. residual_requests = totals.request_count - seen_requests if residual_requests > 0: + billed_total = totals.billed_input_tokens + totals.completion_tokens result.append( UsageGroupRow( key=None, cost=totals.cost - sum(r.cost for r in result), - tokens=totals.total_tokens - sum(r.tokens for r in result), + tokens=billed_total - sum(r.tokens for r in result), requests=residual_requests, is_other=True, ) @@ -581,7 +673,7 @@ def _dense_series( start: datetime, end: datetime, bucket: Bucket, - rows: list[tuple[str, float, int, int]], + populated: dict[str, UsageSeriesPoint], ) -> list[UsageSeriesPoint]: """Fill every bucket in ``[floor(start), end)`` so the chart's x-axis is linear in time. ``GROUP BY`` omits empty buckets, so without this a sparse range (say @@ -589,9 +681,8 @@ def _dense_series( misread the trend. Falls back to the sparse buckets past ``_MAX_SERIES_POINTS``. An empty window (no rows at all) returns an empty series, not a wall of zeros. """ - if not rows: + if not populated: return [] - populated = {key: (cost, tokens, requests) for key, cost, tokens, requests in rows} step = timedelta(hours=1) if bucket == "hour" else timedelta(days=1) if bucket == "hour": cursor = start.replace(minute=0, second=0, microsecond=0) @@ -602,13 +693,9 @@ def _dense_series( points: list[UsageSeriesPoint] = [] while cursor < end: if len(points) >= _MAX_SERIES_POINTS: - return [ - UsageSeriesPoint(bucket_start=key, cost=cost, tokens=tokens, requests=requests) - for key, (cost, tokens, requests) in sorted(populated.items()) - ] + return [populated[key] for key in sorted(populated)] key = cursor.strftime(fmt) - cost, tokens, requests = populated.get(key, (0.0, 0, 0)) - points.append(UsageSeriesPoint(bucket_start=key, cost=cost, tokens=tokens, requests=requests)) + points.append(populated.get(key) or UsageSeriesPoint(bucket_start=key, cost=0.0, tokens=0, requests=0)) cursor += step return points @@ -632,8 +719,10 @@ async def usage_summary( Range-bounded (default last 30 days, hard-capped): unlike the raw ``/v1/usage`` list, every aggregate is scoped to a bounded window so it stays served by the - timestamp index. Returns grand totals, breakdowns by model / user / API key - (top rows plus a reconciling ``other`` fold), and a UTC-bucketed time series. + timestamp index. Returns grand totals, breakdowns by model / user / API key / + source (top rows plus a reconciling ``other`` fold, billed token counts), and + a UTC-bucketed time series carrying each bucket's error count and billed + token composition (input incl. cache, cache read/write, output). """ start, end, conditions, totals = await _summary_context( db, @@ -661,13 +750,31 @@ async def usage_summary( func.coalesce(func.sum(UsageLog.cost), 0.0), func.coalesce(func.sum(UsageLog.total_tokens), 0), func.count(), + func.coalesce(func.sum(case((UsageLog.status == "error", 1), else_=0)), 0), + _billed_input_sum(), + func.coalesce(func.sum(_billed_expr("cache_read_tokens", UsageLog.cache_read_tokens)), 0), + func.coalesce(func.sum(_billed_expr("cache_write_tokens", UsageLog.cache_write_tokens)), 0), + _billed_output_sum(), ) .where(*conditions) .group_by(expr) ) ).all() # Zero-fill empty buckets so the chart is time-linear (GROUP BY drops gaps). - populated = [(_canonical_bucket(row[0], bucket), float(row[1]), int(row[2]), int(row[3])) for row in series_rows] + populated = { + _canonical_bucket(row[0], bucket): UsageSeriesPoint( + bucket_start=_canonical_bucket(row[0], bucket), + cost=float(row[1]), + tokens=int(row[2]), + requests=int(row[3]), + errors=int(row[4]), + input_tokens=int(row[5]), + cache_read_tokens=int(row[6]), + cache_write_tokens=int(row[7]), + output_tokens=int(row[8]), + ) + for row in series_rows + } series = _dense_series(start, end, bucket, populated) return UsageSummary( @@ -683,6 +790,108 @@ async def usage_summary( ) +_GROUP_COLUMNS: dict[str, Any] = { + "model": UsageLog.model, + "user_id": UsageLog.user_id, + "api_key_id": UsageLog.api_key_id, + "source": UsageLog.source, +} + + +@router.get("/series", dependencies=[Depends(verify_master_key)]) +async def usage_series( + db: Annotated[AsyncSession, Depends(get_db)], + group_by: SeriesGroupBy = Query(description="Dimension to split the series by"), + start_date: datetime | None = Query(default=None, description=_START_DESC), + end_date: datetime | None = Query(default=None, description=_END_DESC), + user_id: str | None = Query(default=None, description=_USER_DESC), + status: str | None = Query(default=None, description=_STATUS_DESC), + model: str | None = Query(default=None, description=_MODEL_DESC), + endpoint: str | None = Query(default=None, description=_ENDPOINT_DESC), + source: str | None = Query(default=None, description=_SOURCE_DESC), + api_key_id: str | None = Query(default=None, description=_API_KEY_DESC), + priced: bool | None = Query(default=None, description=_PRICED_DESC), + counts_toward_budget: bool | None = Query(default=None, description=_COUNTS_DESC), + bucket: Bucket = Query(default="day", description="Time-series granularity: 'hour' or 'day'"), +) -> UsageGroupedSeries: + """Time series split by one dimension, for the dashboard's stacked charts. + + Same filters and window bounds as ``/summary``. The window's top groups by + spend are returned as their own series; everything past the top eight folds + into a single ``other`` series per bucket, so the stack always reconciles + with the summary totals. Points are sparse (populated cells only). + """ + start, end, conditions, totals = await _summary_context( + db, + start_date=start_date, + end_date=end_date, + user_id=user_id, + status=status, + model=model, + endpoint=endpoint, + source=source, + api_key_id=api_key_id, + priced=priced, + counts_toward_budget=counts_toward_budget, + ) + column = _GROUP_COLUMNS[group_by] + groups = await _breakdown(db, column, conditions, totals, limit=_SERIES_TOP_N) + + # One grouped query for the whole grid: groups outside the top N collapse + # into the fold in SQL rather than being fetched and folded here, so the row + # count stays bounded by buckets × (top N + 2) regardless of cardinality. + # The synthesized groups are encoded as (key NULL, fold flag) rather than a + # sentinel key string: GROUP BY treats NULLs as equal on both dialects, and + # no sentinel can be trusted never to collide with a real key. A NULL column + # value never matches ``IN``, so it lands in the CASE's ``else`` arm; the + # fold flag then separates a NULL group that ranked in the top N (a real + # ``key=None`` series, e.g. a deleted user) from the past-top-N remainder. + named = {g.key for g in groups if g.key is not None} + keeps_null = any(g.key is None and not g.is_other for g in groups) + key_expr = case((column.in_(named), column), else_=null()) + if keeps_null: + fold_expr = case((column.is_(None), 0), (column.in_(named), 0), else_=1) + else: + fold_expr = case((column.in_(named), 0), else_=1) + bucket_expr = _bucket_expr(_dialect_name(db), bucket) + rows = ( + await db.execute( + select( + bucket_expr, + key_expr, + fold_expr, + func.coalesce(func.sum(UsageLog.cost), 0.0), + _billed_input_sum() + _billed_output_sum(), + func.count(), + ) + .where(*conditions) + .group_by(bucket_expr, key_expr, fold_expr) + ) + ).all() + + points = [ + UsageGroupedSeriesPoint( + bucket_start=_canonical_bucket(row[0], bucket), + key=row[1], + is_other=bool(row[2]), + cost=float(row[3]), + tokens=int(row[4]), + requests=int(row[5]), + ) + for row in rows + ] + points.sort(key=lambda p: p.bucket_start) + + return UsageGroupedSeries( + start_date=start.isoformat(), + end_date=end.isoformat(), + bucket=bucket, + group_by=group_by, + groups=groups, + points=points, + ) + + # Leading characters a spreadsheet may interpret as a formula. Any cell starting # with one is prefixed with a single quote so opening the CSV in Excel/Sheets can # never execute attacker-influenced text (model / user ids are caller-supplied). @@ -713,8 +922,10 @@ async def usage_summary_csv( A dedicated route rather than a ``format=csv`` flag on ``/summary`` so that endpoint keeps a single JSON response model and a clean OpenAPI schema. The - export is **uncapped** (no top-N fold): finance wants every row. Kept separate - from the bare-array ``/v1/usage`` contract, which is untouched. + export is **uncapped** (no top-N fold): finance wants every row. ``tokens`` + is the billed total (fresh input, both cache buckets, and output), matching + the dashboard's analytics. Kept separate from the bare-array ``/v1/usage`` + contract, which is untouched. """ _start, _end, conditions, totals = await _summary_context( db, diff --git a/src/gateway/static/dashboard/assets/ActivityPage-BSXD7oi2.js b/src/gateway/static/dashboard/assets/ActivityPage-BSXD7oi2.js new file mode 100644 index 000000000..428f7e0a1 --- /dev/null +++ b/src/gateway/static/dashboard/assets/ActivityPage-BSXD7oi2.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as d,u as lt}from"./react-dgEcD0HR.js";import{f as it,b as ct,a as dt,r as ut,u as mt,c as ht,d as xt,e as Fe,g as fe,h as z,i as pt,A as ce,j as gt,k as ft,P as bt,E as vt,C as Be,l as O,R as _t,F as be,m as ve,n as $e,Y as kt}from"./index-Dhxz7Eyv.js";import{C as yt,T as St}from"./charts-BI8Uczg4.js";import{B as U,S as jt}from"./heroui-DZj66Arc.js";import{u as wt,r as Nt,B as Ct}from"./tableSelection-CojkFPwd.js";import{C as Pt}from"./ConfirmDialog-DawcDVEg.js";import{D as It}from"./DataTable-CrQq0sYf.js";import{F as Mt}from"./FilterChips-BlzD0qFP.js";import{T as Tt,S as At,P as Et}from"./TablePagination-BYC0DnfO.js";import"./recharts-BwTTRGtj.js";function Le(t,n){const c=new Date(t);return Number.isNaN(c.getTime())?t:n==="hour"?c.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):c.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const Rt={key:"success",label:"Succeeded",color:"var(--otari-brand)"},Dt={key:"errors",label:"Failed",color:"var(--otari-danger)"},Ft={key:"requests",label:"Requests",color:"var(--otari-brand)"};function Lt({presets:t,extentKey:n,onPreset:c,onSelectRange:r,onSelectFull:i,series:v,bucket:o,windowStart:u,windowEnd:h,loading:_=!1,ariaLabel:j="Request volume over the selected window",action:w}){const p=v.map(a=>a.bucketStart),m=v.length,Q=it(u,h),B=v.some(a=>(a.errors??0)>0),D=B?[Rt,Dt]:[Ft],g=v.map(a=>{const x=Math.min(a.errors??0,a.requests);return B?{x:a.bucketStart,success:a.requests-x,errors:x}:{x:a.bucketStart,requests:a.requests}}),W=m>0?ct(p,u,h):{startIndex:0,endIndex:0},[F,$]=d.useState(null),Y=d.useRef(F),q=a=>{Y.current=a,$(a)},f=F??W,b=f.endIndex-f.startIndex+1,y=f.startIndex===0&&f.endIndex>=m-1,P=m>0&&!y,I=(a,x)=>{if(m===0)return;const k=Math.max(0,Math.min(a,x)),E=Math.min(m-1,Math.max(a,x));if(k===0&&E===m-1){i();return}const X=ut(p,k,E,o);X&&r(X.startIso,X.endIso)},N=t.findIndex(a=>a.key===n),M=N>=0?t[N].seconds:m*dt(o)/1e3,Z=N>=0?t[N+1]:t.find(a=>a.seconds===null||M!==null&&a.seconds>M),K=a=>{const x=Math.max(1,Math.min(m,Math.round(a))),k=(f.startIndex+f.endIndex+1)/2;let E=Math.round(k-x/2);E=Math.max(0,Math.min(m-x,E)),I(E,E+x-1)},G=()=>{if(y){Z&&c(Z);return}K(b*2)},ee=()=>K(b/2),H=d.useRef(null),T=d.useRef(null),V=a=>{const x=Math.max(0,Math.min(m-b,a));return{startIndex:x,endIndex:x+b-1}},de=a=>{const x=a.key==="ArrowRight"||a.key==="ArrowUp"?1:a.key==="ArrowLeft"||a.key==="ArrowDown"?-1:a.key==="PageUp"?b:a.key==="PageDown"?-b:a.key==="Home"?-m:a.key==="End"?m:0;if(x===0)return;a.preventDefault();const k=V(f.startIndex+x);k.startIndex!==f.startIndex&&I(k.startIndex,k.endIndex)},L=a=>{if(!T.current||!H.current)return;const x=H.current.getBoundingClientRect().width;if(x<=0)return;const k=Math.round((a.clientX-T.current.x)/x*m);q(V(T.current.startIndex+k))},A=a=>{a.currentTarget.hasPointerCapture(a.pointerId)&&a.currentTarget.releasePointerCapture(a.pointerId),T.current=null;const x=Y.current;q(null),x&&x.startIndex!==W.startIndex&&I(x.startIndex,x.endIndex)},te=m?f.startIndex/m*100:0,se=m?(f.endIndex+1)/m*100:100,ae=Math.max(0,m-b);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.map(a=>e.jsx(U,{size:"sm",variant:n===a.key?"primary":"outline",onPress:()=>c(a),children:a.label},a.key)),e.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",Q," · UTC"]}),w]})]}),e.jsxs("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[e.jsxs("span",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:["Requests / ",o==="hour"?"hour":"day"]}),e.jsx(yt,{series:D})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"hidden text-[11px] text-[var(--otari-muted)] sm:inline",children:"drag across the chart to zoom"}),e.jsx(U,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom in",isDisabled:m===0,onPress:ee,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M12 5v14M5 12h14",strokeLinecap:"round"})})}),e.jsx(U,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom out",isDisabled:m===0||y&&!Z,onPress:G,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})})}),P?e.jsx(U,{size:"sm",variant:"ghost",onPress:()=>I(0,m-1),children:"Reset"}):null]})]}),_&&m===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center",children:e.jsx(jt,{size:"sm"})}):m===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center text-xs text-[var(--otari-muted)]",children:"No activity in this range."}):e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(St,{data:g,series:D,formatValue:a=>a.toLocaleString(),formatXTick:a=>Le(a,o),ariaLabel:j,height:90,onSelectRange:I,window:P||F?f:null}),P||F?e.jsx("div",{ref:H,className:"relative h-2.5 w-full rounded-full bg-[var(--otari-bg)]",children:e.jsx("div",{role:"slider","aria-label":"Pan the selected window","aria-valuemin":0,"aria-valuemax":ae,"aria-valuenow":Math.min(f.startIndex,ae),"aria-valuetext":`Window starting at ${Le(p[f.startIndex]??p[0],o)}`,tabIndex:0,className:"absolute inset-y-0 cursor-grab touch-none rounded-full bg-[var(--otari-brand)]/40 outline-none hover:bg-[var(--otari-brand)]/60 focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)] active:cursor-grabbing",style:{left:`${te}%`,width:`${Math.max(2,se-te)}%`},onKeyDown:de,onPointerDown:a=>{a.preventDefault(),T.current={x:a.clientX,startIndex:f.startIndex},q({...f}),a.currentTarget.setPointerCapture(a.pointerId)},onPointerMove:L,onPointerUp:A,onPointerCancel:A})}):null]})]})]})}function Ot(t){const[n,c]=lt(),r=d.useCallback(o=>n.get(o)??t[o],[n,t]),i=d.useCallback(o=>{const u=Number.parseInt(n.get(o)??"",10);if(!Number.isNaN(u))return u;const h=Number.parseInt(t[o],10);return Number.isNaN(h)?0:h},[n,t]),v=d.useCallback(o=>{c(u=>{const h=new URLSearchParams(u);for(const[_,j]of Object.entries(o)){const w=String(j);w===""||w===t[_]?h.delete(_):h.set(_,w)}return h},{replace:!0})},[c,t]);return{get:r,getNumber:i,patch:v}}const Ut=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function le(t){return t===null?"—":Ut.format(t)}function C(t){return t===null?"—":t.toLocaleString()}function qe(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function Bt(t){const n=new Date(t);return Number.isNaN(n.getTime())?t:n.toLocaleString()}function $t(t){const n=new Date(t).getTime();if(Number.isNaN(n))return t;const c=Math.max(0,Math.round((Date.now()-n)/1e3));if(c<60)return`${c}s ago`;const r=Math.round(c/60);if(r<60)return`${r}m ago`;const i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}const qt=t=>t.id,Kt=t=>t.status==="error"?"bg-red-50":void 0,Oe=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],Ue=[{label:"All",value:""},{label:"Priced",value:"true"},{label:"Unpriced",value:"false"}],zt=50,Wt={range:ce,start_date:"",end_date:"",status:"",model:"",user_id:"",api_key_id:"",priced:"",source:"",page:"0",size:String(zt)};function ie(t,n,c){if(n||c)return{start:n||void 0,end:c||void 0};if(t===Be)return{};const r=z(O,t)??z(O,ce),i=(r==null?void 0:r.seconds)??null;return{start:i==null?void 0:$e(i),end:void 0}}function _e(t){const n=ie(t,"","");if(n.start)return n;const c=z(O,t);return(c==null?void 0:c.seconds)==null?{start:$e(kt)}:n}function Yt({status:t}){const n=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${n}`,children:t})}const Zt={gateway:"Gateway",claude_code:"Claude Code",codex:"Codex"};function ke(t){return Zt[t]??t}function R(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function Ke(t){const n=t.billing_meters??null,c=R(n?n.total_input_tokens:t.prompt_tokens),r=R(n?n.cache_read_tokens:t.cache_read_tokens),i=R(n?n.cache_write_tokens:t.cache_write_tokens),v=R(n?n.completion_tokens:t.completion_tokens),o=Math.max(0,c-r-i),u=o+r+i+v;return u>0?{fresh:o,cacheRead:r,cacheWrite:i,output:v,total:u}:null}const Gt=[{key:"fresh",label:"Fresh input",fill:"var(--otari-ink)"},{key:"cacheRead",label:"Cache read",fill:"var(--otari-brand)"},{key:"cacheWrite",label:"Cache write",fill:"var(--otari-brand-soft)"},{key:"output",label:"Output",fill:"var(--otari-brand-dark)"}];function Ht({entry:t}){const n=Ke(t);if(n===null)return e.jsx("span",{className:"tabular-nums",children:C(t.total_tokens)});const c=Gt.map(o=>({...o,value:n[o.key]})),r=c.filter(o=>o.value>0).map(o=>`${o.label} ${o.value.toLocaleString()}`).join(", ");let i=0;const v=c.map(o=>{const u=o.value/n.total*100,h={...o,x:i,width:u};return i+=u,h});return e.jsxs("span",{className:"inline-flex flex-col items-end gap-1",title:r,children:[e.jsx("span",{className:"tabular-nums",children:n.total.toLocaleString()}),e.jsx("svg",{viewBox:"0 0 100 4",preserveAspectRatio:"none",role:"img","aria-label":`Token composition: ${r}`,className:"h-1.5 w-20 overflow-hidden rounded-full bg-[var(--otari-brand-tint)]",children:v.filter(o=>o.width>0).map(o=>e.jsx("rect",{x:o.x,y:0,width:o.width,height:4,fill:o.fill},o.key))})]})}function S({label:t,children:n}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:n})]})}function Vt({entry:t}){var n,c;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"This request failed. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(S,{label:"Provider",children:t.provider??"—"}),e.jsx(S,{label:"Endpoint",children:t.endpoint}),e.jsx(S,{label:"Source",children:ke(t.source)}),t.source_label?e.jsx(S,{label:"Session",children:t.source_label}):null,e.jsx(S,{label:"User",children:t.user_id??"—"}),e.jsx(S,{label:"API key",children:t.api_key_id??"—"}),e.jsx(S,{label:"Prompt tokens",children:C(t.prompt_tokens)}),e.jsx(S,{label:"Completion tokens",children:C(t.completion_tokens)}),e.jsx(S,{label:"Total tokens",children:C(t.total_tokens)}),e.jsx(S,{label:"Billed tokens",children:e.jsx("span",{title:"Fresh input, cache reads and writes, and output: the tokens this request was priced on, and the total the activity row's bar splits.",children:C(((n=Ke(t))==null?void 0:n.total)??null)})}),e.jsx(S,{label:"Cost",children:le(t.cost)}),e.jsx(S,{label:"Cache read tokens",children:C(t.cache_read_tokens)}),e.jsx(S,{label:"Cache write tokens",children:C(t.cache_write_tokens)}),e.jsx(S,{label:"1h cache writes",children:C(t.cache_write_1h_tokens??null)}),e.jsx(S,{label:"Total time",children:qe(t.latency_ms)}),e.jsx(S,{label:"Request ID",children:t.id})]}),(c=t.pricing_breakdown)!=null&&c.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(S,{label:r.meter.replaceAll("_"," "),children:[C(r.units)," at ",le(r.rate_per_million)," / 1M, ",le(r.cost)]},r.meter))})]}):null]})}function cs(){var Ie,Me,Te,Ae,Ee,Re;const t=mt(),n=ht(),c=d.useMemo(()=>{const s=new Map;for(const l of n.data??[])s.set(l.id,l.key_name??`${l.id.slice(0,8)}…`);return s},[n.data]),r=Ot(Wt),i=r.get("range"),v=r.get("start_date"),o=r.get("end_date"),u=r.get("status"),h=r.get("model"),_=r.get("user_id"),j=r.get("api_key_id"),w=r.get("priced"),p=r.get("source"),m=Math.max(0,r.getNumber("page")),Q=r.getNumber("size"),B=Et.reduce((s,l)=>Math.abs(l-Q)ie(i,v,o)),F=d.useRef(D);d.useEffect(()=>{F.current!==D&&(F.current=D,W(ie(i,v,o)))},[D,i,v,o]);const[$,Y]=d.useState(()=>_e(i)),q=d.useRef(i);d.useEffect(()=>{q.current!==i&&(q.current=i,Y(_e(i)))},[i]);const f=w==="true"?!0:w==="false"?!1:void 0,b=d.useMemo(()=>({start_date:g.start,end_date:g.end,status:u||void 0,model:h.trim()||void 0,user_id:_||void 0,api_key_id:j||void 0,source:p||void 0,priced:f}),[g,u,h,_,j,p,f]),y=wt(),P=JSON.stringify(b),I=d.useRef(P);d.useEffect(()=>{I.current!==P&&(I.current=P,r.patch({page:0}),y.clear())},[P,r,y]);const N=xt(b,m,B),M=Fe(b),Z=d.useMemo(()=>({start_date:g.start,end_date:g.end,status:u||void 0,user_id:_||void 0,api_key_id:j||void 0,source:p||void 0}),[g,u,_,j,p]),K=fe(Z,"day"),G=((Me=(Ie=K.data)==null?void 0:Ie.by_model)==null?void 0:Me.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],ee=(n.data??[]).map(s=>({value:s.id,label:s.key_name??`${s.id.slice(0,8)}…`})),H=d.useMemo(()=>({start_date:g.start,end_date:g.end,status:u||void 0,model:h.trim()||void 0,user_id:_||void 0,api_key_id:j||void 0}),[g,u,h,_,j]),T=fe(H,"day",!!p),V=(Te=p?T.data:K.data)==null?void 0:Te.by_source,de=d.useMemo(()=>{const s=(V??[]).filter(l=>!l.is_other&&l.key!==null).map(l=>l.key);return p&&!s.includes(p)?[p,...s]:s},[V,p]),L=z(O,i)??z(O,ce),A=!!(g.start&&$.start&&new Date(g.start).getTime()({start_date:A?g.start:$.start,end_date:A?g.end:void 0,status:u||void 0,model:h.trim()||void 0,user_id:_||void 0,api_key_id:j||void 0,source:p||void 0,priced:f}),[A,g,$,u,h,_,j,p,f]),a=fe(ae,se),x=(((Ae=a.data)==null?void 0:Ae.series)??[]).map(s=>({bucketStart:s.bucket_start,requests:s.requests,errors:s.errors??0})),k=N.data??[],X=M.isSuccess&&!M.isPlaceholderData?((Ee=M.data)==null?void 0:Ee.total)??0:null,ue=z(O,i),ze=!!(v||o)||i!==ce&&(ue==null?void 0:ue.seconds)!=null,We=!!(u||h.trim()||_||j||w||p||ze),re=(s,l)=>{var De;return((De=s.find(ot=>ot.value===l))==null?void 0:De.label)??l},ye=(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),Ye=()=>r.patch({status:"",priced:"",model:"",user_id:"",api_key_id:"",source:""}),Ze=[...u?[{key:"status",label:"Status",value:re(Oe,u),onClear:()=>r.patch({status:""})}]:[],...w?[{key:"priced",label:"Priced",value:re(Ue,w),onClear:()=>r.patch({priced:""})}]:[],..._?[{key:"user",label:"User",value:re(ye,_),onClear:()=>r.patch({user_id:""})}]:[],...h.trim()?[{key:"model",label:"Model",value:h.trim(),onClear:()=>r.patch({model:""})}]:[],...j?[{key:"key",label:"API key",value:re(ee,j),onClear:()=>r.patch({api_key_id:""})}]:[],...p?[{key:"source",label:"Source",value:ke(p),onClear:()=>r.patch({source:""})}]:[]],me=d.useMemo(()=>k.filter(s=>!s.counts_toward_budget).map(s=>s.id),[k]),Ge=d.useMemo(()=>k.filter(s=>s.counts_toward_budget).map(s=>s.id),[k]),Se=Nt(y.selectedKeys,me),J=Se.length,je=y.allMatching||J>0,He=d.useMemo(()=>({...b,counts_toward_budget:!1}),[b]),we=Fe(He,je),ne=we.isSuccess?((Re=we.data)==null?void 0:Re.total)??null:null,Ve=me.length>0&&J===me.length&&ne!=null&&ne>J,oe=y.allMatching?ne??J:J,he=gt(),xe=ft(),[Xe,pe]=d.useState(!1),[Je,ge]=d.useState(!1),[Qe,Ne]=d.useState(null),et=d.useCallback(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Request detail"}),e.jsx(U,{size:"sm",variant:"ghost",onPress:()=>Ne(null),children:"Close"})]}),e.jsx(Vt,{entry:s})]}),[]),Ce=()=>y.allMatching?{by_filter:!0,model:b.model,user_id:b.user_id,api_key_id:b.api_key_id,status:b.status,start_date:b.start_date,end_date:b.end_date,priced:b.priced}:{ids:Se},tt=()=>{he.mutate(Ce(),{onSuccess:()=>{pe(!1),y.clear()}})},st=s=>{xe.mutate({...Ce(),...s},{onSuccess:()=>{ge(!1),y.clear()}})},at=()=>{N.refetch(),M.refetch(),a.refetch(),K.refetch(),T.refetch()},Pe=s=>{if(s.key===i&&!v&&!o){W(ie(s.key,"","")),Y(_e(s.key));return}r.patch({range:s.key,start_date:"",end_date:""})},rt=(s,l)=>r.patch({start_date:s,end_date:l}),nt=d.useMemo(()=>{const s=l=>l===null?"—":c.get(l)??`${l.slice(0,8)}…`;return[{id:"time",header:"Time",cell:l=>e.jsx("span",{title:Bt(l.timestamp),className:"text-[var(--otari-muted)]",children:$t(l.timestamp)})},{id:"user",header:"User",cell:l=>l.user_id??"—"},{id:"model",header:"Model",isRowHeader:!0,cell:l=>l.model},{id:"api_key",header:"API key",cell:l=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:s(l.api_key_id)})},{id:"tokens",header:"Tokens",align:"end",cell:l=>e.jsx(Ht,{entry:l})},{id:"cost",header:"Cost",align:"end",cell:l=>le(l.cost)},{id:"latency",header:"Total time",align:"end",cell:l=>qe(l.latency_ms)},{id:"status",header:"Status",cell:l=>e.jsx(Yt,{status:l.status})}]},[c]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(bt,{title:"Activity",description:"A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored."}),e.jsx(vt,{error:N.error??M.error}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(Lt,{presets:O,extentKey:te,onPreset:Pe,onSelectRange:rt,onSelectFull:()=>L?Pe(L):void 0,series:x,bucket:se,windowStart:g.start,windowEnd:g.end,loading:a.isLoading,ariaLabel:"Activity request volume over the selected window",action:e.jsx(_t,{onRefresh:at,isFetching:N.isFetching,updatedAt:N.dataUpdatedAt})}),e.jsxs(Mt,{chips:Ze,onClearAll:Ye,children:[e.jsx(be,{id:"filter-status",label:"Status",value:u,onChange:s=>r.patch({status:s}),children:Oe.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsx(be,{id:"filter-priced",label:"Priced?",value:w,onChange:s=>r.patch({priced:s}),children:Ue.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(be,{id:"filter-source",label:"Source",value:p,onChange:s=>r.patch({source:s}),children:[e.jsx("option",{value:"",children:"All"}),de.map(s=>e.jsx("option",{value:s,children:ke(s)},s))]}),e.jsx(ve,{label:"API key",value:j,onChange:s=>r.patch({api_key_id:s}),placeholder:"All keys",options:ee}),e.jsx(ve,{label:"User",value:_,onChange:s=>r.patch({user_id:s}),placeholder:"All users",options:ye}),e.jsx(ve,{label:"Model",value:h,onChange:s=>r.patch({model:s}),allowsCustom:!0,placeholder:"Any model",options:(h&&!G.includes(h)?[h,...G]:G).map(s=>({value:s,label:s}))})]})]}),je?e.jsxs(Ct,{selectedCount:oe,allMatching:y.allMatching,matchingTotal:ne,canSelectAllMatching:Ve,onSelectAllMatching:y.enableAllMatching,onClear:y.clear,children:[e.jsx(U,{size:"sm",variant:"primary",onPress:()=>ge(!0),children:"Set price"}),e.jsx(U,{size:"sm",variant:"danger",onPress:()=>pe(!0),children:"Delete"})]}):null,e.jsx(It,{ariaLabel:"Activity log",columns:nt,rows:k,getRowKey:qt,isLoading:N.isLoading,emptyContent:We?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange,disabledKeys:Ge,onRowAction:s=>Ne(l=>l===s?null:s),rowClassName:Kt,detailKey:Qe,renderDetail:et}),e.jsx(Tt,{page:m,pageSize:B,total:X,rowsOnPage:k.length,onPageChange:s=>r.patch({page:s}),onPageSizeChange:s=>r.patch({size:s,page:0}),isFetching:N.isFetching,hasNextFallback:k.length===B}),e.jsx(Pt,{isOpen:Xe,onOpenChange:pe,heading:"Delete usage rows",body:`Delete ${oe.toLocaleString()} imported ${oe===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:he.isPending,error:he.error,onConfirm:tt}),e.jsx(At,{isOpen:Je,onOpenChange:ge,targetCount:oe,isPending:xe.isPending,error:xe.error,onSubmit:st})]})}export{cs as ActivityPage}; diff --git a/src/gateway/static/dashboard/assets/ActivityPage-VQgwkhn4.js b/src/gateway/static/dashboard/assets/ActivityPage-VQgwkhn4.js deleted file mode 100644 index 92467af0f..000000000 --- a/src/gateway/static/dashboard/assets/ActivityPage-VQgwkhn4.js +++ /dev/null @@ -1 +0,0 @@ -import{j as s}from"./tanstack-query-1t81HyiD.js";import{u as nt,r as i}from"./react-dgEcD0HR.js";import{u as lt,a as ot,b as it,c as Pe,d as J,f as C,e as ct,A as B,g as dt,h as ut,P as mt,E as pt,C as Ee,i as w,R as ht,F as Q,j as X,k as Me,Y as gt}from"./index-DsUY4UvK.js";import{A as xt,F as ft}from"./FilterChips-Dah6AI5Z.js";import{u as _t,r as bt,B as vt}from"./tableSelection-9hV37uhu.js";import{C as kt}from"./ConfirmDialog-NCJIhH2z.js";import{D as yt}from"./DataTable-Bmn_eYSV.js";import{T as St,S as jt,P as wt}from"./TablePagination-DgA36VXY.js";import{B as ee}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function Ct(t){const[r,c]=nt(),a=i.useCallback(l=>r.get(l)??t[l],[r,t]),o=i.useCallback(l=>{const d=Number.parseInt(r.get(l)??"",10);if(!Number.isNaN(d))return d;const u=Number.parseInt(t[l],10);return Number.isNaN(u)?0:u},[r,t]),f=i.useCallback(l=>{c(d=>{const u=new URLSearchParams(d);for(const[h,x]of Object.entries(l)){const v=String(x);v===""||v===t[h]?u.delete(h):u.set(h,v)}return u},{replace:!0})},[c,t]);return{get:a,getNumber:o,patch:f}}const Nt=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function L(t){return t===null?"—":Nt.format(t)}function k(t){return t===null?"—":t.toLocaleString()}function Te(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function Pt(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleString()}function At(t){const r=new Date(t).getTime();if(Number.isNaN(r))return t;const c=Math.max(0,Math.round((Date.now()-r)/1e3));if(c<60)return`${c}s ago`;const a=Math.round(c/60);if(a<60)return`${a}m ago`;const o=Math.round(a/60);return o<24?`${o}h ago`:`${Math.round(o/24)}d ago`}const Ft=t=>t.id,Et=t=>t.status==="error"?"bg-red-50":void 0,Ae=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],Fe=[{label:"All",value:""},{label:"Priced",value:"true"},{label:"Unpriced",value:"false"}],Mt=50,Tt={range:B,start_date:"",end_date:"",status:"",model:"",user_id:"",api_key_id:"",priced:"",source:"",page:"0",size:String(Mt)};function U(t,r,c){if(r||c)return{start:r||void 0,end:c||void 0};if(t===Ee)return{};const a=C(w,t)??C(w,B),o=(a==null?void 0:a.seconds)??null;return{start:o==null?void 0:Me(o),end:void 0}}function te(t){const r=U(t,"","");if(r.start)return r;const c=C(w,t);return(c==null?void 0:c.seconds)==null?{start:Me(gt)}:r}function Dt({status:t}){const r=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return s.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r}`,children:t})}const Ot={gateway:"Gateway",claude_code:"Claude Code",codex:"Codex"};function se(t){return Ot[t]??t}function y(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function De(t){const r=t.billing_meters??null,c=y(r?r.total_input_tokens:t.prompt_tokens),a=y(r?r.cache_read_tokens:t.cache_read_tokens),o=y(r?r.cache_write_tokens:t.cache_write_tokens),f=y(r?r.completion_tokens:t.completion_tokens),l=Math.max(0,c-a-o),d=l+a+o+f;return d>0?{fresh:l,cacheRead:a,cacheWrite:o,output:f,total:d}:null}const It=[{key:"fresh",label:"Fresh input",fill:"var(--otari-ink)"},{key:"cacheRead",label:"Cache read",fill:"var(--otari-brand)"},{key:"cacheWrite",label:"Cache write",fill:"var(--otari-brand-soft)"},{key:"output",label:"Output",fill:"var(--otari-brand-dark)"}];function Rt({entry:t}){const r=De(t);if(r===null)return s.jsx("span",{className:"tabular-nums",children:k(t.total_tokens)});const c=It.map(l=>({...l,value:r[l.key]})),a=c.filter(l=>l.value>0).map(l=>`${l.label} ${l.value.toLocaleString()}`).join(", ");let o=0;const f=c.map(l=>{const d=l.value/r.total*100,u={...l,x:o,width:d};return o+=d,u});return s.jsxs("span",{className:"inline-flex flex-col items-end gap-1",title:a,children:[s.jsx("span",{className:"tabular-nums",children:r.total.toLocaleString()}),s.jsx("svg",{viewBox:"0 0 100 4",preserveAspectRatio:"none",role:"img","aria-label":`Token composition: ${a}`,className:"h-1.5 w-20 overflow-hidden rounded-full bg-[var(--otari-brand-tint)]",children:f.filter(l=>l.width>0).map(l=>s.jsx("rect",{x:l.x,y:0,width:l.width,height:4,fill:l.fill},l.key))})]})}function p({label:t,children:r}){return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),s.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:r})]})}function Lt({entry:t}){var r,c;return s.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"}),s.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"This request failed. Inspect gateway logs for details."})]}):null,s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(p,{label:"Provider",children:t.provider??"—"}),s.jsx(p,{label:"Endpoint",children:t.endpoint}),s.jsx(p,{label:"Source",children:se(t.source)}),t.source_label?s.jsx(p,{label:"Session",children:t.source_label}):null,s.jsx(p,{label:"User",children:t.user_id??"—"}),s.jsx(p,{label:"API key",children:t.api_key_id??"—"}),s.jsx(p,{label:"Prompt tokens",children:k(t.prompt_tokens)}),s.jsx(p,{label:"Completion tokens",children:k(t.completion_tokens)}),s.jsx(p,{label:"Total tokens",children:k(t.total_tokens)}),s.jsx(p,{label:"Billed tokens",children:s.jsx("span",{title:"Fresh input, cache reads and writes, and output: the tokens this request was priced on, and the total the activity row's bar splits.",children:k(((r=De(t))==null?void 0:r.total)??null)})}),s.jsx(p,{label:"Cost",children:L(t.cost)}),s.jsx(p,{label:"Cache read tokens",children:k(t.cache_read_tokens)}),s.jsx(p,{label:"Cache write tokens",children:k(t.cache_write_tokens)}),s.jsx(p,{label:"1h cache writes",children:k(t.cache_write_1h_tokens??null)}),s.jsx(p,{label:"Total time",children:Te(t.latency_ms)}),s.jsx(p,{label:"Request ID",children:t.id})]}),(c=t.pricing_breakdown)!=null&&c.length?s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),s.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(a=>s.jsxs(p,{label:a.meter.replaceAll("_"," "),children:[k(a.units)," at ",L(a.rate_per_million)," / 1M, ",L(a.cost)]},a.meter))})]}):null]})}function Jt(){var ke,ye,Se,je,we,Ce;const t=lt(),r=ot(),c=i.useMemo(()=>{const e=new Map;for(const n of r.data??[])e.set(n.id,n.key_name??`${n.id.slice(0,8)}…`);return e},[r.data]),a=Ct(Tt),o=a.get("range"),f=a.get("start_date"),l=a.get("end_date"),d=a.get("status"),u=a.get("model"),h=a.get("user_id"),x=a.get("api_key_id"),v=a.get("priced"),g=a.get("source"),ae=Math.max(0,a.getNumber("page")),re=a.getNumber("size"),$=wt.reduce((e,n)=>Math.abs(n-re)U(o,f,l)),le=i.useRef(E);i.useEffect(()=>{le.current!==E&&(le.current=E,ne(U(o,f,l)))},[E,o,f,l]);const[M,oe]=i.useState(()=>te(o)),ie=i.useRef(o);i.useEffect(()=>{ie.current!==o&&(ie.current=o,oe(te(o)))},[o]);const T=v==="true"?!0:v==="false"?!1:void 0,b=i.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,model:u.trim()||void 0,user_id:h||void 0,api_key_id:x||void 0,source:g||void 0,priced:T}),[m,d,u,h,x,g,T]),_=_t(),D=JSON.stringify(b),ce=i.useRef(D);i.useEffect(()=>{ce.current!==D&&(ce.current=D,a.patch({page:0}),_.clear())},[D,a,_]);const S=it(b,ae,$),N=Pe(b),Oe=i.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,user_id:h||void 0,api_key_id:x||void 0,source:g||void 0}),[m,d,h,x,g]),K=J(Oe,"day"),q=((ye=(ke=K.data)==null?void 0:ke.by_model)==null?void 0:ye.filter(e=>!e.is_other&&e.key!==null).map(e=>e.key))??[],de=(r.data??[]).map(e=>({value:e.id,label:e.key_name??`${e.id.slice(0,8)}…`})),Ie=i.useMemo(()=>({start_date:m.start,end_date:m.end,status:d||void 0,model:u.trim()||void 0,user_id:h||void 0,api_key_id:x||void 0}),[m,d,u,h,x]),ue=J(Ie,"day",!!g),me=(Se=g?ue.data:K.data)==null?void 0:Se.by_source,Re=i.useMemo(()=>{const e=(me??[]).filter(n=>!n.is_other&&n.key!==null).map(n=>n.key);return g&&!e.includes(g)?[g,...e]:e},[me,g]),P=C(w,o)??C(w,B),A=!!(m.start&&M.start&&new Date(m.start).getTime()({start_date:A?m.start:M.start,end_date:A?m.end:void 0,status:d||void 0,model:u.trim()||void 0,user_id:h||void 0,api_key_id:x||void 0,source:g||void 0,priced:T}),[A,m,M,d,u,h,x,g,T]),z=J(Ue,pe),Be=(((je=z.data)==null?void 0:je.series)??[]).map(e=>({bucketStart:e.bucket_start,requests:e.requests})),j=S.data??[],$e=N.isSuccess&&!N.isPlaceholderData?((we=N.data)==null?void 0:we.total)??0:null,W=C(w,o),Ke=!!(f||l)||o!==B&&(W==null?void 0:W.seconds)!=null,qe=!!(d||u.trim()||h||x||v||g||Ke),O=(e,n)=>{var Ne;return((Ne=e.find(rt=>rt.value===n))==null?void 0:Ne.label)??n},he=(t.data??[]).map(e=>({value:e.user_id,label:e.alias?`${e.alias} (${e.user_id})`:e.user_id})),ze=()=>a.patch({status:"",priced:"",model:"",user_id:"",api_key_id:"",source:""}),We=[...d?[{key:"status",label:"Status",value:O(Ae,d),onClear:()=>a.patch({status:""})}]:[],...v?[{key:"priced",label:"Priced",value:O(Fe,v),onClear:()=>a.patch({priced:""})}]:[],...h?[{key:"user",label:"User",value:O(he,h),onClear:()=>a.patch({user_id:""})}]:[],...u.trim()?[{key:"model",label:"Model",value:u.trim(),onClear:()=>a.patch({model:""})}]:[],...x?[{key:"key",label:"API key",value:O(de,x),onClear:()=>a.patch({api_key_id:""})}]:[],...g?[{key:"source",label:"Source",value:se(g),onClear:()=>a.patch({source:""})}]:[]],Y=i.useMemo(()=>j.filter(e=>!e.counts_toward_budget).map(e=>e.id),[j]),Ye=i.useMemo(()=>j.filter(e=>e.counts_toward_budget).map(e=>e.id),[j]),ge=bt(_.selectedKeys,Y),F=ge.length,xe=_.allMatching||F>0,Ge=i.useMemo(()=>({...b,counts_toward_budget:!1}),[b]),fe=Pe(Ge,xe),I=fe.isSuccess?((Ce=fe.data)==null?void 0:Ce.total)??null:null,He=Y.length>0&&F===Y.length&&I!=null&&I>F,R=_.allMatching?I??F:F,G=dt(),H=ut(),[Ve,V]=i.useState(!1),[Ze,Z]=i.useState(!1),[Je,_e]=i.useState(null),Qe=i.useCallback(e=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[s.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Request detail"}),s.jsx(ee,{size:"sm",variant:"ghost",onPress:()=>_e(null),children:"Close"})]}),s.jsx(Lt,{entry:e})]}),[]),be=()=>_.allMatching?{by_filter:!0,model:b.model,user_id:b.user_id,api_key_id:b.api_key_id,status:b.status,start_date:b.start_date,end_date:b.end_date,priced:b.priced}:{ids:ge},Xe=()=>{G.mutate(be(),{onSuccess:()=>{V(!1),_.clear()}})},et=e=>{H.mutate({...be(),...e},{onSuccess:()=>{Z(!1),_.clear()}})},tt=()=>{S.refetch(),N.refetch(),z.refetch(),K.refetch(),ue.refetch()},ve=e=>{if(e.key===o&&!f&&!l){ne(U(e.key,"","")),oe(te(e.key));return}a.patch({range:e.key,start_date:"",end_date:""})},st=(e,n)=>a.patch({start_date:e,end_date:n}),at=i.useMemo(()=>{const e=n=>n===null?"—":c.get(n)??`${n.slice(0,8)}…`;return[{id:"time",header:"Time",cell:n=>s.jsx("span",{title:Pt(n.timestamp),className:"text-[var(--otari-muted)]",children:At(n.timestamp)})},{id:"user",header:"User",cell:n=>n.user_id??"—"},{id:"model",header:"Model",isRowHeader:!0,cell:n=>n.model},{id:"api_key",header:"API key",cell:n=>s.jsx("span",{className:"text-[var(--otari-muted)]",children:e(n.api_key_id)})},{id:"tokens",header:"Tokens",align:"end",cell:n=>s.jsx(Rt,{entry:n})},{id:"cost",header:"Cost",align:"end",cell:n=>L(n.cost)},{id:"latency",header:"Total time",align:"end",cell:n=>Te(n.latency_ms)},{id:"status",header:"Status",cell:n=>s.jsx(Dt,{status:n.status})}]},[c]);return s.jsxs("div",{className:"flex flex-col gap-6",children:[s.jsx(mt,{title:"Activity",description:"A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored."}),s.jsx(pt,{error:S.error??N.error}),s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsx(xt,{presets:w,extentKey:Le,onPreset:ve,onSelectRange:st,onSelectFull:()=>P?ve(P):void 0,series:Be,bucket:pe,windowStart:m.start,windowEnd:m.end,loading:z.isLoading,ariaLabel:"Activity request volume over the selected window",action:s.jsx(ht,{onRefresh:tt,isFetching:S.isFetching,updatedAt:S.dataUpdatedAt})}),s.jsxs(ft,{chips:We,onClearAll:ze,children:[s.jsx(Q,{id:"filter-status",label:"Status",value:d,onChange:e=>a.patch({status:e}),children:Ae.map(e=>s.jsx("option",{value:e.value,children:e.label},e.value))}),s.jsx(Q,{id:"filter-priced",label:"Priced?",value:v,onChange:e=>a.patch({priced:e}),children:Fe.map(e=>s.jsx("option",{value:e.value,children:e.label},e.value))}),s.jsxs(Q,{id:"filter-source",label:"Source",value:g,onChange:e=>a.patch({source:e}),children:[s.jsx("option",{value:"",children:"All"}),Re.map(e=>s.jsx("option",{value:e,children:se(e)},e))]}),s.jsx(X,{label:"API key",value:x,onChange:e=>a.patch({api_key_id:e}),placeholder:"All keys",options:de}),s.jsx(X,{label:"User",value:h,onChange:e=>a.patch({user_id:e}),placeholder:"All users",options:he}),s.jsx(X,{label:"Model",value:u,onChange:e=>a.patch({model:e}),allowsCustom:!0,placeholder:"Any model",options:(u&&!q.includes(u)?[u,...q]:q).map(e=>({value:e,label:e}))})]})]}),xe?s.jsxs(vt,{selectedCount:R,allMatching:_.allMatching,matchingTotal:I,canSelectAllMatching:He,onSelectAllMatching:_.enableAllMatching,onClear:_.clear,children:[s.jsx(ee,{size:"sm",variant:"primary",onPress:()=>Z(!0),children:"Set price"}),s.jsx(ee,{size:"sm",variant:"danger",onPress:()=>V(!0),children:"Delete"})]}):null,s.jsx(yt,{ariaLabel:"Activity log",columns:at,rows:j,getRowKey:Ft,isLoading:S.isLoading,emptyContent:qe?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:_.selectedKeys,onSelectionChange:_.onSelectionChange,disabledKeys:Ye,onRowAction:e=>_e(n=>n===e?null:e),rowClassName:Et,detailKey:Je,renderDetail:Qe}),s.jsx(St,{page:ae,pageSize:$,total:$e,rowsOnPage:j.length,onPageChange:e=>a.patch({page:e}),onPageSizeChange:e=>a.patch({size:e,page:0}),isFetching:S.isFetching,hasNextFallback:j.length===$}),s.jsx(kt,{isOpen:Ve,onOpenChange:V,heading:"Delete usage rows",body:`Delete ${R.toLocaleString()} imported ${R===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:G.isPending,error:G.error,onConfirm:Xe}),s.jsx(jt,{isOpen:Ze,onOpenChange:Z,targetCount:R,isPending:H.isPending,error:H.error,onSubmit:et})]})}export{Jt as ActivityPage}; diff --git a/src/gateway/static/dashboard/assets/AliasesPage-nuRqwFaK.js b/src/gateway/static/dashboard/assets/AliasesPage-DFSg4QUS.js similarity index 94% rename from src/gateway/static/dashboard/assets/AliasesPage-nuRqwFaK.js rename to src/gateway/static/dashboard/assets/AliasesPage-DFSg4QUS.js index 253507e52..4520e9cef 100644 --- a/src/gateway/static/dashboard/assets/AliasesPage-nuRqwFaK.js +++ b/src/gateway/static/dashboard/assets/AliasesPage-DFSg4QUS.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as L}from"./react-dgEcD0HR.js";import{l as T,m as I,n as M,o as R,P as K,E as w,p as P,u as F}from"./index-DsUY4UvK.js";import{u as O,r as $,B as U}from"./tableSelection-9hV37uhu.js";import{C as q}from"./ConfirmDialog-NCJIhH2z.js";import{D as H}from"./DataTable-Bmn_eYSV.js";import{F as V}from"./Field-Dwp6u3t8.js";import{C as k,L as z,I as G,a as J,b as W,f as X,B as j,d as A}from"./heroui-BI50yK5B.js";import{U as Q}from"./UserComboBox-a9wxf8eF.js";const Y=50;function B({label:t,value:a,onChange:n,description:r,placeholder:c="provider:model",autoFocus:l,isRequired:d}){const o=T(),{visible:m,total:h,failed:x}=u.useMemo(()=>{var N;const i=a.trim().toLowerCase(),v=((N=o.data)==null?void 0:N.providers)??[],C=v.flatMap(f=>f.models),p=i?C.filter(f=>f.key.toLowerCase().includes(i)):C;return{visible:p.slice(0,Y),total:p.length,failed:v.filter(f=>!f.ok)}},[o.data,a]),g=o.isLoading?"Loading models from your providers…":x.length>0?`Could not list models for ${x.map(v=>v.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:h>m.length?`Showing ${m.length} of ${h} matches. Keep typing to narrow them.`:r;return e.jsxs(k.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:a,onInputChange:n,onSelectionChange:i=>{i!=null&&n(String(i))},isRequired:d,className:"flex max-w-md flex-col gap-1",children:[e.jsx(z,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(k.InputGroup,{children:[e.jsx(G,{placeholder:c,autoFocus:l}),e.jsx(k.Trigger,{})]}),e.jsx(k.Popover,{children:e.jsx(J,{items:m,className:"max-h-72 overflow-auto",children:i=>e.jsx(W,{id:i.key,textValue:i.key,children:i.key})})}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:g}):null]})}const S=t=>JSON.stringify([t.user_id,t.name]);function Z({userId:t,onChange:a}){const n=F(),r=t!==null,c=(l,d)=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>a(l?"":null),className:r===l?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:d});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Applies to"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"A global alias resolves for every caller. A user-scoped one resolves only for that user, and takes precedence over a global alias of the same name."})]}),e.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[c(!1,"Every caller"),c(!0,"One user")]}),r?e.jsx(Q,{label:"User",value:t??"",onChange:a,users:n.data??[],placeholder:"Pick a user…",description:"Only this user resolves the alias.",unknownHint:e.jsx("span",{className:"text-red-700",children:"No such user. Pick an existing one."})}):null]})}function ee({alias:t,onClose:a}){const n=P(),[r,c]=u.useState(t.target),l=r.trim()!==""&&r.trim()!==t.target,d=()=>{l&&n.mutate({name:t.name,target:r.trim(),user_id:t.user_id},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name}),t.user_id?e.jsxs(e.Fragment,{children:[" for user ",e.jsx("code",{children:t.user_id})]}):null]}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["The alias name and who it applies to (",t.user_id?e.jsx("code",{children:t.user_id}):"every caller",") are the key and cannot be changed here. Delete and recreate to change either."]})]}),e.jsx(B,{label:"Target",value:r,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!l||n.isPending,onPress:d,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function se({onClose:t,initialTarget:a=""}){const n=P(),[r,c]=u.useState(""),[l,d]=u.useState(a),[o,m]=u.useState(null),h=/[:/]/.test(r),x=o===null||o.trim()!=="",g=r.trim()!==""&&l.trim()!==""&&!h&&x,i=()=>{g&&n.mutate({name:r.trim(),target:l.trim(),user_id:o===null?null:o.trim()},{onSuccess:t})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(V,{label:"Alias name",value:r,onChange:c,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:h?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(B,{label:"Target",value:l,onChange:d,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsx(Z,{userId:o,onChange:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!g||n.isPending,onPress:i,children:n.isPending?"Creating…":"Create alias"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function me(){const t=I(),a=M(),[n]=L(),r=n.get("target")??"",[c,l]=u.useState(r!==""),[d,o]=u.useState(null),m=O(),[h,x]=u.useState(!1),[g,i]=u.useState(void 0),[v,C]=u.useState(!1),p=[...t.data??[]].sort((s,b)=>s.name.localeCompare(b.name)||(s.user_id??"").localeCompare(b.user_id??"")),N=p.filter(s=>s.source==="stored").map(S),f=p.filter(s=>s.source!=="stored").map(S),y=$(m.selectedKeys,N),D=new Map(p.map(s=>[S(s),s])),_=async()=>{C(!0),i(void 0);try{for(const s of y){const b=D.get(s);b!==void 0&&await a.mutateAsync({name:b.name,userId:b.user_id})}m.clear(),x(!1)}catch(s){i(s)}finally{C(!1)}},E=u.useMemo(()=>[{id:"alias",header:"Alias",isRowHeader:!0,cell:s=>e.jsx("span",{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name})},{id:"target",header:"Target",cell:s=>e.jsx("span",{className:"break-all text-[var(--otari-muted)]",children:s.target})},{id:"scope",header:"Applies to",cell:s=>s.user_id?e.jsx("code",{className:"break-all text-xs text-[var(--otari-ink)]",children:s.user_id}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Every caller"})},{id:"source",header:"Source",cell:s=>e.jsx(X,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})},{id:"actions",header:"Actions",align:"end",cell:s=>s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{l(!1),o(s)},children:"Edit"}),e.jsx(R,{confirmLabel:"Delete",isPending:a.isPending,onConfirm:()=>a.mutate({name:s.name,userId:s.user_id}),children:"Delete"})]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})}],[a.isPending,a.mutate]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(K,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:c||d?null:e.jsx(j,{variant:"primary",onPress:()=>{o(null),l(!0)},children:"New alias"})}),e.jsx(w,{error:t.error}),c?e.jsx(se,{initialTarget:r,onClose:()=>l(!1)}):null,d?e.jsx(ee,{alias:d,onClose:()=>o(null)}):null,a.error?e.jsx(w,{error:a.error}):null,y.length>0?e.jsx(U,{selectedCount:y.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:m.clear,children:e.jsx(j,{size:"sm",variant:"danger",onPress:()=>x(!0),children:"Delete"})}):null,e.jsx(H,{ariaLabel:"Aliases",columns:E,rows:p,getRowKey:S,isLoading:t.isLoading,emptyContent:"No aliases yet. Create one to give a model a friendly name.",selectionMode:"multiple",selectedKeys:m.selectedKeys,onSelectionChange:m.onSelectionChange,disabledKeys:f}),e.jsx(q,{isOpen:h,onOpenChange:x,heading:"Delete aliases",body:`Delete ${y.length} stored ${y.length===1?"alias":"aliases"}? Callers using ${y.length===1?"it":"them"} will get a model-not-found error.`,confirmLabel:"Delete",isPending:v,error:g,onConfirm:_})]})}export{me as AliasesPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as L}from"./react-dgEcD0HR.js";import{o as T,p as I,q as M,s as R,P as K,E as w,t as P,u as F}from"./index-Dhxz7Eyv.js";import{u as O,r as $,B as q}from"./tableSelection-CojkFPwd.js";import{C as U}from"./ConfirmDialog-DawcDVEg.js";import{D as H}from"./DataTable-CrQq0sYf.js";import{F as V}from"./Field-DEJ6Wjg9.js";import{C as k,L as z,I as G,a as J,b as W,f as X,B as j,d as A}from"./heroui-DZj66Arc.js";import{U as Q}from"./UserComboBox-nt7pHfqn.js";const Y=50;function B({label:t,value:a,onChange:n,description:r,placeholder:c="provider:model",autoFocus:l,isRequired:d}){const o=T(),{visible:m,total:h,failed:x}=u.useMemo(()=>{var N;const i=a.trim().toLowerCase(),v=((N=o.data)==null?void 0:N.providers)??[],C=v.flatMap(f=>f.models),p=i?C.filter(f=>f.key.toLowerCase().includes(i)):C;return{visible:p.slice(0,Y),total:p.length,failed:v.filter(f=>!f.ok)}},[o.data,a]),g=o.isLoading?"Loading models from your providers…":x.length>0?`Could not list models for ${x.map(v=>v.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:h>m.length?`Showing ${m.length} of ${h} matches. Keep typing to narrow them.`:r;return e.jsxs(k.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:a,onInputChange:n,onSelectionChange:i=>{i!=null&&n(String(i))},isRequired:d,className:"flex max-w-md flex-col gap-1",children:[e.jsx(z,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(k.InputGroup,{children:[e.jsx(G,{placeholder:c,autoFocus:l}),e.jsx(k.Trigger,{})]}),e.jsx(k.Popover,{children:e.jsx(J,{items:m,className:"max-h-72 overflow-auto",children:i=>e.jsx(W,{id:i.key,textValue:i.key,children:i.key})})}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:g}):null]})}const S=t=>JSON.stringify([t.user_id,t.name]);function Z({userId:t,onChange:a}){const n=F(),r=t!==null,c=(l,d)=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>a(l?"":null),className:r===l?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:d});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Applies to"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"A global alias resolves for every caller. A user-scoped one resolves only for that user, and takes precedence over a global alias of the same name."})]}),e.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[c(!1,"Every caller"),c(!0,"One user")]}),r?e.jsx(Q,{label:"User",value:t??"",onChange:a,users:n.data??[],placeholder:"Pick a user…",description:"Only this user resolves the alias.",unknownHint:e.jsx("span",{className:"text-red-700",children:"No such user. Pick an existing one."})}):null]})}function ee({alias:t,onClose:a}){const n=P(),[r,c]=u.useState(t.target),l=r.trim()!==""&&r.trim()!==t.target,d=()=>{l&&n.mutate({name:t.name,target:r.trim(),user_id:t.user_id},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name}),t.user_id?e.jsxs(e.Fragment,{children:[" for user ",e.jsx("code",{children:t.user_id})]}):null]}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["The alias name and who it applies to (",t.user_id?e.jsx("code",{children:t.user_id}):"every caller",") are the key and cannot be changed here. Delete and recreate to change either."]})]}),e.jsx(B,{label:"Target",value:r,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!l||n.isPending,onPress:d,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function se({onClose:t,initialTarget:a=""}){const n=P(),[r,c]=u.useState(""),[l,d]=u.useState(a),[o,m]=u.useState(null),h=/[:/]/.test(r),x=o===null||o.trim()!=="",g=r.trim()!==""&&l.trim()!==""&&!h&&x,i=()=>{g&&n.mutate({name:r.trim(),target:l.trim(),user_id:o===null?null:o.trim()},{onSuccess:t})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(V,{label:"Alias name",value:r,onChange:c,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:h?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(B,{label:"Target",value:l,onChange:d,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsx(Z,{userId:o,onChange:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!g||n.isPending,onPress:i,children:n.isPending?"Creating…":"Create alias"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function me(){const t=I(),a=M(),[n]=L(),r=n.get("target")??"",[c,l]=u.useState(r!==""),[d,o]=u.useState(null),m=O(),[h,x]=u.useState(!1),[g,i]=u.useState(void 0),[v,C]=u.useState(!1),p=[...t.data??[]].sort((s,b)=>s.name.localeCompare(b.name)||(s.user_id??"").localeCompare(b.user_id??"")),N=p.filter(s=>s.source==="stored").map(S),f=p.filter(s=>s.source!=="stored").map(S),y=$(m.selectedKeys,N),D=new Map(p.map(s=>[S(s),s])),_=async()=>{C(!0),i(void 0);try{for(const s of y){const b=D.get(s);b!==void 0&&await a.mutateAsync({name:b.name,userId:b.user_id})}m.clear(),x(!1)}catch(s){i(s)}finally{C(!1)}},E=u.useMemo(()=>[{id:"alias",header:"Alias",isRowHeader:!0,cell:s=>e.jsx("span",{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name})},{id:"target",header:"Target",cell:s=>e.jsx("span",{className:"break-all text-[var(--otari-muted)]",children:s.target})},{id:"scope",header:"Applies to",cell:s=>s.user_id?e.jsx("code",{className:"break-all text-xs text-[var(--otari-ink)]",children:s.user_id}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Every caller"})},{id:"source",header:"Source",cell:s=>e.jsx(X,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})},{id:"actions",header:"Actions",align:"end",cell:s=>s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{l(!1),o(s)},children:"Edit"}),e.jsx(R,{confirmLabel:"Delete",isPending:a.isPending,onConfirm:()=>a.mutate({name:s.name,userId:s.user_id}),children:"Delete"})]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})}],[a.isPending,a.mutate]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(K,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:c||d?null:e.jsx(j,{variant:"primary",onPress:()=>{o(null),l(!0)},children:"New alias"})}),e.jsx(w,{error:t.error}),c?e.jsx(se,{initialTarget:r,onClose:()=>l(!1)}):null,d?e.jsx(ee,{alias:d,onClose:()=>o(null)}):null,a.error?e.jsx(w,{error:a.error}):null,y.length>0?e.jsx(q,{selectedCount:y.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:m.clear,children:e.jsx(j,{size:"sm",variant:"danger",onPress:()=>x(!0),children:"Delete"})}):null,e.jsx(H,{ariaLabel:"Aliases",columns:E,rows:p,getRowKey:S,isLoading:t.isLoading,emptyContent:"No aliases yet. Create one to give a model a friendly name.",selectionMode:"multiple",selectedKeys:m.selectedKeys,onSelectionChange:m.onSelectionChange,disabledKeys:f}),e.jsx(U,{isOpen:h,onOpenChange:x,heading:"Delete aliases",body:`Delete ${y.length} stored ${y.length===1?"alias":"aliases"}? Callers using ${y.length===1?"it":"them"} will get a model-not-found error.`,confirmLabel:"Delete",isPending:v,error:g,onConfirm:_})]})}export{me as AliasesPage}; diff --git a/src/gateway/static/dashboard/assets/BudgetsPage-_DPQrLj-.js b/src/gateway/static/dashboard/assets/BudgetsPage-CnOzEeql.js similarity index 91% rename from src/gateway/static/dashboard/assets/BudgetsPage-_DPQrLj-.js rename to src/gateway/static/dashboard/assets/BudgetsPage-CnOzEeql.js index 89090ae72..10408bd97 100644 --- a/src/gateway/static/dashboard/assets/BudgetsPage-_DPQrLj-.js +++ b/src/gateway/static/dashboard/assets/BudgetsPage-CnOzEeql.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{q as ae,u as re,r as le,s as ie,t as oe,v as de,P as ue,E as T,I as ce,w as me,x as xe}from"./index-DsUY4UvK.js";import{u as ge,r as he,B as pe}from"./tableSelection-9hV37uhu.js";import{C as fe}from"./ConfirmDialog-NCJIhH2z.js";import{D as be}from"./DataTable-Bmn_eYSV.js";import{F as z}from"./Field-Dwp6u3t8.js";import{C as E,I as je,a as ve,b as ye,B as x,d as k,S as Ne}from"./heroui-BI50yK5B.js";const Se=50;function _e({value:t,onChange:r,users:a,label:o,description:l}){const[g,h]=i.useState(""),d=i.useMemo(()=>a.filter(s=>!s.user_id.startsWith("apikey-")).map(s=>({id:s.user_id,label:s.alias?`${s.user_id} (${s.alias})`:s.user_id})),[a]),p=i.useMemo(()=>{const s=g.trim().toLowerCase();return d.filter(u=>!t.includes(u.id)).filter(u=>!s||u.id.toLowerCase().includes(s)||u.label.toLowerCase().includes(s)).slice(0,Se)},[d,t,g]),c=s=>{t.includes(s)||r([...t,s]),h("")},m=s=>r(t.filter(u=>u!==s));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:o}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[s,e.jsx("button",{type:"button","aria-label":`Remove ${s}`,onClick:()=>m(s),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},s))}):null,d.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:h,selectedKey:null,onSelectionChange:s=>{s!=null&&c(String(s))},className:"flex flex-col gap-1",children:[e.jsxs(E.InputGroup,{children:[e.jsx(je,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(ve,{items:p,className:"max-h-72 overflow-auto",children:s=>e.jsx(ye,{id:s.id,textValue:s.label,children:s.label})})})]})]})}const Ce=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function D(t){return Ce.format(t)}const j=86400,q=3600,O=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function we(t){if(t===null)return"No reset";const r=O.find(a=>a.seconds===t);return r?r.label:t%j===0?`Every ${t/j} days`:t%q===0?`Every ${t/q} hours`:`Every ${t}s`}function W(t){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function De(t){const r=t.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function Y(t){return t!==null&&t%j===0?String(t/j):""}function Be({value:t,onChange:r,onInvalidChange:a}){const o=O.some(s=>s.seconds===t),[l,g]=i.useState(!o),[h,d]=i.useState(()=>Y(t)),p=h.trim(),c=Number(p),m=p!==""&&(!Number.isSafeInteger(c)||c<=0);return i.useEffect(()=>{a==null||a(m)},[m,a]),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.map(s=>e.jsx(x,{size:"sm",variant:!l&&t===s.seconds?"primary":"outline",onPress:()=>{g(!1),d(Y(s.seconds)),r(s.seconds)},children:s.label},s.label)),e.jsx(x,{size:"sm",variant:l?"primary":"outline",onPress:()=>g(!0),children:"Custom"})]}),l?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx(z,{label:"Every N days",value:h,onChange:s=>{d(s);const u=Number(s.trim());r(s.trim()===""||!Number.isSafeInteger(u)||u<=0?null:u*j)},placeholder:"14",description:m?e.jsx("span",{className:"text-red-700",children:"Enter a whole number of days."}):"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function G({title:t,submitLabel:r,initial:a,error:o,isPending:l,onSubmit:g,onClose:h,assignUsers:d}){const[p,c]=i.useState(a.name??""),[m,s]=i.useState(a.max_budget===null?"":String(a.max_budget)),[u,b]=i.useState(a.budget_duration_sec),[S,v]=i.useState(!1),[B,P]=i.useState([]),f=De(m),A=!l&&f.valid&&!S,C=()=>{A&&g({name:p.trim()||null,max_budget:f.value,budget_duration_sec:u},B)};return e.jsx(k,{children:e.jsxs(k.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(T,{error:o}),e.jsx(z,{label:"Name (optional)",value:p,onChange:c,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx(z,{label:"Spending limit (USD)",value:m,onChange:s,placeholder:"100.00",description:f.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(Be,{value:u,onChange:b,onInvalidChange:v}),d?e.jsx(_e,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:B,onChange:P,users:d}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:!A,onPress:C,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:h,children:"Cancel"})]})]})})}function Pe({budget:t}){if(t.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=t.total_spend;if(t.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[D(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=t.max_budget*t.user_count,o=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:D(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",D(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(o,l?100:2)}%`}})})]})}function Ae({budgetId:t}){const r=xe(t);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(Ne,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:o.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:D(o.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:W(o.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:W(o.next_reset_at)})]},o.id))})]})})}function Ee({label:t,isPending:r,onConfirm:a}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:t}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}const ke=t=>t.budget_id;function Q(t){return t.split("-")[0]}function $(t){return t.name??Q(t.budget_id)}function Te(){const t=ae(),r=re(),a=le(),o=ie(),l=oe(),g=de(),[h,d]=i.useState(!1),[p,c]=i.useState(null),[m,s]=i.useState(null),[u,b]=i.useState(null),[S,v]=i.useState(null),[B,P]=i.useState(!1),f=ge(),[A,C]=i.useState(!1),[X,F]=i.useState(void 0),[J,H]=i.useState(!1),w=t.data??[],K=t.isLoading,y=w.find(n=>n.budget_id===p)??null,U=w.find(n=>n.budget_id===m)??null,L=!K&&w.length===0&&!h,Z=w.map(n=>n.budget_id),_=he(f.selectedKeys,Z),ee=async()=>{H(!0),F(void 0);try{for(const n of _)await l.mutateAsync(n);f.clear(),C(!1)}catch(n){F(n)}finally{H(!1)}},te=i.useMemo(()=>[{id:"budget",header:"Budget",isRowHeader:!0,cell:n=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:Q(n.budget_id)})]})},{id:"limit",header:"Limit (per user)",cell:n=>n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):D(n.max_budget)},{id:"reset",header:"Reset",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:we(n.budget_duration_sec)})},{id:"users",header:"Users",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:n.user_count})},{id:"usage",header:"Usage",cell:n=>e.jsx(Pe,{budget:n})},{id:"actions",header:"Actions",align:"end",cell:n=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(N=>N===n.budget_id?null:n.budget_id),children:m===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{d(!1),c(n.budget_id)},children:"Edit"}),e.jsx(Ee,{label:$(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})}],[m,l.isPending,l.mutate]),V=async(n,N)=>{P(!0),b(null);const I=await Promise.allSettled(N.map(M=>g.mutateAsync({id:M,body:{budget_id:n}})));P(!1);const R=I.flatMap((M,ne)=>M.status==="rejected"?[N[ne]]:[]);if(R.length>0){v({budgetId:n,userIds:R}),b(new Error(`Budget created, but could not assign it to: ${R.join(", ")}. Retry to try again.`));return}v(null),d(!1)},se=(n,N)=>{if(S){V(S.budgetId,S.userIds);return}b(null),a.mutate(n,{onSuccess:async I=>{if(N.length>0){await V(I.budget_id,N);return}d(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ue,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:h||L?null:e.jsx(x,{variant:"primary",onPress:()=>{c(null),b(null),v(null),d(!0)},children:"Create budget"})}),e.jsx(T,{error:t.error??a.error??o.error??l.error??g.error}),e.jsx(ce,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),L?e.jsx(me,{title:"No budgets yet",description:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit.",actionLabel:"Create your first budget",onAction:()=>{c(null),b(null),v(null),d(!0)}}):null,h?e.jsx(G,{title:"Create budget",submitLabel:S?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??u,isPending:a.isPending||B,assignUsers:r.data??[],onSubmit:se,onClose:()=>{b(null),v(null),d(!1)}}):null,y?e.jsx(G,{title:`Edit budget ${$(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:o.error,isPending:o.isPending,onSubmit:n=>o.mutate({id:y.budget_id,body:n},{onSuccess:()=>c(null)}),onClose:()=>c(null)},y.budget_id):null,_.length>0?e.jsx(pe,{selectedCount:_.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:f.clear,children:e.jsx(x,{size:"sm",variant:"danger",onPress:()=>C(!0),children:"Delete"})}):null,L?null:e.jsx(be,{ariaLabel:"Budgets",columns:te,rows:w,getRowKey:ke,isLoading:K,emptyContent:"No budgets yet. Create one to cap spending.",selectionMode:"multiple",selectedKeys:f.selectedKeys,onSelectionChange:f.onSelectionChange}),U?e.jsx(k,{children:e.jsxs(k.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsxs("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:["Reset history — ",$(U)]}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(null),children:"Close"})]}),e.jsx(Ae,{budgetId:U.budget_id})]})}):null,e.jsx(fe,{isOpen:A,onOpenChange:C,heading:"Delete budgets",body:`Delete ${_.length} ${_.length===1?"budget":"budgets"}? Users on ${_.length===1?"it":"them"} will no longer be capped.`,confirmLabel:"Delete",isPending:J,error:X,onConfirm:ee})]})}export{Te as BudgetsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{v as ae,u as re,w as le,x as ie,y as oe,z as de,P as ue,E as T,I as ce,B as me,D as xe}from"./index-Dhxz7Eyv.js";import{u as ge,r as he,B as pe}from"./tableSelection-CojkFPwd.js";import{C as fe}from"./ConfirmDialog-DawcDVEg.js";import{D as be}from"./DataTable-CrQq0sYf.js";import{F as $}from"./Field-DEJ6Wjg9.js";import{C as E,I as je,a as ve,b as ye,B as x,d as k,S as Ne}from"./heroui-DZj66Arc.js";const Se=50;function _e({value:t,onChange:r,users:a,label:o,description:l}){const[g,h]=i.useState(""),d=i.useMemo(()=>a.filter(s=>!s.user_id.startsWith("apikey-")).map(s=>({id:s.user_id,label:s.alias?`${s.user_id} (${s.alias})`:s.user_id})),[a]),p=i.useMemo(()=>{const s=g.trim().toLowerCase();return d.filter(u=>!t.includes(u.id)).filter(u=>!s||u.id.toLowerCase().includes(s)||u.label.toLowerCase().includes(s)).slice(0,Se)},[d,t,g]),c=s=>{t.includes(s)||r([...t,s]),h("")},m=s=>r(t.filter(u=>u!==s));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:o}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[s,e.jsx("button",{type:"button","aria-label":`Remove ${s}`,onClick:()=>m(s),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},s))}):null,d.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:h,selectedKey:null,onSelectionChange:s=>{s!=null&&c(String(s))},className:"flex flex-col gap-1",children:[e.jsxs(E.InputGroup,{children:[e.jsx(je,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(ve,{items:p,className:"max-h-72 overflow-auto",children:s=>e.jsx(ye,{id:s.id,textValue:s.label,children:s.label})})})]})]})}const Ce=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function D(t){return Ce.format(t)}const j=86400,W=3600,O=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function we(t){if(t===null)return"No reset";const r=O.find(a=>a.seconds===t);return r?r.label:t%j===0?`Every ${t/j} days`:t%W===0?`Every ${t/W} hours`:`Every ${t}s`}function q(t){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function De(t){const r=t.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function Y(t){return t!==null&&t%j===0?String(t/j):""}function Be({value:t,onChange:r,onInvalidChange:a}){const o=O.some(s=>s.seconds===t),[l,g]=i.useState(!o),[h,d]=i.useState(()=>Y(t)),p=h.trim(),c=Number(p),m=p!==""&&(!Number.isSafeInteger(c)||c<=0);return i.useEffect(()=>{a==null||a(m)},[m,a]),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.map(s=>e.jsx(x,{size:"sm",variant:!l&&t===s.seconds?"primary":"outline",onPress:()=>{g(!1),d(Y(s.seconds)),r(s.seconds)},children:s.label},s.label)),e.jsx(x,{size:"sm",variant:l?"primary":"outline",onPress:()=>g(!0),children:"Custom"})]}),l?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx($,{label:"Every N days",value:h,onChange:s=>{d(s);const u=Number(s.trim());r(s.trim()===""||!Number.isSafeInteger(u)||u<=0?null:u*j)},placeholder:"14",description:m?e.jsx("span",{className:"text-red-700",children:"Enter a whole number of days."}):"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function G({title:t,submitLabel:r,initial:a,error:o,isPending:l,onSubmit:g,onClose:h,assignUsers:d}){const[p,c]=i.useState(a.name??""),[m,s]=i.useState(a.max_budget===null?"":String(a.max_budget)),[u,b]=i.useState(a.budget_duration_sec),[S,v]=i.useState(!1),[B,P]=i.useState([]),f=De(m),A=!l&&f.valid&&!S,C=()=>{A&&g({name:p.trim()||null,max_budget:f.value,budget_duration_sec:u},B)};return e.jsx(k,{children:e.jsxs(k.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(T,{error:o}),e.jsx($,{label:"Name (optional)",value:p,onChange:c,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx($,{label:"Spending limit (USD)",value:m,onChange:s,placeholder:"100.00",description:f.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(Be,{value:u,onChange:b,onInvalidChange:v}),d?e.jsx(_e,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:B,onChange:P,users:d}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:!A,onPress:C,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:h,children:"Cancel"})]})]})})}function Pe({budget:t}){if(t.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=t.total_spend;if(t.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[D(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=t.max_budget*t.user_count,o=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:D(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",D(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(o,l?100:2)}%`}})})]})}function Ae({budgetId:t}){const r=xe(t);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(Ne,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:o.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:D(o.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:q(o.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:q(o.next_reset_at)})]},o.id))})]})})}function Ee({label:t,isPending:r,onConfirm:a}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:t}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}const ke=t=>t.budget_id;function Q(t){return t.split("-")[0]}function z(t){return t.name??Q(t.budget_id)}function Te(){const t=ae(),r=re(),a=le(),o=ie(),l=oe(),g=de(),[h,d]=i.useState(!1),[p,c]=i.useState(null),[m,s]=i.useState(null),[u,b]=i.useState(null),[S,v]=i.useState(null),[B,P]=i.useState(!1),f=ge(),[A,C]=i.useState(!1),[X,F]=i.useState(void 0),[J,H]=i.useState(!1),w=t.data??[],K=t.isLoading,y=w.find(n=>n.budget_id===p)??null,U=w.find(n=>n.budget_id===m)??null,L=!K&&w.length===0&&!h,Z=w.map(n=>n.budget_id),_=he(f.selectedKeys,Z),ee=async()=>{H(!0),F(void 0);try{for(const n of _)await l.mutateAsync(n);f.clear(),C(!1)}catch(n){F(n)}finally{H(!1)}},te=i.useMemo(()=>[{id:"budget",header:"Budget",isRowHeader:!0,cell:n=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:Q(n.budget_id)})]})},{id:"limit",header:"Limit (per user)",cell:n=>n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):D(n.max_budget)},{id:"reset",header:"Reset",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:we(n.budget_duration_sec)})},{id:"users",header:"Users",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:n.user_count})},{id:"usage",header:"Usage",cell:n=>e.jsx(Pe,{budget:n})},{id:"actions",header:"Actions",align:"end",cell:n=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(N=>N===n.budget_id?null:n.budget_id),children:m===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{d(!1),c(n.budget_id)},children:"Edit"}),e.jsx(Ee,{label:z(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})}],[m,l.isPending,l.mutate]),V=async(n,N)=>{P(!0),b(null);const I=await Promise.allSettled(N.map(M=>g.mutateAsync({id:M,body:{budget_id:n}})));P(!1);const R=I.flatMap((M,ne)=>M.status==="rejected"?[N[ne]]:[]);if(R.length>0){v({budgetId:n,userIds:R}),b(new Error(`Budget created, but could not assign it to: ${R.join(", ")}. Retry to try again.`));return}v(null),d(!1)},se=(n,N)=>{if(S){V(S.budgetId,S.userIds);return}b(null),a.mutate(n,{onSuccess:async I=>{if(N.length>0){await V(I.budget_id,N);return}d(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ue,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:h||L?null:e.jsx(x,{variant:"primary",onPress:()=>{c(null),b(null),v(null),d(!0)},children:"Create budget"})}),e.jsx(T,{error:t.error??a.error??o.error??l.error??g.error}),e.jsx(ce,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),L?e.jsx(me,{title:"No budgets yet",description:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit.",actionLabel:"Create your first budget",onAction:()=>{c(null),b(null),v(null),d(!0)}}):null,h?e.jsx(G,{title:"Create budget",submitLabel:S?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??u,isPending:a.isPending||B,assignUsers:r.data??[],onSubmit:se,onClose:()=>{b(null),v(null),d(!1)}}):null,y?e.jsx(G,{title:`Edit budget ${z(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:o.error,isPending:o.isPending,onSubmit:n=>o.mutate({id:y.budget_id,body:n},{onSuccess:()=>c(null)}),onClose:()=>c(null)},y.budget_id):null,_.length>0?e.jsx(pe,{selectedCount:_.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:f.clear,children:e.jsx(x,{size:"sm",variant:"danger",onPress:()=>C(!0),children:"Delete"})}):null,L?null:e.jsx(be,{ariaLabel:"Budgets",columns:te,rows:w,getRowKey:ke,isLoading:K,emptyContent:"No budgets yet. Create one to cap spending.",selectionMode:"multiple",selectedKeys:f.selectedKeys,onSelectionChange:f.onSelectionChange}),U?e.jsx(k,{children:e.jsxs(k.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsxs("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:["Reset history — ",z(U)]}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(null),children:"Close"})]}),e.jsx(Ae,{budgetId:U.budget_id})]})}):null,e.jsx(fe,{isOpen:A,onOpenChange:C,heading:"Delete budgets",body:`Delete ${_.length} ${_.length===1?"budget":"budgets"}? Users on ${_.length===1?"it":"them"} will no longer be capped.`,confirmLabel:"Delete",isPending:J,error:X,onConfirm:ee})]})}export{Te as BudgetsPage}; diff --git a/src/gateway/static/dashboard/assets/ConfirmDialog-NCJIhH2z.js b/src/gateway/static/dashboard/assets/ConfirmDialog-DawcDVEg.js similarity index 84% rename from src/gateway/static/dashboard/assets/ConfirmDialog-NCJIhH2z.js rename to src/gateway/static/dashboard/assets/ConfirmDialog-DawcDVEg.js index 54531e12a..9a6351c2c 100644 --- a/src/gateway/static/dashboard/assets/ConfirmDialog-NCJIhH2z.js +++ b/src/gateway/static/dashboard/assets/ConfirmDialog-DawcDVEg.js @@ -1 +1 @@ -import{j as r}from"./tanstack-query-1t81HyiD.js";import{E as j}from"./index-DsUY4UvK.js";import{A as e,B as l}from"./heroui-BI50yK5B.js";function p({isOpen:s,onOpenChange:a,heading:n,body:o,confirmLabel:t,confirmVariant:c="danger",isPending:i,error:d,onConfirm:x}){return r.jsx(e,{isOpen:s,onOpenChange:a,children:s?r.jsx(e.Backdrop,{children:r.jsx(e.Container,{placement:"center",size:"md",children:r.jsxs(e.Dialog,{children:[r.jsx(e.Header,{children:r.jsx(e.Heading,{children:n})}),r.jsxs(e.Body,{className:"flex flex-col gap-4",children:[r.jsx("div",{className:"text-sm text-[var(--otari-muted)]",children:o}),r.jsx(j,{error:d})]}),r.jsxs(e.Footer,{children:[r.jsx(l,{variant:"ghost",isDisabled:i,onPress:()=>a(!1),children:"Cancel"}),r.jsx(l,{variant:c,isPending:i,onPress:x,children:t})]})]})})}):null})}export{p as C}; +import{j as r}from"./tanstack-query-1t81HyiD.js";import{E as j}from"./index-Dhxz7Eyv.js";import{A as e,B as l}from"./heroui-DZj66Arc.js";function p({isOpen:s,onOpenChange:a,heading:n,body:o,confirmLabel:t,confirmVariant:c="danger",isPending:i,error:d,onConfirm:x}){return r.jsx(e,{isOpen:s,onOpenChange:a,children:s?r.jsx(e.Backdrop,{children:r.jsx(e.Container,{placement:"center",size:"md",children:r.jsxs(e.Dialog,{children:[r.jsx(e.Header,{children:r.jsx(e.Heading,{children:n})}),r.jsxs(e.Body,{className:"flex flex-col gap-4",children:[r.jsx("div",{className:"text-sm text-[var(--otari-muted)]",children:o}),r.jsx(j,{error:d})]}),r.jsxs(e.Footer,{children:[r.jsx(l,{variant:"ghost",isDisabled:i,onPress:()=>a(!1),children:"Cancel"}),r.jsx(l,{variant:c,isPending:i,onPress:x,children:t})]})]})})}):null})}export{p as C}; diff --git a/src/gateway/static/dashboard/assets/DataTable-Bmn_eYSV.js b/src/gateway/static/dashboard/assets/DataTable-CrQq0sYf.js similarity index 69% rename from src/gateway/static/dashboard/assets/DataTable-Bmn_eYSV.js rename to src/gateway/static/dashboard/assets/DataTable-CrQq0sYf.js index aac346265..51ab30f25 100644 --- a/src/gateway/static/dashboard/assets/DataTable-Bmn_eYSV.js +++ b/src/gateway/static/dashboard/assets/DataTable-CrQq0sYf.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as s,a as O}from"./react-dgEcD0HR.js";import{j as i,S as D,k as I}from"./heroui-BI50yK5B.js";function _({isSelected:c,isIndeterminate:a,isDisabled:o}){const[l,f]=s.useState(null);s.useEffect(()=>{l!==null&&c===l&&f(null)},[c,l]),s.useEffect(()=>{if(l===null)return;const b=setTimeout(()=>f(null),600);return()=>clearTimeout(b)},[l]);const j=l??(c||a);return t.jsx("span",{onPointerDown:()=>{o||f(!c)},className:`flex h-4 w-4 items-center justify-center rounded border transition-colors ${j?"border-[var(--otari-brand)] bg-[var(--otari-brand)] text-white":"border-[var(--otari-line)] bg-[var(--otari-surface)]"} group-data-[focus-visible]:outline-2 group-data-[focus-visible]:outline-[var(--otari-brand)]`,children:a&&l===null?t.jsx("svg",{viewBox:"0 0 24 24",className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:3,"aria-hidden":!0,children:t.jsx("line",{x1:"6",x2:"18",y1:"12",y2:"12",strokeLinecap:"round"})}):j?t.jsx("svg",{viewBox:"0 0 24 24",className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:3,"aria-hidden":!0,children:t.jsx("polyline",{points:"5 12 10 17 19 7",strokeLinecap:"round",strokeLinejoin:"round"})}):null})}function $({ariaLabel:c}){return t.jsx(I,{slot:"selection","aria-label":c,className:"group inline-flex items-center",children:({isSelected:a,isIndeterminate:o,isDisabled:l})=>t.jsx(_,{isSelected:a,isIndeterminate:o,isDisabled:l})})}const B=44;function A({ariaLabel:c,columns:a,rows:o,getRowKey:l,isLoading:f=!1,emptyContent:j="No rows.",selectionMode:b="none",selectedKeys:m,onSelectionChange:P,disabledKeys:W,sortDescriptor:w,onSortChange:z,onRowAction:h,rowClassName:g,resizable:N=!1,detailKey:d=null,renderDetail:x}){const v=b==="multiple",q=N?i.ResizableContainer:i.ScrollContainer,E=a.length+(v?1:0),C=s.useRef(null),[L,y]=s.useState(null),S=s.useMemo(()=>d!=null&&x?o.find(e=>l(e)===d)??null:null,[d,x,o,l]);s.useLayoutEffect(()=>{y(null);const e=C.current;if(!e||d==null||!S)return;const r=document.createElement("tr");r.className="otari-detail-row",r.setAttribute("role","presentation");const n=document.createElement("td");n.colSpan=E,r.appendChild(n);const p=()=>{const T=e.querySelector(`tbody tr[data-key="${CSS.escape(d)}"]`);if(!T)return!1;for(const M of e.querySelectorAll(".otari-detail-opening"))M.classList.remove("otari-detail-opening");return T.after(r),y(n),!0};let u=null;return p()||(u=new MutationObserver(()=>{p()&&(u==null||u.disconnect(),u=null)}),u.observe(e,{childList:!0,subtree:!0})),()=>{u==null||u.disconnect(),r.remove()}},[d,S,E,o,w]);const H=s.useCallback(e=>{var r;if(h){if(x&&e!==d){const n=(r=C.current)==null?void 0:r.querySelector(`tbody tr[data-key="${CSS.escape(e)}"]`);n==null||n.classList.add("otari-detail-opening"),setTimeout(()=>n==null?void 0:n.classList.remove("otari-detail-opening"),1500)}h(e)}},[h,x,d]),k=s.useCallback(e=>{var p;if(!h||!(m==="all"||m instanceof Set&&m.size>0))return null;const n=e.target instanceof Element?e.target:null;return!n||n.closest("label[slot=selection], button, a, input, select, textarea, .otari-detail-row")?null:((p=n.closest("tbody tr[data-key]"))==null?void 0:p.getAttribute("data-key"))??null},[h,m]),R=s.useCallback(e=>{const r=l(e);return t.jsxs(i.Row,{id:r,className:g==null?void 0:g(e),children:[v?t.jsx(i.Cell,{children:t.jsx($,{ariaLabel:"Select row"})}):null,a.map(n=>t.jsx(i.Cell,{className:n.align==="end"?"text-right tabular-nums":void 0,children:n.cell(e)},n.id))]},r)},[l,g,v,a]);return t.jsxs(i.Root,{ref:C,className:"otari-table",children:[t.jsx(q,{className:"overflow-x-auto",onPointerDownCapture:e=>{k(e)!=null&&e.stopPropagation()},onMouseDownCapture:e=>{k(e)!=null&&e.stopPropagation()},onClickCapture:e=>{const r=k(e);r!=null&&(e.stopPropagation(),H(r))},children:t.jsxs(i.Content,{"aria-label":c,className:"w-full text-sm",selectionMode:b,selectionBehavior:"toggle",disabledBehavior:"selection",selectedKeys:m,onSelectionChange:P,disabledKeys:W,sortDescriptor:w,onSortChange:z,onRowAction:h?e=>H(String(e)):void 0,children:[t.jsxs(i.Header,{children:[v?t.jsx(i.Column,{width:B,minWidth:B,children:t.jsx($,{ariaLabel:"Select all rows"})}):null,a.map(e=>t.jsx(i.Column,{id:e.id,isRowHeader:e.isRowHeader,allowsSorting:e.allowsSorting,width:e.width,minWidth:e.minWidth,className:e.align==="end"?"text-right":void 0,children:({sortDirection:r})=>t.jsxs("div",{className:`flex items-center gap-1 ${e.align==="end"?"justify-end":""}`,children:[e.allowsSorting?t.jsx(i.SortableColumnHeader,{sortDirection:r,children:e.header}):t.jsx("span",{children:e.header}),N?t.jsx(i.ColumnResizer,{className:"ml-auto cursor-col-resize px-1"}):null]})},e.id))]}),t.jsx(i.Body,{items:f&&o.length===0?[]:o,dependencies:[R],renderEmptyState:()=>t.jsx("div",{className:"px-4 py-10 text-center text-[var(--otari-muted)]",children:f?t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(D,{size:"sm"})," Loading…"]}):j}),children:R})]})}),L&&S&&x?O.createPortal(t.jsx("div",{className:"otari-detail-reveal",children:t.jsx("div",{children:x(S)})}),L):null]})}export{A as D}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as s,a as O}from"./react-dgEcD0HR.js";import{h as i,S as D,$ as I}from"./heroui-DZj66Arc.js";function _({isSelected:c,isIndeterminate:a,isDisabled:o}){const[l,f]=s.useState(null);s.useEffect(()=>{l!==null&&c===l&&f(null)},[c,l]),s.useEffect(()=>{if(l===null)return;const j=setTimeout(()=>f(null),600);return()=>clearTimeout(j)},[l]);const b=l??(c||a);return t.jsx("span",{onPointerDown:()=>{o||f(!c)},className:`flex h-4 w-4 items-center justify-center rounded border transition-colors ${b?"border-[var(--otari-brand)] bg-[var(--otari-brand)] text-white":"border-[var(--otari-line)] bg-[var(--otari-surface)]"} group-data-[focus-visible]:outline-2 group-data-[focus-visible]:outline-[var(--otari-brand)]`,children:a&&l===null?t.jsx("svg",{viewBox:"0 0 24 24",className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:3,"aria-hidden":!0,children:t.jsx("line",{x1:"6",x2:"18",y1:"12",y2:"12",strokeLinecap:"round"})}):b?t.jsx("svg",{viewBox:"0 0 24 24",className:"h-3 w-3",fill:"none",stroke:"currentColor",strokeWidth:3,"aria-hidden":!0,children:t.jsx("polyline",{points:"5 12 10 17 19 7",strokeLinecap:"round",strokeLinejoin:"round"})}):null})}function T({ariaLabel:c}){return t.jsx(I,{slot:"selection","aria-label":c,className:"group inline-flex items-center",children:({isSelected:a,isIndeterminate:o,isDisabled:l})=>t.jsx(_,{isSelected:a,isIndeterminate:o,isDisabled:l})})}const B=44;function A({ariaLabel:c,columns:a,rows:o,getRowKey:l,isLoading:f=!1,emptyContent:b="No rows.",selectionMode:j="none",selectedKeys:m,onSelectionChange:P,disabledKeys:W,sortDescriptor:w,onSortChange:z,onRowAction:h,rowClassName:g,resizable:N=!1,detailKey:d=null,renderDetail:x}){const v=j==="multiple",q=N?i.ResizableContainer:i.ScrollContainer,E=a.length+(v?1:0),C=s.useRef(null),[L,$]=s.useState(null),S=s.useMemo(()=>d!=null&&x?o.find(e=>l(e)===d)??null:null,[d,x,o,l]);s.useLayoutEffect(()=>{$(null);const e=C.current;if(!e||d==null||!S)return;const r=document.createElement("tr");r.className="otari-detail-row",r.setAttribute("role","presentation");const n=document.createElement("td");n.colSpan=E,r.appendChild(n);const p=()=>{const R=e.querySelector(`tbody tr[data-key="${CSS.escape(d)}"]`);if(!R)return!1;for(const M of e.querySelectorAll(".otari-detail-opening"))M.classList.remove("otari-detail-opening");return R.after(r),$(n),!0};let u=null;return p()||(u=new MutationObserver(()=>{p()&&(u==null||u.disconnect(),u=null)}),u.observe(e,{childList:!0,subtree:!0})),()=>{u==null||u.disconnect(),r.remove()}},[d,S,E,o,w]);const y=s.useCallback(e=>{var r;if(h){if(x&&e!==d){const n=(r=C.current)==null?void 0:r.querySelector(`tbody tr[data-key="${CSS.escape(e)}"]`);n==null||n.classList.add("otari-detail-opening"),setTimeout(()=>n==null?void 0:n.classList.remove("otari-detail-opening"),1500)}h(e)}},[h,x,d]),k=s.useCallback(e=>{var p;if(!h||!(m==="all"||m instanceof Set&&m.size>0))return null;const n=e.target instanceof Element?e.target:null;return!n||n.closest("label[slot=selection], button, a, input, select, textarea, .otari-detail-row")?null:((p=n.closest("tbody tr[data-key]"))==null?void 0:p.getAttribute("data-key"))??null},[h,m]),H=s.useCallback(e=>{const r=l(e);return t.jsxs(i.Row,{id:r,className:g==null?void 0:g(e),children:[v?t.jsx(i.Cell,{children:t.jsx(T,{ariaLabel:"Select row"})}):null,a.map(n=>t.jsx(i.Cell,{className:n.align==="end"?"text-right tabular-nums":void 0,children:n.cell(e)},n.id))]},r)},[l,g,v,a]);return t.jsxs(i.Root,{ref:C,className:"otari-table",children:[t.jsx(q,{className:"overflow-x-auto",onPointerDownCapture:e=>{k(e)!=null&&e.stopPropagation()},onMouseDownCapture:e=>{k(e)!=null&&e.stopPropagation()},onClickCapture:e=>{const r=k(e);r!=null&&(e.stopPropagation(),y(r))},children:t.jsxs(i.Content,{"aria-label":c,className:"w-full text-sm",selectionMode:j,selectionBehavior:"toggle",disabledBehavior:"selection",selectedKeys:m,onSelectionChange:P,disabledKeys:W,sortDescriptor:w,onSortChange:z,onRowAction:h?e=>y(String(e)):void 0,children:[t.jsxs(i.Header,{children:[v?t.jsx(i.Column,{width:B,minWidth:B,children:t.jsx(T,{ariaLabel:"Select all rows"})}):null,a.map(e=>t.jsx(i.Column,{id:e.id,isRowHeader:e.isRowHeader,allowsSorting:e.allowsSorting,width:e.width,minWidth:e.minWidth,className:e.align==="end"?"text-right":void 0,children:({sortDirection:r})=>t.jsxs("div",{className:`flex items-center gap-1 ${e.align==="end"?"justify-end":""}`,children:[e.allowsSorting?t.jsx(i.SortableColumnHeader,{sortDirection:r,children:e.header}):t.jsx("span",{children:e.header}),N?t.jsx(i.ColumnResizer,{className:"ml-auto cursor-col-resize px-1"}):null]})},e.id))]}),t.jsx(i.Body,{items:f&&o.length===0?[]:o,dependencies:[H],renderEmptyState:()=>t.jsx("div",{className:"px-4 py-10 text-center text-[var(--otari-muted)]",children:f?t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(D,{size:"sm"})," Loading…"]}):b}),children:H})]})}),L&&S&&x?O.createPortal(t.jsx("div",{className:"otari-detail-reveal",children:t.jsx("div",{children:x(S)})}),L):null]})}export{A as D}; diff --git a/src/gateway/static/dashboard/assets/DocsPage-LBlDxv2S.js b/src/gateway/static/dashboard/assets/DocsPage-CgRlIVtI.js similarity index 99% rename from src/gateway/static/dashboard/assets/DocsPage-LBlDxv2S.js rename to src/gateway/static/dashboard/assets/DocsPage-CgRlIVtI.js index 5d9136b48..9db36ff75 100644 --- a/src/gateway/static/dashboard/assets/DocsPage-LBlDxv2S.js +++ b/src/gateway/static/dashboard/assets/DocsPage-CgRlIVtI.js @@ -1,4 +1,4 @@ -import{j as re}from"./tanstack-query-1t81HyiD.js";import{P as gi}from"./index-DsUY4UvK.js";import{d as ct}from"./heroui-BI50yK5B.js";import{g as nr}from"./react-dgEcD0HR.js";function yi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi={};function ht(e,t){return(bi.jsx?xi:ki).test(e)}const wi=/[ \t\n\f\r]/g;function Si(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(wi,"")===""}class Ke{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function tr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ke(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ci=0;const L=Te(),Y=Te(),Dn=Te(),E=Te(),$=Te(),Ie=Te(),te=Te();function Te(){return 2**++Ci}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:Ie,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ai.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Di);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Ti,zi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function zi(e){return"-"+e.toLowerCase()}function Di(e){return e.charAt(1).toUpperCase()}const Li=tr([rr,Ei,or,ar,sr],"html"),qn=tr([rr,Ii,or,ar,sr],"svg");function _i(e){return e.join(" ").trim()}var De={},mn,dt;function Ri(){if(dt)return mn;dt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=` +import{j as re}from"./tanstack-query-1t81HyiD.js";import{P as gi}from"./index-Dhxz7Eyv.js";import{d as ct}from"./heroui-DZj66Arc.js";import{g as nr}from"./react-dgEcD0HR.js";function yi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi={};function ht(e,t){return(bi.jsx?xi:ki).test(e)}const wi=/[ \t\n\f\r]/g;function Si(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(wi,"")===""}class Ke{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function tr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ke(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ci=0;const L=Te(),Y=Te(),Dn=Te(),E=Te(),$=Te(),Ie=Te(),te=Te();function Te(){return 2**++Ci}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:Ie,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ai.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Di);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Ti,zi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function zi(e){return"-"+e.toLowerCase()}function Di(e){return e.charAt(1).toUpperCase()}const Li=tr([rr,Ei,or,ar,sr],"html"),qn=tr([rr,Ii,or,ar,sr],"svg");function _i(e){return e.join(" ").trim()}var De={},mn,dt;function Ri(){if(dt)return mn;dt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=` `,u="/",h="*",c="",p="comment",f="declaration";function g(S,y){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];y=y||{};var I=1,C=1;function R(D){var T=D.match(t);T&&(I+=T.length);var U=D.lastIndexOf(s);C=~U?D.length-U:C+D.length}function F(){var D={line:I,column:C};return function(T){return T.position=new b(D),j(),T}}function b(D){this.start=D,this.end={line:I,column:C},this.source=y.source}b.prototype.content=S;function M(D){var T=new Error(y.source+":"+I+":"+C+": "+D);if(T.reason=D,T.filename=y.source,T.line=I,T.column=C,T.source=S,!y.silent)throw T}function H(D){var T=D.exec(S);if(T){var U=T[0];return R(U),S=S.slice(U.length),T}}function j(){H(n)}function k(D){var T;for(D=D||[];T=A();)T!==!1&&D.push(T);return D}function A(){var D=F();if(!(u!=S.charAt(0)||h!=S.charAt(1))){for(var T=2;c!=S.charAt(T)&&(h!=S.charAt(T)||u!=S.charAt(T+1));)++T;if(T+=2,c===S.charAt(T-1))return M("End of comment missing");var U=S.slice(2,T-2);return C+=2,R(U),S=S.slice(T),C+=2,D({type:p,comment:U})}}function P(){var D=F(),T=H(r);if(T){if(A(),!H(i))return M("property missing ':'");var U=H(o),K=D({type:f,property:w(T[0].replace(e,c)),value:U?w(U[0].replace(e,c)):c});return H(l),K}}function q(){var D=[];k(D);for(var T;T=P();)T!==!1&&(D.push(T),k(D));return D}return j(),q()}function w(S){return S?S.replace(a,c):c}return mn=g,mn}var gt;function Fi(){if(gt)return De;gt=1;var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(De,"__esModule",{value:!0}),De.default=n;const t=e(Ri());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),a=typeof i=="function";return l.forEach(s=>{if(s.type!=="declaration")return;const{property:u,value:h}=s;a?i(u,h,s):h&&(o=o||{},o[u]=h)}),o}return De}var Be={},yt;function Oi(){if(yt)return Be;yt=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(u){return!u||n.test(u)||e.test(u)},l=function(u,h){return h.toUpperCase()},a=function(u,h){return"".concat(h,"-")},s=function(u,h){return h===void 0&&(h={}),o(u)?u:(u=u.toLowerCase(),h.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(t,l))};return Be.camelCase=s,Be}var je,kt;function Mi(){if(kt)return je;kt=1;var e=je&&je.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Fi()),n=Oi();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(a,s){a&&s&&(l[(0,n.camelCase)(a,o)]=s)}),l}return r.default=r,je=r,je}var Ni=Mi();const Bi=nr(Ni),ur=cr("end"),Un=cr("start");function cr(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ji(e){const t=Un(e),n=ur(e);if(t&&n)return{start:t,end:n}}function Ue(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xt(e.position):"start"in e||"end"in e?xt(e):"line"in e||"column"in e?_n(e):""}function _n(e){return bt(e&&e.line)+":"+bt(e&&e.column)}function xt(e){return _n(e&&e.start)+"-"+_n(e&&e.end)}function bt(e){return e&&typeof e=="number"?e:1}class G extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?o.ruleId=r:(o.source=r.slice(0,s),o.ruleId=r.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){const s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ue(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}G.prototype.file="";G.prototype.name="";G.prototype.reason="";G.prototype.message="";G.prototype.stack="";G.prototype.column=void 0;G.prototype.line=void 0;G.prototype.ancestors=void 0;G.prototype.cause=void 0;G.prototype.fatal=void 0;G.prototype.place=void 0;G.prototype.ruleId=void 0;G.prototype.source=void 0;const Vn={}.hasOwnProperty,Hi=new Map,qi=/[A-Z]/g,Ui=new Set(["table","tbody","thead","tfoot","tr"]),Vi=new Set(["td","th"]),hr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $i(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Zi(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ji(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qn:Li,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=fr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function fr(e,t,n){if(t.type==="element")return Wi(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Yi(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Qi(e,t,n);if(t.type==="mdxjsEsm")return Ki(e,t);if(t.type==="root")return Xi(e,t,n);if(t.type==="text")return Gi(e,t)}function Wi(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=qn,e.schema=i),e.ancestors.push(t);const o=mr(e,t.tagName,!1),l=el(e,t);let a=Wn(e,t);return Ui.has(t.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!Si(s):!0})),pr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Yi(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}We(e,t.position)}function Ki(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);We(e,t.position)}function Qi(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=qn,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:mr(e,t.name,!0),l=nl(e,t),a=Wn(e,t);return pr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Xi(e,t,n){const r={};return $n(r,Wn(e,t)),e.create(t,e.Fragment,r,n)}function Gi(e,t){return t.value}function pr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $n(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ji(e,t,n){return r;function r(i,o,l,a){const u=Array.isArray(l.children)?n:t;return a?u(o,l,a):u(o,l)}}function Zi(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),s=Un(r);return t(i,o,l,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function el(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Vn.call(t.properties,i)){const o=tl(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&Vi.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function nl(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else We(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else We(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Wn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Hi;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(ie(e,e.length,0,t),e):t}const Ct={}.hasOwnProperty;function gr(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ce(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const J=be(/[A-Za-z]/),X=be(/[\dA-Za-z]/),hl=be(/[#-'*+\--9=?A-Z^-~]/);function rn(e){return e!==null&&(e<32||e===127)}const Rn=be(/\d/),fl=be(/[\dA-Fa-f]/),pl=be(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function W(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}const sn=be(new RegExp("\\p{P}|\\p{S}","u")),ve=be(/\s/);function be(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fe(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function B(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(s){return O(s)?(e.enter(n),a(s)):t(s)}function a(s){return O(s)&&o++l))return;const M=t.events.length;let H=M,j,k;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(j){k=t.events[H][1].end;break}j=!0}for(y(r),b=M;bC;){const F=n[R];t.containerState=F[1],F[0].exit.call(t,e)}n.length=C}function I(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function kl(e,t,n){return B(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _e(e){if(e===null||W(e)||ve(e))return 1;if(sn(e))return 2}function un(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};It(c,-s),It(p,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:s>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=le(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=le(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=le(u,un(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=le(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,u=le(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,ie(e,r-1,n-r+3,u),n=r+u.length-h-2;break}}for(n=-1;++n0&&O(b)?B(e,I,"linePrefix",o+1)(b):I(b)}function I(b){return b===null||z(b)?e.check(vt,w,R)(b):(e.enter("codeFlowValue"),C(b))}function C(b){return b===null||z(b)?(e.exit("codeFlowValue"),I(b)):(e.consume(b),C)}function R(b){return e.exit("codeFenced"),t(b)}function F(b,M,H){let j=0;return k;function k(T){return b.enter("lineEnding"),b.consume(T),b.exit("lineEnding"),A}function A(T){return b.enter("codeFencedFence"),O(T)?B(b,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):P(T)}function P(T){return T===a?(b.enter("codeFencedFenceSequence"),q(T)):H(T)}function q(T){return T===a?(j++,b.consume(T),q):j>=l?(b.exit("codeFencedFenceSequence"),O(T)?B(b,D,"whitespace")(T):D(T)):H(T)}function D(T){return T===null||z(T)?(b.exit("codeFencedFence"),M(T)):H(T)}}}function zl(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const gn={name:"codeIndented",tokenize:Ll},Dl={partial:!0,tokenize:_l};function Ll(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),B(e,o,"linePrefix",5)(u)}function o(u){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?s(u):z(u)?e.attempt(Dl,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||z(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),t(u)}}function _l(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):B(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):z(l)?i(l):n(l)}}const Rl={name:"codeText",previous:Ol,resolve:Fl,tokenize:Ml};function Fl(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&He(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),He(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),He(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Sr(e,t,n,r,i,o,l,a,s){const u=s||Number.POSITIVE_INFINITY;let h=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||rn(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||z(y)?n(y):(e.consume(y),y===92?g:f)}function g(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function w(y){return!h&&(y===null||y===41||W(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):h999||f===null||f===91||f===93&&!s||f===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===null||f===91||f===93||z(f)||a++>999?(e.exit("chunkString"),h(f)):(e.consume(f),s||(s=!O(f)),f===92?p:c)}function p(f){return f===91||f===92||f===93?(e.consume(f),a++,c):c(f)}}function Er(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,s):n(p)}function s(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),s(l)):p===null?n(p):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),B(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===l||p===null||z(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:h)}function c(p){return p===l||p===92?(e.consume(p),h):h(p)}}function Ve(e,t){let n;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):O(i)?B(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const $l={name:"definition",tokenize:Yl},Wl={partial:!0,tokenize:Kl};function Yl(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),l(f)}function l(f){return Cr.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=ce(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),s):n(f)}function s(f){return W(f)?Ve(e,u)(f):u(f)}function u(f){return Sr(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function h(f){return e.attempt(Wl,c,c)(f)}function c(f){return O(f)?B(e,p,"whitespace")(f):p(f)}function p(f){return f===null||z(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function Kl(e,t,n){return r;function r(a){return W(a)?Ve(e,i)(a):n(a)}function i(a){return Er(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return O(a)?B(e,l,"whitespace")(a):l(a)}function l(a){return a===null||z(a)?t(a):n(a)}}const Ql={name:"hardBreakEscape",tokenize:Xl};function Xl(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return z(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Gl={name:"headingAtx",resolve:Jl,tokenize:Zl};function Jl(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ie(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Zl(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),o(h)}function o(h){return e.enter("atxHeadingSequence"),l(h)}function l(h){return h===35&&r++<6?(e.consume(h),l):h===null||W(h)?(e.exit("atxHeadingSequence"),a(h)):n(h)}function a(h){return h===35?(e.enter("atxHeadingSequence"),s(h)):h===null||z(h)?(e.exit("atxHeading"),t(h)):O(h)?B(e,a,"whitespace")(h):(e.enter("atxHeadingText"),u(h))}function s(h){return h===35?(e.consume(h),s):(e.exit("atxHeadingSequence"),a(h))}function u(h){return h===null||h===35||W(h)?(e.exit("atxHeadingText"),a(h)):(e.consume(h),u)}}const eo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],At=["pre","script","style","textarea"],no={concrete:!0,name:"htmlFlow",resolveTo:io,tokenize:lo},to={partial:!0,tokenize:ao},ro={partial:!0,tokenize:oo};function io(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function lo(e,t,n){const r=this;let i,o,l,a,s;return u;function u(d){return h(d)}function h(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,w):d===63?(e.consume(d),i=3,r.interrupt?t:m):J(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function p(d){return d===45?(e.consume(d),i=2,f):d===91?(e.consume(d),i=5,a=0,g):J(d)?(e.consume(d),i=4,r.interrupt?t:m):n(d)}function f(d){return d===45?(e.consume(d),r.interrupt?t:m):n(d)}function g(d){const se="CDATA[";return d===se.charCodeAt(a++)?(e.consume(d),a===se.length?r.interrupt?t:P:g):n(d)}function w(d){return J(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function S(d){if(d===null||d===47||d===62||W(d)){const se=d===47,we=l.toLowerCase();return!se&&!o&&At.includes(we)?(i=1,r.interrupt?t(d):P(d)):eo.includes(l.toLowerCase())?(i=6,se?(e.consume(d),y):r.interrupt?t(d):P(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(d):o?I(d):C(d))}return d===45||X(d)?(e.consume(d),l+=String.fromCharCode(d),S):n(d)}function y(d){return d===62?(e.consume(d),r.interrupt?t:P):n(d)}function I(d){return O(d)?(e.consume(d),I):k(d)}function C(d){return d===47?(e.consume(d),k):d===58||d===95||J(d)?(e.consume(d),R):O(d)?(e.consume(d),C):k(d)}function R(d){return d===45||d===46||d===58||d===95||X(d)?(e.consume(d),R):F(d)}function F(d){return d===61?(e.consume(d),b):O(d)?(e.consume(d),F):C(d)}function b(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),s=d,M):O(d)?(e.consume(d),b):H(d)}function M(d){return d===s?(e.consume(d),s=null,j):d===null||z(d)?n(d):(e.consume(d),M)}function H(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||W(d)?F(d):(e.consume(d),H)}function j(d){return d===47||d===62||O(d)?C(d):n(d)}function k(d){return d===62?(e.consume(d),A):n(d)}function A(d){return d===null||z(d)?P(d):O(d)?(e.consume(d),A):n(d)}function P(d){return d===45&&i===2?(e.consume(d),U):d===60&&i===1?(e.consume(d),K):d===62&&i===4?(e.consume(d),ae):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),pe):z(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(to,me,q)(d)):d===null||z(d)?(e.exit("htmlFlowData"),q(d)):(e.consume(d),P)}function q(d){return e.check(ro,D,me)(d)}function D(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),T}function T(d){return d===null||z(d)?q(d):(e.enter("htmlFlowData"),P(d))}function U(d){return d===45?(e.consume(d),m):P(d)}function K(d){return d===47?(e.consume(d),l="",oe):P(d)}function oe(d){if(d===62){const se=l.toLowerCase();return At.includes(se)?(e.consume(d),ae):P(d)}return J(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),oe):P(d)}function pe(d){return d===93?(e.consume(d),m):P(d)}function m(d){return d===62?(e.consume(d),ae):d===45&&i===2?(e.consume(d),m):P(d)}function ae(d){return d===null||z(d)?(e.exit("htmlFlowData"),me(d)):(e.consume(d),ae)}function me(d){return e.exit("htmlFlow"),t(d)}}function oo(e,t,n){const r=this;return i;function i(l){return z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ao(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Qe,t,n)}}const so={name:"htmlText",tokenize:uo};function uo(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),s}function s(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),F):m===63?(e.consume(m),C):J(m)?(e.consume(m),H):n(m)}function u(m){return m===45?(e.consume(m),h):m===91?(e.consume(m),o=0,g):J(m)?(e.consume(m),I):n(m)}function h(m){return m===45?(e.consume(m),f):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):z(m)?(l=c,K(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),f):c(m)}function f(m){return m===62?U(m):m===45?p(m):c(m)}function g(m){const ae="CDATA[";return m===ae.charCodeAt(o++)?(e.consume(m),o===ae.length?w:g):n(m)}function w(m){return m===null?n(m):m===93?(e.consume(m),S):z(m)?(l=w,K(m)):(e.consume(m),w)}function S(m){return m===93?(e.consume(m),y):w(m)}function y(m){return m===62?U(m):m===93?(e.consume(m),y):w(m)}function I(m){return m===null||m===62?U(m):z(m)?(l=I,K(m)):(e.consume(m),I)}function C(m){return m===null?n(m):m===63?(e.consume(m),R):z(m)?(l=C,K(m)):(e.consume(m),C)}function R(m){return m===62?U(m):C(m)}function F(m){return J(m)?(e.consume(m),b):n(m)}function b(m){return m===45||X(m)?(e.consume(m),b):M(m)}function M(m){return z(m)?(l=M,K(m)):O(m)?(e.consume(m),M):U(m)}function H(m){return m===45||X(m)?(e.consume(m),H):m===47||m===62||W(m)?j(m):n(m)}function j(m){return m===47?(e.consume(m),U):m===58||m===95||J(m)?(e.consume(m),k):z(m)?(l=j,K(m)):O(m)?(e.consume(m),j):U(m)}function k(m){return m===45||m===46||m===58||m===95||X(m)?(e.consume(m),k):A(m)}function A(m){return m===61?(e.consume(m),P):z(m)?(l=A,K(m)):O(m)?(e.consume(m),A):j(m)}function P(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,q):z(m)?(l=P,K(m)):O(m)?(e.consume(m),P):(e.consume(m),D)}function q(m){return m===i?(e.consume(m),i=void 0,T):m===null?n(m):z(m)?(l=q,K(m)):(e.consume(m),q)}function D(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||W(m)?j(m):(e.consume(m),D)}function T(m){return m===47||m===62||W(m)?j(m):n(m)}function U(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function K(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),oe}function oe(m){return O(m)?B(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):pe(m)}function pe(m){return e.enter("htmlTextData"),l(m)}}const Qn={name:"labelEnd",resolveAll:po,resolveTo:mo,tokenize:go},co={tokenize:yo},ho={tokenize:ko},fo={tokenize:xo};function po(e){let t=-1;const n=[];for(;++t=3&&(u===null||z(u))?(e.exit("thematicBreak"),t(u)):n(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),O(u)?B(e,a,"whitespace")(u):a(u))}}const Z={continuation:{tokenize:Po},exit:Do,name:"list",tokenize:Ao},vo={partial:!0,tokenize:Lo},To={partial:!0,tokenize:zo};function Ao(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(f){const g=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Rn(f)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(tn,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(f)}return n(f)}function s(f){return Rn(f)&&++l<10?(e.consume(f),s):(!r.interrupt||l<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Qe,r.interrupt?n:h,e.attempt(vo,p,c))}function h(f){return r.containerState.initialBlankLine=!0,o++,p(f)}function c(f){return O(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Po(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Qe,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,B(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!O(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(To,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,B(e,e.attempt(Z,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function zo(e,t,n){const r=this;return B(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function Do(e){e.exit(this.containerState.type)}function Lo(e,t,n){const r=this;return B(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!O(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Pt={name:"setextUnderline",resolveTo:_o,tokenize:Ro};function _o(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Ro(e,t,n){const r=this;let i;return o;function o(u){let h=r.events.length,c;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){c=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),O(u)?B(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||z(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Fo={tokenize:Oo};function Oo(e){const t=this,n=e.attempt(Qe,r,e.attempt(this.parser.constructs.flowInitial,i,B(e,e.attempt(this.parser.constructs.flow,i,e.attempt(jl,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Mo={resolveAll:vr()},No=Ir("string"),Bo=Ir("text");function Ir(e){return{resolveAll:vr(e==="text"?jo:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(h){return u(h)?o(h):a(h)}function a(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),s}function s(h){return u(h)?(n.exit("data"),o(h)):(n.consume(h),s)}function u(h){if(h===null)return!0;const c=i[h];let p=-1;if(c)for(;++p-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Zo(e,t){let n=-1;const r=[];let i;for(;++n0){const ue=_.tokenStack[_.tokenStack.length-1];(ue[1]||Dt).call(_,void 0,ue[0])}for(v.position={start:xe(x.length>0?x[0][1].start:{line:1,column:1,offset:0}),end:xe(x.length>0?x[x.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++Vd(r=>!r),"aria-expanded":a,"aria-controls":n,children:a?"Done":"Add filter"}),s.map(r=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] py-0.5 pl-2.5 pr-1 text-xs text-[var(--otari-brand-dark)]",children:[e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[r.label,":"]}),e.jsx("span",{className:"font-medium",children:r.value}),e.jsx("button",{type:"button",onClick:r.onClear,"aria-label":`Remove ${r.label} filter`,className:"ml-0.5 inline-flex h-4 w-4 items-center justify-center rounded-full text-[var(--otari-muted)] outline-none hover:bg-[var(--otari-line)] hover:text-[var(--otari-ink)] focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)]",children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"h-3 w-3","aria-hidden":"true",children:e.jsx("path",{d:"M6 6l12 12M18 6L6 18",strokeLinecap:"round"})})})]},r.key)),s.length>0&&t?e.jsx(l,{size:"sm",variant:"ghost",onPress:t,children:"Clear all"}):null]}),e.jsx("div",{id:n,className:a?"flex flex-wrap items-end gap-3":"hidden",children:o})]})}export{u as F}; diff --git a/src/gateway/static/dashboard/assets/FilterChips-Dah6AI5Z.js b/src/gateway/static/dashboard/assets/FilterChips-Dah6AI5Z.js deleted file mode 100644 index 39389f66b..000000000 --- a/src/gateway/static/dashboard/assets/FilterChips-Dah6AI5Z.js +++ /dev/null @@ -1 +0,0 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as p}from"./react-dgEcD0HR.js";import{B as M,S as ae,$ as ne,h as se,i as ie}from"./heroui-BI50yK5B.js";import{an as oe,ao as le,ap as ce,aq as de}from"./index-DsUY4UvK.js";import{R as ue,B as me,X as xe,T as he,a as fe}from"./recharts-C4kRDmvS.js";const pe="var(--otari-brand)",ge=10,ve=22;function $(o,m){const c=new Date(o);return Number.isNaN(c.getTime())?o:m==="hour"?c.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):c.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function be({active:o,label:m,payload:c,bucket:g}){var x;const j=(x=c==null?void 0:c[0])==null?void 0:x.value;return!o||typeof j!="number"||typeof m!="string"?null:t.jsxs("div",{className:"rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-xs shadow-sm",children:[t.jsxs("div",{className:"text-[var(--otari-muted)]",children:[$(m,g)," · UTC"]}),t.jsxs("div",{className:"font-medium tabular-nums text-[var(--otari-ink)]",children:[j.toLocaleString()," requests"]})]})}const je="group top-1/2 h-full w-3 cursor-ew-resize outline-none",F=["Window start","Window end"];function W({index:o}){return t.jsxs(ie,{index:o,"aria-label":F[o],className:`${je} pointer-events-auto`,children:[t.jsx("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-1/2 w-0.5 -translate-x-1/2 bg-[var(--otari-brand)]"}),t.jsx("span",{"aria-hidden":!0,className:"absolute left-1/2 top-1/2 h-6 w-2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-surface)] shadow-sm group-focus-visible:ring-2 group-focus-visible:ring-[var(--otari-brand)]"})]})}function Pe({presets:o,extentKey:m,onPreset:c,onSelectRange:g,onSelectFull:j,series:x,bucket:l,windowStart:C,windowEnd:S,loading:K=!1,ariaLabel:_="Request volume over the selected window",action:O}){const w=x.map(e=>e.bucketStart),X=x.map(e=>({x:e.bucketStart,requests:e.requests})),r=x.length,H=oe(C,S),z=()=>{if(r===0)return[0,1];const{startIndex:e,endIndex:s}=ce(w,C,S);return[e,s+1]},[T,Z]=p.useState(z),y=p.useRef(T),v=e=>{y.current=e,Z(e)},N=p.useRef(!1);p.useEffect(()=>{N.current||v(z())},[C,S,r,w[0],w[r-1]]);const b=([e,s])=>{if(N.current=!1,r===0)return;const i=Math.max(0,Math.min(r-1,Math.floor(e+1e-6))),a=Math.max(i,Math.min(r-1,Math.ceil(s-1e-6)-1));if(i===0&&a===r-1){j(),v([0,r]);return}const n=de(w,i,a,l);n&&g(n.startIso,n.endIso)},k=o.findIndex(e=>e.key===m),B=k>=0?o[k].seconds:r*le(l)/1e3,A=k>=0?o[k+1]:o.find(e=>e.seconds===null||B!==null&&e.seconds>B),[d,u]=T,P=d<=.01&&u>=r-.01,L=e=>{const s=Math.max(1,Math.min(r,e)),i=(d+u)/2;let a=i-s/2,n=i+s/2;a<0&&(n-=a,a=0),n>r&&(a-=n-r,n=r);const f=[Math.max(0,a),Math.min(r,n)];v(f),b(f)},V=()=>{if(P){A&&c(A);return}L((u-d)*2)},G=()=>L((u-d)/2),J=(e,s)=>{const[i,a]=y.current,n=e===0?[Math.max(0,Math.min(a-1,Math.round(i)+s)),a]:[i,Math.min(r,Math.max(i+1,Math.round(a)+s))];v(n),b(n)},Q=e=>{var n,f;const s=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:0;if(s===0)return;const i=(f=(n=e.target).getAttribute)==null?void 0:f.call(n,"aria-label"),a=F.indexOf(i);a<0||(e.preventDefault(),e.stopPropagation(),J(a,s))},R=p.useRef(null),h=p.useRef(null),Y=e=>{if(!h.current||!R.current)return;const s=R.current.getBoundingClientRect().width;if(s<=0)return;const i=(e.clientX-h.current.x)/s*r,a=h.current.sel[1]-h.current.sel[0],n=Math.max(0,Math.min(r-a,h.current.sel[0]+i));v([n,n+a])},ee=e=>{const[s,i]=y.current,a=i-s,n=Math.max(0,Math.min(r-a,Math.round(s)+e)),f=[n,n+a];v(f),b(f)},te=e=>{if(P)return;const[s,i]=y.current,a=Math.max(1,Math.round(i-s)),n=e.key==="ArrowRight"||e.key==="ArrowUp"?1:e.key==="ArrowLeft"||e.key==="ArrowDown"?-1:e.key==="PageUp"?a:e.key==="PageDown"?-a:e.key==="Home"?-r:e.key==="End"?r:0;n!==0&&(e.preventDefault(),ee(n))},I=r?Math.min(d,u)/r*100:0,E=r?Math.max(d,u)/r*100:100,D=!P,re=Math.max(1,Math.round(u-d)),U=Math.max(0,r-re),q=Math.min(Math.max(0,Math.round(Math.min(d,u))),U);return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.map(e=>t.jsx(M,{size:"sm",variant:m===e.key?"primary":"outline",onPress:()=>c(e),children:e.label},e.key)),t.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[t.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",H," · UTC"]}),O]})]}),t.jsxs("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-2",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[t.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:["Requests / ",l==="hour"?"hour":"day"]}),t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"hidden text-[11px] text-[var(--otari-muted)] sm:inline",children:"drag the edges to zoom · the bottom strip to pan"}),t.jsx(M,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom in",isDisabled:r===0,onPress:G,children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:t.jsx("path",{d:"M12 5v14M5 12h14",strokeLinecap:"round"})})}),t.jsx(M,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom out",isDisabled:r===0||P&&!A,onPress:V,children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:t.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})})}),D?t.jsx(M,{size:"sm",variant:"ghost",onPress:()=>b([0,r]),children:"Reset"}):null]})]}),K&&r===0?t.jsx("div",{className:"flex h-[90px] items-center justify-center",children:t.jsx(ae,{size:"sm"})}):r===0?t.jsx("div",{className:"flex h-[90px] items-center justify-center text-xs text-[var(--otari-muted)]",children:"No activity in this range."}):t.jsxs("div",{ref:R,className:"relative w-full",children:[t.jsx("div",{role:"img","aria-label":_,className:"w-full touch-pan-y select-none",children:t.jsx(ue,{width:"100%",height:90,children:t.jsxs(me,{data:X,margin:{top:4,right:0,left:0,bottom:0},children:[t.jsx(xe,{dataKey:"x",tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:40,tickFormatter:e=>$(e,l),tick:{fontSize:10,fill:"var(--otari-muted)"}}),t.jsx(he,{cursor:{fill:"var(--otari-line)",opacity:.35},content:t.jsx(be,{bucket:l})}),t.jsx(fe,{dataKey:"requests",fill:pe,radius:[2,2,0,0],isAnimationActive:!1})]})})}),D?t.jsxs(t.Fragment,{children:[t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 left-0 bg-[var(--otari-bg)] opacity-70",style:{width:`${I}%`}}),t.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 right-0 bg-[var(--otari-bg)] opacity-70",style:{width:`${100-E}%`}})]}):null,t.jsx("div",{role:"slider","aria-label":"Pan the selected window","aria-valuemin":0,"aria-valuemax":U,"aria-valuenow":q,"aria-valuetext":`Window starting at ${$(w[Math.min(q,r-1)]??w[0],l)}`,"aria-disabled":!D,tabIndex:0,className:"absolute bottom-0 z-[1] cursor-grab touch-none rounded bg-[var(--otari-brand)]/10 outline-none hover:bg-[var(--otari-brand)]/20 focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)] active:cursor-grabbing",style:{left:`${I}%`,width:`${Math.max(0,E-I)}%`,height:ve},onKeyDown:te,onPointerDown:e=>{e.stopPropagation(),e.preventDefault(),N.current=!0,h.current={x:e.clientX,sel:[Math.min(d,u),Math.max(d,u)]},e.currentTarget.setPointerCapture(e.pointerId)},onPointerMove:Y,onPointerUp:e=>{e.currentTarget.releasePointerCapture(e.pointerId),h.current=null,b(y.current)},onPointerCancel:e=>{e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),h.current=null,b(y.current)}}),t.jsx("div",{className:"pointer-events-none absolute inset-0 z-[2]",onKeyDownCapture:Q,children:t.jsx(ne,{"aria-label":"Selected time range",minValue:0,maxValue:r,step:1/ge,value:T,onChange:e=>{N.current=!0,Array.isArray(e)&&e.length===2&&v([e[0],e[1]])},onChangeEnd:e=>{Array.isArray(e)&&e.length===2&&b([e[0],e[1]])},className:"pointer-events-none h-full w-full",children:t.jsxs(se,{className:"pointer-events-none relative h-full w-full",children:[t.jsx(W,{index:0}),t.jsx(W,{index:1})]})})})]})]})]})}function Ce({chips:o,children:m,onClearAll:c}){const[g,j]=p.useState(!1),x=p.useId();return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx(M,{size:"sm",variant:"outline",onPress:()=>j(l=>!l),"aria-expanded":g,"aria-controls":x,children:g?"Done":"Add filter"}),o.map(l=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] py-0.5 pl-2.5 pr-1 text-xs text-[var(--otari-brand-dark)]",children:[t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[l.label,":"]}),t.jsx("span",{className:"font-medium",children:l.value}),t.jsx("button",{type:"button",onClick:l.onClear,"aria-label":`Remove ${l.label} filter`,className:"ml-0.5 inline-flex h-4 w-4 items-center justify-center rounded-full text-[var(--otari-muted)] outline-none hover:bg-[var(--otari-line)] hover:text-[var(--otari-ink)] focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)]",children:t.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"h-3 w-3","aria-hidden":"true",children:t.jsx("path",{d:"M6 6l12 12M18 6L6 18",strokeLinecap:"round"})})})]},l.key)),o.length>0&&c?t.jsx(M,{size:"sm",variant:"ghost",onPress:c,children:"Clear all"}):null]}),t.jsx("div",{id:x,className:g?"flex flex-wrap items-end gap-3":"hidden",children:m})]})}export{Pe as A,Ce as F}; diff --git a/src/gateway/static/dashboard/assets/KeysPage-C7uXJfSL.js b/src/gateway/static/dashboard/assets/KeysPage-HexHbKWR.js similarity index 90% rename from src/gateway/static/dashboard/assets/KeysPage-C7uXJfSL.js rename to src/gateway/static/dashboard/assets/KeysPage-HexHbKWR.js index 8761c49ca..48642a37c 100644 --- a/src/gateway/static/dashboard/assets/KeysPage-C7uXJfSL.js +++ b/src/gateway/static/dashboard/assets/KeysPage-HexHbKWR.js @@ -1,4 +1,4 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{a as J,y as U,z as Q,B as X,P as Z,E as O,w as ee,D as te,u as V,I as se}from"./index-DsUY4UvK.js";import{u as ae,r as ne,B as re}from"./tableSelection-9hV37uhu.js";import{C as ie}from"./ConfirmDialog-NCJIhH2z.js";import{D as le}from"./DataTable-Bmn_eYSV.js";import{F as A}from"./Field-Dwp6u3t8.js";import{a as F,M as q}from"./ModelScopeControl-B4eI_pm-.js";import{U as oe}from"./UserComboBox-a9wxf8eF.js";import{f as P,B as f,d as D}from"./heroui-BI50yK5B.js";function $(t){if(!t)return"—";const a=new Date(t);return Number.isNaN(a.getTime())?"—":a.toLocaleDateString()}function ce(t){if(!t)return null;const a=new Date(t).getTime();if(Number.isNaN(a))return null;const n=Math.round((a-Date.now())/1e3),r=Math.abs(n),d=[["day",86400],["hour",3600],["minute",60]],o=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[l,x]of d)if(r>=x)return o.format(Math.round(n/x),l);return o.format(n,"second")}function de(t){if(!t.expires_at)return!1;const a=new Date(t.expires_at).getTime();return!Number.isNaN(a)&&aString(r).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}T${n(a.getHours())}:${n(a.getMinutes())}`}const me=t=>(t??"").startsWith("apikey-"),M=t=>t.key_name??t.id,xe=t=>t.id;function K({label:t,value:a,multiline:n=!1,fieldRef:r}){const d=i.useRef(null),o=r??d,[l,x]=i.useState(!1),[g,p]=i.useState(!1),c=async()=>{var m,y,h;(m=o.current)==null||m.focus(),(y=o.current)==null||y.select();try{if((h=navigator.clipboard)!=null&&h.writeText){await navigator.clipboard.writeText(a),x(!0),p(!1),window.setTimeout(()=>x(!1),2e3);return}}catch{}p(!0)},u="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(f,{size:"sm",variant:"outline",onPress:c,children:l?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:o,readOnly:!0,rows:a.split(` +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{c as Y,G as U,H as Q,J as X,P as Z,E as O,B as ee,K as te,u as V,I as se}from"./index-Dhxz7Eyv.js";import{u as ae,r as ne,B as re}from"./tableSelection-CojkFPwd.js";import{C as ie}from"./ConfirmDialog-DawcDVEg.js";import{D as le}from"./DataTable-CrQq0sYf.js";import{F as A}from"./Field-DEJ6Wjg9.js";import{a as F,M as q}from"./ModelScopeControl-Bs976Tb8.js";import{U as oe}from"./UserComboBox-nt7pHfqn.js";import{f as P,B as f,d as D}from"./heroui-DZj66Arc.js";function $(t){if(!t)return"—";const a=new Date(t);return Number.isNaN(a.getTime())?"—":a.toLocaleDateString()}function ce(t){if(!t)return null;const a=new Date(t).getTime();if(Number.isNaN(a))return null;const n=Math.round((a-Date.now())/1e3),r=Math.abs(n),d=[["day",86400],["hour",3600],["minute",60]],o=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[l,x]of d)if(r>=x)return o.format(Math.round(n/x),l);return o.format(n,"second")}function de(t){if(!t.expires_at)return!1;const a=new Date(t.expires_at).getTime();return!Number.isNaN(a)&&aString(r).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}T${n(a.getHours())}:${n(a.getMinutes())}`}const me=t=>(t??"").startsWith("apikey-"),K=t=>t.key_name??t.id,xe=t=>t.id;function M({label:t,value:a,multiline:n=!1,fieldRef:r}){const d=i.useRef(null),o=r??d,[l,x]=i.useState(!1),[g,p]=i.useState(!1),c=async()=>{var m,y,h;(m=o.current)==null||m.focus(),(y=o.current)==null||y.select();try{if((h=navigator.clipboard)!=null&&h.writeText){await navigator.clipboard.writeText(a),x(!0),p(!1),window.setTimeout(()=>x(!1),2e3);return}}catch{}p(!0)},u="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(f,{size:"sm",variant:"outline",onPress:c,children:l?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:o,readOnly:!0,rows:a.split(` `).length,value:a,onFocus:m=>m.currentTarget.select(),className:`${u} resize-none whitespace-pre`}):e.jsx("input",{ref:o,readOnly:!0,value:a,onFocus:m=>m.currentTarget.select(),className:u}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-green-700",children:l?"Copied to clipboard.":""}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function he({title:t,result:a,onClose:n}){const r=i.useRef(null),d=i.useRef(null),o=typeof window<"u"?window.location.origin:"",l=a.key;i.useEffect(()=>{var c,u;(c=d.current)==null||c.focus(),(u=d.current)==null||u.select()},[]);const x=c=>{var h;if(c.key!=="Tab")return;const u=(h=r.current)==null?void 0:h.querySelectorAll('button, input, textarea, a[href], [tabindex]:not([tabindex="-1"])');if(!u||u.length===0)return;const m=u[0],y=u[u.length-1];c.shiftKey&&document.activeElement===m?(c.preventDefault(),y.focus()):!c.shiftKey&&document.activeElement===y&&(c.preventDefault(),m.focus())},g=[`curl ${o}/v1/chat/completions \\`,` -H "Otari-Key: ${l}" \\`,' -H "Content-Type: application/json" \\',` -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'`].join(` `),p=["from openai import OpenAI","",`client = OpenAI(base_url="${o}/v1", api_key="${l}")`,"resp = client.chat.completions.create(",' model="your-model",',' messages=[{"role": "user", "content": "Hello"}],',")","print(resp.choices[0].message.content)"].join(` -`);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:x,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(se,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",F(a.allowed_models).text,"."]}),e.jsx(K,{label:"Secret key",value:l,fieldRef:d}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(K,{label:"curl",value:g,multiline:!0}),e.jsx(K,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(f,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function H({trigger:t,message:a,confirmLabel:n,isPending:r,onConfirm:d}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:a}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(f,{size:"sm",variant:"danger",isDisabled:r,onPress:d,children:n}),e.jsx(f,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(f,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:t})}function W({userId:t,users:a}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const r=a.find(l=>l.user_id===n);if(!r)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:d}=F(r.allowed_models),o=r.allowed_models&&r.allowed_models.length>0?r.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:d.toLowerCase()}),o?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:o}),")"]}):null,". This key inherits that, or narrows within it."]})}function Y({checked:t,onChange:a}){return e.jsxs("label",{className:"flex items-start gap-2 rounded-lg border border-[var(--otari-line)] p-3 text-sm",children:[e.jsx("input",{type:"checkbox",checked:t,onChange:n=>a(n.target.checked),className:"mt-0.5 h-4 w-4 accent-[var(--otari-brand)]","aria-label":"Exempt this key from budget"}),e.jsxs("span",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:"Exempt from budget"}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Requests on this key are logged with their cost but never counted toward the owner's budget or spend, and never blocked by it."})]})]})}function fe({onClose:t,onCreated:a}){const n=te(),r=V(),[d,o]=i.useState(""),[l,x]=i.useState(""),[g,p]=i.useState(!1),[c,u]=i.useState(""),[m,y]=i.useState(null),[h,N]=i.useState(!1),[v,I]=i.useState(!0),C=l!==""&&new Date(l).getTime(){if(n.isPending||!v||w)return;const b={key_name:d.trim()||null,user_id:c.trim(),expires_at:l?new Date(l).toISOString():null,allowed_models:m,exclude_from_budget:h};n.mutate(b,{onSuccess:j=>{a(j),t()}})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(A,{label:"Expires (optional)",value:l,onChange:x,type:"datetime-local",description:C?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(oe,{value:c,onChange:u,users:r.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(b=>!b),children:g?"Hide advanced":"Advanced"}),g?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(W,{userId:c,users:r.data??[]}),e.jsx(q,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(b,j)=>{y(b),I(j)}}),e.jsx(Y,{checked:h,onChange:N})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!v||w,onPress:S,children:n.isPending?"Creating…":"Create key"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ge({apiKey:t,onClose:a}){const n=U(),r=V(),[d,o]=i.useState(t.key_name??""),[l,x]=i.useState(ue(t.expires_at)),[g,p]=i.useState(t.allowed_models),[c,u]=i.useState(t.exclude_from_budget),[m,y]=i.useState(!0),h=()=>{n.isPending||!m||n.mutate({id:t.id,body:{key_name:d.trim()||null,expires_at:l?new Date(l).toISOString():null,allowed_models:g,exclude_from_budget:c}},{onSuccess:a})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot"}),e.jsx(A,{label:"Expires",value:l,onChange:x,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(W,{userId:t.user_id,users:r.data??[]}):null,e.jsx(q,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(N,v)=>{p(N),y(v)}}),e.jsx(Y,{checked:c,onChange:u}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!m,onPress:h,children:n.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function pe({apiKey:t}){return t.is_active?de(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function ye({allowed:t}){const{text:a,tone:n}=F(t),r=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",d=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${r}`,title:d,children:a})}function Ae(){const t=J(),a=U(),n=Q(),r=X(),[d,o]=i.useState(!1),[l,x]=i.useState(null),[g,p]=i.useState(null),c=t.data??[],u=t.isLoading,m=c.find(s=>s.id===l)??null,y=!u&&c.length===0&&!d,h=ae(),[N,v]=i.useState(!1),[I,C]=i.useState(void 0),[w,S]=i.useState(!1),b=c.map(s=>s.id),j=ne(h.selectedKeys,b),E=c.filter(s=>j.includes(s.id)),z=i.useCallback((s,k)=>a.mutate({id:s.id,body:{is_active:k}}),[a.mutate]),L=i.useCallback(s=>n.mutate(s.id,{onSuccess:k=>p({title:`New secret for ${M(s)}`,result:k})}),[n.mutate]),R=async(s,k,T)=>{S(!0),C(void 0);try{for(const B of s)await k(B);h.clear(),T==null||T()}catch(B){C(B)}finally{S(!1)}},G=i.useMemo(()=>[{id:"name",header:"Name",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:s.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx(ye,{allowed:s.allowed_models}),s.exclude_from_budget?e.jsx("span",{className:"inline-flex items-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] px-2 py-0.5 text-xs font-medium text-[var(--otari-brand-dark)]",title:"Requests on this key are logged with cost but never counted toward budget",children:"Budget-exempt"}):null]})]})},{id:"status",header:"Status",cell:s=>e.jsx(pe,{apiKey:s})},{id:"owner",header:"Owner",cell:s=>me(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.user_id??"—"})},{id:"key",header:"Key",cell:s=>e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.key_prefix?`${s.key_prefix}…`:"—"})},{id:"created",header:"Created",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:$(s.created_at)})},{id:"last_used",header:"Last used",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:ce(s.last_used_at)??"never"})},{id:"expires",header:"Expires",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.expires_at?new Date(s.expires_at).toLocaleString():void 0,children:s.expires_at?$(s.expires_at):"never"})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:a.isPending,onPress:()=>z(s,!s.is_active),children:s.is_active?"Disable":"Enable"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{o(!1),x(s.id)},children:"Edit"}),e.jsx(H,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:M(s)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>L(s)}),s.is_active?null:e.jsx(H,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:r.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:M(s)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>r.mutate(s.id)})]})}],[a.isPending,n.isPending,r.isPending,r.mutate,z,L]),_=E.filter(s=>!s.is_active);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:d?null:e.jsx(f,{variant:"primary",onPress:()=>{x(null),o(!0)},children:"Create key"})}),e.jsx(O,{error:t.error??a.error??n.error??r.error}),y?e.jsx(ee,{title:"No API keys yet",description:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe.",actionLabel:"Create your first key",onAction:()=>{x(null),o(!0)}}):null,d?e.jsx(fe,{onClose:()=>o(!1),onCreated:s=>p({title:"API key created",result:s})}):null,m?e.jsx(ge,{apiKey:m,onClose:()=>x(null)},m.id):null,j.length>0?e.jsxs(re,{selectedCount:j.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:h.clear,children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{is_active:!1}})),children:"Disable"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{exclude_from_budget:!0}})),children:"Budget-exempt"}),e.jsx(f,{size:"sm",variant:"danger",isDisabled:_.length===0,onPress:()=>v(!0),children:"Delete"})]}):null,y?null:e.jsx(le,{ariaLabel:"API keys",columns:G,rows:c,getRowKey:xe,isLoading:u,emptyContent:"No API keys yet. Create one to authenticate a caller.",selectionMode:"multiple",selectedKeys:h.selectedKeys,onSelectionChange:h.onSelectionChange}),e.jsx(ie,{isOpen:N,onOpenChange:v,heading:"Delete API keys",body:`Permanently delete ${_.length} disabled ${_.length===1?"key":"keys"}? This removes them and unlinks their usage history. Cannot be undone. Active keys in the selection are skipped; disable them first.`,confirmLabel:"Delete permanently",isPending:w,error:I,onConfirm:()=>void R(_,s=>r.mutateAsync(s.id),()=>v(!1))}),g?e.jsx(he,{title:g.title,result:g.result,onClose:()=>{p(null),n.reset()}}):null]})}export{Ae as KeysPage}; +`);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:x,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(se,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",F(a.allowed_models).text,"."]}),e.jsx(M,{label:"Secret key",value:l,fieldRef:d}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(M,{label:"curl",value:g,multiline:!0}),e.jsx(M,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(f,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function H({trigger:t,message:a,confirmLabel:n,isPending:r,onConfirm:d}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:a}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(f,{size:"sm",variant:"danger",isDisabled:r,onPress:d,children:n}),e.jsx(f,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(f,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:t})}function G({userId:t,users:a}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const r=a.find(l=>l.user_id===n);if(!r)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:d}=F(r.allowed_models),o=r.allowed_models&&r.allowed_models.length>0?r.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:d.toLowerCase()}),o?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:o}),")"]}):null,". This key inherits that, or narrows within it."]})}function J({checked:t,onChange:a}){return e.jsxs("label",{className:"flex items-start gap-2 rounded-lg border border-[var(--otari-line)] p-3 text-sm",children:[e.jsx("input",{type:"checkbox",checked:t,onChange:n=>a(n.target.checked),className:"mt-0.5 h-4 w-4 accent-[var(--otari-brand)]","aria-label":"Exempt this key from budget"}),e.jsxs("span",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:"Exempt from budget"}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Requests on this key are logged with their cost but never counted toward the owner's budget or spend, and never blocked by it."})]})]})}function fe({onClose:t,onCreated:a}){const n=te(),r=V(),[d,o]=i.useState(""),[l,x]=i.useState(""),[g,p]=i.useState(!1),[c,u]=i.useState(""),[m,y]=i.useState(null),[h,N]=i.useState(!1),[v,I]=i.useState(!0),C=l!==""&&new Date(l).getTime(){if(n.isPending||!v||w)return;const b={key_name:d.trim()||null,user_id:c.trim(),expires_at:l?new Date(l).toISOString():null,allowed_models:m,exclude_from_budget:h};n.mutate(b,{onSuccess:j=>{a(j),t()}})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(A,{label:"Expires (optional)",value:l,onChange:x,type:"datetime-local",description:C?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(oe,{value:c,onChange:u,users:r.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(b=>!b),children:g?"Hide advanced":"Advanced"}),g?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(G,{userId:c,users:r.data??[]}),e.jsx(q,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(b,j)=>{y(b),I(j)}}),e.jsx(J,{checked:h,onChange:N})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!v||w,onPress:S,children:n.isPending?"Creating…":"Create key"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ge({apiKey:t,onClose:a}){const n=U(),r=V(),[d,o]=i.useState(t.key_name??""),[l,x]=i.useState(ue(t.expires_at)),[g,p]=i.useState(t.allowed_models),[c,u]=i.useState(t.exclude_from_budget),[m,y]=i.useState(!0),h=()=>{n.isPending||!m||n.mutate({id:t.id,body:{key_name:d.trim()||null,expires_at:l?new Date(l).toISOString():null,allowed_models:g,exclude_from_budget:c}},{onSuccess:a})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot"}),e.jsx(A,{label:"Expires",value:l,onChange:x,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(G,{userId:t.user_id,users:r.data??[]}):null,e.jsx(q,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(N,v)=>{p(N),y(v)}}),e.jsx(J,{checked:c,onChange:u}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!m,onPress:h,children:n.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function pe({apiKey:t}){return t.is_active?de(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function ye({allowed:t}){const{text:a,tone:n}=F(t),r=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",d=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${r}`,title:d,children:a})}function Ae(){const t=Y(),a=U(),n=Q(),r=X(),[d,o]=i.useState(!1),[l,x]=i.useState(null),[g,p]=i.useState(null),c=t.data??[],u=t.isLoading,m=c.find(s=>s.id===l)??null,y=!u&&c.length===0&&!d,h=ae(),[N,v]=i.useState(!1),[I,C]=i.useState(void 0),[w,S]=i.useState(!1),b=c.map(s=>s.id),j=ne(h.selectedKeys,b),E=c.filter(s=>j.includes(s.id)),z=i.useCallback((s,k)=>a.mutate({id:s.id,body:{is_active:k}}),[a.mutate]),L=i.useCallback(s=>n.mutate(s.id,{onSuccess:k=>p({title:`New secret for ${K(s)}`,result:k})}),[n.mutate]),R=async(s,k,T)=>{S(!0),C(void 0);try{for(const B of s)await k(B);h.clear(),T==null||T()}catch(B){C(B)}finally{S(!1)}},W=i.useMemo(()=>[{id:"name",header:"Name",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:s.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx(ye,{allowed:s.allowed_models}),s.exclude_from_budget?e.jsx("span",{className:"inline-flex items-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] px-2 py-0.5 text-xs font-medium text-[var(--otari-brand-dark)]",title:"Requests on this key are logged with cost but never counted toward budget",children:"Budget-exempt"}):null]})]})},{id:"status",header:"Status",cell:s=>e.jsx(pe,{apiKey:s})},{id:"owner",header:"Owner",cell:s=>me(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.user_id??"—"})},{id:"key",header:"Key",cell:s=>e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.key_prefix?`${s.key_prefix}…`:"—"})},{id:"created",header:"Created",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:$(s.created_at)})},{id:"last_used",header:"Last used",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:ce(s.last_used_at)??"never"})},{id:"expires",header:"Expires",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.expires_at?new Date(s.expires_at).toLocaleString():void 0,children:s.expires_at?$(s.expires_at):"never"})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:a.isPending,onPress:()=>z(s,!s.is_active),children:s.is_active?"Disable":"Enable"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{o(!1),x(s.id)},children:"Edit"}),e.jsx(H,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:K(s)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>L(s)}),s.is_active?null:e.jsx(H,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:r.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:K(s)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>r.mutate(s.id)})]})}],[a.isPending,n.isPending,r.isPending,r.mutate,z,L]),_=E.filter(s=>!s.is_active);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:d?null:e.jsx(f,{variant:"primary",onPress:()=>{x(null),o(!0)},children:"Create key"})}),e.jsx(O,{error:t.error??a.error??n.error??r.error}),y?e.jsx(ee,{title:"No API keys yet",description:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe.",actionLabel:"Create your first key",onAction:()=>{x(null),o(!0)}}):null,d?e.jsx(fe,{onClose:()=>o(!1),onCreated:s=>p({title:"API key created",result:s})}):null,m?e.jsx(ge,{apiKey:m,onClose:()=>x(null)},m.id):null,j.length>0?e.jsxs(re,{selectedCount:j.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:h.clear,children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{is_active:!1}})),children:"Disable"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{exclude_from_budget:!0}})),children:"Budget-exempt"}),e.jsx(f,{size:"sm",variant:"danger",isDisabled:_.length===0,onPress:()=>v(!0),children:"Delete"})]}):null,y?null:e.jsx(le,{ariaLabel:"API keys",columns:W,rows:c,getRowKey:xe,isLoading:u,emptyContent:"No API keys yet. Create one to authenticate a caller.",selectionMode:"multiple",selectedKeys:h.selectedKeys,onSelectionChange:h.onSelectionChange}),e.jsx(ie,{isOpen:N,onOpenChange:v,heading:"Delete API keys",body:`Permanently delete ${_.length} disabled ${_.length===1?"key":"keys"}? This removes them and unlinks their usage history. Cannot be undone. Active keys in the selection are skipped; disable them first.`,confirmLabel:"Delete permanently",isPending:w,error:I,onConfirm:()=>void R(_,s=>r.mutateAsync(s.id),()=>v(!1))}),g?e.jsx(he,{title:g.title,result:g.result,onClose:()=>{p(null),n.reset()}}):null]})}export{Ae as KeysPage}; diff --git a/src/gateway/static/dashboard/assets/ModelScopeControl-B4eI_pm-.js b/src/gateway/static/dashboard/assets/ModelScopeControl-Bs976Tb8.js similarity index 85% rename from src/gateway/static/dashboard/assets/ModelScopeControl-B4eI_pm-.js rename to src/gateway/static/dashboard/assets/ModelScopeControl-Bs976Tb8.js index 4d2afafac..da616d50a 100644 --- a/src/gateway/static/dashboard/assets/ModelScopeControl-B4eI_pm-.js +++ b/src/gateway/static/dashboard/assets/ModelScopeControl-Bs976Tb8.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{T as A,l as $,m as T}from"./index-DsUY4UvK.js";import{C as d,I as P,a as R,b as V}from"./heroui-BI50yK5B.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function W({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=T(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(P,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(R,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function X(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{W as M,X as a}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{X as A,o as $,p as P}from"./index-Dhxz7Eyv.js";import{C as d,I as R,a as T,b as V}from"./heroui-DZj66Arc.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; diff --git a/src/gateway/static/dashboard/assets/ModelsPage-Dgku-JK2.js b/src/gateway/static/dashboard/assets/ModelsPage-Cwjl8fM-.js similarity index 71% rename from src/gateway/static/dashboard/assets/ModelsPage-Dgku-JK2.js rename to src/gateway/static/dashboard/assets/ModelsPage-Cwjl8fM-.js index 65f366341..652e512d0 100644 --- a/src/gateway/static/dashboard/assets/ModelsPage-Dgku-JK2.js +++ b/src/gateway/static/dashboard/assets/ModelsPage-Cwjl8fM-.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as gt,u as vt,r as c}from"./react-dgEcD0HR.js";import{G as _t,H as bt,l as jt,J as yt,K as je,P as Pt,E as Nt,F as K,I as St,L as ae,M as Re,o as we,N as be,O as Ct,Q as kt,S as E}from"./index-DsUY4UvK.js";import{u as Mt,r as Wt,B as It}from"./tableSelection-9hV37uhu.js";import{D as Tt}from"./DataTable-Bmn_eYSV.js";import{T as Lt,S as $t}from"./TablePagination-DgA36VXY.js";import{B as $,d as se,f as V}from"./heroui-BI50yK5B.js";function Oe(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function At(t,i=Date.now()){const r=new Map;for(const n of t){const l=r.get(n.model_key)??[];l.push(n),r.set(n.model_key,l)}const s=[];for(const n of r.values()){const l=[...n].sort((p,u)=>Date.parse(p.effective_at)-Date.parse(u.effective_at)),m=[...l].reverse().find(p=>Date.parse(p.effective_at)<=i);s.push(m??l[0])}return s.sort((n,l)=>n.model_key.localeCompare(l.model_key))}const Et="otari",De=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],Ot=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Fe={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Dt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],Ft=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Kt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],Bt=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Rt=1440*60*1e3,wt=t=>t.key;function Ke(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function Be(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const s=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,l)=>l.min_input_tokens-n.min_input_tokens)[0];return s?{inputPrice:s.input_price_per_million??r.inputPrice,outputPrice:s.output_price_per_million??r.outputPrice,cacheReadPrice:s.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:s.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:s.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ce(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function z(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function Y(t){return t.trim()===""?null:Number(t)}function ze(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Ve(t){const i=new Set;return t.every(r=>{const s=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(l=>l.trim()!=="");return!Number.isInteger(s)||s<=0||i.has(s)||!n?!1:(i.add(s),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(z))})}function Ye(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function b({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:s=>i(s.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function qe({tiers:t,onChange:i}){const r=(n,l,m)=>{i(t.map(p=>p.id===n?{...p,[l]:m}:p))},s=()=>{const n=t.reduce((l,m)=>Math.max(l,m.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx($,{size:"sm",variant:"outline",onPress:s,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:l=>r(n.id,"minInputTokens",l.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(b,{value:n.input,onChange:l=>r(n.id,"input",l),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(b,{value:n.output,onChange:l=>r(n.id,"output",l),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(b,{value:n.cacheRead,onChange:l=>r(n.id,"cacheRead",l),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(b,{value:n.cacheWrite,onChange:l=>r(n.id,"cacheWrite",l),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(b,{value:n.cacheWrite1h,onChange:l=>r(n.id,"cacheWrite1h",l),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(l=>l.id!==n.id)),children:"Remove"})]},n.id))]})}function zt({source:t}){return t==="configured"?e.jsx(V,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(V,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function oe({label:t,tone:i="info",children:r}){const s=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":s,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:s,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Vt(){const t=kt();return t.data?t.data.default_pricing?e.jsx(oe,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(oe,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function I({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function le({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Yt({row:t}){const i=je(),r=Re(),[s,n]=c.useState(!1),[l,m]=c.useState(""),[p,u]=c.useState(""),[P,j]=c.useState(""),[k,T]=c.useState(""),[y,h]=c.useState(""),[N,O]=c.useState([]),S=()=>{m(t.inputPrice==null?"":String(t.inputPrice)),u(t.outputPrice==null?"":String(t.outputPrice)),j(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),T(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),h(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),O(ze(t.pricingTiers)),n(!0)},X=ce(l)&&ce(p)&&z(P)&&z(k)&&z(y)&&Ve(N),W=()=>{X&&i.mutate({model_key:t.key,input_price_per_million:Number(l),output_price_per_million:Number(p),cache_read_price_per_million:Y(P),cache_write_price_per_million:Y(k),cache_write_1h_price_per_million:Y(y),pricing_tiers:Ye(N)},{onSuccess:()=>n(!1)})};return s?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(b,{value:l,onChange:m,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(b,{value:p,onChange:u,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(b,{value:P,onChange:j,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(b,{value:k,onChange:T,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(b,{value:y,onChange:h,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(qe,{tiers:N,onChange:O}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:"sm",variant:"primary",isDisabled:i.isPending||!X,onPress:W,children:"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:be(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(I,{label:"Input",value:t.inputPrice==null?"—":`${E(t.inputPrice)} / 1M`}),e.jsx(I,{label:"Output",value:t.outputPrice==null?"—":`${E(t.outputPrice)} / 1M`}),e.jsx(I,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${E(t.cacheReadPrice)} / 1M`}),e.jsx(I,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${E(t.cacheWritePrice)} / 1M`}),e.jsx(I,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${E(t.cacheWrite1hPrice)} / 1M`}),e.jsx(I,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx($,{size:"sm",variant:"outline",onPress:S,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(we,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error)}):null]})]})}function qt({row:t,metadata:i,metadataAvailable:r,onMakeAlias:s,onClose:n}){const l=(i==null?void 0:i.input_modalities)??[],m=(i==null?void 0:i.output_modalities)??[],p=Ot.filter(({key:u})=>i==null?void 0:i[u]);return e.jsx(se,{children:e.jsxs(se.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(V,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(le,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Yt,{row:t},t.key),e.jsx($,{size:"sm",variant:"outline",onPress:()=>s(t.key),children:"Make an alias"})]}),e.jsxs(le,{title:"Specs",children:[e.jsx(I,{label:"Context window",value:ae(t.contextWindow)}),e.jsx(I,{label:"Max output",value:ae((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(I,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(I,{label:"Released",value:Ct(i==null?void 0:i.release_date)}),e.jsx(I,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(le,{title:"Modalities",children:l.length===0&&m.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),l.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),m.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]})]})}),e.jsx(le,{title:"Capabilities",children:p.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(({key:u,label:P})=>e.jsx(V,{size:"sm",color:"default",children:P},u))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Ht=15;function Ut({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:s=>i(s.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}const He="otari.dashboard.modelsSort",_e={col:"model",dir:"asc"},Gt=["model","released","input","output"];function Jt(){if(typeof window>"u")return _e;try{const t=window.localStorage.getItem(He);if(!t)return _e;const i=JSON.parse(t);if(Gt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return _e}function Qt({row:t,onClose:i}){const r=je(),s=Re(),[n,l]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[m,p]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[u,P]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[j,k]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[T,y]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[h,N]=c.useState(ze(t.pricingTiers)),O=ce(n)&&ce(m)&&z(u)&&z(j)&&z(T)&&Ve(h),S=()=>{O&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(m),cache_read_price_per_million:Y(u),cache_write_price_per_million:Y(j),cache_write_1h_price_per_million:Y(T),pricing_tiers:Ye(h)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(b,{value:n,onChange:l,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(b,{value:m,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(b,{value:u,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(b,{value:j,onChange:k,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(b,{value:T,onChange:y,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx($,{size:"sm",variant:"primary",isDisabled:r.isPending||!O,onPress:S,children:r.isPending?"Saving…":"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(we,{confirmLabel:"Reset",isPending:s.isPending,onConfirm:()=>s.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||s.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error??s.error)}):null]}),e.jsx(qe,{tiers:h,onChange:N})]})}function Xt({primary:t,secondary:i,rowKey:r,primaryLabel:s,secondaryLabel:n,onEdit:l}){const m=(p,u)=>e.jsx("button",{type:"button","aria-label":`Edit ${u} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:P=>{P.stopPropagation(),l()},children:p==null?"—":E(p)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[m(t,s),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),m(i,n)]})}function Zt({rates:t,rowKey:i,onEdit:r}){const s=[t.cacheReadPrice==null?null:`R ${E(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${E(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${E(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:s.length>0?s.join(" · "):"Input-rate fallback"})}function ei({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,l)=>n.min_input_tokens-l.min_input_tokens).map(n=>ae(n.min_input_tokens)),s=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:s})}function ti({rows:t,isLoading:i,empty:r,sortDescriptor:s,onSortChange:n,selectedKey:l,onSelect:m,onEditPricing:p,comparisonContextTokens:u,selectedKeys:P,onSelectionChange:j}){const k=c.useMemo(()=>{const y=u==null?"Base":`at ${ae(u)}`;return[{id:"model",header:"Model",isRowHeader:!0,allowsSorting:!0,cell:h=>e.jsxs("span",{className:"font-medium break-all",children:[h.model,e.jsx("span",{className:"sr-only",children:h.key})]})},{id:"provider",header:"Provider",cell:h=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:h.provider})},{id:"input",header:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[`${y} in / out $ / 1M`,e.jsx(Vt,{})]}),align:"end",allowsSorting:!0,cell:h=>{const N=Be(h,u);return e.jsx(Xt,{primary:N.inputPrice,secondary:N.outputPrice,rowKey:h.key,primaryLabel:"input",secondaryLabel:"output",onEdit:()=>p(h.key)})}},{id:"caching",header:`Caching ${u==null?"policy":y}`,align:"end",cell:h=>e.jsx(Zt,{rates:Be(h,u),rowKey:h.key,onEdit:()=>p(h.key)})},{id:"policy",header:"Pricing policy",align:"end",cell:h=>e.jsx(ei,{row:h,onEdit:()=>p(h.key)})}]},[u,p]),T=c.useCallback(y=>y.key===l?"bg-[var(--otari-brand-tint)]":void 0,[l]);return e.jsx(Tt,{ariaLabel:"Models",columns:k,rows:t,getRowKey:wt,isLoading:i,emptyContent:r,selectionMode:"multiple",selectedKeys:P,onSelectionChange:j,sortDescriptor:s,onSortChange:n,onRowAction:m,rowClassName:T})}function ii({providers:t}){if(t.length===0)return null;const i=t.filter(l=>!l.discovery_unsupported),r=t.filter(l=>l.discovery_unsupported),s=l=>l.map(m=>m.provider).join(", "),n=l=>l.length===1;return e.jsxs(St,{tone:"warning",children:[i.length>0?e.jsxs("span",{className:"block",children:["Could not list ",s(i),". Check ",n(i)?"that provider's":"those providers'"," ","credentials in config.yml; ",n(i)?"its":"their"," models are missing from the list below."]}):null,r.length>0?e.jsxs("span",{className:"block",children:[s(r)," ",n(r)?"does":"do"," not offer model discovery, so"," ",n(r)?"its":"their"," models are missing from the list below."," ",n(r)?"The provider":"They"," may still serve requests; declare the model ids"," ",n(r)?"it serves":"they serve"," under the ",e.jsx("code",{children:"models:"})," key in config.yml to list them here."]}):null]})}function pi(){var Te,Le,$e;const t=gt(),[i]=vt(),r=_t(),s=bt(),n=jt(),l=yt(),m=je(),[p,u]=c.useState(""),[P,j]=c.useState(0),[k,T]=c.useState(Ht),[y,h]=c.useState(null),[N,O]=c.useState(null),[S,X]=c.useState(Jt),W=Mt(),[Ue,ue]=c.useState(!1),[Ge,ye]=c.useState(!1),[Je,Pe]=c.useState(void 0);c.useEffect(()=>{try{window.localStorage.setItem(He,JSON.stringify(S))}catch{}},[S]);const[D,Ne]=c.useState(i.get("provider")||"all"),[B,Qe]=c.useState("all"),[q,Xe]=c.useState("all"),[H,Ze]=c.useState("all"),[de,et]=c.useState("0"),[Z,tt]=c.useState(""),[ee,it]=c.useState("all"),[pe,rt]=c.useState(""),F=((Te=l.data)==null?void 0:Te.models)??{},nt=((Le=l.data)==null?void 0:Le.available)??!1,Se=c.useMemo(()=>{var a;return new Set((((a=n.data)==null?void 0:a.providers)??[]).flatMap(x=>x.models.map(o=>o.key)))},[n.data]),lt=a=>{u(a),j(0)},R=a=>x=>{a(x),j(0)},te=c.useMemo(()=>{var M,v,_,A,L,w,Ae;const a=new Map(At(s.data??[]).map(d=>[d.model_key,d])),x=[],o=new Set,g=(d,ve,Ee,f)=>{if(o.has(d))return;o.add(d);const C=a.get(d);x.push({key:d,model:Ke(ve,Ee),provider:Ee,isDiscovered:Se.has(d),contextWindow:(f==null?void 0:f.contextWindow)??null,inputPrice:C?C.input_price_per_million:(f==null?void 0:f.inputPrice)??null,outputPrice:C?C.output_price_per_million:(f==null?void 0:f.outputPrice)??null,cacheReadPrice:C?C.cache_read_price_per_million:(f==null?void 0:f.cacheReadPrice)??null,cacheWritePrice:C?C.cache_write_price_per_million:(f==null?void 0:f.cacheWritePrice)??null,cacheWrite1hPrice:C?C.cache_write_1h_price_per_million??null:(f==null?void 0:f.cacheWrite1hPrice)??null,pricingTiers:C?C.pricing_tiers??[]:(f==null?void 0:f.pricingTiers)??[],source:C?"configured":(f==null?void 0:f.source)??"none"})};for(const d of((M=r.data)==null?void 0:M.data)??[]){if(d.owned_by===Et)continue;const ve=d.pricing_source==="default"?"default":d.pricing?"configured":"none";g(d.id,d.id,d.owned_by||Oe(d.id),{key:d.id,model:d.id,provider:d.owned_by,contextWindow:d.context_window,inputPrice:((v=d.pricing)==null?void 0:v.input_price_per_million)??null,outputPrice:((_=d.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:((A=d.pricing)==null?void 0:A.cache_read_price_per_million)??null,cacheWritePrice:((L=d.pricing)==null?void 0:L.cache_write_price_per_million)??null,cacheWrite1hPrice:((w=d.pricing)==null?void 0:w.cache_write_1h_price_per_million)??null,pricingTiers:((Ae=d.pricing)==null?void 0:Ae.pricing_tiers)??[],source:ve})}for(const d of a.keys())g(d,d,Oe(d));return x},[r.data,s.data,Se]),Ce=c.useMemo(()=>new Map(te.map(a=>[a.key,a])),[te]),ie=c.useMemo(()=>{var o,g,M;const a=te.map(v=>{var _,A;return{...v,contextWindow:v.contextWindow??((_=F[v.key])==null?void 0:_.context_window)??null,releaseDate:((A=F[v.key])==null?void 0:A.release_date)??null}}),x=new Set(a.map(v=>v.key));for(const v of((o=n.data)==null?void 0:o.providers)??[])for(const _ of v.models)x.has(_.key)||(x.add(_.key),a.push({key:_.key,model:Ke(_.key,v.provider),provider:v.provider,isDiscovered:!0,contextWindow:((g=F[_.key])==null?void 0:g.context_window)??null,releaseDate:((M=F[_.key])==null?void 0:M.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return a},[te,n.data,F]),at=((($e=n.data)==null?void 0:$e.providers)??[]).filter(a=>!a.ok),re=c.useMemo(()=>{const a=Array.from(new Set(ie.map(x=>x.provider))).sort((x,o)=>x.localeCompare(o));return[{value:"all",label:"All providers"},...a.map(x=>({value:x,label:x}))]},[ie]);c.useEffect(()=>{D==="all"||re.length<=1||re.some(a=>a.value===D)||Ne("all")},[re,D]);const U=p.trim().toLowerCase(),he=Number(de)||0,me=Z===""?Number.POSITIVE_INFINITY:Number(Z),st=pe===""?null:Number(pe),xe=ee==="all"?null:Date.now()-Number(ee)*Rt,G=c.useMemo(()=>{const a=o=>{if(U&&!o.key.toLowerCase().includes(U)&&!o.provider.toLowerCase().includes(U)||D!=="all"&&o.provider!==D||B==="configured"&&o.source!=="configured"||B==="default"&&o.source!=="default"||B==="priced"&&o.inputPrice==null||B==="unpriced"&&o.inputPrice!=null||q==="discovered"&&!o.isDiscovered||q==="custom"&&o.isDiscovered)return!1;if(H!=="all"){const g=De.find(v=>v.value===H),M=F[o.key];if(!g||!M||!g.test(M))return!1}if(he>0&&(o.contextWindow==null||o.contextWindowme))return!1;if(xe!=null){const g=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(g)||g{const M=S.dir==="asc"?1:-1;if(S.col==="model")return o.model.localeCompare(g.model)*M;if(S.col==="released"){const L=o.releaseDate??null,w=g.releaseDate??null;return!L&&!w?o.model.localeCompare(g.model):L?w?(Lw?1:0)*M||o.model.localeCompare(g.model):-1:1}const v=L=>S.col==="input"?L.inputPrice:L.outputPrice,_=v(o),A=v(g);return _==null&&A==null?o.model.localeCompare(g.model):_==null?1:A==null?-1:(_-A)*M||o.model.localeCompare(g.model)};return ie.filter(a).sort(x)},[ie,U,D,B,q,H,he,me,xe,F,S]),J=G.length,ct=Math.max(1,Math.ceil(J/k)),ke=Math.min(P,ct-1),Me=ke*k,fe=G.slice(Me,Me+k),ot={column:S.col,direction:S.dir==="asc"?"ascending":"descending"},ut=a=>{X({col:String(a.column),dir:a.direction==="ascending"?"asc":"desc"}),j(0)},dt=c.useCallback(a=>h(x=>x===a?null:a),[]),ge=fe.map(a=>a.key),Q=Wt(W.selectedKeys,ge),pt=ge.length>0&&Q.length===ge.length&&J>Q.length,ht=W.allMatching?G.map(a=>a.key):Q,We=W.allMatching?J:Q.length,Ie=y?G.find(a=>a.key===y)??Ce.get(y)??null:null,mt=async a=>{ye(!0),Pe(void 0);try{for(const x of ht)await m.mutateAsync({model_key:x,input_price_per_million:a.input_price_per_million,output_price_per_million:a.output_price_per_million,cache_read_price_per_million:a.cache_read_price_per_million??null,cache_write_price_per_million:a.cache_write_price_per_million??null,cache_write_1h_price_per_million:null,pricing_tiers:[]});W.clear(),ue(!1)}catch(x){Pe(x)}finally{ye(!1)}},xt=r.isLoading||s.isLoading||n.isLoading,ft=U!==""||D!=="all"||B!=="all"||q!=="all"||H!=="all"||de!=="0"||Z!==""||ee!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",ne=N?G.find(a=>a.key===N)??Ce.get(N)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Pt,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(Nt,{error:r.error??s.error??n.error??l.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${ne?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ut,{value:p,onChange:lt,placeholder:"Search models…"}),e.jsx(K,{ariaLabel:"Filter by provider",value:D,onChange:R(Ne),options:re}),e.jsx(K,{ariaLabel:"Filter by pricing",value:B,onChange:R(Qe),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(K,{ariaLabel:"Filter by source",value:q,onChange:R(Xe),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(K,{ariaLabel:"Filter by capability",value:H,onChange:R(Ze),options:[{value:"all",label:"Any capability"},...De.map(a=>({value:a.value,label:a.label}))]}),e.jsx(K,{ariaLabel:"Minimum context window",value:de,onChange:R(et),options:Dt}),e.jsx(K,{ariaLabel:"Maximum input price",value:Z,onChange:R(tt),options:Ft}),e.jsx(K,{ariaLabel:"Compare prices at context",value:pe,onChange:rt,options:Kt}),e.jsx(K,{ariaLabel:"Filter by release date",value:ee,onChange:R(it),options:Bt})]}),e.jsx(ii,{providers:at}),Q.length>0?e.jsx(It,{selectedCount:We,allMatching:W.allMatching,matchingTotal:J,canSelectAllMatching:pt,onSelectAllMatching:W.enableAllMatching,onClear:W.clear,children:e.jsx($,{size:"sm",variant:"primary",onPress:()=>ue(!0),children:"Set pricing"})}):null,e.jsx(ti,{rows:fe,isLoading:xt,empty:ft,sortDescriptor:ot,onSortChange:ut,selectedKey:N,onSelect:O,onEditPricing:dt,comparisonContextTokens:st,selectedKeys:W.selectedKeys,onSelectionChange:W.onSelectionChange}),Ie?e.jsx(se,{children:e.jsxs(se.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Edit pricing"}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>h(null),children:"Close"})]}),e.jsx(Qt,{row:Ie,onClose:()=>h(null)})]})}):null,e.jsx(Lt,{page:ke,pageSize:k,total:J,rowsOnPage:fe.length,onPageChange:j,onPageSizeChange:a=>{T(a),j(0)},pageSizeOptions:[15,25,50]})]}),ne?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(qt,{row:ne,metadata:F[ne.key],metadataAvailable:nt,onMakeAlias:a=>t(`/aliases?target=${encodeURIComponent(a)}`),onClose:()=>O(null)})}):null]}),e.jsx($t,{isOpen:Ue,onOpenChange:ue,targetCount:We,isPending:Ge,error:Je,onSubmit:mt,title:"Set pricing",description:a=>`Apply these per-1M rates to ${a.toLocaleString()} selected ${a===1?"model":"models"}. This replaces each model's price; pricing tiers and the 1h cache rate are cleared. Edit a single model for tiers.`})]})}export{pi as ModelsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as gt,u as vt,r as c}from"./react-dgEcD0HR.js";import{L as _t,M as bt,o as jt,N as yt,O as je,P as Pt,E as Nt,F as B,I as St,Q as se,S as Re,s as we,T as be,U as Ct,V as kt,W as E}from"./index-Dhxz7Eyv.js";import{u as Mt,r as Wt,B as Tt}from"./tableSelection-CojkFPwd.js";import{D as It}from"./DataTable-CrQq0sYf.js";import{T as Lt,S as $t}from"./TablePagination-BYC0DnfO.js";import{B as $,d as ae,f as V}from"./heroui-DZj66Arc.js";function Oe(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function At(t,i=Date.now()){const r=new Map;for(const n of t){const l=r.get(n.model_key)??[];l.push(n),r.set(n.model_key,l)}const a=[];for(const n of r.values()){const l=[...n].sort((p,u)=>Date.parse(p.effective_at)-Date.parse(u.effective_at)),m=[...l].reverse().find(p=>Date.parse(p.effective_at)<=i);a.push(m??l[0])}return a.sort((n,l)=>n.model_key.localeCompare(l.model_key))}const Et="otari",De=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],Ot=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Fe={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Dt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],Ft=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Bt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],Kt=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Rt=1440*60*1e3,wt=t=>t.key;function Be(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function Ke(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const a=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,l)=>l.min_input_tokens-n.min_input_tokens)[0];return a?{inputPrice:a.input_price_per_million??r.inputPrice,outputPrice:a.output_price_per_million??r.outputPrice,cacheReadPrice:a.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:a.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:a.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ce(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function z(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function Y(t){return t.trim()===""?null:Number(t)}function ze(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Ve(t){const i=new Set;return t.every(r=>{const a=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(l=>l.trim()!=="");return!Number.isInteger(a)||a<=0||i.has(a)||!n?!1:(i.add(a),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(z))})}function Ye(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function b({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:a=>i(a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function qe({tiers:t,onChange:i}){const r=(n,l,m)=>{i(t.map(p=>p.id===n?{...p,[l]:m}:p))},a=()=>{const n=t.reduce((l,m)=>Math.max(l,m.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx($,{size:"sm",variant:"outline",onPress:a,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:l=>r(n.id,"minInputTokens",l.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(b,{value:n.input,onChange:l=>r(n.id,"input",l),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(b,{value:n.output,onChange:l=>r(n.id,"output",l),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(b,{value:n.cacheRead,onChange:l=>r(n.id,"cacheRead",l),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(b,{value:n.cacheWrite,onChange:l=>r(n.id,"cacheWrite",l),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(b,{value:n.cacheWrite1h,onChange:l=>r(n.id,"cacheWrite1h",l),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(l=>l.id!==n.id)),children:"Remove"})]},n.id))]})}function zt({source:t}){return t==="configured"?e.jsx(V,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(V,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function oe({label:t,tone:i="info",children:r}){const a=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":a,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:a,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Vt(){const t=kt();return t.data?t.data.default_pricing?e.jsx(oe,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(oe,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function le({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Yt({row:t}){const i=je(),r=Re(),[a,n]=c.useState(!1),[l,m]=c.useState(""),[p,u]=c.useState(""),[P,j]=c.useState(""),[k,I]=c.useState(""),[y,h]=c.useState(""),[N,O]=c.useState([]),S=()=>{m(t.inputPrice==null?"":String(t.inputPrice)),u(t.outputPrice==null?"":String(t.outputPrice)),j(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),I(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),h(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),O(ze(t.pricingTiers)),n(!0)},X=ce(l)&&ce(p)&&z(P)&&z(k)&&z(y)&&Ve(N),W=()=>{X&&i.mutate({model_key:t.key,input_price_per_million:Number(l),output_price_per_million:Number(p),cache_read_price_per_million:Y(P),cache_write_price_per_million:Y(k),cache_write_1h_price_per_million:Y(y),pricing_tiers:Ye(N)},{onSuccess:()=>n(!1)})};return a?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(b,{value:l,onChange:m,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(b,{value:p,onChange:u,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(b,{value:P,onChange:j,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(b,{value:k,onChange:I,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(b,{value:y,onChange:h,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(qe,{tiers:N,onChange:O}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:"sm",variant:"primary",isDisabled:i.isPending||!X,onPress:W,children:"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:be(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${E(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${E(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${E(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${E(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${E(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx($,{size:"sm",variant:"outline",onPress:S,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(we,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error)}):null]})]})}function qt({row:t,metadata:i,metadataAvailable:r,onMakeAlias:a,onClose:n}){const l=(i==null?void 0:i.input_modalities)??[],m=(i==null?void 0:i.output_modalities)??[],p=Ot.filter(({key:u})=>i==null?void 0:i[u]);return e.jsx(ae,{children:e.jsxs(ae.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(V,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(le,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Yt,{row:t},t.key),e.jsx($,{size:"sm",variant:"outline",onPress:()=>a(t.key),children:"Make an alias"})]}),e.jsxs(le,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:se(t.contextWindow)}),e.jsx(T,{label:"Max output",value:se((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:Ct(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(le,{title:"Modalities",children:l.length===0&&m.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),l.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),m.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]})]})}),e.jsx(le,{title:"Capabilities",children:p.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(({key:u,label:P})=>e.jsx(V,{size:"sm",color:"default",children:P},u))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Ut=15;function Ht({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:a=>i(a.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}const Ue="otari.dashboard.modelsSort",_e={col:"model",dir:"asc"},Gt=["model","released","input","output"];function Jt(){if(typeof window>"u")return _e;try{const t=window.localStorage.getItem(Ue);if(!t)return _e;const i=JSON.parse(t);if(Gt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return _e}function Qt({row:t,onClose:i}){const r=je(),a=Re(),[n,l]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[m,p]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[u,P]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[j,k]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[I,y]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[h,N]=c.useState(ze(t.pricingTiers)),O=ce(n)&&ce(m)&&z(u)&&z(j)&&z(I)&&Ve(h),S=()=>{O&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(m),cache_read_price_per_million:Y(u),cache_write_price_per_million:Y(j),cache_write_1h_price_per_million:Y(I),pricing_tiers:Ye(h)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(b,{value:n,onChange:l,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(b,{value:m,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(b,{value:u,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(b,{value:j,onChange:k,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(b,{value:I,onChange:y,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx($,{size:"sm",variant:"primary",isDisabled:r.isPending||!O,onPress:S,children:r.isPending?"Saving…":"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(we,{confirmLabel:"Reset",isPending:a.isPending,onConfirm:()=>a.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||a.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error??a.error)}):null]}),e.jsx(qe,{tiers:h,onChange:N})]})}function Xt({primary:t,secondary:i,rowKey:r,primaryLabel:a,secondaryLabel:n,onEdit:l}){const m=(p,u)=>e.jsx("button",{type:"button","aria-label":`Edit ${u} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:P=>{P.stopPropagation(),l()},children:p==null?"—":E(p)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[m(t,a),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),m(i,n)]})}function Zt({rates:t,rowKey:i,onEdit:r}){const a=[t.cacheReadPrice==null?null:`R ${E(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${E(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${E(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:a.length>0?a.join(" · "):"Input-rate fallback"})}function ei({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,l)=>n.min_input_tokens-l.min_input_tokens).map(n=>se(n.min_input_tokens)),a=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:a})}function ti({rows:t,isLoading:i,empty:r,sortDescriptor:a,onSortChange:n,selectedKey:l,onSelect:m,onEditPricing:p,comparisonContextTokens:u,selectedKeys:P,onSelectionChange:j}){const k=c.useMemo(()=>{const y=u==null?"Base":`at ${se(u)}`;return[{id:"model",header:"Model",isRowHeader:!0,allowsSorting:!0,cell:h=>e.jsxs("span",{className:"font-medium break-all",children:[h.model,e.jsx("span",{className:"sr-only",children:h.key})]})},{id:"provider",header:"Provider",cell:h=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:h.provider})},{id:"input",header:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[`${y} in / out $ / 1M`,e.jsx(Vt,{})]}),align:"end",allowsSorting:!0,cell:h=>{const N=Ke(h,u);return e.jsx(Xt,{primary:N.inputPrice,secondary:N.outputPrice,rowKey:h.key,primaryLabel:"input",secondaryLabel:"output",onEdit:()=>p(h.key)})}},{id:"caching",header:`Caching ${u==null?"policy":y}`,align:"end",cell:h=>e.jsx(Zt,{rates:Ke(h,u),rowKey:h.key,onEdit:()=>p(h.key)})},{id:"policy",header:"Pricing policy",align:"end",cell:h=>e.jsx(ei,{row:h,onEdit:()=>p(h.key)})}]},[u,p]),I=c.useCallback(y=>y.key===l?"bg-[var(--otari-brand-tint)]":void 0,[l]);return e.jsx(It,{ariaLabel:"Models",columns:k,rows:t,getRowKey:wt,isLoading:i,emptyContent:r,selectionMode:"multiple",selectedKeys:P,onSelectionChange:j,sortDescriptor:a,onSortChange:n,onRowAction:m,rowClassName:I})}function ii({providers:t}){if(t.length===0)return null;const i=t.filter(l=>!l.discovery_unsupported),r=t.filter(l=>l.discovery_unsupported),a=l=>l.map(m=>m.provider).join(", "),n=l=>l.length===1;return e.jsxs(St,{tone:"warning",children:[i.length>0?e.jsxs("span",{className:"block",children:["Could not list ",a(i),". Check ",n(i)?"that provider's":"those providers'"," ","credentials in config.yml; ",n(i)?"its":"their"," models are missing from the list below."]}):null,r.length>0?e.jsxs("span",{className:"block",children:[a(r)," ",n(r)?"does":"do"," not offer model discovery, so"," ",n(r)?"its":"their"," models are missing from the list below."," ",n(r)?"The provider":"They"," may still serve requests; declare the model ids"," ",n(r)?"it serves":"they serve"," under the ",e.jsx("code",{children:"models:"})," key in config.yml to list them here."]}):null]})}function pi(){var Ie,Le,$e;const t=gt(),[i]=vt(),r=_t(),a=bt(),n=jt(),l=yt(),m=je(),[p,u]=c.useState(""),[P,j]=c.useState(0),[k,I]=c.useState(Ut),[y,h]=c.useState(null),[N,O]=c.useState(null),[S,X]=c.useState(Jt),W=Mt(),[He,ue]=c.useState(!1),[Ge,ye]=c.useState(!1),[Je,Pe]=c.useState(void 0);c.useEffect(()=>{try{window.localStorage.setItem(Ue,JSON.stringify(S))}catch{}},[S]);const[D,Ne]=c.useState(i.get("provider")||"all"),[K,Qe]=c.useState("all"),[q,Xe]=c.useState("all"),[U,Ze]=c.useState("all"),[de,et]=c.useState("0"),[Z,tt]=c.useState(""),[ee,it]=c.useState("all"),[pe,rt]=c.useState(""),F=((Ie=l.data)==null?void 0:Ie.models)??{},nt=((Le=l.data)==null?void 0:Le.available)??!1,Se=c.useMemo(()=>{var s;return new Set((((s=n.data)==null?void 0:s.providers)??[]).flatMap(x=>x.models.map(o=>o.key)))},[n.data]),lt=s=>{u(s),j(0)},R=s=>x=>{s(x),j(0)},te=c.useMemo(()=>{var M,v,_,A,L,w,Ae;const s=new Map(At(a.data??[]).map(d=>[d.model_key,d])),x=[],o=new Set,g=(d,ve,Ee,f)=>{if(o.has(d))return;o.add(d);const C=s.get(d);x.push({key:d,model:Be(ve,Ee),provider:Ee,isDiscovered:Se.has(d),contextWindow:(f==null?void 0:f.contextWindow)??null,inputPrice:C?C.input_price_per_million:(f==null?void 0:f.inputPrice)??null,outputPrice:C?C.output_price_per_million:(f==null?void 0:f.outputPrice)??null,cacheReadPrice:C?C.cache_read_price_per_million:(f==null?void 0:f.cacheReadPrice)??null,cacheWritePrice:C?C.cache_write_price_per_million:(f==null?void 0:f.cacheWritePrice)??null,cacheWrite1hPrice:C?C.cache_write_1h_price_per_million??null:(f==null?void 0:f.cacheWrite1hPrice)??null,pricingTiers:C?C.pricing_tiers??[]:(f==null?void 0:f.pricingTiers)??[],source:C?"configured":(f==null?void 0:f.source)??"none"})};for(const d of((M=r.data)==null?void 0:M.data)??[]){if(d.owned_by===Et)continue;const ve=d.pricing_source==="default"?"default":d.pricing?"configured":"none";g(d.id,d.id,d.owned_by||Oe(d.id),{key:d.id,model:d.id,provider:d.owned_by,contextWindow:d.context_window,inputPrice:((v=d.pricing)==null?void 0:v.input_price_per_million)??null,outputPrice:((_=d.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:((A=d.pricing)==null?void 0:A.cache_read_price_per_million)??null,cacheWritePrice:((L=d.pricing)==null?void 0:L.cache_write_price_per_million)??null,cacheWrite1hPrice:((w=d.pricing)==null?void 0:w.cache_write_1h_price_per_million)??null,pricingTiers:((Ae=d.pricing)==null?void 0:Ae.pricing_tiers)??[],source:ve})}for(const d of s.keys())g(d,d,Oe(d));return x},[r.data,a.data,Se]),Ce=c.useMemo(()=>new Map(te.map(s=>[s.key,s])),[te]),ie=c.useMemo(()=>{var o,g,M;const s=te.map(v=>{var _,A;return{...v,contextWindow:v.contextWindow??((_=F[v.key])==null?void 0:_.context_window)??null,releaseDate:((A=F[v.key])==null?void 0:A.release_date)??null}}),x=new Set(s.map(v=>v.key));for(const v of((o=n.data)==null?void 0:o.providers)??[])for(const _ of v.models)x.has(_.key)||(x.add(_.key),s.push({key:_.key,model:Be(_.key,v.provider),provider:v.provider,isDiscovered:!0,contextWindow:((g=F[_.key])==null?void 0:g.context_window)??null,releaseDate:((M=F[_.key])==null?void 0:M.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return s},[te,n.data,F]),st=((($e=n.data)==null?void 0:$e.providers)??[]).filter(s=>!s.ok),re=c.useMemo(()=>{const s=Array.from(new Set(ie.map(x=>x.provider))).sort((x,o)=>x.localeCompare(o));return[{value:"all",label:"All providers"},...s.map(x=>({value:x,label:x}))]},[ie]);c.useEffect(()=>{D==="all"||re.length<=1||re.some(s=>s.value===D)||Ne("all")},[re,D]);const H=p.trim().toLowerCase(),he=Number(de)||0,me=Z===""?Number.POSITIVE_INFINITY:Number(Z),at=pe===""?null:Number(pe),xe=ee==="all"?null:Date.now()-Number(ee)*Rt,G=c.useMemo(()=>{const s=o=>{if(H&&!o.key.toLowerCase().includes(H)&&!o.provider.toLowerCase().includes(H)||D!=="all"&&o.provider!==D||K==="configured"&&o.source!=="configured"||K==="default"&&o.source!=="default"||K==="priced"&&o.inputPrice==null||K==="unpriced"&&o.inputPrice!=null||q==="discovered"&&!o.isDiscovered||q==="custom"&&o.isDiscovered)return!1;if(U!=="all"){const g=De.find(v=>v.value===U),M=F[o.key];if(!g||!M||!g.test(M))return!1}if(he>0&&(o.contextWindow==null||o.contextWindowme))return!1;if(xe!=null){const g=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(g)||g{const M=S.dir==="asc"?1:-1;if(S.col==="model")return o.model.localeCompare(g.model)*M;if(S.col==="released"){const L=o.releaseDate??null,w=g.releaseDate??null;return!L&&!w?o.model.localeCompare(g.model):L?w?(Lw?1:0)*M||o.model.localeCompare(g.model):-1:1}const v=L=>S.col==="input"?L.inputPrice:L.outputPrice,_=v(o),A=v(g);return _==null&&A==null?o.model.localeCompare(g.model):_==null?1:A==null?-1:(_-A)*M||o.model.localeCompare(g.model)};return ie.filter(s).sort(x)},[ie,H,D,K,q,U,he,me,xe,F,S]),J=G.length,ct=Math.max(1,Math.ceil(J/k)),ke=Math.min(P,ct-1),Me=ke*k,fe=G.slice(Me,Me+k),ot={column:S.col,direction:S.dir==="asc"?"ascending":"descending"},ut=s=>{X({col:String(s.column),dir:s.direction==="ascending"?"asc":"desc"}),j(0)},dt=c.useCallback(s=>h(x=>x===s?null:s),[]),ge=fe.map(s=>s.key),Q=Wt(W.selectedKeys,ge),pt=ge.length>0&&Q.length===ge.length&&J>Q.length,ht=W.allMatching?G.map(s=>s.key):Q,We=W.allMatching?J:Q.length,Te=y?G.find(s=>s.key===y)??Ce.get(y)??null:null,mt=async s=>{ye(!0),Pe(void 0);try{for(const x of ht)await m.mutateAsync({model_key:x,input_price_per_million:s.input_price_per_million,output_price_per_million:s.output_price_per_million,cache_read_price_per_million:s.cache_read_price_per_million??null,cache_write_price_per_million:s.cache_write_price_per_million??null,cache_write_1h_price_per_million:null,pricing_tiers:[]});W.clear(),ue(!1)}catch(x){Pe(x)}finally{ye(!1)}},xt=r.isLoading||a.isLoading||n.isLoading,ft=H!==""||D!=="all"||K!=="all"||q!=="all"||U!=="all"||de!=="0"||Z!==""||ee!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",ne=N?G.find(s=>s.key===N)??Ce.get(N)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Pt,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(Nt,{error:r.error??a.error??n.error??l.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${ne?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ht,{value:p,onChange:lt,placeholder:"Search models…"}),e.jsx(B,{ariaLabel:"Filter by provider",value:D,onChange:R(Ne),options:re}),e.jsx(B,{ariaLabel:"Filter by pricing",value:K,onChange:R(Qe),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(B,{ariaLabel:"Filter by source",value:q,onChange:R(Xe),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(B,{ariaLabel:"Filter by capability",value:U,onChange:R(Ze),options:[{value:"all",label:"Any capability"},...De.map(s=>({value:s.value,label:s.label}))]}),e.jsx(B,{ariaLabel:"Minimum context window",value:de,onChange:R(et),options:Dt}),e.jsx(B,{ariaLabel:"Maximum input price",value:Z,onChange:R(tt),options:Ft}),e.jsx(B,{ariaLabel:"Compare prices at context",value:pe,onChange:rt,options:Bt}),e.jsx(B,{ariaLabel:"Filter by release date",value:ee,onChange:R(it),options:Kt})]}),e.jsx(ii,{providers:st}),Q.length>0?e.jsx(Tt,{selectedCount:We,allMatching:W.allMatching,matchingTotal:J,canSelectAllMatching:pt,onSelectAllMatching:W.enableAllMatching,onClear:W.clear,children:e.jsx($,{size:"sm",variant:"primary",onPress:()=>ue(!0),children:"Set pricing"})}):null,e.jsx(ti,{rows:fe,isLoading:xt,empty:ft,sortDescriptor:ot,onSortChange:ut,selectedKey:N,onSelect:O,onEditPricing:dt,comparisonContextTokens:at,selectedKeys:W.selectedKeys,onSelectionChange:W.onSelectionChange}),Te?e.jsx(ae,{children:e.jsxs(ae.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Edit pricing"}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>h(null),children:"Close"})]}),e.jsx(Qt,{row:Te,onClose:()=>h(null)})]})}):null,e.jsx(Lt,{page:ke,pageSize:k,total:J,rowsOnPage:fe.length,onPageChange:j,onPageSizeChange:s=>{I(s),j(0)},pageSizeOptions:[15,25,50]})]}),ne?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(qt,{row:ne,metadata:F[ne.key],metadataAvailable:nt,onMakeAlias:s=>t(`/aliases?target=${encodeURIComponent(s)}`),onClose:()=>O(null)})}):null]}),e.jsx($t,{isOpen:He,onOpenChange:ue,targetCount:We,isPending:Ge,error:Je,onSubmit:mt,title:"Set pricing",description:s=>`Apply these per-1M rates to ${s.toLocaleString()} selected ${s===1?"model":"models"}. This replaces each model's price; pricing tiers and the 1h cache rate are cleared. Edit a single model for tiers.`})]})}export{pi as ModelsPage}; diff --git a/src/gateway/static/dashboard/assets/OverviewPage-C0SW-na1.js b/src/gateway/static/dashboard/assets/OverviewPage-C0SW-na1.js new file mode 100644 index 000000000..ea18c6deb --- /dev/null +++ b/src/gateway/static/dashboard/assets/OverviewPage-C0SW-na1.js @@ -0,0 +1 @@ +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as y,i as at,N as T}from"./react-dgEcD0HR.js";import{X as st,Z as nt,g as S,_ as ot,v as it,c as lt,u as dt,d as ct,$ as w,P as ut,R as mt,E as Y,a0 as b,a1 as _,a2 as N,a3 as R,a4 as D,a5 as vt}from"./index-Dhxz7Eyv.js";import{S as U}from"./charts-BI8Uczg4.js";import{D as ht}from"./DataTable-CrQq0sYf.js";import{d as B,B as xt}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function M(e){return e==="neutral"?void 0:e}const ft=.02,pt=.1;function K(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,a=n>=pt?"alert":n>=ft?"warn":"ok";return{rate:n,status:a}}function gt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy+e.degraded===0?"alert":"warn"}const bt=.8;function yt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(o=>o.max_budget!==null&&o.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let a=0,l=0,r,m=-1;for(const o of n){const s=o.max_budget*o.user_count,i=s>0?o.total_spend/s:0;i>=1?a+=1:i>=bt&&(l+=1),i>m&&(m=i,r={name:o.name??o.budget_id,spent:o.total_spend,allocated:s,pct:i})}const d=a>0?"alert":l>0?"warn":"ok",h=a>0?`${a} over limit`:l>0?`${l} near limit`:"All within budget";return{status:d,label:h,overCount:a,nearCount:l,cappedCount:n.length,worst:r}}const W=864e5,G=30;function I(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function jt(){const[e,n]=y.useState(I);return y.useEffect(()=>{const a=()=>{if(document.visibilityState==="visible"){const l=I();n(r=>r===l?r:l)}};return document.addEventListener("visibilitychange",a),window.addEventListener("focus",a),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}},[]),y.useMemo(()=>{const a=Date.now(),l=new Date(a);return{today:new Date(l.getFullYear(),l.getMonth(),l.getDate()).toISOString(),periodStart:new Date(a-G*W).toISOString(),prevStart:new Date(a-2*G*W).toISOString()}},[e])}const St={ok:"Healthy",warn:"Elevated",alert:"High"},wt={ok:"On track",warn:"Near limit",alert:"Over budget"};function qt(){const e=st();return e.isLoading?t.jsx(nt,{}):t.jsx(Nt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function Nt({needsSetup:e=!1}){var $,L,O,A,F,P,q,H;const n=jt(),a=y.useMemo(()=>({start_date:n.today}),[n]),l=y.useMemo(()=>({start_date:n.periodStart}),[n]),r=y.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=S(a,"hour"),d=S(l,"day"),h=S(r,"day"),o=ot(),s=it(),i=lt(),x=dt(),f=ct({},0,5),E=($=m.data)==null?void 0:$.totals,v=(L=d.data)==null?void 0:L.totals,p=(O=h.data)==null?void 0:O.totals,j=((A=d.data)==null?void 0:A.series)??[],C=j.length>1,c=K(v),k=K(p),V=c.rate!==null&&k.rate!==null?w(c.rate,k.rate):null,u=yt(s.data??[]),X=gt(o.data),Z=(i.data??[]).filter(g=>g.is_active).length,z=(x.data??[]).filter(g=>!g.blocked).length,J=(((F=f.data)==null?void 0:F.length)??0)>0,Q=e&&f.isSuccess&&!J,tt=m.error??d.error??o.error??s.error??i.error??x.error,et=()=>{m.refetch(),d.refetch(),h.refetch(),o.refetch(),s.refetch(),i.refetch(),x.refetch(),f.refetch()},rt=m.isFetching||d.isFetching||h.isFetching||o.isFetching||s.isFetching||i.isFetching||x.isFetching||f.isFetching;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ut,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway.",action:t.jsx(mt,{onRefresh:et,isFetching:rt,updatedAt:d.dataUpdatedAt})}),Q?t.jsx(Rt,{}):null,t.jsx(Y,{error:tt}),t.jsx(Dt,{providerHealth:X,healthy:((P=o.data)==null?void 0:P.healthy)??0,degraded:((q=o.data)==null?void 0:q.degraded)??0,total:((H=o.data)==null?void 0:H.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:o.isSuccess&&s.isSuccess&&d.isSuccess,failed:o.isError||s.isError||d.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(b,{label:"Spend today",value:E?_(E.cost):"—"}),t.jsx(b,{label:"Spend, last 30 days",value:v?_(v.cost):"—",hint:v?t.jsx(N,{fraction:w(v.cost,p==null?void 0:p.cost)}):null,chart:C?t.jsx(U,{values:j.map(g=>g.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Requests, last 30 days",value:v?R(v.request_count):"—",hint:v?t.jsx(N,{fraction:w(v.request_count,p==null?void 0:p.request_count)}):null,chart:C?t.jsx(U,{values:j.map(g=>g.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Error rate, last 30 days",value:c.rate===null?"—":D(c.rate),status:M(c.status),statusLabel:c.status==="neutral"?void 0:St[c.status],hint:c.rate!==null?t.jsx(N,{fraction:V}):null}),t.jsx(b,{label:"Budget health",value:s.data&&u.worst?D(u.worst.pct):"—",status:s.data?M(u.status):void 0,statusLabel:s.data&&u.status!=="neutral"?wt[u.status]:void 0,hint:s.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(b,{label:"Active keys",value:i.data?R(Z):"—",to:"/keys"}),t.jsx(b,{label:"Active users",value:x.data?R(z):"—",to:"/users"})]}),t.jsx(Ct,{entries:f.data??[],loading:f.isLoading,error:f.error})]})}function Rt(){const e=at();return t.jsx(B,{children:t.jsxs(B.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(xt,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function _t({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function Dt({providerHealth:e,healthy:n,degraded:a,total:l,budget:r,errStatus:m,errRate:d,ready:h,failed:o}){if(o)return t.jsx(_t,{text:"Some status data could not be loaded."});if(!h)return null;const s=[];if((e==="warn"||e==="alert")&&l>0){const i=l-n-a;i>0&&s.push({text:`${i} provider${i===1?"":"s"} unreachable`,to:"/providers"}),a>0&&s.push({text:`${a} provider${a===1?"":"s"} without model discovery`,to:"/providers"})}return r.overCount>0?s.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&s.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),m==="alert"&&d!==null&&s.push({text:`error rate ${D(d)}`,to:"/activity?status=error"}),s.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),s.map((i,x)=>t.jsxs("span",{className:"flex items-center gap-2",children:[x>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(T,{to:i.to,className:"underline underline-offset-2 hover:text-amber-950",children:i.text})]},i.to+i.text))]})}function Et(e){return e==="error"?"error":"ok"}function Ct({entries:e,loading:n,error:a}){const l=[{id:"time",header:"Time",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(r.timestamp).toLocaleString(),children:vt(r.timestamp)})},{id:"model",header:"Model",isRowHeader:!0,cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:r.model})},{id:"cost",header:"Cost",align:"end",cell:r=>r.cost===null?"—":_(r.cost)},{id:"status",header:"Status",cell:r=>t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Et(r.status)})}];return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(T,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(Y,{error:a}),t.jsx(ht,{ariaLabel:"Recent activity",columns:l,rows:e,getRowKey:r=>r.id,isLoading:n,emptyContent:"No requests yet. Once the gateway serves traffic, it appears here."})]})}export{qt as OverviewIndex,Nt as OverviewPage,I as localDayKey}; diff --git a/src/gateway/static/dashboard/assets/OverviewPage-C5sP44tb.js b/src/gateway/static/dashboard/assets/OverviewPage-C5sP44tb.js deleted file mode 100644 index 088fe5967..000000000 --- a/src/gateway/static/dashboard/assets/OverviewPage-C5sP44tb.js +++ /dev/null @@ -1 +0,0 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as y,i as st,N as I}from"./react-dgEcD0HR.js";import{T as at,U as nt,d as S,V as ot,q as it,a as lt,u as dt,b as ct,W as w,P as ut,R as mt,E as Y,X as b,Z as _,_ as N,$ as R,a0 as D,a1 as vt}from"./index-DsUY4UvK.js";import{S as H}from"./charts-DIsd9m--.js";import{D as ht}from"./DataTable-Bmn_eYSV.js";import{d as B,B as xt}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function M(e){return e==="neutral"?void 0:e}const ft=.02,pt=.1;function W(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,s=n>=pt?"alert":n>=ft?"warn":"ok";return{rate:n,status:s}}function gt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy+e.degraded===0?"alert":"warn"}const bt=.8;function yt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(o=>o.max_budget!==null&&o.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let s=0,l=0,r,m=-1;for(const o of n){const a=o.max_budget*o.user_count,i=a>0?o.total_spend/a:0;i>=1?s+=1:i>=bt&&(l+=1),i>m&&(m=i,r={name:o.name??o.budget_id,spent:o.total_spend,allocated:a,pct:i})}const d=s>0?"alert":l>0?"warn":"ok",h=s>0?`${s} over limit`:l>0?`${l} near limit`:"All within budget";return{status:d,label:h,overCount:s,nearCount:l,cappedCount:n.length,worst:r}}const K=864e5,T=30;function G(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function jt(){const[e,n]=y.useState(G);return y.useEffect(()=>{const s=()=>{if(document.visibilityState==="visible"){const l=G();n(r=>r===l?r:l)}};return document.addEventListener("visibilitychange",s),window.addEventListener("focus",s),()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("focus",s)}},[]),y.useMemo(()=>{const s=Date.now(),l=new Date(s);return{today:new Date(l.getFullYear(),l.getMonth(),l.getDate()).toISOString(),periodStart:new Date(s-T*K).toISOString(),prevStart:new Date(s-2*T*K).toISOString()}},[e])}const St={ok:"Healthy",warn:"Elevated",alert:"High"},wt={ok:"On track",warn:"Near limit",alert:"Over budget"};function qt(){const e=at();return e.isLoading?t.jsx(nt,{}):t.jsx(Nt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function Nt({needsSetup:e=!1}){var $,L,O,A,F,P,q,U;const n=jt(),s=y.useMemo(()=>({start_date:n.today}),[n]),l=y.useMemo(()=>({start_date:n.periodStart}),[n]),r=y.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=S(s,"hour"),d=S(l,"day"),h=S(r,"day"),o=ot(),a=it(),i=lt(),x=dt(),f=ct({},0,5),E=($=m.data)==null?void 0:$.totals,v=(L=d.data)==null?void 0:L.totals,p=(O=h.data)==null?void 0:O.totals,j=((A=d.data)==null?void 0:A.series)??[],C=j.length>1,c=W(v),k=W(p),V=c.rate!==null&&k.rate!==null?w(c.rate,k.rate):null,u=yt(a.data??[]),X=gt(o.data),Z=(i.data??[]).filter(g=>g.is_active).length,z=(x.data??[]).filter(g=>!g.blocked).length,J=(((F=f.data)==null?void 0:F.length)??0)>0,Q=e&&f.isSuccess&&!J,tt=m.error??d.error??o.error??a.error??i.error??x.error,et=()=>{m.refetch(),d.refetch(),h.refetch(),o.refetch(),a.refetch(),i.refetch(),x.refetch(),f.refetch()},rt=m.isFetching||d.isFetching||h.isFetching||o.isFetching||a.isFetching||i.isFetching||x.isFetching||f.isFetching;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ut,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway.",action:t.jsx(mt,{onRefresh:et,isFetching:rt,updatedAt:d.dataUpdatedAt})}),Q?t.jsx(Rt,{}):null,t.jsx(Y,{error:tt}),t.jsx(Dt,{providerHealth:X,healthy:((P=o.data)==null?void 0:P.healthy)??0,degraded:((q=o.data)==null?void 0:q.degraded)??0,total:((U=o.data)==null?void 0:U.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:o.isSuccess&&a.isSuccess&&d.isSuccess,failed:o.isError||a.isError||d.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(b,{label:"Spend today",value:E?_(E.cost):"—"}),t.jsx(b,{label:"Spend, last 30 days",value:v?_(v.cost):"—",hint:v?t.jsx(N,{fraction:w(v.cost,p==null?void 0:p.cost)}):null,chart:C?t.jsx(H,{values:j.map(g=>g.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Requests, last 30 days",value:v?R(v.request_count):"—",hint:v?t.jsx(N,{fraction:w(v.request_count,p==null?void 0:p.request_count)}):null,chart:C?t.jsx(H,{values:j.map(g=>g.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Error rate, last 30 days",value:c.rate===null?"—":D(c.rate),status:M(c.status),statusLabel:c.status==="neutral"?void 0:St[c.status],hint:c.rate!==null?t.jsx(N,{fraction:V}):null}),t.jsx(b,{label:"Budget health",value:a.data&&u.worst?D(u.worst.pct):"—",status:a.data?M(u.status):void 0,statusLabel:a.data&&u.status!=="neutral"?wt[u.status]:void 0,hint:a.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(b,{label:"Active keys",value:i.data?R(Z):"—",to:"/keys"}),t.jsx(b,{label:"Active users",value:x.data?R(z):"—",to:"/users"})]}),t.jsx(Ct,{entries:f.data??[],loading:f.isLoading,error:f.error})]})}function Rt(){const e=st();return t.jsx(B,{children:t.jsxs(B.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(xt,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function _t({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function Dt({providerHealth:e,healthy:n,degraded:s,total:l,budget:r,errStatus:m,errRate:d,ready:h,failed:o}){if(o)return t.jsx(_t,{text:"Some status data could not be loaded."});if(!h)return null;const a=[];if((e==="warn"||e==="alert")&&l>0){const i=l-n-s;i>0&&a.push({text:`${i} provider${i===1?"":"s"} unreachable`,to:"/providers"}),s>0&&a.push({text:`${s} provider${s===1?"":"s"} without model discovery`,to:"/providers"})}return r.overCount>0?a.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&a.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),m==="alert"&&d!==null&&a.push({text:`error rate ${D(d)}`,to:"/activity?status=error"}),a.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),a.map((i,x)=>t.jsxs("span",{className:"flex items-center gap-2",children:[x>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(I,{to:i.to,className:"underline underline-offset-2 hover:text-amber-950",children:i.text})]},i.to+i.text))]})}function Et(e){return e==="error"?"error":"ok"}function Ct({entries:e,loading:n,error:s}){const l=[{id:"time",header:"Time",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(r.timestamp).toLocaleString(),children:vt(r.timestamp)})},{id:"model",header:"Model",isRowHeader:!0,cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:r.model})},{id:"cost",header:"Cost",align:"end",cell:r=>r.cost===null?"—":_(r.cost)},{id:"status",header:"Status",cell:r=>t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Et(r.status)})}];return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(I,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(Y,{error:s}),t.jsx(ht,{ariaLabel:"Recent activity",columns:l,rows:e,getRowKey:r=>r.id,isLoading:n,emptyContent:"No requests yet. Once the gateway serves traffic, it appears here."})]})}export{qt as OverviewIndex,Nt as OverviewPage,G as localDayKey}; diff --git a/src/gateway/static/dashboard/assets/ProvidersPage-CYSSSf8R.js b/src/gateway/static/dashboard/assets/ProvidersPage-17Tj43ca.js similarity index 97% rename from src/gateway/static/dashboard/assets/ProvidersPage-CYSSSf8R.js rename to src/gateway/static/dashboard/assets/ProvidersPage-17Tj43ca.js index 31a8369ee..d59f06ca6 100644 --- a/src/gateway/static/dashboard/assets/ProvidersPage-CYSSSf8R.js +++ b/src/gateway/static/dashboard/assets/ProvidersPage-17Tj43ca.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,L as M}from"./react-dgEcD0HR.js";import{T as Y,a2 as V,Q as G,V as Q,a3 as W,a4 as J,a5 as X,P as Z,E as I,I as ee,a6 as te,a7 as se,a1 as q,o as ae,a8 as $,a9 as re,N as O,aa as ne,ab as ie}from"./index-DsUY4UvK.js";import{F as _}from"./Field-Dwp6u3t8.js";import{D as oe}from"./DataTable-Bmn_eYSV.js";import{B as f,d as S,f as de,T as le,L as F,I as H,D as ce,S as me,C as T,a as ue,b as xe}from"./heroui-BI50yK5B.js";function E({value:t,onChange:s,label:a,placeholder:n,description:i}){return e.jsxs(le,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(H,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),i?e.jsx(ce,{className:"text-xs text-[var(--otari-muted)]",children:i}):null]})}function z({label:t,value:s,onChange:a,description:n,placeholder:i,extra:d=[],includeCatalog:l=!0}){var k;const g=ne(),u=x.useMemo(()=>l?[...d,...(g.data??[]).map(o=>({id:o.id,name:o.name}))]:d,[g.data,d,l]),[p,m]=x.useState(()=>{var o;return((o=u.find(b=>b.id===s))==null?void 0:o.name)??""}),j=((k=u.find(o=>o.id===s))==null?void 0:k.name)??"",h=p.trim()===j.trim()?"":p.trim().toLowerCase(),c=u.filter(o=>!h||o.name.toLowerCase().includes(h)||o.id.toLowerCase().includes(h)).slice(0,50);return e.jsxs(T.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:p,onInputChange:m,onSelectionChange:o=>{var b;o!=null?(a(String(o)),m(((b=u.find(N=>N.id===String(o)))==null?void 0:b.name)??"")):(a(""),m(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(T.InputGroup,{children:[e.jsx(H,{placeholder:i??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:o=>o.currentTarget.select()}),e.jsx(T.Trigger,{})]}),e.jsx(T.Popover,{children:e.jsx(ue,{items:c,className:"max-h-72 overflow-auto",children:o=>e.jsx(xe,{id:o.id,textValue:o.name,children:o.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function U({getPayload:t}){const s=ie(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:O(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):s.data.discovery_unsupported?e.jsxs("span",{className:"block max-w-md break-words text-xs text-amber-800",children:["This provider does not list models, so the key could not be verified here. Save it and use the provider; declare its model ids under ",e.jsx("code",{children:"models:"})," to have them show up in the catalogue. If you did not expect this, check the provider's reply below.",s.data.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:s.data.error}):null]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function pe({onClose:t}){var A;const s=$(),[a,n]=x.useState(""),[i,d]=x.useState(""),[l,g]=x.useState(!1),[u,p]=x.useState(""),[m,j]=x.useState(""),h=re(a),c=((A=h.data)==null?void 0:A.id)===a?h.data:void 0;x.useEffect(()=>{c&&p(c.default_api_base??"")},[c]);const k=(c==null?void 0:c.env_key_present)??!1,o=((c==null?void 0:c.requires_api_key)??!0)&&!k,b=m.trim()!==""&&m.trim()!==a,N=/[:/]/.test(m),P=a!==""&&!N&&(!o||i.trim()!=="")&&!s.isPending,C=()=>{P&&s.mutate({instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsx(z,{label:"Provider",value:a,onChange:w=>{n(w),j(""),p("")},description:"Its endpoint is built in."}),e.jsx(E,{value:i,onChange:d,label:c&&!o?"API key (optional)":"API key",description:c?o?`${c.name}'s endpoint is built in — just add your key.`:k?`${c.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${c.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>g(w=>!w),children:l?"Hide advanced":"Advanced (API base, rename)"}),l?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:u,onChange:p,placeholder:(c==null?void 0:c.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:m,onChange:j,placeholder:a||"instance name",description:N?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!P,onPress:C,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a===""?null:{instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null}})]})]})}function he({onClose:t}){const s=$(),[a,n]=x.useState(""),[i,d]=x.useState("openai-compatible"),[l,g]=x.useState(""),[u,p]=x.useState(""),m=/[:/]/.test(a),j=a.trim()!==""&&!m&&l.trim()!==""&&!s.isPending,h=()=>{j&&s.mutate({instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:m?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(z,{label:"Compatible with",value:i,onChange:d,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:l,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(E,{value:u,onChange:p,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!j,onPress:h,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a.trim()===""||l.trim()===""?null:{instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null}})]})]})}function ve({onClose:t}){const[s,a]=x.useState("known");return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,i])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:i},n))})}),s==="known"?e.jsx(pe,{onClose:t}):e.jsx(he,{onClose:t})]})})}function ge({provider:t,onClose:s}){const a=te(),[n,i]=x.useState(t.provider_type??""),[d,l]=x.useState(t.api_base??""),[g,u]=x.useState(!1),[p,m]=x.useState(""),j=()=>{if(a.isPending)return;const h={provider_type:n.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};g&&p.trim()&&(h.api_key=p.trim()),a.mutate({instance:t.instance,body:h},{onSuccess:s})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(I,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:i,placeholder:"openai"}),e.jsx(_,{label:"API base",value:d,onChange:l,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(E,{value:p,onChange:m,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),m("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(f,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:a.isPending,onPress:j,children:a.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function fe(t,s){const a=new Map((s??[]).map(d=>[d.instance,d])),n=new Map((t??[]).map(d=>[d.instance,d]));return[...new Set([...a.keys(),...n.keys()])].sort().map(d=>{const l=a.get(d);return{instance:d,source:l?"stored":"config",stored:l,meta:n.get(d)}})}function je({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(me,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):t.discovery_unsupported?e.jsxs("span",{className:"block max-w-xs break-words text-xs text-amber-800",children:["Could not list models, so the key could not be verified. It may still work for requests.",t.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:t.error}):null]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function be({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=!t.ok&&t.discovery_unsupported,a=t.ok?"border-green-200 bg-green-50 text-green-700":s?"border-amber-200 bg-amber-50 text-amber-800":"border-red-200 bg-red-50 text-red-700",n=t.ok?"bg-green-500":s?"bg-amber-500":"bg-red-500",i=t.checked_at?`Last checked ${q(t.checked_at)}`:"Not checked yet",d=s?`${t.error??"This provider does not list models."} Requests to it may still work.`:t.error??"Unreachable",l=t.ok?i:`${d} · ${i}`;return e.jsxs("span",{title:l,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${n}`}),t.ok?"Reachable":s?"No model discovery":"Unreachable"]})}function ye({healthy:t,degraded:s,total:a,checkedAt:n}){const d=t===a?"bg-green-500":t+s===a?"bg-amber-500":"bg-red-500",l=se();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${d}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s>0?e.jsxs("span",{className:"text-amber-800",children:[s," without model discovery"]}):null,n?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",q(n)]}):null,e.jsx(f,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function R({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function ke({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n,secretKeyConfigured:i}){return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(R,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(R,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(R,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(f,{variant:"primary",isDisabled:!i,onPress:t,children:"Add your first provider"})})]})})}function Ae(){var K,B,D,L;const t=Y(),s=V(),a=G(),n=Q(),i=W(),d=J(),l=X(),[g,u]=x.useState(!1),[p,m]=x.useState(null),[j,h]=x.useState({}),c=fe((K=t.data)==null?void 0:K.providers,s.data),k=new Map((((B=n.data)==null?void 0:B.providers)??[]).map(r=>[r.instance,r])),o=t.isLoading||s.isLoading,b=((D=s.data)==null?void 0:D.find(r=>r.instance===p))??null,N=((L=a.data)==null?void 0:L.require_pricing)===!0&&a.data.default_pricing===!1,P=a.data?a.data.secret_key_configured!==!1:!a.isError,C=!o&&c.length===0&&!g,A=r=>{h(v=>({...v,[r]:{status:"pending"}})),d.mutate(r,{onSuccess:v=>h(y=>({...y,[r]:{status:"done",...v}})),onError:v=>h(y=>({...y,[r]:{status:"done",ok:!1,model_count:0,error:O(v),discovery_unsupported:!1}}))})},w=[{id:"provider",header:"Provider",isRowHeader:!0,cell:r=>e.jsx(M,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"font-medium text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})},{id:"type",header:"Type",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:((v=r.meta)==null?void 0:v.provider_type)??((y=r.stored)==null?void 0:y.provider_type)??r.instance})}},{id:"source",header:"Source",cell:r=>e.jsx(de,{size:"sm",color:r.source==="stored"?"accent":"default",children:r.source==="stored"?"stored":"config"})},{id:"api_key",header:"API key",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:(v=r.stored)!=null&&v.last4?`••••${r.stored.last4}`:"none set"}):(y=r.meta)!=null&&y.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"})}},{id:"status",header:"Status",cell:r=>e.jsx(be,{health:k.get(r.instance)})},{id:"actions",header:"Actions",align:"end",cell:r=>{var v,y;return r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:((v=j[r.instance])==null?void 0:v.status)==="pending"||((y=r.stored)==null?void 0:y.decryptable)===!1,onPress:()=>A(r.instance),children:"Test"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{u(!1),m(r.instance)},children:"Edit"}),e.jsx(ae,{confirmLabel:"Delete",isPending:i.isPending,onConfirm:()=>i.mutate(r.instance),children:"Delete"})]}),e.jsx(je,{state:j[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})}}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||C?null:e.jsx(f,{variant:"primary",isDisabled:!P,onPress:()=>{m(null),u(!0)},children:"Add provider"})}),e.jsx(I,{error:t.error??s.error??a.error??n.error??l.error??i.error}),P?null:e.jsxs(ee,{tone:"warning",children:[e.jsx("code",{children:"OTARI_SECRET_KEY"})," is not set, so provider keys can't be encrypted at rest and adding providers from the dashboard is disabled. Set it on the server and restart to add providers here. Providers defined in"," ",e.jsx("code",{children:"config.yml"})," keep working without it."]}),C?e.jsx(ke,{onAddProvider:()=>{m(null),u(!0)},needsPricing:N,onEnablePricing:()=>l.mutate({default_pricing:!0}),enabling:l.isPending,secretKeyConfigured:P}):null,g&&P?e.jsx(ve,{onClose:()=>u(!1)}):null,b?e.jsx(ge,{provider:b,onClose:()=>m(null)}):null,!o&&c.length>0&&n.data&&n.data.total>0?e.jsx(ye,{healthy:n.data.healthy,degraded:n.data.degraded,total:n.data.total,checkedAt:n.data.checked_at}):null,C?null:e.jsx(oe,{ariaLabel:"Providers",columns:w,rows:c,getRowKey:r=>r.instance,isLoading:o,emptyContent:"No providers yet. Add your first provider to start serving models."})]})}export{Ae as ProvidersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,L as M}from"./react-dgEcD0HR.js";import{X as Y,a6 as V,V as G,_ as W,a7 as X,a8 as J,a9 as Q,P as Z,E as I,I as ee,aa as te,ab as se,a5 as q,s as ae,ac as $,ad as re,T as O,ae as ne,af as ie}from"./index-Dhxz7Eyv.js";import{F as _}from"./Field-DEJ6Wjg9.js";import{D as oe}from"./DataTable-CrQq0sYf.js";import{B as f,d as S,f as de,T as le,L as F,I as H,D as ce,S as me,C as T,a as ue,b as xe}from"./heroui-DZj66Arc.js";function E({value:t,onChange:s,label:a,placeholder:n,description:i}){return e.jsxs(le,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(H,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),i?e.jsx(ce,{className:"text-xs text-[var(--otari-muted)]",children:i}):null]})}function z({label:t,value:s,onChange:a,description:n,placeholder:i,extra:d=[],includeCatalog:l=!0}){var k;const g=ne(),u=x.useMemo(()=>l?[...d,...(g.data??[]).map(o=>({id:o.id,name:o.name}))]:d,[g.data,d,l]),[p,m]=x.useState(()=>{var o;return((o=u.find(b=>b.id===s))==null?void 0:o.name)??""}),j=((k=u.find(o=>o.id===s))==null?void 0:k.name)??"",h=p.trim()===j.trim()?"":p.trim().toLowerCase(),c=u.filter(o=>!h||o.name.toLowerCase().includes(h)||o.id.toLowerCase().includes(h)).slice(0,50);return e.jsxs(T.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:p,onInputChange:m,onSelectionChange:o=>{var b;o!=null?(a(String(o)),m(((b=u.find(N=>N.id===String(o)))==null?void 0:b.name)??"")):(a(""),m(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(T.InputGroup,{children:[e.jsx(H,{placeholder:i??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:o=>o.currentTarget.select()}),e.jsx(T.Trigger,{})]}),e.jsx(T.Popover,{children:e.jsx(ue,{items:c,className:"max-h-72 overflow-auto",children:o=>e.jsx(xe,{id:o.id,textValue:o.name,children:o.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function U({getPayload:t}){const s=ie(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:O(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):s.data.discovery_unsupported?e.jsxs("span",{className:"block max-w-md break-words text-xs text-amber-800",children:["This provider does not list models, so the key could not be verified here. Save it and use the provider; declare its model ids under ",e.jsx("code",{children:"models:"})," to have them show up in the catalogue. If you did not expect this, check the provider's reply below.",s.data.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:s.data.error}):null]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function pe({onClose:t}){var A;const s=$(),[a,n]=x.useState(""),[i,d]=x.useState(""),[l,g]=x.useState(!1),[u,p]=x.useState(""),[m,j]=x.useState(""),h=re(a),c=((A=h.data)==null?void 0:A.id)===a?h.data:void 0;x.useEffect(()=>{c&&p(c.default_api_base??"")},[c]);const k=(c==null?void 0:c.env_key_present)??!1,o=((c==null?void 0:c.requires_api_key)??!0)&&!k,b=m.trim()!==""&&m.trim()!==a,N=/[:/]/.test(m),P=a!==""&&!N&&(!o||i.trim()!=="")&&!s.isPending,C=()=>{P&&s.mutate({instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsx(z,{label:"Provider",value:a,onChange:w=>{n(w),j(""),p("")},description:"Its endpoint is built in."}),e.jsx(E,{value:i,onChange:d,label:c&&!o?"API key (optional)":"API key",description:c?o?`${c.name}'s endpoint is built in — just add your key.`:k?`${c.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${c.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>g(w=>!w),children:l?"Hide advanced":"Advanced (API base, rename)"}),l?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:u,onChange:p,placeholder:(c==null?void 0:c.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:m,onChange:j,placeholder:a||"instance name",description:N?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!P,onPress:C,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a===""?null:{instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null}})]})]})}function he({onClose:t}){const s=$(),[a,n]=x.useState(""),[i,d]=x.useState("openai-compatible"),[l,g]=x.useState(""),[u,p]=x.useState(""),m=/[:/]/.test(a),j=a.trim()!==""&&!m&&l.trim()!==""&&!s.isPending,h=()=>{j&&s.mutate({instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:m?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(z,{label:"Compatible with",value:i,onChange:d,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:l,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(E,{value:u,onChange:p,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!j,onPress:h,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a.trim()===""||l.trim()===""?null:{instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null}})]})]})}function ve({onClose:t}){const[s,a]=x.useState("known");return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,i])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:i},n))})}),s==="known"?e.jsx(pe,{onClose:t}):e.jsx(he,{onClose:t})]})})}function ge({provider:t,onClose:s}){const a=te(),[n,i]=x.useState(t.provider_type??""),[d,l]=x.useState(t.api_base??""),[g,u]=x.useState(!1),[p,m]=x.useState(""),j=()=>{if(a.isPending)return;const h={provider_type:n.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};g&&p.trim()&&(h.api_key=p.trim()),a.mutate({instance:t.instance,body:h},{onSuccess:s})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(I,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:i,placeholder:"openai"}),e.jsx(_,{label:"API base",value:d,onChange:l,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(E,{value:p,onChange:m,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),m("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(f,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:a.isPending,onPress:j,children:a.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function fe(t,s){const a=new Map((s??[]).map(d=>[d.instance,d])),n=new Map((t??[]).map(d=>[d.instance,d]));return[...new Set([...a.keys(),...n.keys()])].sort().map(d=>{const l=a.get(d);return{instance:d,source:l?"stored":"config",stored:l,meta:n.get(d)}})}function je({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(me,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):t.discovery_unsupported?e.jsxs("span",{className:"block max-w-xs break-words text-xs text-amber-800",children:["Could not list models, so the key could not be verified. It may still work for requests.",t.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:t.error}):null]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function be({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=!t.ok&&t.discovery_unsupported,a=t.ok?"border-green-200 bg-green-50 text-green-700":s?"border-amber-200 bg-amber-50 text-amber-800":"border-red-200 bg-red-50 text-red-700",n=t.ok?"bg-green-500":s?"bg-amber-500":"bg-red-500",i=t.checked_at?`Last checked ${q(t.checked_at)}`:"Not checked yet",d=s?`${t.error??"This provider does not list models."} Requests to it may still work.`:t.error??"Unreachable",l=t.ok?i:`${d} · ${i}`;return e.jsxs("span",{title:l,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${n}`}),t.ok?"Reachable":s?"No model discovery":"Unreachable"]})}function ye({healthy:t,degraded:s,total:a,checkedAt:n}){const d=t===a?"bg-green-500":t+s===a?"bg-amber-500":"bg-red-500",l=se();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${d}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s>0?e.jsxs("span",{className:"text-amber-800",children:[s," without model discovery"]}):null,n?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",q(n)]}):null,e.jsx(f,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function R({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function ke({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n,secretKeyConfigured:i}){return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(R,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(R,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(R,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(f,{variant:"primary",isDisabled:!i,onPress:t,children:"Add your first provider"})})]})})}function Ae(){var K,B,D,L;const t=Y(),s=V(),a=G(),n=W(),i=X(),d=J(),l=Q(),[g,u]=x.useState(!1),[p,m]=x.useState(null),[j,h]=x.useState({}),c=fe((K=t.data)==null?void 0:K.providers,s.data),k=new Map((((B=n.data)==null?void 0:B.providers)??[]).map(r=>[r.instance,r])),o=t.isLoading||s.isLoading,b=((D=s.data)==null?void 0:D.find(r=>r.instance===p))??null,N=((L=a.data)==null?void 0:L.require_pricing)===!0&&a.data.default_pricing===!1,P=a.data?a.data.secret_key_configured!==!1:!a.isError,C=!o&&c.length===0&&!g,A=r=>{h(v=>({...v,[r]:{status:"pending"}})),d.mutate(r,{onSuccess:v=>h(y=>({...y,[r]:{status:"done",...v}})),onError:v=>h(y=>({...y,[r]:{status:"done",ok:!1,model_count:0,error:O(v),discovery_unsupported:!1}}))})},w=[{id:"provider",header:"Provider",isRowHeader:!0,cell:r=>e.jsx(M,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"font-medium text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})},{id:"type",header:"Type",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:((v=r.meta)==null?void 0:v.provider_type)??((y=r.stored)==null?void 0:y.provider_type)??r.instance})}},{id:"source",header:"Source",cell:r=>e.jsx(de,{size:"sm",color:r.source==="stored"?"accent":"default",children:r.source==="stored"?"stored":"config"})},{id:"api_key",header:"API key",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:(v=r.stored)!=null&&v.last4?`••••${r.stored.last4}`:"none set"}):(y=r.meta)!=null&&y.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"})}},{id:"status",header:"Status",cell:r=>e.jsx(be,{health:k.get(r.instance)})},{id:"actions",header:"Actions",align:"end",cell:r=>{var v,y;return r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:((v=j[r.instance])==null?void 0:v.status)==="pending"||((y=r.stored)==null?void 0:y.decryptable)===!1,onPress:()=>A(r.instance),children:"Test"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{u(!1),m(r.instance)},children:"Edit"}),e.jsx(ae,{confirmLabel:"Delete",isPending:i.isPending,onConfirm:()=>i.mutate(r.instance),children:"Delete"})]}),e.jsx(je,{state:j[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})}}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||C?null:e.jsx(f,{variant:"primary",isDisabled:!P,onPress:()=>{m(null),u(!0)},children:"Add provider"})}),e.jsx(I,{error:t.error??s.error??a.error??n.error??l.error??i.error}),P?null:e.jsxs(ee,{tone:"warning",children:[e.jsx("code",{children:"OTARI_SECRET_KEY"})," is not set, so provider keys can't be encrypted at rest and adding providers from the dashboard is disabled. Set it on the server and restart to add providers here. Providers defined in"," ",e.jsx("code",{children:"config.yml"})," keep working without it."]}),C?e.jsx(ke,{onAddProvider:()=>{m(null),u(!0)},needsPricing:N,onEnablePricing:()=>l.mutate({default_pricing:!0}),enabling:l.isPending,secretKeyConfigured:P}):null,g&&P?e.jsx(ve,{onClose:()=>u(!1)}):null,b?e.jsx(ge,{provider:b,onClose:()=>m(null)}):null,!o&&c.length>0&&n.data&&n.data.total>0?e.jsx(ye,{healthy:n.data.healthy,degraded:n.data.degraded,total:n.data.total,checkedAt:n.data.checked_at}):null,C?null:e.jsx(oe,{ariaLabel:"Providers",columns:w,rows:c,getRowKey:r=>r.instance,isLoading:o,emptyContent:"No providers yet. Add your first provider to start serving models."})]})}export{Ae as ProvidersPage}; diff --git a/src/gateway/static/dashboard/assets/SettingsPage-DaOqG5a9.js b/src/gateway/static/dashboard/assets/SettingsPage-CY71vadM.js similarity index 94% rename from src/gateway/static/dashboard/assets/SettingsPage-DaOqG5a9.js rename to src/gateway/static/dashboard/assets/SettingsPage-CY71vadM.js index 09fe89f26..102172102 100644 --- a/src/gateway/static/dashboard/assets/SettingsPage-DaOqG5a9.js +++ b/src/gateway/static/dashboard/assets/SettingsPage-CY71vadM.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{Q as R,a5 as C,P,E as y,U as E,ac as T,ad as _,ae as D,F as A,af as O,a2 as F,ag as I,I as w}from"./index-DsUY4UvK.js";import{d as v,B as h,A as d,g as K,I as z}from"./heroui-BI50yK5B.js";function b(t,r){return{[t]:r}}function M(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function L(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||M(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(A,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function U({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function V({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(V,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function Q({source:t}){const r=O(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:K({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(G,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function X(){var o;const t=F(),r=I(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(Q,{source:t}),e.jsx(X,{})]})})]})}function W({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=T(),r=_(),s=D(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(W,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&L(l,n)),k=ee(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,t.isLoading?e.jsx(E,{}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(U,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,L as fieldMatches}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{V as R,a9 as C,P,E as y,Z as E,ag as T,ah as _,ai as D,F as A,aj as O,a6 as F,ak as I,I as w}from"./index-Dhxz7Eyv.js";import{d as v,B as h,A as d,g as K,I as z}from"./heroui-DZj66Arc.js";function b(t,r){return{[t]:r}}function M(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function L(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||M(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(A,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function V({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function U({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(U,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function X({source:t}){const r=O(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:K({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(G,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function Z(){var o;const t=F(),r=I(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(X,{source:t}),e.jsx(Z,{})]})})]})}function Q({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function W(){const t=T(),r=_(),s=D(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(Q,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&L(l,n)),k=ee(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,t.isLoading?e.jsx(E,{}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(V,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(W,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,L as fieldMatches}; diff --git a/src/gateway/static/dashboard/assets/TablePagination-DgA36VXY.js b/src/gateway/static/dashboard/assets/TablePagination-BYC0DnfO.js similarity index 97% rename from src/gateway/static/dashboard/assets/TablePagination-DgA36VXY.js rename to src/gateway/static/dashboard/assets/TablePagination-BYC0DnfO.js index e3b563a5f..01bc818f9 100644 --- a/src/gateway/static/dashboard/assets/TablePagination-DgA36VXY.js +++ b/src/gateway/static/dashboard/assets/TablePagination-BYC0DnfO.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{I as w,E as M,F as D}from"./index-DsUY4UvK.js";import{A as o,B as x,T as F,L as $,I as T,S as y}from"./heroui-BI50yK5B.js";function _({label:t,value:r,onChange:a,isRequired:c,autoFocus:i}){return e.jsxs(F,{value:r,onChange:a,isRequired:c,className:"flex flex-col gap-1",children:[e.jsx($,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsx(T,{inputMode:"decimal",placeholder:"0.00",autoFocus:i})]})}function R(t){const r=t.trim();if(r==="")return null;const a=Number(r);return Number.isFinite(a)&&a>=0?a:Number.NaN}const C=t=>`Recompute cost for ${t.toLocaleString()} imported ${t===1?"row":"rows"} from each row's own token counts at these per-1M rates. Enforced gateway rows are never affected.`;function W({isOpen:t,onOpenChange:r,targetCount:a,isPending:c,error:i,onSubmit:E,title:I="Set price",description:L=C}){const[j,p]=u.useState(""),[n,h]=u.useState(""),[b,N]=u.useState(""),[f,v]=u.useState("");u.useEffect(()=>{t&&(p(""),h(""),N(""),v(""))},[t]);const m=R(j),l=R(n),d=R(b),s=R(f),g=m===null||Number.isNaN(m)||l===null||Number.isNaN(l)||Number.isNaN(d??0)||Number.isNaN(s??0),S=()=>{g||m===null||l===null||E({input_price_per_million:m,output_price_per_million:l,...d!==null&&!Number.isNaN(d)?{cache_read_price_per_million:d}:{},...s!==null&&!Number.isNaN(s)?{cache_write_price_per_million:s}:{}})};return e.jsx(o,{isOpen:t,onOpenChange:r,children:t?e.jsx(o.Backdrop,{children:e.jsx(o.Container,{placement:"center",size:"lg",children:e.jsxs(o.Dialog,{children:[e.jsx(o.Header,{children:e.jsx(o.Heading,{children:I})}),e.jsxs(o.Body,{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:L(a)}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(_,{label:"Input $ / 1M",value:j,onChange:p,isRequired:!0,autoFocus:!0}),e.jsx(_,{label:"Output $ / 1M",value:n,onChange:h,isRequired:!0}),e.jsx(_,{label:"Cache read $ / 1M",value:b,onChange:N}),e.jsx(_,{label:"Cache write $ / 1M",value:f,onChange:v})]}),e.jsx(w,{tone:"info",children:"Leave a cache rate blank to bill those tokens at the input rate."}),e.jsx(M,{error:i})]}),e.jsxs(o.Footer,{children:[e.jsx(x,{variant:"ghost",isDisabled:c,onPress:()=>r(!1),children:"Cancel"}),e.jsx(x,{variant:"primary",isDisabled:g,isPending:c,onPress:S,children:"Set price"})]})]})})}):null})}const P=[25,50,100];function q({page:t,pageSize:r,total:a,rowsOnPage:c,onPageChange:i,onPageSizeChange:E,pageSizeOptions:I=P,isFetching:L=!1,hasNextFallback:j=!1}){const p=u.useId(),n=a!=null?Math.max(1,Math.ceil(a/r)):null,h=t===0,b=n!=null?t>=n-1:!j,N=c>0?t*r+1:0,f=t*r+c,v=a!=null?a===0?"0 of 0":`${N.toLocaleString()}–${f.toLocaleString()} of ${a.toLocaleString()}`:c>0?`${N.toLocaleString()}–${f.toLocaleString()}`:"0",[m,l]=u.useState(String(t+1));u.useEffect(()=>{l(String(t+1))},[t]);const d=()=>{const s=Number.parseInt(m,10);if(Number.isNaN(s)){l(String(t+1));return}const g=n??Number.MAX_SAFE_INTEGER,S=Math.min(Math.max(s,1),g);S-1!==t?i(S-1):l(String(t+1))};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:p,className:"text-sm text-[var(--otari-muted)]",children:"Rows"}),e.jsx(D,{id:p,ariaLabel:"Rows per page",value:String(r),onChange:s=>E(Number.parseInt(s,10)),options:I.map(s=>({value:String(s),label:String(s)}))}),L?e.jsx(y,{size:"sm"}):null]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[var(--otari-muted)] tabular-nums",children:v}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"outline","aria-label":"First page",isDisabled:h,onPress:()=>i(0),children:"«"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Previous page",isDisabled:h,onPress:()=>i(t-1),children:"‹"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{"aria-label":"Page number",inputMode:"numeric",value:m,onChange:s=>l(s.target.value.replace(/[^0-9]/g,"")),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()},onBlur:d,className:"w-12 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-2 py-1 text-center text-sm text-[var(--otari-ink)] tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"}),n!=null?e.jsxs("span",{className:"tabular-nums",children:["/ ",n.toLocaleString()]}):null]}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Next page",isDisabled:b,onPress:()=>i(t+1),children:"›"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Last page",isDisabled:n==null||b,onPress:()=>n!=null&&i(n-1),children:"»"})]})]})]})}export{P,W as S,q as T}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{I as w,E as M,F as D}from"./index-Dhxz7Eyv.js";import{A as o,B as x,T as F,L as $,I as T,S as y}from"./heroui-DZj66Arc.js";function _({label:t,value:r,onChange:a,isRequired:c,autoFocus:i}){return e.jsxs(F,{value:r,onChange:a,isRequired:c,className:"flex flex-col gap-1",children:[e.jsx($,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsx(T,{inputMode:"decimal",placeholder:"0.00",autoFocus:i})]})}function R(t){const r=t.trim();if(r==="")return null;const a=Number(r);return Number.isFinite(a)&&a>=0?a:Number.NaN}const C=t=>`Recompute cost for ${t.toLocaleString()} imported ${t===1?"row":"rows"} from each row's own token counts at these per-1M rates. Enforced gateway rows are never affected.`;function W({isOpen:t,onOpenChange:r,targetCount:a,isPending:c,error:i,onSubmit:E,title:I="Set price",description:L=C}){const[j,p]=u.useState(""),[n,h]=u.useState(""),[b,N]=u.useState(""),[f,v]=u.useState("");u.useEffect(()=>{t&&(p(""),h(""),N(""),v(""))},[t]);const m=R(j),l=R(n),d=R(b),s=R(f),g=m===null||Number.isNaN(m)||l===null||Number.isNaN(l)||Number.isNaN(d??0)||Number.isNaN(s??0),S=()=>{g||m===null||l===null||E({input_price_per_million:m,output_price_per_million:l,...d!==null&&!Number.isNaN(d)?{cache_read_price_per_million:d}:{},...s!==null&&!Number.isNaN(s)?{cache_write_price_per_million:s}:{}})};return e.jsx(o,{isOpen:t,onOpenChange:r,children:t?e.jsx(o.Backdrop,{children:e.jsx(o.Container,{placement:"center",size:"lg",children:e.jsxs(o.Dialog,{children:[e.jsx(o.Header,{children:e.jsx(o.Heading,{children:I})}),e.jsxs(o.Body,{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:L(a)}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(_,{label:"Input $ / 1M",value:j,onChange:p,isRequired:!0,autoFocus:!0}),e.jsx(_,{label:"Output $ / 1M",value:n,onChange:h,isRequired:!0}),e.jsx(_,{label:"Cache read $ / 1M",value:b,onChange:N}),e.jsx(_,{label:"Cache write $ / 1M",value:f,onChange:v})]}),e.jsx(w,{tone:"info",children:"Leave a cache rate blank to bill those tokens at the input rate."}),e.jsx(M,{error:i})]}),e.jsxs(o.Footer,{children:[e.jsx(x,{variant:"ghost",isDisabled:c,onPress:()=>r(!1),children:"Cancel"}),e.jsx(x,{variant:"primary",isDisabled:g,isPending:c,onPress:S,children:"Set price"})]})]})})}):null})}const P=[25,50,100];function q({page:t,pageSize:r,total:a,rowsOnPage:c,onPageChange:i,onPageSizeChange:E,pageSizeOptions:I=P,isFetching:L=!1,hasNextFallback:j=!1}){const p=u.useId(),n=a!=null?Math.max(1,Math.ceil(a/r)):null,h=t===0,b=n!=null?t>=n-1:!j,N=c>0?t*r+1:0,f=t*r+c,v=a!=null?a===0?"0 of 0":`${N.toLocaleString()}–${f.toLocaleString()} of ${a.toLocaleString()}`:c>0?`${N.toLocaleString()}–${f.toLocaleString()}`:"0",[m,l]=u.useState(String(t+1));u.useEffect(()=>{l(String(t+1))},[t]);const d=()=>{const s=Number.parseInt(m,10);if(Number.isNaN(s)){l(String(t+1));return}const g=n??Number.MAX_SAFE_INTEGER,S=Math.min(Math.max(s,1),g);S-1!==t?i(S-1):l(String(t+1))};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:p,className:"text-sm text-[var(--otari-muted)]",children:"Rows"}),e.jsx(D,{id:p,ariaLabel:"Rows per page",value:String(r),onChange:s=>E(Number.parseInt(s,10)),options:I.map(s=>({value:String(s),label:String(s)}))}),L?e.jsx(y,{size:"sm"}):null]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[var(--otari-muted)] tabular-nums",children:v}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"outline","aria-label":"First page",isDisabled:h,onPress:()=>i(0),children:"«"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Previous page",isDisabled:h,onPress:()=>i(t-1),children:"‹"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{"aria-label":"Page number",inputMode:"numeric",value:m,onChange:s=>l(s.target.value.replace(/[^0-9]/g,"")),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()},onBlur:d,className:"w-12 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-2 py-1 text-center text-sm text-[var(--otari-ink)] tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"}),n!=null?e.jsxs("span",{className:"tabular-nums",children:["/ ",n.toLocaleString()]}):null]}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Next page",isDisabled:b,onPress:()=>i(t+1),children:"›"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Last page",isDisabled:n==null||b,onPress:()=>n!=null&&i(n-1),children:"»"})]})]})]})}export{P,W as S,q as T}; diff --git a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-B5j54QGf.js b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-D_8zOvld.js similarity index 77% rename from src/gateway/static/dashboard/assets/ToolsGuardrailsPage-B5j54QGf.js rename to src/gateway/static/dashboard/assets/ToolsGuardrailsPage-D_8zOvld.js index 3c4c714ac..c0603ec39 100644 --- a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-B5j54QGf.js +++ b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-D_8zOvld.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x}from"./react-dgEcD0HR.js";import{ah as L,ai as C,P,E,U as R,N as w,aj as D,F as U}from"./index-DsUY4UvK.js";import{d as N,B as g}from"./heroui-BI50yK5B.js";function M(s,t){return{[s]:t}}const B=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=x.useState(null),a=x.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function z({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",b="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r),[m,p]=x.useState(null),c=D();x.useEffect(()=>{i(r)},[r]);const o=l.trim()!==r,d=l.trim(),h=m!==null&&m===d;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:l,disabled:n,placeholder:"unset",onChange:v=>{i(v.target.value),c.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(d===""?null:d),children:"Save"}),e.jsx(g,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:d===""||c.isPending,onPress:()=>{p(d),c.mutate({service:s.service,url:d})},children:c.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:c.isPending||!h?null:c.error?e.jsx("span",{className:"text-red-700",children:w(c.error)}):c.data?e.jsx("span",{className:c.data.ok?"font-medium text-green-700":"text-red-700",children:c.data.reason}):null}),e.jsx(j,{message:a})]})]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:p=>i(p.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(l.trim()===""?null:l.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l.trim(),p=Number(m),o=(m===""||Number.isInteger(p)&&p>=1)&&m!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:d=>i(d.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(m===""?null:p),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(U,{ariaLabel:s.key,value:r,onChange:l=>t(l==="default"?null:l==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function O({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(F,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n})}function V(){const s=L(),t=C(),[a,n]=$(),[r,l]=x.useState({}),i=s.data,m=!i||t.isPending,p=new Map(((i==null?void 0:i.fields)??[]).map(o=>[o.key,o])),c=(o,d)=>{l(h=>{const{[o.key]:v,...u}=h;return u}),t.mutate(M(o.key,d),{onSuccess:()=>n(`${o.key} saved`),onError:h=>l(v=>({...v,[o.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(E,{error:s.error}),s.isLoading?e.jsx(R,{}):null,B.map(o=>{const d=o.order.map(u=>p.get(u)).filter(u=>u!==void 0),h=((i==null?void 0:i.fields)??[]).filter(u=>u.service===o.key&&!o.order.includes(u.key)),v=[...d,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:o.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:o.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(O,{field:u,onSave:T=>c(u,T),saveError:r[u.key],disabled:m},u.key))})})]},o.key)}),e.jsx(z,{message:a})]})}export{V as ToolsGuardrailsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x}from"./react-dgEcD0HR.js";import{al as L,am as C,P,E,Z as R,T as w,an as D,F as M}from"./index-Dhxz7Eyv.js";import{d as N,B as g}from"./heroui-DZj66Arc.js";function U(s,t){return{[s]:t}}const B=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=x.useState(null),a=x.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function z({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",b="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[o,i]=x.useState(r),[m,p]=x.useState(null),c=D();x.useEffect(()=>{i(r)},[r]);const l=o.trim()!==r,d=o.trim(),h=m!==null&&m===d;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:o,disabled:n,placeholder:"unset",onChange:v=>{i(v.target.value),c.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!l,onPress:()=>t(d===""?null:d),children:"Save"}),e.jsx(g,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:d===""||c.isPending,onPress:()=>{p(d),c.mutate({service:s.service,url:d})},children:c.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:c.isPending||!h?null:c.error?e.jsx("span",{className:"text-red-700",children:w(c.error)}):c.data?e.jsx("span",{className:c.data.ok?"font-medium text-green-700":"text-red-700",children:c.data.reason}):null}),e.jsx(j,{message:a})]})]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[o,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=o!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:o,disabled:n,placeholder:"default",onChange:p=>i(p.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(o.trim()===""?null:o.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[o,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=o.trim(),p=Number(m),l=(m===""||Number.isInteger(p)&&p>=1)&&m!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:o,disabled:n,placeholder:"default",onChange:d=>i(d.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!l,onPress:()=>t(m===""?null:p),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(M,{ariaLabel:s.key,value:r,onChange:o=>t(o==="default"?null:o==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function O({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(F,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n})}function V(){const s=L(),t=C(),[a,n]=$(),[r,o]=x.useState({}),i=s.data,m=!i||t.isPending,p=new Map(((i==null?void 0:i.fields)??[]).map(l=>[l.key,l])),c=(l,d)=>{o(h=>{const{[l.key]:v,...u}=h;return u}),t.mutate(U(l.key,d),{onSuccess:()=>n(`${l.key} saved`),onError:h=>o(v=>({...v,[l.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(E,{error:s.error}),s.isLoading?e.jsx(R,{}):null,B.map(l=>{const d=l.order.map(u=>p.get(u)).filter(u=>u!==void 0),h=((i==null?void 0:i.fields)??[]).filter(u=>u.service===l.key&&!l.order.includes(u.key)),v=[...d,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:l.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:l.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(O,{field:u,onSave:T=>c(u,T),saveError:r[u.key],disabled:m},u.key))})})]},l.key)}),e.jsx(z,{message:a})]})}export{V as ToolsGuardrailsPage}; diff --git a/src/gateway/static/dashboard/assets/UsagePage-DQoRJkY3.js b/src/gateway/static/dashboard/assets/UsagePage-DQoRJkY3.js deleted file mode 100644 index 2264caf5d..000000000 --- a/src/gateway/static/dashboard/assets/UsagePage-DQoRJkY3.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as Ae,r as i}from"./react-dgEcD0HR.js";import{u as Ue,a as Re,k as te,e as Oe,d as Y,W as T,ak as ke,P as Ke,E as ye,al as je,R as $e,j as se,w as Be,X as q,_ as A,Z as V,a0 as Ie,am as B,f as ze,g as He,h as Ze,b as Ge,c as xe}from"./index-DsUY4UvK.js";import{A as We,F as Ye}from"./FilterChips-Dah6AI5Z.js";import{u as Qe,r as Ve,B as Je}from"./tableSelection-9hV37uhu.js";import{S as ae,B as Xe}from"./charts-DIsd9m--.js";import{C as et}from"./ConfirmDialog-NCJIhH2z.js";import{D as we}from"./DataTable-Bmn_eYSV.js";import{T as tt,S as st}from"./TablePagination-DgA36VXY.js";import{B as I,S as pe}from"./heroui-BI50yK5B.js";import"./recharts-C4kRDmvS.js";function Q(t){return t.toLocaleString()}function at(t){return t===null?"—":t<1e3?`${Math.round(t)} ms`:`${(t/1e3).toFixed(2)} s`}const fe=ze(je,ke),ne=15,_e="__other__",ve="__unknown__";function Se({title:t,rows:r,totalCost:h,emptyLabel:n,onDrill:v,loading:m}){const[c,x]=i.useState(!1),j=c?r:r.slice(0,ne),U=r.length-j.length,N=o=>o.is_other?_e:o.key??ve,R=[{id:"name",header:t.replace("Spend by ",""),isRowHeader:!0,cell:o=>{const d=h>0?o.cost/h:0;return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"truncate text-[var(--otari-ink)]",children:o.is_other?`Other (${o.requests.toLocaleString()} req)`:o.key===null?"(unknown)":o.key}),e.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:e.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,d*100)}%`}})})]})}},{id:"requests",header:"Requests",align:"end",cell:o=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:Q(o.requests)})},{id:"spend",header:"Spend",align:"end",cell:o=>e.jsx("span",{className:"text-[var(--otari-ink)]",children:V(o.cost)})}];return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(we,{ariaLabel:t,columns:R,rows:j,getRowKey:N,isLoading:m,emptyContent:n,onRowAction:o=>{o!==_e&&o!==ve&&v(o)}}),!m&&U>0?e.jsxs(I,{size:"sm",variant:"ghost",onPress:()=>x(!0),children:["Show all ",r.length]}):null,!m&&c&&r.length>ne?e.jsxs(I,{size:"sm",variant:"ghost",onPress:()=>x(!1),children:["Show top ",ne]}):null]})}const nt=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}];function ot(t,r){return r==="cost"?t.cost:r==="tokens"?t.tokens:t.requests}function be(t,r){return r==="cost"?V(t):r==="tokens"?B(t):Q(t)}function rt(t,r){const h=new Date(t);return Number.isNaN(h.getTime())?t:r==="hour"?h.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):h.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}function lt(t,r,h){const n=t.map(m=>({label:rt(m.bucket_start,h),value:ot(m,r)})),v=n.length?Math.max(...n.map(m=>m.value)):0;return{points:n,peak:v,count:t.length}}const it=50;function ct(t){const r=new Date(t).getTime();if(Number.isNaN(r))return t;const h=Math.max(0,Math.round((Date.now()-r)/1e3));if(h<60)return`${h}s ago`;const n=Math.round(h/60);if(n<60)return`${n}m ago`;const v=Math.round(n/60);return v<24?`${v}h ago`:`${Math.round(v/24)}d ago`}function dt({status:t}){return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:t})}const ut=[{id:"time",header:"Time",isRowHeader:!0,cell:t=>e.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(t.timestamp).toLocaleString(),children:ct(t.timestamp)})},{id:"model",header:"Model",cell:t=>e.jsx("span",{className:"text-[var(--otari-ink)]",children:t.model})},{id:"user",header:"User",cell:t=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:t.user_id??"—"})},{id:"tokens",header:"Tokens",align:"end",cell:t=>t.total_tokens===null?"—":t.total_tokens.toLocaleString()},{id:"cost",header:"Cost",align:"end",cell:t=>t.cost===null?"—":V(t.cost)},{id:"status",header:"Status",cell:t=>e.jsx(dt,{status:t.status})}],mt=t=>t.id;function ht({filters:t,anyFilter:r}){var $,H;const[h,n]=i.useState(0),[v,m]=i.useState(it),c=Qe(),x=He(),j=Ze(),[U,N]=i.useState(!1),[R,o]=i.useState(!1),d=JSON.stringify(t),L=i.useRef(d);i.useEffect(()=>{L.current!==d&&(L.current=d,n(0),c.clear())},[d,c]);const p=Ge(t,h,v),C=xe(t),g=p.data??[],P=C.isSuccess&&!C.isPlaceholderData?(($=C.data)==null?void 0:$.total)??0:null,O=g.filter(_=>!_.counts_toward_budget).map(_=>_.id),f=g.filter(_=>_.counts_toward_budget).map(_=>_.id),S=Ve(c.selectedKeys,O),b=S.length,y=c.allMatching||b>0,D=i.useMemo(()=>({...t,counts_toward_budget:!1}),[t]),k=xe(D,y),E=k.isSuccess?((H=k.data)==null?void 0:H.total)??null:null,K=O.length>0&&b===O.length&&E!=null&&E>b,F=c.allMatching?E??b:b,l=()=>c.allMatching?{by_filter:!0,model:t.model,user_id:t.user_id,api_key_id:t.api_key_id,start_date:t.start_date,end_date:t.end_date,priced:t.priced}:{ids:S},a=()=>x.mutate(l(),{onSuccess:()=>{N(!1),c.clear()}}),u=_=>j.mutate({...l(),..._},{onSuccess:()=>{o(!1),c.clear()}});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Individual requests"}),e.jsx(ye,{error:p.error??C.error}),y?e.jsxs(Je,{selectedCount:F,allMatching:c.allMatching,matchingTotal:E,canSelectAllMatching:K,onSelectAllMatching:c.enableAllMatching,onClear:c.clear,children:[e.jsx(I,{size:"sm",variant:"primary",onPress:()=>o(!0),children:"Set price"}),e.jsx(I,{size:"sm",variant:"danger",onPress:()=>N(!0),children:"Delete"})]}):null,e.jsx(we,{ariaLabel:"Individual requests",columns:ut,rows:g,getRowKey:mt,isLoading:p.isLoading,emptyContent:r?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:c.selectedKeys,onSelectionChange:c.onSelectionChange,disabledKeys:f}),e.jsx(tt,{page:h,pageSize:v,total:P,rowsOnPage:g.length,onPageChange:n,onPageSizeChange:_=>{m(_),n(0)},isFetching:p.isFetching,hasNextFallback:g.length===v}),e.jsx(et,{isOpen:U,onOpenChange:N,heading:"Delete usage rows",body:`Delete ${F.toLocaleString()} imported ${F===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:x.isPending,error:x.error,onConfirm:a}),e.jsx(st,{isOpen:R,onOpenChange:o,targetCount:F,isPending:j.isPending,error:j.error,onSubmit:u})]})}function wt(){var ue,me,he,ge;const t=Ae(),r=Ue(),h=Re(),[n,v]=i.useState(fe),[m,c]=i.useState(()=>te(fe.seconds??0)),[x,j]=i.useState(!1),[U,N]=i.useState(),[R,o]=i.useState(),[d,L]=i.useState(""),[p,C]=i.useState(""),[g,z]=i.useState(""),[P,O]=i.useState("cost"),f=x?U:m,S=x?R:void 0,b=x?f?Oe(f,S):"day":n.bucket,y=i.useMemo(()=>({start_date:f,end_date:S,model:d.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0}),[f,S,d,p,g]),D=i.useMemo(()=>{if(x){if(!f||!S)return null;const s=new Date(S).getTime()-new Date(f).getTime();return s>0?{...y,start_date:new Date(new Date(f).getTime()-s).toISOString(),end_date:f}:null}return!m||n.seconds===null?null:{...y,start_date:new Date(new Date(m).getTime()-n.seconds*1e3).toISOString(),end_date:m}},[x,f,S,y,n.seconds,m]),k=Y(y,b),E=Y(D??y,b,D!==null),oe=i.useMemo(()=>({start_date:m,model:d.trim()||void 0,user_id:p||void 0,api_key_id:g||void 0}),[m,d,p,g]),K=Y(oe,n.bucket),F=(((ue=K.data)==null?void 0:ue.series)??[]).map(s=>({bucketStart:s.bucket_start,requests:s.requests})),l=k.data,a=l==null?void 0:l.totals,u=D!==null?(me=E.data)==null?void 0:me.totals:void 0,$=a?T(a.cost,u==null?void 0:u.cost):null,H=i.useMemo(()=>({...y,model:void 0}),[y]),_=Y(H,b),J=((ge=(he=_.data)==null?void 0:he.by_model)==null?void 0:ge.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],re=(r.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),le=(h.data??[]).map(s=>({value:s.id,label:s.key_name??`${s.id.slice(0,8)}…`})),Ne=(d&&!J.includes(d)?[d,...J]:J).map(s=>({value:s,label:s})),Ce=x||n.key!==ke,Z=!!(d.trim()||p||g||Ce),ie=(s,w)=>{var G;return((G=s.find(W=>W.value===w))==null?void 0:G.label)??w},Pe=()=>{L(""),C(""),z("")},Ee=[...p?[{key:"user",label:"User",value:ie(re,p),onClear:()=>C("")}]:[],...d.trim()?[{key:"model",label:"Model",value:d.trim(),onClear:()=>L("")}]:[],...g?[{key:"key",label:"API key",value:ie(le,g),onClear:()=>z("")}]:[]],qe=!!(l&&a&&a.request_count===0&&!Z),Le=(l==null?void 0:l.start_date)??f,De=(l==null?void 0:l.end_date)??S,ce=s=>{j(!1),v(s),c(te(s.seconds??0)),N(void 0),o(void 0)},Fe=(s,w)=>{j(!0),N(s),o(w)},Me=()=>{x||c(te(n.seconds??0)),k.refetch(),K.refetch(),_.refetch(),D!==null&&E.refetch()},de=s=>{const w=new URLSearchParams;f&&w.set("start_date",f),S&&w.set("end_date",S);for(const[G,W]of Object.entries(s))W&&w.set(G,W);t(`/activity?${w.toString()}`)},Te=a&&a.request_count>0?a.error_count/a.request_count:0,M=(l==null?void 0:l.series)??[],X=M.length>1,ee=lt(M,P,b);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Ke,{title:"Usage & analytics",description:"Aggregate spend, tokens, and request volume over time. Click a model or user to drill into the request log."}),e.jsx(ye,{error:k.error}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(We,{presets:je,extentKey:n.key,onPreset:ce,onSelectRange:Fe,onSelectFull:()=>ce(n),series:F,bucket:n.bucket,windowStart:Le,windowEnd:De,loading:K.isLoading,ariaLabel:"Usage request volume over the selected window",action:e.jsx($e,{onRefresh:Me,isFetching:k.isFetching,updatedAt:k.dataUpdatedAt})}),e.jsxs(Ye,{chips:Ee,onClearAll:Pe,children:[e.jsx(se,{label:"User",value:p,onChange:C,options:re,placeholder:"All users"}),e.jsx(se,{label:"Model",value:d,onChange:L,options:Ne,placeholder:"All models"}),e.jsx(se,{label:"API key",value:g,onChange:z,options:le,placeholder:"All keys"})]})]}),qe?e.jsx(Be,{title:"No usage yet",description:"Once the gateway serves requests, spend and volume appear here."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[e.jsx(q,{label:"Tracked cost",value:a?V(a.cost):"—",hint:a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[e.jsx(A,{fraction:$}),a.unpriced_requests?`${$!==null?" · ":""}${Q(a.unpriced_requests)} unpriced`:null]}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),e.jsx(q,{label:"Requests",value:a?Q(a.request_count):"—",hint:a?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Ie(Te)," errors",u?e.jsxs(e.Fragment,{children:[" · ",e.jsx(A,{fraction:T(a.request_count,u.request_count)})]}):null]}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),e.jsx(q,{label:"Tokens",value:a?B(a.total_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.total_tokens,u==null?void 0:u.total_tokens)}):null,chart:X?e.jsx(ae,{values:M.map(s=>s.tokens),ariaLabel:"Token usage trend over the selected window"}):void 0}),e.jsx(q,{label:"Cache read",value:a?B(a.cache_read_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.cache_read_tokens,u==null?void 0:u.cache_read_tokens)}):null}),e.jsx(q,{label:"Cache write",value:a?B(a.cache_write_tokens):"—",hint:a?e.jsx(A,{fraction:T(a.cache_write_tokens,u==null?void 0:u.cache_write_tokens)}):null}),e.jsx(q,{label:"1h cache write",value:a?B(a.cache_write_1h_tokens??0):"—",hint:a?e.jsx(A,{fraction:T(a.cache_write_1h_tokens??0,(u==null?void 0:u.cache_write_1h_tokens)??0)}):null}),e.jsx(q,{label:"Avg latency",value:a?at(a.avg_latency_ms):"—"})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(Se,{title:"Spend by model",rows:(l==null?void 0:l.by_model)??[],totalCost:(a==null?void 0:a.cost)??0,emptyLabel:Z?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>de({model:s,user_id:p||void 0,api_key_id:g||void 0}),loading:k.isLoading}),e.jsx(Se,{title:"Spend by user",rows:(l==null?void 0:l.by_user)??[],totalCost:(a==null?void 0:a.cost)??0,emptyLabel:Z?"No usage matches these filters.":"No usage recorded yet.",onDrill:s=>de({user_id:s,model:d.trim()||void 0,api_key_id:g||void 0}),loading:k.isLoading})]}),e.jsx(ht,{filters:y,anyFilter:Z}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Over time"}),e.jsxs("div",{className:"inline-flex gap-1.5",children:[nt.map(s=>e.jsx(I,{size:"sm",variant:P===s.key?"primary":"outline",onPress:()=>O(s.key),children:s.label},s.key)),k.isFetching?e.jsx(pe,{size:"sm"}):null]})]}),k.isLoading?e.jsx("div",{className:"flex h-48 items-center justify-center",children:e.jsx(pe,{size:"sm"})}):M.length===0?e.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):e.jsxs("figure",{className:"flex flex-col gap-2",children:[e.jsx(Xe,{data:ee.points,formatValue:s=>be(s,P),ariaLabel:`${P} per ${b}`}),e.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[be(ee.peak,P)," peak · ",ee.count," ",b==="hour"?"hours":"days"," (times in UTC)"]})]})]})]})]})}export{wt as UsagePage}; diff --git a/src/gateway/static/dashboard/assets/UsagePage-r45FObnV.js b/src/gateway/static/dashboard/assets/UsagePage-r45FObnV.js new file mode 100644 index 000000000..f8982e6c0 --- /dev/null +++ b/src/gateway/static/dashboard/assets/UsagePage-r45FObnV.js @@ -0,0 +1 @@ +import{j as t}from"./tanstack-query-1t81HyiD.js";import{i as at,r as u}from"./react-dgEcD0HR.js";import{u as ot,c as rt,n as le,i as nt,g as ie,ao as lt,$ as Q,ap as Ae,P as it,E as ct,aq as Ue,f as dt,R as ut,m as ce,B as mt,a0 as M,a2 as V,a1 as ue,a4 as Ee,ar as D,F as ht,h as vt,r as pt}from"./index-Dhxz7Eyv.js";import{S as X,C as kt,T as _t}from"./charts-BI8Uczg4.js";import{D as xt}from"./DataTable-CrQq0sYf.js";import{F as ft}from"./FilterChips-BlzD0qFP.js";import{B as F,S as Fe}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function J(l){return l.toLocaleString()}function gt(l){return l===null?"—":l<1e3?`${Math.round(l)} ms`:`${(l/1e3).toFixed(2)} s`}function yt(l,g){const y=new Date(l);return Number.isNaN(y.getTime())?l:g==="hour"?y.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):y.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const Le=vt(Ue,Ae),de=15,Re=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}],bt=[{value:"",label:"None"},{value:"model",label:"Model"},{value:"user_id",label:"User"},{value:"api_key_id",label:"API key"},{value:"source",label:"Source"}],jt=[{key:"fresh",label:"Fresh input",color:"var(--otari-ink)"},{key:"cache_read",label:"Cache read",color:"var(--otari-brand)"},{key:"cache_write",label:"Cache write",color:"var(--otari-brand-soft)"},{key:"output",label:"Output",color:"var(--otari-brand-dark)"}],St=[{key:"success",label:"Succeeded",color:"var(--otari-brand)"},{key:"errors",label:"Failed",color:"var(--otari-danger)"}],qe=["var(--otari-cat-1)","var(--otari-cat-2)","var(--otari-cat-3)","var(--otari-cat-4)","var(--otari-cat-5)","var(--otari-cat-6)","var(--otari-cat-7)","var(--otari-cat-8)"],wt="var(--otari-cat-other)";function Nt(l){return l==="cost"?ue:l==="tokens"?D:J}const Oe="__other__",Pe="__unknown__";function Ct({dimensionLabel:l,rows:g,totalCost:y,emptyLabel:_,labelFor:q,onDrill:T,loading:L}){const[v,O]=u.useState(!1),I=v?g:g.slice(0,de),z=g.length-I.length,ee=s=>s.is_other?Oe:s.key??Pe,K=[{id:"name",header:l,isRowHeader:!0,cell:s=>{const P=y>0?s.cost/y:0;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"truncate text-[var(--otari-ink)]",children:s.is_other?`Other (${s.requests.toLocaleString()} req)`:s.key===null?"(unknown)":(q==null?void 0:q(s.key))??s.key}),t.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:t.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,P*100)}%`}})})]})}},{id:"requests",header:"Requests",align:"end",cell:s=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:J(s.requests)})},{id:"tokens",header:"Tokens",align:"end",cell:s=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:D(s.tokens)})},{id:"spend",header:"Spend",align:"end",cell:s=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:ue(s.cost)})}];return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(xt,{ariaLabel:`Spend by ${l.toLowerCase()}`,columns:K,rows:I,getRowKey:ee,isLoading:L,emptyContent:_,onRowAction:s=>{s!==Oe&&s!==Pe&&T(s)}}),!L&&z>0?t.jsxs(F,{size:"sm",variant:"ghost",onPress:()=>O(!0),children:["Show all ",g.length]}):null,!L&&v&&g.length>de?t.jsxs(F,{size:"sm",variant:"ghost",onPress:()=>O(!1),children:["Show top ",de]}):null]})}function At(){var we,Ne,Ce;const l=at(),g=ot(),y=rt(),[_,q]=u.useState(Le),[T,L]=u.useState(()=>le(Le.seconds??0)),[v,O]=u.useState(!1),[I,z]=u.useState(),[ee,K]=u.useState(),[s,P]=u.useState(""),[x,te]=u.useState(""),[f,se]=u.useState(""),[m,$e]=u.useState("cost"),[k,Be]=u.useState(""),p=v?I:T,b=v?ee:void 0,S=v?p?nt(p,b):"day":_.bucket,w=u.useMemo(()=>({start_date:p,end_date:b,model:s.trim()||void 0,user_id:x||void 0,api_key_id:f||void 0}),[p,b,s,x,f]),G=u.useMemo(()=>{if(v){if(!p||!b)return null;const e=new Date(b).getTime()-new Date(p).getTime();return e>0?{...w,start_date:new Date(new Date(p).getTime()-e).toISOString(),end_date:p}:null}return!T||_.seconds===null?null:{...w,start_date:new Date(new Date(T).getTime()-_.seconds*1e3).toISOString(),end_date:T}},[v,p,b,w,_.seconds,T]),N=ie(w,S),me=ie(G??w,S,G!==null),R=lt(w,S,k||null),r=N.data,a=r==null?void 0:r.totals,c=G!==null?(we=me.data)==null?void 0:we.totals:void 0,he=a?Q(a.cost,c==null?void 0:c.cost):null,Me=u.useMemo(()=>({...w,model:void 0}),[w]),ve=ie(Me,S),ae=((Ce=(Ne=ve.data)==null?void 0:Ne.by_model)==null?void 0:Ce.filter(e=>!e.is_other&&e.key!==null).map(e=>e.key))??[],pe=(g.data??[]).map(e=>({value:e.user_id,label:e.alias?`${e.alias} (${e.user_id})`:e.user_id})),oe=(y.data??[]).map(e=>({value:e.id,label:e.key_name??`${e.id.slice(0,8)}…`})),ke=e=>{var i;return((i=oe.find(d=>d.value===e))==null?void 0:i.label)??e},De=(s&&!ae.includes(s)?[s,...ae]:ae).map(e=>({value:e,label:e})),Ie=v||_.key!==Ae,_e=!!(s.trim()||x||f||Ie),xe=(e,i)=>{var d;return((d=e.find(o=>o.value===i))==null?void 0:d.label)??i},ze=()=>{P(""),te(""),se("")},Ke=[...x?[{key:"user",label:"User",value:xe(pe,x),onClear:()=>te("")}]:[],...s.trim()?[{key:"model",label:"Model",value:s.trim(),onClear:()=>P("")}]:[],...f?[{key:"key",label:"API key",value:xe(oe,f),onClear:()=>se("")}]:[]],Ge=!!(r&&a&&a.request_count===0&&!_e),He=(r==null?void 0:r.start_date)??p,Ye=(r==null?void 0:r.end_date)??b,fe=e=>{O(!1),q(e),L(le(e.seconds??0)),z(void 0),K(void 0)},We=(e,i)=>{O(!0),z(e),K(i)},Ze=()=>{v||L(le(_.seconds??0)),N.refetch(),ve.refetch(),G!==null&&me.refetch(),k&&R.refetch()},A=e=>{const i=new URLSearchParams;p&&i.set("start_date",p),b&&i.set("end_date",b);for(const[d,o]of Object.entries(e))o&&i.set(d,o);l(`/activity?${i.toString()}`)},Qe=a&&a.request_count>0?a.error_count/a.request_count:0,h=(r==null?void 0:r.series)??[],H=h.length>1,U=a==null?void 0:a.billed_input_tokens,Y=a===void 0?null:U!==void 0?U+a.completion_tokens:a.total_tokens,Ve=c===void 0?null:c.billed_input_tokens!==void 0?c.billed_input_tokens+c.completion_tokens:c.total_tokens,W=U!==void 0&&U>0&&a?a.cache_read_tokens/U:null,ge=(c==null?void 0:c.billed_input_tokens)!==void 0&&c.billed_input_tokens>0?c.cache_read_tokens/c.billed_input_tokens:void 0,ye=e=>e.input_tokens!==void 0?e.input_tokens+(e.output_tokens??0):e.tokens,re=h.some(e=>(e.input_tokens??0)>0),be=h.some(e=>(e.errors??0)>0),C=u.useMemo(()=>{var d;const e=h.map(o=>o.bucket_start);if(k){const o=R.data;if(!o)return{series:[],data:[]};const E=o.groups.map((n,j)=>({key:`g${j}`,label:n.is_other?"Other":n.key===null?"(unknown)":k==="api_key_id"?ke(n.key):n.key,color:n.is_other?wt:qe[j%qe.length]})),Z=new Map(o.groups.map((n,j)=>[`${n.is_other}|${n.key}`,`g${j}`])),B=new Map(e.map(n=>[n,{x:n,...Object.fromEntries(E.map(j=>[j.key,0]))}]));for(const n of o.points){const j=Z.get(`${n.is_other}|${n.key}`),Te=B.get(n.bucket_start);!j||!Te||(Te[j]=m==="cost"?n.cost:m==="tokens"?n.tokens:n.requests)}return{series:E,data:[...B.values()]}}return m==="tokens"&&re?{series:jt,data:h.map(o=>{const E=o.input_tokens??0,Z=o.cache_read_tokens??0,B=o.cache_write_tokens??0;return{x:o.bucket_start,fresh:Math.max(0,E-Z-B),cache_read:Z,cache_write:B,output:o.output_tokens??0}})}:m==="requests"&&be?{series:St,data:h.map(o=>{const E=Math.min(o.errors??0,o.requests);return{x:o.bucket_start,success:o.requests-E,errors:E}})}:{series:[{key:m,label:((d=Re.find(o=>o.key===m))==null?void 0:d.label)??m,color:"var(--otari-brand)"}],data:h.map(o=>({x:o.bucket_start,[m]:m==="cost"?o.cost:m==="tokens"?ye(o):o.requests}))}},[h,k,R.data,m,re,be,y.data]),je=Nt(m),Xe=N.isLoading||!!k&&R.isLoading,Je=C.data.length?Math.max(...C.data.map(e=>C.series.reduce((i,d)=>i+(typeof e[d.key]=="number"?e[d.key]:0),0))):0,et=h.map(e=>e.bucket_start),tt=(e,i)=>{const d=pt(et,e,i,S);d&&We(d.startIso,d.endIso)},ne=[{key:"model",label:"Model",rows:(r==null?void 0:r.by_model)??[],labelFor:void 0,drill:e=>A({model:e,user_id:x||void 0,api_key_id:f||void 0})},{key:"user",label:"User",rows:(r==null?void 0:r.by_user)??[],labelFor:void 0,drill:e=>A({user_id:e,model:s.trim()||void 0,api_key_id:f||void 0})},{key:"api_key",label:"API key",rows:(r==null?void 0:r.by_api_key)??[],labelFor:ke,drill:e=>A({api_key_id:e,model:s.trim()||void 0,user_id:x||void 0})},{key:"source",label:"Source",rows:(r==null?void 0:r.by_source)??[],labelFor:void 0,drill:e=>A({source:e,model:s.trim()||void 0,user_id:x||void 0,api_key_id:f||void 0})}],[Se,st]=u.useState("model"),$=ne.find(e=>e.key===Se)??ne[0];return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(it,{title:"Usage & analytics",description:"Spend, tokens, cache use, and request volume over time. Group the chart by model, user, key, or source, and click a breakdown row to drill into the request log.",action:t.jsx(F,{size:"sm",variant:"outline",onPress:()=>A({model:s.trim()||void 0,user_id:x||void 0,api_key_id:f||void 0}),children:"Open activity log"})}),t.jsx(ct,{error:N.error??(k?R.error:null)}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Ue.map(e=>t.jsx(F,{size:"sm",variant:!v&&_.key===e.key?"primary":"outline",onPress:()=>fe(e),children:e.label},e.key)),t.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[t.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",dt(He,Ye)," · UTC"]}),t.jsx(ut,{onRefresh:Ze,isFetching:N.isFetching,updatedAt:N.dataUpdatedAt})]})]}),t.jsxs(ft,{chips:Ke,onClearAll:ze,children:[t.jsx(ce,{label:"User",value:x,onChange:te,options:pe,placeholder:"All users"}),t.jsx(ce,{label:"Model",value:s,onChange:P,options:De,placeholder:"All models"}),t.jsx(ce,{label:"API key",value:f,onChange:se,options:oe,placeholder:"All keys"})]})]}),Ge?t.jsx(mt,{title:"No usage yet",description:"Once the gateway serves requests, spend and volume appear here."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-5",children:[t.jsx(M,{label:"Tracked cost",value:a?ue(a.cost):"—",hint:a?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t.jsx(V,{fraction:he}),a.unpriced_requests?`${he!==null?" · ":""}${J(a.unpriced_requests)} unpriced`:null]}):null,chart:H?t.jsx(X,{values:h.map(e=>e.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),t.jsx(M,{label:"Requests",value:a?J(a.request_count):"—",hint:a?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Ee(Qe)," errors",c?t.jsxs(t.Fragment,{children:[" · ",t.jsx(V,{fraction:Q(a.request_count,c.request_count)})]}):null]}):null,chart:H?t.jsx(X,{values:h.map(e=>e.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),t.jsx(M,{label:"Tokens (billed)",value:Y!==null?D(Y):"—",hint:Y!==null?t.jsx(V,{fraction:Q(Y,Ve??void 0)}):null,chart:H?t.jsx(X,{values:h.map(ye),ariaLabel:"Billed token trend over the selected window"}):void 0}),t.jsx(M,{label:"Cache hit rate",value:W!==null?Ee(W):"—",hint:a?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[W!==null&&ge!==void 0?t.jsxs(t.Fragment,{children:[t.jsx(V,{fraction:Q(W,ge)})," · "]}):null,D(a.cache_read_tokens)," read · ",D(a.cache_write_tokens)," written"]}):null,chart:H&&re?t.jsx(X,{values:h.map(e=>(e.input_tokens??0)>0?(e.cache_read_tokens??0)/(e.input_tokens??1):0),ariaLabel:"Cache hit rate trend over the selected window"}):void 0}),t.jsx(M,{label:"Avg latency",value:a?gt(a.avg_latency_ms):"—"})]}),t.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("div",{className:"inline-flex gap-1.5",children:Re.map(e=>t.jsx(F,{size:"sm",variant:m===e.key?"primary":"outline",onPress:()=>$e(e.key),children:e.label},e.key))}),t.jsxs("div",{className:"flex items-center gap-2",children:[v?t.jsx(F,{size:"sm",variant:"ghost",onPress:()=>fe(_),children:"Reset zoom"}):null,N.isFetching||k&&R.isFetching?t.jsx(Fe,{size:"sm"}):null,t.jsx(ht,{ariaLabel:"Group by",value:k,onChange:e=>Be(e),options:bt.map(e=>({value:e.value,label:e.value?`By ${e.label.toLowerCase()}`:"No grouping"}))})]})]}),t.jsx(kt,{series:C.series}),Xe?t.jsx("div",{className:"flex h-64 items-center justify-center",children:t.jsx(Fe,{size:"sm"})}):C.data.length===0?t.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):t.jsxs("figure",{className:"flex flex-col gap-2",children:[t.jsx(_t,{data:C.data,series:C.series,formatValue:je,formatXTick:e=>yt(e,S),ariaLabel:`${m} per ${S}${k?`, grouped by ${k}`:""}`,height:260,showYAxis:!0,showTotal:!0,onSelectRange:tt}),t.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[je(Je)," peak · ",C.data.length," ",S==="hour"?"hours":"days"," (times in UTC) · drag across the chart to zoom"]})]})]}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Spend by ",$.label.toLowerCase()]}),t.jsx("div",{className:"inline-flex gap-1.5",children:ne.map(e=>t.jsx(F,{size:"sm",variant:Se===e.key?"primary":"outline",onPress:()=>st(e.key),children:e.label},e.key))})]}),t.jsx(Ct,{dimensionLabel:$.label,rows:$.rows,totalCost:(a==null?void 0:a.cost)??0,emptyLabel:_e?"No usage matches these filters.":"No usage recorded yet.",labelFor:$.labelFor,onDrill:$.drill,loading:N.isLoading})]})]})]})}export{At as UsagePage}; diff --git a/src/gateway/static/dashboard/assets/UserComboBox-a9wxf8eF.js b/src/gateway/static/dashboard/assets/UserComboBox-nt7pHfqn.js similarity index 95% rename from src/gateway/static/dashboard/assets/UserComboBox-a9wxf8eF.js rename to src/gateway/static/dashboard/assets/UserComboBox-nt7pHfqn.js index 5e3161a1b..cfae483e9 100644 --- a/src/gateway/static/dashboard/assets/UserComboBox-a9wxf8eF.js +++ b/src/gateway/static/dashboard/assets/UserComboBox-nt7pHfqn.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as L}from"./react-dgEcD0HR.js";import{C as r,L as b,I as v,a as k,b as B,D as N}from"./heroui-BI50yK5B.js";function y({value:x,onChange:c,users:p,description:f,label:h="Owner",placeholder:g="Pick a user, or type a new id…",unknownHint:j}){const a=p.filter(e=>!e.user_id.startsWith("apikey-")).map(e=>({id:e.user_id,name:e.alias?`${e.user_id} (${e.alias})`:e.user_id})),[i,l]=L.useState(x),o=i.trim().toLowerCase(),w=a.filter(e=>!o||e.id.toLowerCase().includes(o)||e.name.toLowerCase().includes(o)).slice(0,50),d=e=>{const s=e.trim(),m=a.find(u=>u.id===s||u.name===s);return m?m.id:s},n=d(i),C=a.some(e=>e.id===n),I=n!==""&&!C?j??t.jsxs("span",{children:["Creates a new user ",t.jsx("code",{children:n}),"."]}):f??"Spend and budgets track against this user.";return t.jsxs(r.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:i,onInputChange:e=>{l(e),c(d(e))},onSelectionChange:e=>{if(e!=null){const s=String(e);l(s),c(s)}},className:"flex max-w-md flex-col gap-1",children:[t.jsx(b,{className:"text-sm font-medium text-[var(--otari-ink)]",children:h}),t.jsxs(r.InputGroup,{children:[t.jsx(v,{placeholder:g,autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:e=>e.currentTarget.select()}),t.jsx(r.Trigger,{})]}),t.jsx(r.Popover,{children:t.jsx(k,{items:w,className:"max-h-72 overflow-auto",children:e=>t.jsx(B,{id:e.id,textValue:e.name,children:e.name})})}),t.jsx(N,{className:"text-xs text-[var(--otari-muted)]",children:I})]})}export{y as U}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as L}from"./react-dgEcD0HR.js";import{C as r,L as b,I as v,a as k,b as B,D as N}from"./heroui-DZj66Arc.js";function y({value:x,onChange:c,users:p,description:f,label:h="Owner",placeholder:g="Pick a user, or type a new id…",unknownHint:j}){const a=p.filter(e=>!e.user_id.startsWith("apikey-")).map(e=>({id:e.user_id,name:e.alias?`${e.user_id} (${e.alias})`:e.user_id})),[i,l]=L.useState(x),o=i.trim().toLowerCase(),w=a.filter(e=>!o||e.id.toLowerCase().includes(o)||e.name.toLowerCase().includes(o)).slice(0,50),d=e=>{const s=e.trim(),m=a.find(u=>u.id===s||u.name===s);return m?m.id:s},n=d(i),C=a.some(e=>e.id===n),I=n!==""&&!C?j??t.jsxs("span",{children:["Creates a new user ",t.jsx("code",{children:n}),"."]}):f??"Spend and budgets track against this user.";return t.jsxs(r.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:i,onInputChange:e=>{l(e),c(d(e))},onSelectionChange:e=>{if(e!=null){const s=String(e);l(s),c(s)}},className:"flex max-w-md flex-col gap-1",children:[t.jsx(b,{className:"text-sm font-medium text-[var(--otari-ink)]",children:h}),t.jsxs(r.InputGroup,{children:[t.jsx(v,{placeholder:g,autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:e=>e.currentTarget.select()}),t.jsx(r.Trigger,{})]}),t.jsx(r.Popover,{children:t.jsx(k,{items:w,className:"max-h-72 overflow-auto",children:e=>t.jsx(B,{id:e.id,textValue:e.name,children:e.name})})}),t.jsx(N,{className:"text-xs text-[var(--otari-muted)]",children:I})]})}export{y as U}; diff --git a/src/gateway/static/dashboard/assets/UsersPage-DUd7-214.js b/src/gateway/static/dashboard/assets/UsersPage-DJTKoEIl.js similarity index 85% rename from src/gateway/static/dashboard/assets/UsersPage-DUd7-214.js rename to src/gateway/static/dashboard/assets/UsersPage-DJTKoEIl.js index b16ceefdc..fbad4f6bb 100644 --- a/src/gateway/static/dashboard/assets/UsersPage-DUd7-214.js +++ b/src/gateway/static/dashboard/assets/UsersPage-DJTKoEIl.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r}from"./react-dgEcD0HR.js";import{u as Q,q as M,v as K,ar as X,P as Y,E as A,w as Z,as as ee,F as se}from"./index-DsUY4UvK.js";import{u as te,r as ae,B as ne}from"./tableSelection-9hV37uhu.js";import{C as re}from"./ConfirmDialog-NCJIhH2z.js";import{D as le}from"./DataTable-Bmn_eYSV.js";import{F as B}from"./Field-Dwp6u3t8.js";import{a as ie,M as R}from"./ModelScopeControl-B4eI_pm-.js";import{f as I,B as d,d as S,A as f}from"./heroui-BI50yK5B.js";const de=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return de.format(t)}const oe=t=>t.user_id,D=t=>t.startsWith("apikey-");function H(t){return t.split("-")[0]}function E(t){return t.name??H(t.budget_id)}function $({value:t,onChange:l,budgets:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>l(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),n.map(a=>e.jsxs("option",{value:a.budget_id,children:[E(a),a.max_budget===null?" · no limit":` · ${U(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function ce({onClose:t}){const l=ee(),n=M(),[a,i]=r.useState(""),[o,u]=r.useState(""),[c,g]=r.useState(null),[p,m]=r.useState(null),[b,j]=r.useState(!0),x=()=>{if(l.isPending||!b||a.trim()==="")return;const h={user_id:a.trim(),alias:o.trim()||null,budget_id:c,allowed_models:p};l.mutate(h,{onSuccess:t})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:l.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(B,{label:"User ID",value:a,onChange:i,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(B,{label:"Alias (optional)",value:o,onChange:u,placeholder:"Alice"})]}),e.jsx($,{value:c,onChange:g,budgets:n.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{m(h),j(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:l.isPending||!b||a.trim()==="",onPress:x,children:l.isPending?"Creating…":"Create user"}),e.jsx(d,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ue({user:t,onClose:l}){const n=K(),a=M(),[i,o]=r.useState(t.alias??""),[u,c]=r.useState(t.budget_id),[g,p]=r.useState(t.allowed_models),[m,b]=r.useState(!0),j=()=>{if(n.isPending||!m)return;const x={alias:i.trim()||null,budget_id:u,allowed_models:g};n.mutate({id:t.user_id,body:x},{onSuccess:l})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:n.error}),e.jsx(B,{label:"Alias",value:i,onChange:o,placeholder:"Alice"}),e.jsx($,{value:u,onChange:c,budgets:a.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(x,h)=>{p(x),b(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:n.isPending||!m,onPress:j,children:n.isPending?"Saving…":"Save changes"}),e.jsx(d,{variant:"ghost",onPress:l,children:"Cancel"})]})]})})}function ge({trigger:t,message:l,confirmLabel:n,isPending:a,onConfirm:i}){const[o,u]=r.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:l}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(d,{size:"sm",variant:"danger",isDisabled:a,onPress:i,children:n}),e.jsx(d,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>u(!1),children:"Cancel"})]})]}):e.jsx(d,{size:"sm",variant:"danger-soft",onPress:()=>u(!0),children:t})}function me({user:t}){return t.blocked?e.jsx(I,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(I,{size:"sm",color:"accent",children:"Active"})}function xe({allowed:t}){const{text:l,tone:n}=ie(t),a=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",i=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:i,children:l})}function he({isOpen:t,onOpenChange:l,budgets:n,count:a,isPending:i,error:o,onAssign:u}){const[c,g]=r.useState("");return r.useEffect(()=>{t&&g("")},[t]),e.jsx(f,{isOpen:t,onOpenChange:l,children:t?e.jsx(f.Backdrop,{children:e.jsx(f.Container,{placement:"center",size:"md",children:e.jsxs(f.Dialog,{children:[e.jsx(f.Header,{children:e.jsx(f.Heading,{children:"Assign budget"})}),e.jsxs(f.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Assign a budget to ",a," selected ",a===1?"user":"users","."]}),e.jsx(se,{label:"Budget",value:c,onChange:g,options:[{value:"",label:"Select a budget…"},...n.map(p=>({value:p.budget_id,label:E(p)}))]}),e.jsx(A,{error:o})]}),e.jsxs(f.Footer,{children:[e.jsx(d,{variant:"ghost",isDisabled:i,onPress:()=>l(!1),children:"Cancel"}),e.jsx(d,{variant:"primary",isDisabled:!c,isPending:i,onPress:()=>u(c),children:"Assign"})]})]})})}):null})}function Ae(){const t=Q(),l=M(),n=K(),a=X(),[i,o]=r.useState(!1),[u,c]=r.useState(null),[g,p]=r.useState(!1),m=t.data??[],b=t.isLoading,j=m.filter(s=>D(s.user_id)).length,x=g?m:m.filter(s=>!D(s.user_id)),h=m.find(s=>s.user_id===u)??null,C=!b&&x.length===0&&!i,P=r.useMemo(()=>new Map((l.data??[]).map(s=>[s.budget_id,s])),[l.data]),y=te(),[q,_]=r.useState(!1),[W,N]=r.useState(!1),[F,z]=r.useState(void 0),[T,L]=r.useState(!1),G=x.map(s=>s.user_id),v=ae(y.selectedKeys,G),O=r.useCallback((s,k)=>n.mutate({id:s.user_id,body:{blocked:k}}),[n.mutate]),V=async(s,k)=>{L(!0),z(void 0);try{for(const w of v)await s(w);y.clear(),k()}catch(w){z(w)}finally{L(!1)}},J=r.useMemo(()=>[{id:"user",header:"User",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-medium text-[var(--otari-ink)]",children:s.user_id}),D(s.user_id)?e.jsx(I,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})},{id:"status",header:"Status",cell:s=>e.jsx(me,{user:s})},{id:"budget",header:"Budget",cell:s=>s.budget_id?e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.budget_id,children:P.get(s.budget_id)?E(P.get(s.budget_id)):H(s.budget_id)}):e.jsx("span",{className:"text-[var(--otari-muted)]",children:"—"})},{id:"spend",header:"Spend",cell:s=>e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[U(s.spend),s.reserved>0?e.jsxs("span",{children:[" (+",U(s.reserved)," held)"]}):null]})},{id:"access",header:"Model access",cell:s=>e.jsx(xe,{allowed:s.allowed_models})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(d,{size:"sm",variant:"outline",isDisabled:n.isPending,onPress:()=>O(s,!s.blocked),children:s.blocked?"Unblock":"Block"}),e.jsx(d,{size:"sm",variant:"ghost",onPress:()=>{o(!1),c(s.user_id)},children:"Edit"}),e.jsx(ge,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})}],[P,n.isPending,a.isPending,a.mutate,O]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:i?null:e.jsx(d,{variant:"primary",onPress:()=>{c(null),o(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??n.error??a.error}),C?e.jsx(Z,{title:"No users yet",description:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page.",actionLabel:"Create your first user",onAction:()=>{c(null),o(!0)}}):null,j>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>p(s.target.checked)}),"Show auto-created (virtual) users (",j,")"]}):null,i?e.jsx(ce,{onClose:()=>o(!1)}):null,h?e.jsx(ue,{user:h,onClose:()=>c(null)},h.user_id):null,v.length>0?e.jsxs(ne,{selectedCount:v.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:y.clear,children:[e.jsx(d,{size:"sm",variant:"primary",onPress:()=>N(!0),children:"Assign budget"}),e.jsx(d,{size:"sm",variant:"danger",onPress:()=>_(!0),children:"Delete"})]}):null,C?null:e.jsx(le,{ariaLabel:"Users",columns:J,rows:x,getRowKey:oe,isLoading:b,emptyContent:"No users yet. Create one, or create an API key to auto-create one.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange}),e.jsx(re,{isOpen:q,onOpenChange:_,heading:"Delete users",body:`Delete ${v.length} ${v.length===1?"user":"users"}? This deactivates their API keys and hides them; usage history is preserved.`,confirmLabel:"Delete",isPending:T,error:F,onConfirm:()=>V(s=>a.mutateAsync(s),()=>_(!1))}),e.jsx(he,{isOpen:W,onOpenChange:N,budgets:l.data??[],count:v.length,isPending:T,error:F,onAssign:s=>V(k=>n.mutateAsync({id:k,body:{budget_id:s}}),()=>N(!1))})]})}export{Ae as UsersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r}from"./react-dgEcD0HR.js";import{u as Q,v as M,z as K,as as X,P as Y,E as A,B as Z,at as ee,F as se}from"./index-Dhxz7Eyv.js";import{u as te,r as ae,B as ne}from"./tableSelection-CojkFPwd.js";import{C as re}from"./ConfirmDialog-DawcDVEg.js";import{D as le}from"./DataTable-CrQq0sYf.js";import{F as D}from"./Field-DEJ6Wjg9.js";import{a as ie,M as R}from"./ModelScopeControl-Bs976Tb8.js";import{f as I,B as d,d as S,A as f}from"./heroui-DZj66Arc.js";const de=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return de.format(t)}const oe=t=>t.user_id,B=t=>t.startsWith("apikey-");function H(t){return t.split("-")[0]}function z(t){return t.name??H(t.budget_id)}function $({value:t,onChange:l,budgets:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>l(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),n.map(a=>e.jsxs("option",{value:a.budget_id,children:[z(a),a.max_budget===null?" · no limit":` · ${U(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function ce({onClose:t}){const l=ee(),n=M(),[a,i]=r.useState(""),[o,u]=r.useState(""),[c,g]=r.useState(null),[p,m]=r.useState(null),[b,j]=r.useState(!0),x=()=>{if(l.isPending||!b||a.trim()==="")return;const h={user_id:a.trim(),alias:o.trim()||null,budget_id:c,allowed_models:p};l.mutate(h,{onSuccess:t})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:l.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(D,{label:"User ID",value:a,onChange:i,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(D,{label:"Alias (optional)",value:o,onChange:u,placeholder:"Alice"})]}),e.jsx($,{value:c,onChange:g,budgets:n.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{m(h),j(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:l.isPending||!b||a.trim()==="",onPress:x,children:l.isPending?"Creating…":"Create user"}),e.jsx(d,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ue({user:t,onClose:l}){const n=K(),a=M(),[i,o]=r.useState(t.alias??""),[u,c]=r.useState(t.budget_id),[g,p]=r.useState(t.allowed_models),[m,b]=r.useState(!0),j=()=>{if(n.isPending||!m)return;const x={alias:i.trim()||null,budget_id:u,allowed_models:g};n.mutate({id:t.user_id,body:x},{onSuccess:l})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:n.error}),e.jsx(D,{label:"Alias",value:i,onChange:o,placeholder:"Alice"}),e.jsx($,{value:u,onChange:c,budgets:a.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(x,h)=>{p(x),b(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:n.isPending||!m,onPress:j,children:n.isPending?"Saving…":"Save changes"}),e.jsx(d,{variant:"ghost",onPress:l,children:"Cancel"})]})]})})}function ge({trigger:t,message:l,confirmLabel:n,isPending:a,onConfirm:i}){const[o,u]=r.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:l}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(d,{size:"sm",variant:"danger",isDisabled:a,onPress:i,children:n}),e.jsx(d,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>u(!1),children:"Cancel"})]})]}):e.jsx(d,{size:"sm",variant:"danger-soft",onPress:()=>u(!0),children:t})}function me({user:t}){return t.blocked?e.jsx(I,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(I,{size:"sm",color:"accent",children:"Active"})}function xe({allowed:t}){const{text:l,tone:n}=ie(t),a=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",i=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:i,children:l})}function he({isOpen:t,onOpenChange:l,budgets:n,count:a,isPending:i,error:o,onAssign:u}){const[c,g]=r.useState("");return r.useEffect(()=>{t&&g("")},[t]),e.jsx(f,{isOpen:t,onOpenChange:l,children:t?e.jsx(f.Backdrop,{children:e.jsx(f.Container,{placement:"center",size:"md",children:e.jsxs(f.Dialog,{children:[e.jsx(f.Header,{children:e.jsx(f.Heading,{children:"Assign budget"})}),e.jsxs(f.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Assign a budget to ",a," selected ",a===1?"user":"users","."]}),e.jsx(se,{label:"Budget",value:c,onChange:g,options:[{value:"",label:"Select a budget…"},...n.map(p=>({value:p.budget_id,label:z(p)}))]}),e.jsx(A,{error:o})]}),e.jsxs(f.Footer,{children:[e.jsx(d,{variant:"ghost",isDisabled:i,onPress:()=>l(!1),children:"Cancel"}),e.jsx(d,{variant:"primary",isDisabled:!c,isPending:i,onPress:()=>u(c),children:"Assign"})]})]})})}):null})}function Ae(){const t=Q(),l=M(),n=K(),a=X(),[i,o]=r.useState(!1),[u,c]=r.useState(null),[g,p]=r.useState(!1),m=t.data??[],b=t.isLoading,j=m.filter(s=>B(s.user_id)).length,x=g?m:m.filter(s=>!B(s.user_id)),h=m.find(s=>s.user_id===u)??null,C=!b&&x.length===0&&!i,P=r.useMemo(()=>new Map((l.data??[]).map(s=>[s.budget_id,s])),[l.data]),y=te(),[q,_]=r.useState(!1),[W,N]=r.useState(!1),[E,F]=r.useState(void 0),[T,L]=r.useState(!1),G=x.map(s=>s.user_id),v=ae(y.selectedKeys,G),O=r.useCallback((s,k)=>n.mutate({id:s.user_id,body:{blocked:k}}),[n.mutate]),V=async(s,k)=>{L(!0),F(void 0);try{for(const w of v)await s(w);y.clear(),k()}catch(w){F(w)}finally{L(!1)}},J=r.useMemo(()=>[{id:"user",header:"User",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-medium text-[var(--otari-ink)]",children:s.user_id}),B(s.user_id)?e.jsx(I,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})},{id:"status",header:"Status",cell:s=>e.jsx(me,{user:s})},{id:"budget",header:"Budget",cell:s=>s.budget_id?e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.budget_id,children:P.get(s.budget_id)?z(P.get(s.budget_id)):H(s.budget_id)}):e.jsx("span",{className:"text-[var(--otari-muted)]",children:"—"})},{id:"spend",header:"Spend",cell:s=>e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[U(s.spend),s.reserved>0?e.jsxs("span",{children:[" (+",U(s.reserved)," held)"]}):null]})},{id:"access",header:"Model access",cell:s=>e.jsx(xe,{allowed:s.allowed_models})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(d,{size:"sm",variant:"outline",isDisabled:n.isPending,onPress:()=>O(s,!s.blocked),children:s.blocked?"Unblock":"Block"}),e.jsx(d,{size:"sm",variant:"ghost",onPress:()=>{o(!1),c(s.user_id)},children:"Edit"}),e.jsx(ge,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})}],[P,n.isPending,a.isPending,a.mutate,O]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:i?null:e.jsx(d,{variant:"primary",onPress:()=>{c(null),o(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??n.error??a.error}),C?e.jsx(Z,{title:"No users yet",description:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page.",actionLabel:"Create your first user",onAction:()=>{c(null),o(!0)}}):null,j>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>p(s.target.checked)}),"Show auto-created (virtual) users (",j,")"]}):null,i?e.jsx(ce,{onClose:()=>o(!1)}):null,h?e.jsx(ue,{user:h,onClose:()=>c(null)},h.user_id):null,v.length>0?e.jsxs(ne,{selectedCount:v.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:y.clear,children:[e.jsx(d,{size:"sm",variant:"primary",onPress:()=>N(!0),children:"Assign budget"}),e.jsx(d,{size:"sm",variant:"danger",onPress:()=>_(!0),children:"Delete"})]}):null,C?null:e.jsx(le,{ariaLabel:"Users",columns:J,rows:x,getRowKey:oe,isLoading:b,emptyContent:"No users yet. Create one, or create an API key to auto-create one.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange}),e.jsx(re,{isOpen:q,onOpenChange:_,heading:"Delete users",body:`Delete ${v.length} ${v.length===1?"user":"users"}? This deactivates their API keys and hides them; usage history is preserved.`,confirmLabel:"Delete",isPending:T,error:E,onConfirm:()=>V(s=>a.mutateAsync(s),()=>_(!1))}),e.jsx(he,{isOpen:W,onOpenChange:N,budgets:l.data??[],count:v.length,isPending:T,error:E,onAssign:s=>V(k=>n.mutateAsync({id:k,body:{budget_id:s}}),()=>N(!1))})]})}export{Ae as UsersPage}; diff --git a/src/gateway/static/dashboard/assets/charts-BI8Uczg4.js b/src/gateway/static/dashboard/assets/charts-BI8Uczg4.js new file mode 100644 index 000000000..0e63380ca --- /dev/null +++ b/src/gateway/static/dashboard/assets/charts-BI8Uczg4.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as y}from"./react-dgEcD0HR.js";import{R as w,L as C,a as I,B as L,X as M,Y as A,T,b as B,c as g}from"./recharts-BwTTRGtj.js";const j="var(--otari-brand)";function D({active:t,label:a,payload:s,formatValue:l,formatLabel:o,showTotal:u=!1}){const i=(s??[]).filter(n=>typeof n.value=="number");if(!t||i.length===0)return null;const p=typeof a=="string"&&o?o(a):a,m=i.length>1?i.filter(n=>n.value>0):i,c=i.reduce((n,f)=>n+f.value,0);return e.jsxs("div",{className:"rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2.5 py-1.5 text-xs shadow-sm",children:[e.jsx("div",{className:"text-[var(--otari-muted)]",children:p}),e.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:m.map((n,f)=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[var(--otari-muted)]",children:[i.length>1?e.jsx("span",{"aria-hidden":!0,className:"h-2 w-2 rounded-sm",style:{backgroundColor:n.color}}):null,n.name]}),e.jsx("span",{className:"font-medium tabular-nums text-[var(--otari-ink)]",children:l(n.value)})]},f))}),u&&i.length>1?e.jsxs("div",{className:"mt-1 flex items-center justify-between gap-4 border-t border-[var(--otari-line)] pt-1",children:[e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Total"}),e.jsx("span",{className:"font-semibold tabular-nums text-[var(--otari-ink)]",children:l(c)})]}):null]})}function F({series:t}){return t.length<2?null:e.jsx("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:t.map(a=>e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx("span",{"aria-hidden":!0,className:"h-2 w-2 rounded-sm",style:{backgroundColor:a.color}}),a.label]},a.key))})}function N(t){const a=t==null?void 0:t.activeTooltipIndex,s=typeof a=="string"?Number(a):a;return typeof s=="number"&&Number.isFinite(s)?s:null}function K({data:t,series:a,formatValue:s,formatXTick:l,ariaLabel:o,height:u=200,showYAxis:i=!1,showTotal:p,onSelectRange:m,window:c}){const[n,f]=y.useState(null),h=y.useRef(n),v=r=>{h.current=r,f(r)},b=()=>{const r=h.current;v(null),!(!r||!m||r.start===r.end)&&m(Math.min(r.start,r.end),Math.max(r.start,r.end))},k=!!m&&t.length>1,d=c&&(c.startIndex>0||c.endIndex{if(!k)return;const x=N(r);x!==null&&v({start:x,end:x})},onMouseMove:r=>{const x=N(r);h.current&&x!==null&&v({...h.current,end:x})},onMouseUp:b,onMouseLeave:b,children:[e.jsx(M,{dataKey:"x",tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:40,tickFormatter:l,tick:{fontSize:10,fill:"var(--otari-muted)"}}),i?e.jsx(A,{width:52,tickLine:!1,axisLine:!1,tickFormatter:r=>s(r),tick:{fontSize:10,fill:"var(--otari-muted)"}}):null,e.jsx(T,{cursor:{fill:"var(--otari-line)",opacity:.35},content:e.jsx(D,{formatValue:s,formatLabel:l,showTotal:p})}),a.map(r=>e.jsx(B,{dataKey:r.key,name:r.label,stackId:"stack",fill:r.color,stroke:"var(--otari-surface)",strokeWidth:a.length>1?1:0,radius:a.length>1?0:[2,2,0,0],isAnimationActive:!1},r.key)),d&&d.startIndex>0?e.jsx(g,{x1:t[0].x,x2:t[d.startIndex-1].x,fill:"var(--otari-bg)",fillOpacity:.75,stroke:"none"}):null,d&&d.endIndex({index:u,value:o}));return e.jsx("div",{role:"img","aria-label":a,className:"w-full",children:e.jsx(w,{width:"100%",height:s,children:e.jsx(C,{data:l,margin:{top:2,right:2,left:2,bottom:2},children:e.jsx(I,{type:"monotone",dataKey:"value",stroke:j,strokeWidth:1.5,dot:!1,isAnimationActive:!1})})})})}export{F as C,z as S,K as T}; diff --git a/src/gateway/static/dashboard/assets/charts-DIsd9m--.js b/src/gateway/static/dashboard/assets/charts-DIsd9m--.js deleted file mode 100644 index aa810c13c..000000000 --- a/src/gateway/static/dashboard/assets/charts-DIsd9m--.js +++ /dev/null @@ -1 +0,0 @@ -import{j as a}from"./tanstack-query-1t81HyiD.js";import{R as l,L as d,b as c,B as m,X as u,T as x,a as f}from"./recharts-C4kRDmvS.js";const o="var(--otari-brand)";function v({active:e,label:i,payload:t,formatValue:r}){var n;const s=(n=t==null?void 0:t[0])==null?void 0:n.value;return!e||typeof s!="number"?null:a.jsxs("div",{className:"rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-xs shadow-sm",children:[a.jsx("div",{className:"text-[var(--otari-muted)]",children:i}),a.jsx("div",{className:"font-medium tabular-nums text-[var(--otari-ink)]",children:r(s)})]})}function p({data:e,formatValue:i,ariaLabel:t,height:r=200}){return a.jsx("div",{role:"img","aria-label":t,className:"w-full",children:a.jsx(l,{width:"100%",height:r,children:a.jsxs(m,{data:e,margin:{top:4,right:4,left:4,bottom:0},children:[a.jsx(u,{dataKey:"label",tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:24,tick:{fontSize:10,fill:"var(--otari-muted)"}}),a.jsx(x,{cursor:{fill:"var(--otari-line)",opacity:.35},content:a.jsx(v,{formatValue:i})}),a.jsx(f,{dataKey:"value",fill:o,radius:[2,2,0,0],isAnimationActive:!1})]})})})}function b({values:e,ariaLabel:i,height:t=32}){const r=e.map((s,n)=>({index:n,value:s}));return a.jsx("div",{role:"img","aria-label":i,className:"w-full",children:a.jsx(l,{width:"100%",height:t,children:a.jsx(d,{data:r,margin:{top:2,right:2,left:2,bottom:2},children:a.jsx(c,{type:"monotone",dataKey:"value",stroke:o,strokeWidth:1.5,dot:!1,isAnimationActive:!1})})})})}export{p as B,b as S}; diff --git a/src/gateway/static/dashboard/assets/heroui-BI50yK5B.js b/src/gateway/static/dashboard/assets/heroui-BI50yK5B.js deleted file mode 100644 index af7769d5d..000000000 --- a/src/gateway/static/dashboard/assets/heroui-BI50yK5B.js +++ /dev/null @@ -1,20 +0,0 @@ -var Ko=t=>{throw TypeError(t)};var Ro=(t,e,n)=>e.has(t)||Ko("Cannot "+n);var Mo=(t,e,n)=>(Ro(t,e,"read from private field"),n?n.call(t):e.get(t)),Fo=(t,e,n)=>e.has(t)?Ko("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),wl=(t,e,n,l)=>(Ro(t,e,"write to private field"),l?l.call(t,n):e.set(t,n),n);import{r as s,$ as x,a as kr,b as du,c as Cp}from"./react-dgEcD0HR.js";import{j as I}from"./tanstack-query-1t81HyiD.js";const Ep="react-aria-clear-focus",wp="react-aria-focus";function ol(t){var n;if(typeof window>"u"||window.navigator==null)return!1;let e=(n=window.navigator.userAgentData)==null?void 0:n.brands;return Array.isArray(e)&&e.some(l=>t.test(l.brand))||t.test(window.navigator.userAgent)}function Pr(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)==null?void 0:e.platform)||window.navigator.platform):!1}function rt(t){let e=null;return()=>(e==null&&(e=t()),e)}const $t=rt(function(){return Pr(/^Mac/i)}),Sp=rt(function(){return Pr(/^iPhone/i)}),fu=rt(function(){return Pr(/^iPad/i)||$t()&&navigator.maxTouchPoints>1}),vt=rt(function(){return Sp()||fu()}),jn=rt(function(){return $t()||vt()}),pu=rt(function(){return ol(/AppleWebKit/i)&&!bu()}),bu=rt(function(){return ol(/Chrome/i)}),an=rt(function(){return ol(/Android/i)}),Dp=rt(function(){return ol(/Firefox/i)});function Ne(t){if(kp())t.focus({preventScroll:!0});else{let e=Pp(t);t.focus(),Tp(e)}}let Bn=null;function kp(){if(Bn==null){Bn=!1;try{document.createElement("div").focus({get preventScroll(){return Bn=!0,!0}})}catch{}}return Bn}function Pp(t){let e=t.parentNode,n=[],l=document.scrollingElement||document.documentElement;for(;e instanceof HTMLElement&&e!==l;)(e.offsetHeightt});function Ot(){return s.useContext(Ap)}function Bp(t,e){let n=t.getAttribute("target");return(!n||n==="_self")&&t.origin===location.origin&&!t.hasAttribute("download")&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey}function tt(t,e,n=!0){var a,c;let{metaKey:l,ctrlKey:r,altKey:o,shiftKey:i}=e;Dp()&&((c=(a=window.event)==null?void 0:a.type)!=null&&c.startsWith("key"))&&t.target==="_blank"&&($t()?l=!0:r=!0);let u=pu()&&$t()&&!fu()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:l,ctrlKey:r,altKey:o,shiftKey:i}):new MouseEvent("click",{metaKey:l,ctrlKey:r,altKey:o,shiftKey:i,detail:1,bubbles:!0,cancelable:!0});tt.isOpening=n,Ne(t),t.dispatchEvent(u),tt.isOpening=!1}tt.isOpening=!1;function Kp(t,e){if(t instanceof HTMLAnchorElement)e(t);else if(t.hasAttribute("data-href")){let n=document.createElement("a");n.href=t.getAttribute("data-href"),t.hasAttribute("data-target")&&(n.target=t.getAttribute("data-target")),t.hasAttribute("data-rel")&&(n.rel=t.getAttribute("data-rel")),t.hasAttribute("data-download")&&(n.download=t.getAttribute("data-download")),t.hasAttribute("data-ping")&&(n.ping=t.getAttribute("data-ping")),t.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=t.getAttribute("data-referrer-policy")),t.appendChild(n),e(n),t.removeChild(n)}}function Rp(t,e){Kp(t,n=>tt(n,e))}function Mp(t){const n=Ot().useHref(t.href??"");return{"data-href":t.href?n:void 0,"data-target":t.target,"data-rel":t.rel,"data-download":t.download,"data-ping":t.ping,"data-referrer-policy":t.referrerPolicy}}function hu(t){const n=Ot().useHref((t==null?void 0:t.href)??"");let l={};if(t)for(let r of["href","target","rel","download","ping","referrerPolicy"])r in t&&(l[r]=r==="href"?n:t[r]);return l}function Fp(t,e,n,l){!e.isNative&&t.currentTarget instanceof HTMLAnchorElement&&t.currentTarget.href&&!t.isDefaultPrevented()&&Bp(t.currentTarget,t)&&n&&(t.preventDefault(),e.open(t.currentTarget,t,n,l))}const le=typeof document<"u"?x.useLayoutEffect:()=>{},mu={prefix:String(Math.round(Math.random()*1e10)),current:0},gu=x.createContext(mu),Ip=x.createContext(!1);let Sl=new WeakMap;function Lp(t=!1){var l,r;let e=s.useContext(gu),n=s.useRef(null);if(n.current===null&&!t){let o=(r=(l=x.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)==null?void 0:l.ReactCurrentOwner)==null?void 0:r.current;if(o){let i=Sl.get(o);i==null?Sl.set(o,{id:e.current,state:o.memoizedState}):o.memoizedState!==i.state&&(e.current=i.id,Sl.delete(o))}n.current=++e.current}return n.current}function zp(t){let e=s.useContext(gu),n=Lp(!!t),l=`react-aria${e.prefix}`;return t||`${l}-${n}`}function Np(t){let e=x.useId(),[n]=s.useState(dt()),l=n?"react-aria":`react-aria${mu.prefix}`;return t||`${l}-${e}`}const Vp=typeof x.useId=="function"?Np:zp;function Op(){return!1}function jp(){return!0}function _p(t){return()=>{}}function dt(){return typeof x.useSyncExternalStore=="function"?x.useSyncExternalStore(_p,Op,jp):s.useContext(Ip)}function Hp(t){let[e,n]=s.useState(t),l=s.useRef(e),r=s.useRef(null),o=s.useRef(()=>{if(!r.current)return;let u=r.current.next();if(u.done){r.current=null;return}l.current===u.value?o.current():n(u.value)});le(()=>{l.current=e,r.current&&o.current()});let i=s.useCallback(u=>{r.current=u(l.current),o.current()},[o]);return[e,i]}let Wp=!!(typeof window<"u"&&window.document&&window.document.createElement),Rt=new Map,Jt;typeof FinalizationRegistry<"u"&&(Jt=new FinalizationRegistry(t=>{Rt.delete(t)}));function $e(t){let[e,n]=s.useState(t),l=s.useRef(null),r=Vp(e),o=s.useRef(null);if(Jt&&Jt.register(o,r),Wp){const i=Rt.get(r);i&&!i.includes(l)?i.push(l):Rt.set(r,[l])}return le(()=>{let i=r;return()=>{Jt&&Jt.unregister(o),Rt.delete(i)}},[r]),s.useEffect(()=>{let i=l.current;return i&&n(i),()=>{i&&(l.current=null)}}),r}function Up(t,e){if(t===e)return t;let n=Rt.get(t);if(n)return n.forEach(r=>r.current=e),e;let l=Rt.get(e);return l?(l.forEach(r=>r.current=t),t):e}function sn(t=[]){let e=$e(),[n,l]=Hp(e),r=s.useCallback(()=>{l(function*(){yield e,yield document.getElementById(e)?e:void 0})},[e,l]);return le(r,[e,r,...t]),n}function ft(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}const re=t=>(t==null?void 0:t.ownerDocument)??document,Se=t=>t&&"window"in t&&t.window===t?t:re(t).defaultView||window;function Gp(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&typeof t.nodeType=="number"}function qp(t){return Gp(t)&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in t}let Zp=!1;function Qe(){return Zp}function ne(t,e){if(!Qe())return e&&t?t.contains(e):!1;if(!t||!e)return!1;let n=e;for(;n!==null;){if(n===t)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:qp(n)?n=n.host:n=n.parentNode}return!1}const ie=(t=document)=>{var n;if(!Qe())return t.activeElement;let e=t.activeElement;for(;e&&"shadowRoot"in e&&((n=e.shadowRoot)!=null&&n.activeElement);)e=e.shadowRoot.activeElement;return e};function U(t){if(Qe()&&t.target instanceof Element&&t.target.shadowRoot){if("composedPath"in t)return t.composedPath()[0]??null;if("composedPath"in t.nativeEvent)return t.nativeEvent.composedPath()[0]??null}return t.target}function xt(t){if(!t)return!1;let e=t.getRootNode(),n=Se(t);if(!(e instanceof n.Document||e instanceof n.ShadowRoot))return!1;let l=e.activeElement;return l!=null&&t.contains(l)}class Yp{constructor(e,n,l,r){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=i=>{var u;if(i.nodeType===Node.ELEMENT_NODE){const a=i.shadowRoot;if(a){const c=this._doc.createTreeWalker(a,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(c),NodeFilter.FILTER_ACCEPT}else{if(typeof this.filter=="function")return this.filter(i);if((u=this.filter)!=null&&u.acceptNode)return this.filter.acceptNode(i);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=n,this.filter=r??null,this.whatToShow=l??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(e.createTreeWalker(n,l,this._acceptNode));const o=n.shadowRoot;if(o){const i=this._doc.createTreeWalker(o,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(i)}}get currentNode(){return this._currentNode}set currentNode(e){if(!ne(this.root,e))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let l=e,r=e;for(this._currentNode=e;l&&l!==this.root;)if(l.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const i=l,u=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});n.push(u),u.currentNode=r,this._currentSetFor.add(u),l=r=i.host}else l=l.parentNode;const o=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(o),o.currentNode=r,this._currentSetFor.add(o),this._walkerStack=n}get doc(){return this._doc}firstChild(){let e=this.currentNode,n=this.nextNode();return ne(e,n)?(n&&(this.currentNode=n),n):(this.currentNode=e,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){var n;const e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let r;if(typeof this.filter=="function"?r=this.filter(e):(n=this.filter)!=null&&n.acceptNode&&(r=this.filter.acceptNode(e)),r===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let o=this.nextNode();return o&&(this.currentNode=o),o}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let l=this.nextNode();return l&&(this.currentNode=l),l}else return null}previousNode(){var l;const e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let r=this.previousNode();return r&&(this.currentNode=r),r}else return null;return null}const n=e.previousNode();if(n){if(n.shadowRoot){let o;if(typeof this.filter=="function"?o=this.filter(n):(l=this.filter)!=null&&l.acceptNode&&(o=this.filter.acceptNode(n)),o===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let i=this.lastChild();return i&&(this.currentNode=i),i}return n&&(this.currentNode=n),n}else if(this._walkerStack.length>1){this._walkerStack.shift();let r=this.previousNode();return r&&(this.currentNode=r),r}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}}function yu(t,e,n,l){return Qe()?new Yp(t,e,n,l):t.createTreeWalker(e,n,l)}function pt(...t){return t.length===1&&t[0]?t[0]:e=>{let n=!1;const l=t.map(r=>{const o=Io(r,e);return n||(n=typeof o=="function"),o});if(n)return()=>{l.forEach((r,o)=>{typeof r=="function"?r():Io(t[o],null)})}}}function Io(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function $u(t){var e,n,l="";if(typeof t=="string"||typeof t=="number")l+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e=65&&r.charCodeAt(2)<=90?e[r]=ft(o,i):(r==="className"||r==="UNSAFE_className")&&typeof o=="string"&&typeof i=="string"?e[r]=Xp(o,i):r==="id"&&o&&i?e.id=Up(o,i):r==="ref"&&o&&i?e.ref=pt(o,i):e[r]=i!==void 0?i:o}}return e}const Jp=new Set(["id"]),Qp=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),eb=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),tb=new Set(["dir","lang","hidden","inert","translate"]),Lo=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),nb=/^(data-.*)$/;function oe(t,e={}){let{labelable:n,isLink:l,global:r,events:o=r,propNames:i}=e,u={};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(Jp.has(a)||n&&Qp.has(a)||l&&eb.has(a)||r&&tb.has(a)||o&&(Lo.has(a)||a.endsWith("Capture")&&Lo.has(a.slice(0,-7)))||i!=null&&i.has(a)||nb.test(a))&&(u[a]=t[a]);return u}let ut=new Map,Wl=new Set;function zo(){if(typeof window>"u")return;function t(l){return"propertyName"in l}let e=l=>{let r=U(l);if(!t(l)||!r)return;let o=ut.get(r);o||(o=new Set,ut.set(r,o),r.addEventListener("transitioncancel",n,{once:!0})),o.add(l.propertyName)},n=l=>{let r=U(l);if(!t(l)||!r)return;let o=ut.get(r);if(o&&(o.delete(l.propertyName),o.size===0&&(r.removeEventListener("transitioncancel",n),ut.delete(r)),ut.size===0)){for(let i of Wl)i();Wl.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?zo():document.addEventListener("DOMContentLoaded",zo));function lb(){for(const[t]of ut)"isConnected"in t&&!t.isConnected&&ut.delete(t)}function vu(t){requestAnimationFrame(()=>{lb(),ut.size===0?t():Wl.add(t)})}function Et(){let t=s.useRef(new Map),e=s.useCallback((r,o,i,u)=>{let a=u!=null&&u.once?(...c)=>{t.current.delete(i),i(...c)}:i;t.current.set(i,{type:o,eventTarget:r,fn:a,options:u}),r.addEventListener(o,a,u)},[]),n=s.useCallback((r,o,i,u)=>{var c;let a=((c=t.current.get(i))==null?void 0:c.fn)||i;r.removeEventListener(o,a,u),t.current.delete(i)},[]),l=s.useCallback(()=>{t.current.forEach((r,o)=>{n(r.eventTarget,r.type,o,r.options)})},[n]);return s.useEffect(()=>l,[l]),{addGlobalListener:e,removeGlobalListener:n,removeAllGlobalListeners:l}}function cn(t,e){let{id:n,"aria-label":l,"aria-labelledby":r}=t;return n=$e(n),r&&l?r=[...new Set([n,...r.trim().split(/\s+/)])].join(" "):r&&(r=r.trim().split(/\s+/).join(" ")),!l&&!r&&e&&(l=e),{id:n,"aria-label":l,"aria-labelledby":r}}function Te(t){const e=s.useRef(null),n=s.useRef(void 0),l=s.useCallback(r=>{if(typeof t=="function"){const o=t,i=o(r);return()=>{typeof i=="function"?i():o(null)}}else if(t)return t.current=r,()=>{t.current=null}},[t]);return s.useMemo(()=>({get current(){return e.current},set current(r){e.current=r,n.current&&(n.current(),n.current=void 0),r!=null&&(n.current=l(r))}}),[l])}const rb=x.useInsertionEffect??le;function we(t){const e=s.useRef(null);return rb(()=>{e.current=t},[t]),s.useCallback((...n)=>{const l=e.current;return l==null?void 0:l(...n)},[])}function Tr(t,e){const n=s.useRef(!0),l=s.useRef(null);let r=we(t);s.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),s.useEffect(()=>{let o=l.current;n.current?n.current=!1:(!o||e.some((i,u)=>!Object.is(i,o[u])))&&r(),l.current=e},e)}function No(t,e){const n=s.useRef(!0),l=s.useRef(null);le(()=>(n.current=!0,()=>{n.current=!1}),[]),le(()=>{n.current?n.current=!1:(!l.current||e.some((r,o)=>!Object.is(r,l[o])))&&t(),l.current=e},e)}function ob(){return typeof window.ResizeObserver<"u"}function dn(t){const{ref:e,box:n,onResize:l}=t;let r=we(l);s.useEffect(()=>{let o=e==null?void 0:e.current;if(o)if(ob()){const i=new window.ResizeObserver(u=>{u.length&&r()});return i.observe(o,{box:n}),()=>{o&&i.unobserve(o)}}else return window.addEventListener("resize",r,!1),()=>{window.removeEventListener("resize",r,!1)}},[e,n])}function Ar(t,e){le(()=>{if(t&&t.ref&&e)return t.ref.current=e.current,()=>{t.ref&&(t.ref.current=null)}})}function st(t,e){if(!t)return!1;let n=window.getComputedStyle(t),l=document.scrollingElement||document.documentElement,r=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return t===l&&n.overflow!=="hidden"&&(r=!0),r&&e&&(r=t.scrollHeight!==t.clientHeight||t.scrollWidth!==t.clientWidth),r}function Xe(t,e){let n=t;for(st(n,e)&&(n=n.parentElement);n&&!st(n,e);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function Dl(t,e){let n=[],l=document.scrollingElement||document.documentElement;for(;t&&(st(t,e)&&n.push(t),t!==l);)t=t.parentElement;return n}function Tt(t){return $t()?t.metaKey:t.ctrlKey}const ib=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function rn(t){return t instanceof HTMLInputElement&&!ib.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}let Ke=typeof document<"u"&&window.visualViewport;function ub(){let t=dt(),[e,n]=s.useState(()=>t?{width:0,height:0}:kl());return s.useEffect(()=>{let l=u=>{n(a=>u.width===a.width&&u.height===a.height?a:u)},r=()=>{Ke&&Ke.scale>1||l(kl())},o,i=u=>{Ke&&Ke.scale>1||rn(U(u))&&(o=requestAnimationFrame(()=>{let a=ie();(!a||!rn(a))&&l({width:document.documentElement.clientWidth,height:document.documentElement.clientHeight})}))};return l(kl()),vt()&&window.addEventListener("blur",i,!0),Ke?Ke.addEventListener("resize",r):window.addEventListener("resize",r),()=>{cancelAnimationFrame(o),vt()&&window.removeEventListener("blur",i,!0),Ke?Ke.removeEventListener("resize",r):window.removeEventListener("resize",r)}},[]),e}function kl(){return{width:Ke?Math.min(Ke.width*Ke.scale,document.documentElement.clientWidth):document.documentElement.clientWidth,height:Ke?Ke.height*Ke.scale:document.documentElement.clientHeight}}let ab=0;const Pl=new Map;function $n(t){let[e,n]=s.useState();return le(()=>{if(!t)return;let l=Pl.get(t);if(l)n(l.element.id);else{let r=`react-aria-description-${ab++}`;n(r);let o=document.createElement("div");o.id=r,o.style.display="none",o.textContent=t,document.body.appendChild(o),l={refCount:0,element:o},Pl.set(t,l)}return l.refCount++,()=>{l&&--l.refCount===0&&(l.element.remove(),Pl.delete(t))}},[t]),{"aria-describedby":t?e:void 0}}function Qt(t,e,n,l){let r=we(n),o=n==null;s.useEffect(()=>{if(o||!t.current)return;let i=t.current;return i.addEventListener(e,r,l),()=>{i.removeEventListener(e,r,l)}},[t,e,l,o])}function _n(t,e,n={}){let{block:l="nearest",inline:r="nearest"}=n;if(t===e)return;let o=t.scrollTop,i=t.scrollLeft,u=e.getBoundingClientRect(),a=t.getBoundingClientRect(),c=window.getComputedStyle(e),f=window.getComputedStyle(t),d=document.scrollingElement||document.documentElement,b=t===d,p=t===d?0:a.top,h=t===d?t.clientHeight:a.bottom,y=t===d?0:a.left,m=t===d?t.clientWidth:a.right,g=parseFloat(c.scrollMarginTop)||0,v=parseFloat(c.scrollMarginBottom)||0,E=parseFloat(c.scrollMarginLeft)||0,C=parseFloat(c.scrollMarginRight)||0,R=parseFloat(f.scrollPaddingTop)||0,T=parseFloat(f.scrollPaddingBottom)||0,F=parseFloat(f.scrollPaddingLeft)||0,B=parseFloat(f.scrollPaddingRight)||0,L=parseFloat(f.borderTopWidth)||0,M=parseFloat(f.borderBottomWidth)||0,V=parseFloat(f.borderLeftWidth)||0,H=parseFloat(f.borderRightWidth)||0,j=u.top-g,$=u.bottom+v,D=u.left-E,A=u.right+C,w=t===d?0:V+H,P=t===d?0:L+M,k=t===d?0:t.offsetWidth-t.clientWidth-w,K=t===d?0:t.offsetHeight-t.clientHeight-P,_=p+(b?0:L)+R,Z=h-(b?0:M)-T-K,S=y+(b?0:V)+F,N=m-(b?0:H)-B;f.direction==="rtl"&&!vt()?S+=k:N-=k;let O=j<_||$>Z,X=DN;if(O&&l==="start")o+=j-_;else if(O&&l==="center")o+=(j+$)/2-(_+Z)/2;else if(O&&l==="end")o+=$-Z;else if(O&&l==="nearest"){let J=j-_,de=$-Z;o+=Math.abs(J)<=Math.abs(de)?J:de}if(X&&r==="start")i+=D-S;else if(X&&r==="center")i+=(D+A)/2-(S+N)/2;else if(X&&r==="end")i+=A-N;else if(X&&r==="nearest"){let J=D-S,de=A-N;i+=Math.abs(J)<=Math.abs(de)?J:de}t.scrollTo({left:i,top:o})}function it(t,e={}){var l,r,o;let{containingElement:n}=e;if(t&&t.isConnected){let i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let{left:a,top:c}=t.getBoundingClientRect(),f=Dl(t,!0);for(let p of f)_n(p,t);let{left:d,top:b}=t.getBoundingClientRect();if(Math.abs(a-d)>1||Math.abs(c-b)>1){f=n?Dl(n,!0):[];for(let p of f)_n(p,n,{block:"center",inline:"center"});for(let p of Dl(t,!0))_n(p,t)}}else{let{left:a,top:c}=t.getBoundingClientRect();(l=t==null?void 0:t.scrollIntoView)==null||l.call(t,{block:"nearest"});let{left:f,top:d}=t.getBoundingClientRect();(Math.abs(a-f)>1||Math.abs(c-d)>1)&&((r=n==null?void 0:n.scrollIntoView)==null||r.call(n,{block:"center",inline:"center"}),(o=t.scrollIntoView)==null||o.call(t,{block:"nearest"}))}}}function xu(t){return t.pointerType===""&&t.isTrusted?!0:an()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function sb(t){return!an()&&t.width===0&&t.height===0||t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"}function il(t,e,n){let l=we(r=>{n&&!r.defaultPrevented&&n(e)});s.useEffect(()=>{var o;let r=(o=t==null?void 0:t.current)==null?void 0:o.form;return r==null||r.addEventListener("reset",l),()=>{r==null||r.removeEventListener("reset",l)}},[t])}function Cu(t,e){let{collection:n,onLoadMore:l,scrollOffset:r=1}=t,o=s.useRef(null),i=we(u=>{for(let a of u)a.isIntersecting&&l&&l()});le(()=>(e.current&&(o.current=new IntersectionObserver(i,{root:Xe(e==null?void 0:e.current),rootMargin:`0px ${100*r}% ${100*r}% ${100*r}%`}),o.current.observe(e.current)),()=>{o.current&&o.current.disconnect()}),[n,e,r])}function Eu(t){const e=s.version.split(".");return parseInt(e[0],10)>=19?t:t?"true":void 0}function Br(t,e=!0){let[n,l]=s.useState(!0),r=n&&e;return le(()=>{if(r&&t.current&&"getAnimations"in t.current)for(let o of t.current.getAnimations())o instanceof CSSTransition&&o.cancel()},[t,r]),wu(t,r,s.useCallback(()=>l(!1),[])),r}function Ul(t,e){let[n,l]=s.useState(e?"open":"closed");switch(n){case"open":e||l("exiting");break;case"closed":case"exiting":e&&l("open");break}let r=n==="exiting";return wu(t,r,s.useCallback(()=>{l(o=>o==="exiting"?"closed":o)},[])),r}function wu(t,e,n){le(()=>{if(e&&t.current){if(!("getAnimations"in t.current)){n();return}let l=t.current.getAnimations();if(l.length===0){n();return}let r=!1;return Promise.allSettled(l.map(o=>o.finished)).then(()=>{r||kr.flushSync(()=>{n()})}),()=>{r=!0}}},[t,e,n])}const cb=typeof Element<"u"&&"checkVisibility"in Element.prototype;function db(t){const e=Se(t);if(!(t instanceof e.HTMLElement)&&!(t instanceof e.SVGElement))return!1;let{display:n,visibility:l}=t.style,r=n!=="none"&&l!=="hidden"&&l!=="collapse";if(r){const{getComputedStyle:o}=t.ownerDocument.defaultView;let{display:i,visibility:u}=o(t);r=i!=="none"&&u!=="hidden"&&u!=="collapse"}return r}function fb(t,e){return!t.hasAttribute("hidden")&&!t.hasAttribute("data-react-aria-prevent-focus")&&(t.nodeName==="DETAILS"&&e&&e.nodeName!=="SUMMARY"?t.hasAttribute("open"):!0)}function Kr(t,e){return cb?t.checkVisibility({visibilityProperty:!0})&&!t.closest("[data-react-aria-prevent-focus]"):t.nodeName!=="#comment"&&db(t)&&fb(t,e)&&(!t.parentElement||Kr(t.parentElement,t))}const Rr=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],pb=Rr.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";Rr.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const bb=Rr.join(':not([hidden]):not([tabindex="-1"]),');function Su(t,e){return t.matches(pb)&&!ku(t)&&((e==null?void 0:e.skipVisibilityCheck)||Kr(t))}function Du(t){return t.matches(bb)&&Kr(t)&&!ku(t)}function ku(t){let e=t;for(;e!=null;){if(e instanceof e.ownerDocument.defaultView.HTMLElement&&e.inert)return!0;e=e.parentElement}return!1}function Vo(t){let e=t==null?void 0:t.defaultView;return(e==null?void 0:e.__webpack_nonce__)||globalThis.__webpack_nonce__||void 0}let Tl=new WeakMap;function Pu(t){let e=t??(typeof document<"u"?document:void 0);if(!e)return Vo(e);if(Tl.has(e))return Tl.get(e);let n=e.querySelector('meta[property="csp-nonce"]'),l=n&&n instanceof Se(n).HTMLMetaElement&&(n.nonce||n.content)||Vo(e)||void 0;return l!==void 0&&Tl.set(e,l),l}function hb(t,e,n){const{render:l,...r}=e,o=s.useRef(null),i=s.useMemo(()=>pt(n,o),[n,o]);le(()=>{},[t,l]);const u={...r,ref:i};return l?l(u,void 0):I.jsx(t,{...u})}const Oo={},De=new Proxy({},{get(t,e){if(typeof e!="string")return;let n=Oo[e];return n||(n=s.forwardRef(hb.bind(null,e)),Oo[e]=n),n}});var mb=/\s+/g,gb=t=>typeof t!="string"||!t?t:t.replace(mb," ").trim(),Lt=(...t)=>{const e=[],n=l=>{if(!l&&l!==0&&l!==0n)return;if(Array.isArray(l)){for(let o=0,i=l.length;o0?gb(e.join(" ")):void 0},jo=t=>t===!1?"false":t===!0?"true":t===0?"0":t,Ae=t=>{if(!t||typeof t!="object")return!0;for(const e in t)return!1;return!0},yb=(t,e)=>{if(t===e)return!0;if(!t||!e)return!1;const n=Object.keys(t),l=Object.keys(e);if(n.length!==l.length)return!1;for(let r=0;r{for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const l=e[n];n in t?t[n]=Lt(t[n],l):t[n]=l}return t},Tu=(t,e)=>{for(let n=0;n{const e=[];Tu(t,e);const n=[];for(let l=0;l{const n={};for(const l in t){const r=t[l];if(l in e){const o=e[l];Array.isArray(r)||Array.isArray(o)?n[l]=Au(o,r):typeof r=="object"&&typeof o=="object"&&r&&o?n[l]=Gl(r,o):n[l]=o+" "+r}else n[l]=r}for(const l in e)l in t||(n[l]=e[l]);return n},vb={twMerge:!0,twMergeConfig:{}};function xb(){let t=null,e={},n=!1;return{get cachedTwMerge(){return t},set cachedTwMerge(l){t=l},get cachedTwMergeConfig(){return e},set cachedTwMergeConfig(l){e=l},get didTwMergeConfigChange(){return n},set didTwMergeConfigChange(l){n=l},reset(){t=null,e={},n=!1}}}var Je=xb(),Cb=t=>{const e=(l,r)=>{const{extend:o=null,slots:i={},variants:u={},compoundVariants:a=[],compoundSlots:c=[],defaultVariants:f={}}=l,d={...vb,...r},b=o!=null&&o.base?Lt(o.base,l==null?void 0:l.base):l==null?void 0:l.base,p=o!=null&&o.variants&&!Ae(o.variants)?Gl(u,o.variants):u,h=o!=null&&o.defaultVariants&&!Ae(o.defaultVariants)?{...o.defaultVariants,...f}:f;!Ae(d.twMergeConfig)&&!yb(d.twMergeConfig,Je.cachedTwMergeConfig)&&(Je.didTwMergeConfigChange=!0,Je.cachedTwMergeConfig=d.twMergeConfig);const y=Ae(o==null?void 0:o.slots),m=Ae(i)?{}:{base:Lt(l==null?void 0:l.base,y&&(o==null?void 0:o.base)),...i},g=y?m:$b({...o==null?void 0:o.slots},Ae(m)?{base:l==null?void 0:l.base}:m),v=Ae(o==null?void 0:o.compoundVariants)?a:Au(o==null?void 0:o.compoundVariants,a),E=R=>{if(Ae(p)&&Ae(i)&&y)return t(b,R==null?void 0:R.class,R==null?void 0:R.className)(d);if(v&&!Array.isArray(v))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof v}`);if(c&&!Array.isArray(c))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof c}`);const T=($,D=p,A=null,w=null)=>{const P=D[$];if(!P||Ae(P))return null;const k=(w==null?void 0:w[$])??(R==null?void 0:R[$]);if(k===null)return null;const K=jo(k);if(typeof K=="object")return null;const _=h==null?void 0:h[$],Z=K??jo(_);return P[Z||"false"]},F=()=>{if(!p)return null;const $=Object.keys(p),D=[];for(let A=0;A<$.length;A++){const w=T($[A],p);w&&D.push(w)}return D},B=($,D)=>{if(!p||typeof p!="object")return null;const A=[];for(const w in p){const P=T(w,p,$,D),k=$==="base"&&typeof P=="string"?P:P&&P[$];k&&A.push(k)}return A},L={};for(const $ in R){const D=R[$];D!==void 0&&(L[$]=D)}const M=($,D)=>{var w;const A=typeof(R==null?void 0:R[$])=="object"?{[$]:(w=R[$])==null?void 0:w.initial}:{};return{...h,...L,...A,...D}},V=($=[],D)=>{const A=[],w=$.length;for(let P=0;P{const D=V(v,$);if(!Array.isArray(D))return D;const A={},w=t;for(let P=0;P{if(c.length<1)return null;const D={},A=M(null,$);for(let w=0;w{const P=H(w),k=j(w);return D(g[A],B(A,w),P?P[A]:void 0,k?k[A]:void 0,w==null?void 0:w.class,w==null?void 0:w.className)(d)}}return $}return t(b,F(),V(v),R==null?void 0:R.class,R==null?void 0:R.className)(d)},C=()=>{if(!(!p||typeof p!="object"))return Object.keys(p)};return E.variantKeys=C(),E.extend=o,E.base=b,E.slots=g,E.variants=p,E.defaultVariants=h,E.compoundSlots=c,E.compoundVariants=v,E};return{tv:e,createTV:l=>(r,o)=>e(r,o?Gl(l,o):l)}};const Eb=(t,e)=>{const n=new Array(t.length+e.length);for(let l=0;l({classGroupId:t,validator:e}),Bu=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Gn="-",_o=[],Sb="arbitrary..",Db=t=>{const e=Pb(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:l}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return kb(i);const u=i.split(Gn),a=u[0]===""&&u.length>1?1:0;return Ku(u,a,e)},getConflictingClassGroupIds:(i,u)=>{if(u){const a=l[i],c=n[i];return a?c?Eb(c,a):a:c||_o}return n[i]||_o}}},Ku=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],o=n.nextPart.get(r);if(o){const c=Ku(t,e+1,o);if(c)return c}const i=n.validators;if(i===null)return;const u=e===0?t.join(Gn):t.slice(e).join(Gn),a=i.length;for(let c=0;ct.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),l=e.slice(0,n);return l?Sb+l:void 0})(),Pb=t=>{const{theme:e,classGroups:n}=t;return Tb(n,e)},Tb=(t,e)=>{const n=Bu();for(const l in t){const r=t[l];Mr(r,n,l,e)}return n},Mr=(t,e,n,l)=>{const r=t.length;for(let o=0;o{if(typeof t=="string"){Bb(t,e,n);return}if(typeof t=="function"){Kb(t,e,n,l);return}Rb(t,e,n,l)},Bb=(t,e,n)=>{const l=t===""?e:Ru(e,t);l.classGroupId=n},Kb=(t,e,n,l)=>{if(Mb(t)){Mr(t(l),e,n,l);return}e.validators===null&&(e.validators=[]),e.validators.push(wb(n,t))},Rb=(t,e,n,l)=>{const r=Object.entries(t),o=r.length;for(let i=0;i{let n=t;const l=e.split(Gn),r=l.length;for(let o=0;o"isThemeGetter"in t&&t.isThemeGetter===!0,Fb=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),l=Object.create(null);const r=(o,i)=>{n[o]=i,e++,e>t&&(e=0,l=n,n=Object.create(null))};return{get(o){let i=n[o];if(i!==void 0)return i;if((i=l[o])!==void 0)return r(o,i),i},set(o,i){o in n?n[o]=i:r(o,i)}}},ql="!",Ho=":",Ib=[],Wo=(t,e,n,l,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:l,isExternal:r}),Lb=t=>{const{prefix:e,experimentalParseClassName:n}=t;let l=r=>{const o=[];let i=0,u=0,a=0,c;const f=r.length;for(let y=0;ya?c-a:void 0;return Wo(o,p,b,h)};if(e){const r=e+Ho,o=l;l=i=>i.startsWith(r)?o(i.slice(r.length)):Wo(Ib,!1,i,void 0,!0)}if(n){const r=l;l=o=>n({className:o,parseClassName:r})}return l},zb=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,l)=>{e.set(n,1e6+l)}),n=>{const l=[];let r=[];for(let o=0;o0&&(r.sort(),l.push(...r),r=[]),l.push(i)):r.push(i)}return r.length>0&&(r.sort(),l.push(...r)),l}},Nb=t=>({cache:Fb(t.cacheSize),parseClassName:Lb(t),sortModifiers:zb(t),...Db(t)}),Vb=/\s+/,Ob=(t,e)=>{const{parseClassName:n,getClassGroupId:l,getConflictingClassGroupIds:r,sortModifiers:o}=e,i=[],u=t.trim().split(Vb);let a="";for(let c=u.length-1;c>=0;c-=1){const f=u[c],{isExternal:d,modifiers:b,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:y}=n(f);if(d){a=f+(a.length>0?" "+a:a);continue}let m=!!y,g=l(m?h.substring(0,y):h);if(!g){if(!m){a=f+(a.length>0?" "+a:a);continue}if(g=l(h),!g){a=f+(a.length>0?" "+a:a);continue}m=!1}const v=b.length===0?"":b.length===1?b[0]:o(b).join(":"),E=p?v+ql:v,C=E+g;if(i.indexOf(C)>-1)continue;i.push(C);const R=r(g,m);for(let T=0;T0?" "+a:a)}return a},jb=(...t)=>{let e=0,n,l,r="";for(;e{if(typeof t=="string")return t;let e,n="";for(let l=0;l{let n,l,r,o;const i=a=>{const c=e.reduce((f,d)=>d(f),t());return n=Nb(c),l=n.cache.get,r=n.cache.set,o=u,u(a)},u=a=>{const c=l(a);if(c)return c;const f=Ob(a,n);return r(a,f),f};return o=i,(...a)=>o(jb(...a))},_b=[],ye=t=>{const e=n=>n[t]||_b;return e.isThemeGetter=!0,e},Fu=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Iu=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Hb=/^\d+\/\d+$/,Wb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ub=/\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$/,Gb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kt=t=>Hb.test(t),te=t=>!!t&&!Number.isNaN(Number(t)),ot=t=>!!t&&Number.isInteger(Number(t)),Al=t=>t.endsWith("%")&&te(t.slice(0,-1)),Ye=t=>Wb.test(t),Yb=()=>!0,Xb=t=>Ub.test(t)&&!Gb.test(t),Lu=()=>!1,Jb=t=>qb.test(t),Qb=t=>Zb.test(t),eh=t=>!G(t)&&!q(t),th=t=>jt(t,Vu,Lu),G=t=>Fu.test(t),bt=t=>jt(t,Ou,Xb),Bl=t=>jt(t,ih,te),Uo=t=>jt(t,zu,Lu),nh=t=>jt(t,Nu,Qb),Kn=t=>jt(t,ju,Jb),q=t=>Iu.test(t),qt=t=>_t(t,Ou),lh=t=>_t(t,uh),Go=t=>_t(t,zu),rh=t=>_t(t,Vu),oh=t=>_t(t,Nu),Rn=t=>_t(t,ju,!0),jt=(t,e,n)=>{const l=Fu.exec(t);return l?l[1]?e(l[1]):n(l[2]):!1},_t=(t,e,n=!1)=>{const l=Iu.exec(t);return l?l[1]?e(l[1]):n:!1},zu=t=>t==="position"||t==="percentage",Nu=t=>t==="image"||t==="url",Vu=t=>t==="length"||t==="size"||t==="bg-size",Ou=t=>t==="length",ih=t=>t==="number",uh=t=>t==="family-name",ju=t=>t==="shadow",Yl=()=>{const t=ye("color"),e=ye("font"),n=ye("text"),l=ye("font-weight"),r=ye("tracking"),o=ye("leading"),i=ye("breakpoint"),u=ye("container"),a=ye("spacing"),c=ye("radius"),f=ye("shadow"),d=ye("inset-shadow"),b=ye("text-shadow"),p=ye("drop-shadow"),h=ye("blur"),y=ye("perspective"),m=ye("aspect"),g=ye("ease"),v=ye("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...C(),q,G],T=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto","contain","none"],B=()=>[q,G,a],L=()=>[kt,"full","auto",...B()],M=()=>[ot,"none","subgrid",q,G],V=()=>["auto",{span:["full",ot,q,G]},ot,q,G],H=()=>[ot,"auto",q,G],j=()=>["auto","min","max","fr",q,G],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],D=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...B()],w=()=>[kt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],P=()=>[t,q,G],k=()=>[...C(),Go,Uo,{position:[q,G]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",rh,th,{size:[q,G]}],Z=()=>[Al,qt,bt],S=()=>["","none","full",c,q,G],N=()=>["",te,qt,bt],O=()=>["solid","dashed","dotted","double"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[te,Al,Go,Uo],de=()=>["","none",h,q,G],Ce=()=>["none",te,q,G],z=()=>["none",te,q,G],Y=()=>[te,q,G],ue=()=>[kt,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ye],breakpoint:[Ye],color:[Yb],container:[Ye],"drop-shadow":[Ye],ease:["in","out","in-out"],font:[eh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ye],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ye],shadow:[Ye],spacing:["px",te],text:[Ye],"text-shadow":[Ye],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",kt,G,q,m]}],container:["container"],columns:[{columns:[te,G,q,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:R()}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:F()}],"overscroll-x":[{"overscroll-x":F()}],"overscroll-y":[{"overscroll-y":F()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[ot,"auto",q,G]}],basis:[{basis:[kt,"full","auto",u,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[te,kt,"auto","initial","none",G]}],grow:[{grow:["",te,q,G]}],shrink:[{shrink:["",te,q,G]}],order:[{order:[ot,"first","last","none",q,G]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":j()}],"auto-rows":[{"auto-rows":j()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...D(),"normal"]}],"justify-self":[{"justify-self":["auto",...D()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...D(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...D(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...D(),"baseline"]}],"place-self":[{"place-self":["auto",...D()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:w()}],w:[{w:[u,"screen",...w()]}],"min-w":[{"min-w":[u,"screen","none",...w()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[i]},...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",n,qt,bt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[l,q,Bl]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Al,G]}],"font-family":[{font:[lh,G,e]}],"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:[r,q,G]}],"line-clamp":[{"line-clamp":[te,"none",q,Bl]}],leading:[{leading:[o,...B()]}],"list-image":[{"list-image":["none",q,G]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",q,G]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:[te,"from-font","auto",q,bt]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[te,"auto",q,G]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",q,G]}],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",q,G]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ot,q,G],radial:["",q,G],conic:[ot,q,G]},oh,nh]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:S()}],"rounded-s":[{"rounded-s":S()}],"rounded-e":[{"rounded-e":S()}],"rounded-t":[{"rounded-t":S()}],"rounded-r":[{"rounded-r":S()}],"rounded-b":[{"rounded-b":S()}],"rounded-l":[{"rounded-l":S()}],"rounded-ss":[{"rounded-ss":S()}],"rounded-se":[{"rounded-se":S()}],"rounded-ee":[{"rounded-ee":S()}],"rounded-es":[{"rounded-es":S()}],"rounded-tl":[{"rounded-tl":S()}],"rounded-tr":[{"rounded-tr":S()}],"rounded-br":[{"rounded-br":S()}],"rounded-bl":[{"rounded-bl":S()}],"border-w":[{border:N()}],"border-w-x":[{"border-x":N()}],"border-w-y":[{"border-y":N()}],"border-w-s":[{"border-s":N()}],"border-w-e":[{"border-e":N()}],"border-w-t":[{"border-t":N()}],"border-w-r":[{"border-r":N()}],"border-w-b":[{"border-b":N()}],"border-w-l":[{"border-l":N()}],"divide-x":[{"divide-x":N()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":N()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...O(),"hidden","none"]}],"divide-style":[{divide:[...O(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...O(),"none","hidden"]}],"outline-offset":[{"outline-offset":[te,q,G]}],"outline-w":[{outline:["",te,qt,bt]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",f,Rn,Kn]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",d,Rn,Kn]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[te,bt]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":N()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",b,Rn,Kn]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[te,q,G]}],"mix-blend":[{"mix-blend":[...X(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":X()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[te]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[q,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[te]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",q,G]}],filter:[{filter:["","none",q,G]}],blur:[{blur:de()}],brightness:[{brightness:[te,q,G]}],contrast:[{contrast:[te,q,G]}],"drop-shadow":[{"drop-shadow":["","none",p,Rn,Kn]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",te,q,G]}],"hue-rotate":[{"hue-rotate":[te,q,G]}],invert:[{invert:["",te,q,G]}],saturate:[{saturate:[te,q,G]}],sepia:[{sepia:["",te,q,G]}],"backdrop-filter":[{"backdrop-filter":["","none",q,G]}],"backdrop-blur":[{"backdrop-blur":de()}],"backdrop-brightness":[{"backdrop-brightness":[te,q,G]}],"backdrop-contrast":[{"backdrop-contrast":[te,q,G]}],"backdrop-grayscale":[{"backdrop-grayscale":["",te,q,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[te,q,G]}],"backdrop-invert":[{"backdrop-invert":["",te,q,G]}],"backdrop-opacity":[{"backdrop-opacity":[te,q,G]}],"backdrop-saturate":[{"backdrop-saturate":[te,q,G]}],"backdrop-sepia":[{"backdrop-sepia":["",te,q,G]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",q,G]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[te,"initial",q,G]}],ease:[{ease:["linear","initial",g,q,G]}],delay:[{delay:[te,q,G]}],animate:[{animate:["none",v,q,G]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,q,G]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:Ce()}],"rotate-x":[{"rotate-x":Ce()}],"rotate-y":[{"rotate-y":Ce()}],"rotate-z":[{"rotate-z":Ce()}],scale:[{scale:z()}],"scale-x":[{"scale-x":z()}],"scale-y":[{"scale-y":z()}],"scale-z":[{"scale-z":z()}],"scale-3d":["scale-3d"],skew:[{skew:Y()}],"skew-x":[{"skew-x":Y()}],"skew-y":[{"skew-y":Y()}],transform:[{transform:[q,G,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"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",q,G]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",q,G]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[te,qt,bt,Bl]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-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-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-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-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"]}},ah=(t,{cacheSize:e,prefix:n,experimentalParseClassName:l,extend:r={},override:o={}})=>(en(t,"cacheSize",e),en(t,"prefix",n),en(t,"experimentalParseClassName",l),Mn(t.theme,o.theme),Mn(t.classGroups,o.classGroups),Mn(t.conflictingClassGroups,o.conflictingClassGroups),Mn(t.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),en(t,"orderSensitiveModifiers",o.orderSensitiveModifiers),Fn(t.theme,r.theme),Fn(t.classGroups,r.classGroups),Fn(t.conflictingClassGroups,r.conflictingClassGroups),Fn(t.conflictingClassGroupModifiers,r.conflictingClassGroupModifiers),_u(t,r,"orderSensitiveModifiers"),t),en=(t,e,n)=>{n!==void 0&&(t[e]=n)},Mn=(t,e)=>{if(e)for(const n in e)en(t,n,e[n])},Fn=(t,e)=>{if(e)for(const n in e)_u(t,e,n)},_u=(t,e,n)=>{const l=e[n];l!==void 0&&(t[n]=t[n]?t[n].concat(l):l)},sh=(t,...e)=>typeof t=="function"?Zl(Yl,t,...e):Zl(()=>ah(Yl(),t),...e),ch=Zl(Yl);var dh=t=>Ae(t)?ch:sh({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}),fh=(t,e)=>{const n=Lt(t);return!n||!((e==null?void 0:e.twMerge)??!0)?n:((!Je.cachedTwMerge||Je.didTwMergeConfigChange)&&(Je.didTwMergeConfigChange=!1,Je.cachedTwMerge=dh(Je.cachedTwMergeConfig)),Je.cachedTwMerge(n)||void 0)},ph=(...t)=>e=>fh(t,e),{tv:ke}=Cb(ph);const ul=ke({defaultVariants:{size:"md",status:"danger",variant:"opaque"},slots:{backdrop:"alert-dialog__backdrop",body:"alert-dialog__body",closeTrigger:"alert-dialog__close-trigger",container:"alert-dialog__container",dialog:"alert-dialog__dialog",footer:"alert-dialog__footer",header:"alert-dialog__header",heading:"alert-dialog__heading",icon:"alert-dialog__icon",trigger:"alert-dialog__trigger"},variants:{size:{cover:{dialog:"alert-dialog__dialog--cover"},lg:{dialog:"alert-dialog__dialog--lg"},md:{dialog:"alert-dialog__dialog--md"},sm:{dialog:"alert-dialog__dialog--sm"},xs:{dialog:"alert-dialog__dialog--xs"}},status:{accent:{icon:"alert-dialog__icon--accent"},danger:{icon:"alert-dialog__icon--danger"},default:{icon:"alert-dialog__icon--default"},success:{icon:"alert-dialog__icon--success"},warning:{icon:"alert-dialog__icon--warning"}},variant:{blur:{backdrop:"alert-dialog__backdrop--blur"},opaque:{backdrop:"alert-dialog__backdrop--opaque"},transparent:{backdrop:"alert-dialog__backdrop--transparent"}}}}),bh=ke({base:"button",defaultVariants:{fullWidth:!1,isIconOnly:!1,size:"md",variant:"primary"},variants:{fullWidth:{false:"",true:"button--full-width"},isIconOnly:{true:"button--icon-only"},size:{lg:"button--lg",md:"button--md",sm:"button--sm"},variant:{danger:"button--danger","danger-soft":"button--danger-soft",ghost:"button--ghost",outline:"button--outline",primary:"button--primary",secondary:"button--secondary",tertiary:"button--tertiary"}}}),hh=ke({defaultVariants:{variant:"default"},slots:{base:"card",content:"card__content",description:"card__description",footer:"card__footer",header:"card__header",title:"card__title"},variants:{variant:{default:{base:"card--default"},secondary:{base:"card--secondary"},tertiary:{base:"card--tertiary"},transparent:{base:"card--transparent"}}}}),mh=ke({defaultVariants:{color:"default",variant:"secondary"},slots:{base:"chip",label:"chip__label"},variants:{color:{accent:{base:"chip--accent"},danger:{base:"chip--danger"},default:{base:"chip--default"},success:{base:"chip--success"},warning:{base:"chip--warning"}},size:{lg:{base:"chip--lg"},md:{base:"chip--md"},sm:{base:"chip--sm"}},variant:{primary:{base:"chip--primary"},secondary:{base:"chip--secondary"},soft:{base:"chip--soft"},tertiary:{base:"chip--tertiary"}}}}),gh=ke({base:"close-button",defaultVariants:{variant:"default"},variants:{variant:{default:"close-button--default"}}}),yh=ke({defaultVariants:{fullWidth:!1},slots:{base:"combo-box",inputGroup:"combo-box__input-group",popover:"combo-box__popover",trigger:"combo-box__trigger"},variants:{fullWidth:{false:{},true:{base:"combo-box--full-width",inputGroup:"combo-box__input-group--full-width"}}}}),$h=ke({base:"description"}),vh=ke({base:"input",defaultVariants:{fullWidth:!1,variant:"primary"},variants:{fullWidth:{false:"",true:"input--full-width"},variant:{primary:"input--primary",secondary:"input--secondary"}}}),xh=ke({base:"label",defaultVariants:{isDisabled:!1,isInvalid:!1,isRequired:!1},variants:{isDisabled:{true:"label--disabled"},isInvalid:{true:"label--invalid"},isRequired:{true:"label--required"}}}),Ch=ke({slots:{base:"link",icon:"link__icon"}}),Eh=ke({base:"list-box",defaultVariants:{variant:"default"},variants:{variant:{danger:"list-box--danger",default:"list-box--default"}}}),wh=ke({defaultVariants:{variant:"default"},slots:{indicator:"list-box-item__indicator",item:"list-box-item"},variants:{variant:{danger:{item:"list-box-item--danger"},default:{item:"list-box-item--default"}}}}),Sh=ke({base:"list-box-section"}),Dh=ke({base:"spinner",defaultVariants:{color:"accent",size:"md"},variants:{color:{accent:"spinner--accent",current:"spinner--current",danger:"spinner--danger",success:"spinner--success",warning:"spinner--warning"},size:{lg:"spinner--lg",md:"spinner--md",sm:"spinner--sm",xl:"spinner--xl"}}}),kh=ke({defaultVariants:{variant:"primary"},slots:{base:"table-root",body:"table__body",cell:"table__cell",column:"table__column",columnResizer:"table__column-resizer",content:"table__content",footer:"table__footer",header:"table__header",loadMore:"table__load-more",loadMoreContent:"table__load-more-content",resizableContainer:"table__resizable-container",row:"table__row",scrollContainer:"table__scroll-container",sortableColumnHeader:"table__sortable-column-header",sortableColumnIndicator:"table__sortable-column-indicator"},variants:{variant:{primary:{base:"table-root--primary"},secondary:{base:"table-root--secondary"}}}}),Ph=ke({base:"textfield",defaultVariants:{fullWidth:!1},variants:{fullWidth:{false:"",true:"textfield--full-width"}}}),gt=Symbol("default");function Me({values:t,children:e}){for(let[n,l]of t)e=x.createElement(n.Provider,{value:l},e);return e}function ae(t){let{className:e,style:n,children:l,defaultClassName:r,defaultChildren:o,defaultStyle:i,values:u,render:a}=t;return s.useMemo(()=>{let c,f,d;return typeof e=="function"?c=e({...u,defaultClassName:r}):c=e,typeof n=="function"?f=n({...u,defaultStyle:i||{}}):f=n,typeof l=="function"?d=l({...u,defaultChildren:o}):l==null?d=o:d=l,{className:c??r,style:f||i?{...i,...f}:void 0,children:d??o,"data-rac":"",render:a?b=>a(b,u):void 0}},[e,n,l,r,o,i,u,a])}function Th(t,e){return n=>e(typeof t=="function"?t(n):t,n)}function vn(t,e){let n=s.useContext(t);if(e===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let l=e||gt;if(!n.slots[l]){let r=new Intl.ListFormat().format(Object.keys(n.slots).map(i=>`"${i}"`)),o=e?`Invalid slot "${e}".`:"A slot prop is required.";throw new Error(`${o} Valid slot names are ${r}.`)}return n.slots[l]}return n}function ve(t,e,n){let l=vn(n,t.slot)||{},{ref:r,...o}=l,i=Te(s.useMemo(()=>pt(e,r),[e,r])),u=W(o,t);return"style"in o&&o.style&&"style"in t&&t.style&&(typeof o.style=="function"||typeof t.style=="function"?u.style=a=>{let c=typeof o.style=="function"?o.style(a):o.style,f={...a.defaultStyle,...c},d=typeof t.style=="function"?t.style({...a,defaultStyle:f}):t.style;return{...f,...d}}:u.style={...o.style,...t.style}),[u,i]}function xn(t=!0){let[e,n]=s.useState(t),l=s.useRef(!1),r=s.useCallback(o=>{l.current=!0,n(!!o)},[]);return le(()=>{l.current||n(!1)},[]),[r,e]}function Fr(t){const e=/^(data-.*)$/;let n={};for(const l in t)e.test(l)||(n[l]=t[l]);return n}function Ah(t,e,n){let{render:l,...r}=e,o=s.useRef(null),i=s.useMemo(()=>pt(n,o),[n,o]);le(()=>{},[t,l]);let u={...r,ref:i};return l?l(u,void 0):x.createElement(t,u)}const qo={},ee=new Proxy({},{get(t,e){if(typeof e!="string")return;let n=qo[e];return n||(n=s.forwardRef(Ah.bind(null,e)),qo[e]=n),n}});typeof HTMLTemplateElement<"u"&&(Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.content.firstChild}}),Object.defineProperty(HTMLTemplateElement.prototype,"appendChild",{configurable:!0,enumerable:!0,value:function(t){return this.content.appendChild(t)}}),Object.defineProperty(HTMLTemplateElement.prototype,"removeChild",{configurable:!0,enumerable:!0,value:function(t){return this.content.removeChild(t)}}),Object.defineProperty(HTMLTemplateElement.prototype,"insertBefore",{configurable:!0,enumerable:!0,value:function(t,e){return this.content.insertBefore(t,e)}}));const qn=s.createContext(!1);function Bh(t){if(s.useContext(qn))return x.createElement(x.Fragment,null,t.children);let n=x.createElement(qn.Provider,{value:!0},t.children);return x.createElement("template",null,n)}function Cn(t){let e=(n,l)=>s.useContext(qn)?null:t(n,l);return e.displayName=t.displayName||t.name,s.forwardRef(e)}function Kh(){return s.useContext(qn)}const Ht=s.createContext({}),Rh=Cn(function(e,n){[e,n]=ve(e,n,Ht);let{elementType:l="label",...r}=e,o=ee[l];return x.createElement(o,{className:"react-aria-Label",...r,ref:n})});function al(t){let{id:e,label:n,"aria-labelledby":l,"aria-label":r,labelElementType:o="label"}=t;e=$e(e);let i=$e(),u={};n&&(l=l?`${i} ${l}`:i,u={id:i,htmlFor:o==="label"?e:void 0});let a=cn({id:e,"aria-label":r,"aria-labelledby":l});return{labelProps:u,fieldProps:a}}const Mh=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Fh=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Ih(t){if(Intl.Locale){let n=new Intl.Locale(t).maximize(),l=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(l)return l.direction==="rtl";if(n.script)return Mh.has(n.script)}let e=t.split("-")[0];return Fh.has(e)}const Hu=Symbol.for("react-aria.i18n.locale");function Wu(){let t=typeof window<"u"&&window[Hu]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{t="en-US"}return{locale:t,direction:Ih(t)?"rtl":"ltr"}}let Xl=Wu(),tn=new Set;function Zo(){Xl=Wu();for(let t of tn)t(Xl)}function Lh(){let t=dt(),[e,n]=s.useState(Xl);return s.useEffect(()=>(tn.size===0&&window.addEventListener("languagechange",Zo),tn.add(n),()=>{tn.delete(n),tn.size===0&&window.removeEventListener("languagechange",Zo)}),[]),t?{locale:typeof window<"u"&&window[Hu]||"en-US",direction:"ltr"}:e}const zh=x.createContext(null);function Pe(){let t=Lh();return s.useContext(zh)||t}let Kl=new Map,Jl=!1;try{Jl=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let Zn=!1;try{Zn=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const Uu={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class Nh{constructor(e,n={}){this.numberFormatter=Vh(e,n),this.options=n}format(e){var l;let n="";if(!Jl&&this.options.signDisplay!=null?n=Oh(this.numberFormatter,this.options.signDisplay,e):n=this.numberFormatter.format(e),this.options.style==="unit"&&!Zn){let{unit:r,unitDisplay:o="short",locale:i}=this.resolvedOptions();if(!r)return n;let u=(l=Uu[r])==null?void 0:l[o];n+=u[i]||u.default}return n}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,n){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(e,n);if(n= start date");return`${this.format(e)} – ${this.format(n)}`}formatRangeToParts(e,n){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(e,n);if(n= start date");let l=this.numberFormatter.formatToParts(e),r=this.numberFormatter.formatToParts(n);return[...l.map(o=>({...o,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...r.map(o=>({...o,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!Jl&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!Zn&&this.options.style==="unit"&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}}function Vh(t,e={}){var o;let{numberingSystem:n}=e;if(n&&t.includes("-nu-")&&(t.includes("-u-")||(t+="-u-"),t+=`-nu-${n}`),e.style==="unit"&&!Zn){let{unit:i,unitDisplay:u="short"}=e;if(!i)throw new Error('unit option must be provided with style: "unit"');if(!((o=Uu[i])!=null&&o[u]))throw new Error(`Unsupported unit ${i} with unitDisplay = ${u}`);e={...e,style:"decimal"}}let l=t+(e?Object.entries(e).sort((i,u)=>i[0]0||Object.is(n,0):e==="exceptZero"&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):l=n>0),l){let r=t.format(-n),o=t.format(n),i=r.replace(o,"").replace(/\u200e|\u061C/,"");return[...i].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),r.replace(o,"!!!").replace(i,"+").replace("!!!",o)}else return t.format(n)}}function jh(t={}){let{locale:e}=Pe();return s.useMemo(()=>new Nh(e,t),[e,t])}function fn(t,e=-1/0,n=1/0){return Math.min(Math.max(t,e),n)}function _h(t,e=-1/0,n=1/0){return Math.min(Math.max(t,e),n)}function In(t,e){let n=t,l=0,r=e.toString(),o=r.toLowerCase().indexOf("e-");if(o>0)l=Math.abs(Math.floor(Math.log10(Math.abs(e))))+o;else{let i=r.indexOf(".");i>=0&&(l=r.length-i)}if(l>0){let i=Math.pow(10,l);n=Math.round(n*i)/i}return n}function Zt(t,e,n,l){e=Number(e),n=Number(n);let r=(t-(isNaN(e)?0:e))%l,o=In(Math.abs(r)*2>=l?t+Math.sign(r)*(l-Math.abs(r)):t-r,l);return isNaN(e)?!isNaN(n)&&o>n&&(o=Math.floor(In(n/l,l))*l):on&&(o=e+Math.floor(In((n-e)/l,l))*l),o=In(o,l),o}const Hh=s.createContext(null),Gu=7e3;let We=null;function yt(t,e="assertive",n=Gu){We?We.announce(t,e,n):(We=new Wh,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?We.announce(t,e,n):setTimeout(()=>{We!=null&&We.isAttached()&&(We==null||We.announce(t,e,n))},100))}class Wh{constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}isAttached(){var e;return(e=this.node)==null?void 0:e.isConnected}createLog(e){let n=document.createElement("div");return n.setAttribute("role","log"),n.setAttribute("aria-live",e),n.setAttribute("aria-relevant","additions"),n}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,n="assertive",l=Gu){var o,i;if(!this.node)return;let r=document.createElement("div");typeof e=="object"?(r.setAttribute("role","img"),r.setAttribute("aria-labelledby",e["aria-labelledby"])):r.textContent=e,n==="assertive"?(o=this.assertiveLog)==null||o.appendChild(r):(i=this.politeLog)==null||i.appendChild(r),e!==""&&setTimeout(()=>{r.remove()},l)}clear(e){this.node&&((!e||e==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||e==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}}function Ir(t){let e=t;return e.nativeEvent=t,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function qu(t,e){Object.defineProperty(t,"target",{value:e}),Object.defineProperty(t,"currentTarget",{value:e})}function Zu(t){let e=s.useRef({isFocused:!1,observer:null});return le(()=>{const n=e.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]),s.useCallback(n=>{let l=U(n);if(l instanceof HTMLButtonElement||l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement||l instanceof HTMLSelectElement){e.current.isFocused=!0;let r=l,o=i=>{if(e.current.isFocused=!1,r.disabled){let u=Ir(i);t==null||t(u)}e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};r.addEventListener("focusout",o,{once:!0}),e.current.observer=new MutationObserver(()=>{var i;if(e.current.isFocused&&r.disabled){(i=e.current.observer)==null||i.disconnect();let u=r===ie()?null:ie();r.dispatchEvent(new FocusEvent("blur",{relatedTarget:u})),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:u}))}}),e.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]})}},[t])}let Yn=!1;function Uh(t){for(;t&&!Su(t,{skipVisibilityCheck:!0});)t=t.parentElement;let e=Se(t),n=e.document.activeElement;if(!n||n===t)return;Yn=!0;let l=!1,r=f=>{(U(f)===n||l)&&f.stopImmediatePropagation()},o=f=>{(U(f)===n||l)&&(f.stopImmediatePropagation(),!t&&!l&&(l=!0,Ne(n),a()))},i=f=>{(U(f)===t||l)&&f.stopImmediatePropagation()},u=f=>{(U(f)===t||l)&&(f.stopImmediatePropagation(),l||(l=!0,Ne(n),a()))};e.addEventListener("blur",r,!0),e.addEventListener("focusout",o,!0),e.addEventListener("focusin",u,!0),e.addEventListener("focus",i,!0);let a=()=>{cancelAnimationFrame(c),e.removeEventListener("blur",r,!0),e.removeEventListener("focusout",o,!0),e.removeEventListener("focusin",u,!0),e.removeEventListener("focus",i,!0),Yn=!1,l=!1},c=requestAnimationFrame(a);return a}let nt=null;const pn=new Set;let on=new Map,Ct=!1,Ql=!1;const Gh={Tab:!0,Escape:!0};function sl(t,e){for(let n of pn)n(t,e)}function qh(t){return!(t.metaKey||!$t()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function Xn(t){Ct=!0,!tt.isOpening&&qh(t)&&(nt="keyboard",sl("keyboard",t))}function Mt(t){nt="pointer","pointerType"in t&&t.pointerType,(t.type==="mousedown"||t.type==="pointerdown")&&(Ct=!0,sl("pointer",t))}function Yu(t){!tt.isOpening&&xu(t)&&(Ct=!0,nt="virtual")}function Xu(t){let e=Se(U(t)),n=re(U(t));U(t)===e||U(t)===n||Yn||!t.isTrusted||(!Ct&&!Ql&&(nt="virtual",sl("virtual",t)),Ct=!1,Ql=!1)}function Ju(){Yn||(Ct=!1,Ql=!0)}function Jn(t){if(typeof window>"u"||typeof document>"u")return;const e=Se(t),n=re(t);if(on.get(e))return;let l=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){Ct=!0,l.apply(this,arguments)},n.addEventListener("keydown",Xn,!0),n.addEventListener("keyup",Xn,!0),n.addEventListener("click",Yu,!0),e.addEventListener("focus",Xu,!0),e.addEventListener("blur",Ju,!1),typeof PointerEvent<"u"&&(n.addEventListener("pointerdown",Mt,!0),n.addEventListener("pointermove",Mt,!0),n.addEventListener("pointerup",Mt,!0)),e.addEventListener("beforeunload",()=>{Qu(t)},{once:!0}),on.set(e,{focus:l})}const Qu=(t,e)=>{const n=Se(t),l=re(t);e&&l.removeEventListener("DOMContentLoaded",e),on.has(n)&&(n.HTMLElement.prototype.focus=on.get(n).focus,l.removeEventListener("keydown",Xn,!0),l.removeEventListener("keyup",Xn,!0),l.removeEventListener("click",Yu,!0),n.removeEventListener("focus",Xu,!0),n.removeEventListener("blur",Ju,!1),typeof PointerEvent<"u"&&(l.removeEventListener("pointerdown",Mt,!0),l.removeEventListener("pointermove",Mt,!0),l.removeEventListener("pointerup",Mt,!0)),on.delete(n))};function Zh(t){const e=re(t);let n;return e.readyState!=="loading"?Jn(t):(n=()=>{Jn(t)},e.addEventListener("DOMContentLoaded",n)),()=>Qu(t,n)}typeof document<"u"&&Zh();function zt(){return nt!=="pointer"}function bn(){return nt}function ea(t){nt=t,sl(t,null)}function ta(){Jn();let[t,e]=s.useState(nt);return s.useEffect(()=>{let n=()=>{e(nt)};return pn.add(n),()=>{pn.delete(n)}},[]),dt()?null:t}const Yh=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Xh(t,e,n){let l=n?U(n):void 0,r=re(l),o=Se(l);const i=typeof o<"u"?o.HTMLInputElement:HTMLInputElement,u=typeof o<"u"?o.HTMLTextAreaElement:HTMLTextAreaElement,a=typeof o<"u"?o.HTMLElement:HTMLElement,c=typeof o<"u"?o.KeyboardEvent:KeyboardEvent;let f=ie(r);return t=t||f instanceof i&&!Yh.has(f.type)||f instanceof u||f instanceof a&&f.isContentEditable,!(t&&e==="keyboard"&&n instanceof c&&!Gh[n.key])}function Jh(t,e,n){Jn(),s.useEffect(()=>{if((n==null?void 0:n.enabled)===!1)return;let l=(r,o)=>{Xh(!!(n!=null&&n.isTextInput),r,o)&&t(zt())};return pn.add(l),()=>{pn.delete(l)}},e)}function xe(t){if(!t.isConnected)return;const e=re(t);if(bn()==="virtual"){let n=ie(e);vu(()=>{const l=ie(e);(l===n||l===e.body)&&t.isConnected&&Ne(t)})}else Ne(t)}function Lr(t){let{isDisabled:e,onFocus:n,onBlur:l,onFocusChange:r}=t;const o=s.useCallback(a=>{if(U(a)===a.currentTarget)return l&&l(a),r&&r(!1),!0},[l,r]),i=Zu(o),u=s.useCallback(a=>{let c=U(a);const f=re(c),d=f?ie(f):ie();c===a.currentTarget&&c===d&&(n&&n(a),r&&r(!0),i(a))},[r,n,i]);return{focusProps:{onFocus:!e&&(n||r||l)?u:void 0,onBlur:!e&&(l||r)?o:void 0}}}function Yo(t){if(!t)return;let e=!0;return n=>{let l={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){e=!0},continuePropagation(){e=!1},isPropagationStopped(){return e}};t(l),e&&n.stopPropagation()}}function cl(t){return{keyboardProps:t.isDisabled?{}:{onKeyDown:Yo(t.onKeyDown),onKeyUp:Yo(t.onKeyUp)}}}let er=x.createContext(null);function Qh(t){let e=s.useContext(er)||{};Ar(e,t);let{ref:n,...l}=e;return l}function wt(t,e){let{focusProps:n}=Lr(t),{keyboardProps:l}=cl(t),r=W(n,l),o=Qh(e),i=t.isDisabled?{}:o,u=s.useRef(t.autoFocus);s.useEffect(()=>{u.current&&e.current&&xe(e.current),u.current=!1},[e]);let a=t.excludeFromTabOrder?-1:0;return t.isDisabled&&(a=void 0),{focusableProps:W({...r,tabIndex:a},i)}}let Kt="default",tr="",Hn=new WeakMap;function na(t){if(vt()){if(Kt==="default"){const e=re(t);tr=e.documentElement.style.webkitUserSelect,e.documentElement.style.webkitUserSelect="none"}Kt="disabled"}else if(t instanceof HTMLElement||t instanceof SVGElement){let e="userSelect"in t.style?"userSelect":"webkitUserSelect";Hn.set(t,t.style[e]),t.style[e]="none"}}function nr(t){if(vt()){if(Kt!=="disabled")return;Kt="restoring",setTimeout(()=>{vu(()=>{if(Kt==="restoring"){const e=re(t);e.documentElement.style.webkitUserSelect==="none"&&(e.documentElement.style.webkitUserSelect=tr||""),tr="",Kt="default"}})},300)}else if((t instanceof HTMLElement||t instanceof SVGElement)&&t&&Hn.has(t)){let e=Hn.get(t),n="userSelect"in t.style?"userSelect":"webkitUserSelect";t.style[n]==="none"&&(t.style[n]=e),t.getAttribute("style")===""&&t.removeAttribute("style"),Hn.delete(t)}}const hn=x.createContext({register:()=>{}});hn.displayName="PressResponderContext";function em(t){let e=s.useContext(hn);if(e){let{register:n,ref:l,...r}=e;t=W(r,t),n()}return Ar(e,t.ref),t}var It;class Ln{constructor(e,n,l,r){Fo(this,It);wl(this,It,!0);let o=(r==null?void 0:r.target)??l.currentTarget;const i=o==null?void 0:o.getBoundingClientRect();let u,a=0,c,f=null;l.clientX!=null&&l.clientY!=null&&(c=l.clientX,f=l.clientY),i&&(c!=null&&f!=null?(u=c-i.left,a=f-i.top):(u=i.width/2,a=i.height/2)),this.type=e,this.pointerType=n,this.target=l.currentTarget,this.shiftKey=l.shiftKey,this.metaKey=l.metaKey,this.ctrlKey=l.ctrlKey,this.altKey=l.altKey,this.x=u,this.y=a,this.key=l.key}continuePropagation(){wl(this,It,!1)}get shouldStopPropagation(){return Mo(this,It)}}It=new WeakMap;const Xo=Symbol("linkClicked"),Jo="react-aria-pressable-style",Qo="data-react-aria-pressable";function lt(t){let{onPress:e,onPressChange:n,onPressStart:l,onPressEnd:r,onPressUp:o,onClick:i,isDisabled:u,isPressed:a,preventFocusOnPress:c,shouldCancelOnPointerExit:f,allowTextSelectionOnPress:d,ref:b,...p}=em(t),[h,y]=s.useState(!1),m=s.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:g,removeAllGlobalListeners:v}=Et(),E=s.useCallback(($,D)=>{let A=m.current;if(u||A.didFirePressStart)return!1;let w=!0;if(A.isTriggeringEvent=!0,l){let P=new Ln("pressstart",D,$);l(P),w=P.shouldStopPropagation}return n&&n(!0),A.isTriggeringEvent=!1,A.didFirePressStart=!0,y(!0),w},[u,l,n]),C=s.useCallback(($,D,A=!0)=>{let w=m.current;if(!w.didFirePressStart)return!1;w.didFirePressStart=!1,w.isTriggeringEvent=!0;let P=!0;if(r){let k=new Ln("pressend",D,$);r(k),P=k.shouldStopPropagation}if(n&&n(!1),y(!1),e&&A&&!u){let k=new Ln("press",D,$);e(k),P&&(P=k.shouldStopPropagation)}return w.isTriggeringEvent=!1,P},[u,r,n,e]),R=we(C),T=s.useCallback(($,D)=>{let A=m.current;if(u)return!1;if(o){A.isTriggeringEvent=!0;let w=new Ln("pressup",D,$);return o(w),A.isTriggeringEvent=!1,w.shouldStopPropagation}return!0},[u,o]),F=we(T),B=s.useCallback($=>{let D=m.current;if(D.isPressed&&D.target){D.didFirePressStart&&D.pointerType!=null&&C(ht(D.target,$),D.pointerType,!1),D.isPressed=!1,D.isOverTarget=!1,D.activePointerId=null,D.pointerType=null,v(),d||nr(D.target);for(let A of D.disposables)A();D.disposables=[]}},[d,v,C]),L=we(B);s.useEffect(()=>{u&&m.current.isPressed&&L({currentTarget:m.current.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})},[u]);let M=s.useCallback($=>{f&&B($)},[f,B]),V=s.useCallback($=>{u||i==null||i($)},[u,i]),H=s.useCallback(($,D)=>{if(!u&&i){let A=new MouseEvent("click",$);qu(A,D),i(Ir(A))}},[u,i]),j=s.useMemo(()=>{let $=m.current,D={onKeyDown(w){var P;if(Rl(w.nativeEvent,w.currentTarget)&&ne(w.currentTarget,U(w))){ei(U(w),w.key)&&w.preventDefault();let k=!0;!$.isPressed&&!w.repeat&&($.target=w.currentTarget,$.isPressed=!0,$.pointerType="keyboard",k=E(w,"keyboard"));let K=w.currentTarget,_=Z=>{Rl(Z,K)&&!Z.repeat&&ne(K,U(Z))&&$.target&&F(ht($.target,Z),"keyboard")};g(re(w.currentTarget),"keyup",ft(_,A),!0),k&&w.stopPropagation(),w.metaKey&&$t()&&((P=$.metaKeyEvents)==null||P.set(w.key,w.nativeEvent))}else w.key==="Meta"&&($.metaKeyEvents=new Map)},onClick(w){if(!(w&&!ne(w.currentTarget,U(w)))&&w&&w.button===0&&!$.isTriggeringEvent&&!tt.isOpening){let P=!0;if(u&&w.preventDefault(),!$.ignoreEmulatedMouseEvents&&!$.isPressed&&($.pointerType==="virtual"||xu(w.nativeEvent))){let k=E(w,"virtual"),K=F(w,"virtual"),_=R(w,"virtual");V(w),P=k&&K&&_}else if($.isPressed&&$.pointerType!=="keyboard"){let k=$.pointerType||w.nativeEvent.pointerType||"virtual",K=F(ht(w.currentTarget,w),k),_=R(ht(w.currentTarget,w),k,!0);P=K&&_,$.isOverTarget=!1,V(w),L(w)}$.ignoreEmulatedMouseEvents=!1,P&&w.stopPropagation()}}},A=w=>{var P,k,K;if($.isPressed&&$.target&&Rl(w,$.target)){ei(U(w),w.key)&&w.preventDefault();let _=U(w),Z=ne($.target,_);R(ht($.target,w),"keyboard",Z),Z&&H(w,$.target),v(),w.key!=="Enter"&&zr($.target)&&ne($.target,_)&&!w[Xo]&&(w[Xo]=!0,tt($.target,w,!1)),$.isPressed=!1,(P=$.metaKeyEvents)==null||P.delete(w.key)}else if(w.key==="Meta"&&((k=$.metaKeyEvents)!=null&&k.size)){let _=$.metaKeyEvents;$.metaKeyEvents=void 0;for(let Z of _.values())(K=$.target)==null||K.dispatchEvent(new KeyboardEvent("keyup",Z))}};if(typeof PointerEvent<"u"){D.onPointerDown=k=>{if(k.button!==0||!ne(k.currentTarget,U(k)))return;if(sb(k.nativeEvent)){$.pointerType="virtual";return}$.pointerType=k.pointerType;let K=!0;if(!$.isPressed){$.isPressed=!0,$.isOverTarget=!0,$.activePointerId=k.pointerId,$.target=k.currentTarget,d||na($.target),K=E(k,$.pointerType);let _=U(k);"releasePointerCapture"in _&&("hasPointerCapture"in _?_.hasPointerCapture(k.pointerId)&&_.releasePointerCapture(k.pointerId):_.releasePointerCapture(k.pointerId)),g(re(k.currentTarget),"pointerup",w,!1),g(re(k.currentTarget),"pointercancel",P,!1)}K&&k.stopPropagation()},D.onMouseDown=k=>{if(ne(k.currentTarget,U(k))&&k.button===0){if(c){let K=Uh(k.target);K&&$.disposables.push(K)}k.stopPropagation()}},D.onPointerUp=k=>{!ne(k.currentTarget,U(k))||$.pointerType==="virtual"||k.button===0&&!$.isPressed&&F(k,$.pointerType||k.pointerType)},D.onPointerEnter=k=>{k.pointerId===$.activePointerId&&$.target&&!$.isOverTarget&&$.pointerType!=null&&($.isOverTarget=!0,E(ht($.target,k),$.pointerType))},D.onPointerLeave=k=>{k.pointerId===$.activePointerId&&$.target&&$.isOverTarget&&$.pointerType!=null&&($.isOverTarget=!1,R(ht($.target,k),$.pointerType,!1),M(k))};let w=k=>{if(k.pointerId===$.activePointerId&&$.isPressed&&k.button===0&&$.target){if(ne($.target,U(k))&&$.pointerType!=null){let K=!1,_=setTimeout(()=>{$.isPressed&&$.target instanceof HTMLElement&&(K?L(k):(Ne($.target),$.target.click()))},80);g(k.currentTarget,"click",()=>K=!0,!0),$.disposables.push(()=>clearTimeout(_))}else L(k);$.isOverTarget=!1}},P=k=>{L(k)};D.onDragStart=k=>{ne(k.currentTarget,U(k))&&L(k)}}return D},[g,u,c,v,d,M,E,V,H]);return s.useEffect(()=>{if(!b)return;const $=re(b.current);if(!$||!$.head||$.getElementById(Jo))return;const D=$.createElement("style");D.id=Jo;let A=Pu($);A&&(D.nonce=A),D.textContent=` -@layer { - [${Qo}] { - touch-action: pan-x pan-y pinch-zoom; - } -} - `.trim(),$.head.prepend(D)},[b]),s.useEffect(()=>{let $=m.current;return()=>{d||nr($.target??void 0);for(let D of $.disposables)D();$.disposables=[]}},[d]),{isPressed:a||h,pressProps:W(p,j,{[Qo]:!0})}}function zr(t){return t.tagName==="A"&&t.hasAttribute("href")}function Rl(t,e){const{key:n,code:l}=t,r=e,o=r.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||l==="Space")&&!(r instanceof Se(r).HTMLInputElement&&!la(r,n)||r instanceof Se(r).HTMLTextAreaElement||r.isContentEditable)&&!((o==="link"||!o&&zr(r))&&n!=="Enter")}function ht(t,e){let n=e.clientX,l=e.clientY;return{currentTarget:t,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,clientX:n,clientY:l,key:e.key}}function tm(t){return t instanceof HTMLInputElement?!1:t instanceof HTMLButtonElement?t.type!=="submit"&&t.type!=="reset":!zr(t)}function ei(t,e){return t instanceof HTMLInputElement?!la(t,e):tm(t)}const nm=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function la(t,e){return t.type==="checkbox"||t.type==="radio"?e===" ":nm.has(t.type)}function lm(t,e){let{elementType:n="button",isDisabled:l,onPress:r,onPressStart:o,onPressEnd:i,onPressUp:u,onPressChange:a,preventFocusOnPress:c,allowFocusWhenDisabled:f,onClick:d,href:b,target:p,rel:h,type:y="button"}=t,m;n==="button"?m={type:y,disabled:l,form:t.form,formAction:t.formAction,formEncType:t.formEncType,formMethod:t.formMethod,formNoValidate:t.formNoValidate,formTarget:t.formTarget,name:t.name,value:t.value}:m={role:"button",href:n==="a"&&!l?b:void 0,target:n==="a"?p:void 0,type:n==="input"?y:void 0,disabled:n==="input"?l:void 0,"aria-disabled":!l||n==="input"?void 0:l,rel:n==="a"?h:void 0};let{pressProps:g,isPressed:v}=lt({onPressStart:o,onPressEnd:i,onPressChange:a,onPress:r,onPressUp:u,onClick:d,isDisabled:l,preventFocusOnPress:c,ref:e}),{focusableProps:E}=wt(t,e);f&&(E.tabIndex=l?-1:E.tabIndex);let C=W(E,g,oe(t,{labelable:!0}));return{isPressed:v,buttonProps:W(m,C,{"aria-haspopup":t["aria-haspopup"],"aria-expanded":t["aria-expanded"],"aria-controls":t["aria-controls"],"aria-pressed":t["aria-pressed"],"aria-current":t["aria-current"],"aria-disabled":t["aria-disabled"]})}}function dl(t){let{isDisabled:e,onBlurWithin:n,onFocusWithin:l,onFocusWithinChange:r}=t,o=s.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:u}=Et(),a=s.useCallback(d=>{ne(d.currentTarget,U(d))&&o.current.isFocusWithin&&!ne(d.currentTarget,d.relatedTarget)&&(o.current.isFocusWithin=!1,u(),n&&n(d),r&&r(!1))},[n,r,o,u]),c=Zu(a),f=s.useCallback(d=>{if(!ne(d.currentTarget,U(d)))return;let b=U(d);const p=re(b),h=ie(p);if(!o.current.isFocusWithin&&h===b){l&&l(d),r&&r(!0),o.current.isFocusWithin=!0,c(d);let y=d.currentTarget;i(p,"focus",m=>{let g=U(m);if(o.current.isFocusWithin&&!ne(y,g)){let v=new p.defaultView.FocusEvent("blur",{relatedTarget:g});qu(v,y);let E=Ir(v);a(E)}},{capture:!0})}},[l,r,c,i,a]);return e?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:f,onBlur:a}}}function Ve(t={}){let{autoFocus:e=!1,isTextInput:n,within:l}=t,r=s.useRef({isFocused:!1,isFocusVisible:e||zt()}),[o,i]=s.useState(!1),[u,a]=s.useState(()=>r.current.isFocused&&r.current.isFocusVisible),c=s.useCallback(()=>a(r.current.isFocused&&r.current.isFocusVisible),[]),f=s.useCallback(p=>{r.current.isFocused=p,r.current.isFocusVisible=zt(),i(p),c()},[c]);Jh(p=>{r.current.isFocusVisible=p,c()},[n,o],{enabled:o,isTextInput:n});let{focusProps:d}=Lr({isDisabled:l,onFocusChange:f}),{focusWithinProps:b}=dl({isDisabled:!l,onFocusWithinChange:f});return{isFocused:o,isFocusVisible:u,focusProps:l?b:d}}let lr=!1,zn=0;function rm(){lr=!0,setTimeout(()=>{lr=!1},500)}function ti(t){t.pointerType==="touch"&&rm()}function om(){let t=re(null);if(!(typeof t>"u"))return zn===0&&typeof PointerEvent<"u"&&t.addEventListener("pointerup",ti),zn++,()=>{zn--,!(zn>0)&&typeof PointerEvent<"u"&&t.removeEventListener("pointerup",ti)}}function Fe(t){let{onHoverStart:e,onHoverChange:n,onHoverEnd:l,isDisabled:r}=t,[o,i]=s.useState(!1),u=s.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;s.useEffect(om,[]);let{addGlobalListener:a,removeAllGlobalListeners:c}=Et(),{hoverProps:f,triggerHoverEnd:d}=s.useMemo(()=>{let b=(y,m)=>{if(u.pointerType=m,r||m==="touch"||u.isHovered||!ne(y.currentTarget,U(y)))return;u.isHovered=!0;let g=y.currentTarget;u.target=g,a(re(U(y)),"pointerover",v=>{u.isHovered&&u.target&&!ne(u.target,U(v))&&p(v,v.pointerType)},{capture:!0}),e&&e({type:"hoverstart",target:g,pointerType:m}),n&&n(!0),i(!0)},p=(y,m)=>{let g=u.target;u.pointerType="",u.target=null,!(m==="touch"||!u.isHovered||!g)&&(u.isHovered=!1,c(),l&&l({type:"hoverend",target:g,pointerType:m}),n&&n(!1),i(!1))},h={};return typeof PointerEvent<"u"&&(h.onPointerEnter=y=>{lr&&y.pointerType==="mouse"||b(y,y.pointerType)},h.onPointerLeave=y=>{!r&&ne(y.currentTarget,U(y))&&p(y,y.pointerType)}),{hoverProps:h,triggerHoverEnd:p}},[e,n,l,r,u,a,c]);return s.useEffect(()=>{r&&d({currentTarget:u.target},u.pointerType)},[r]),{hoverProps:f,isHovered:o}}const En=s.createContext({}),Nr=Cn(function(e,n){[e,n]=ve(e,n,En);let l=e,{isPending:r}=l,{buttonProps:o,isPressed:i}=lm(e,n);o=um(o,r);let{focusProps:u,isFocused:a,isFocusVisible:c}=Ve(e),{hoverProps:f,isHovered:d}=Fe({...e,isDisabled:e.isDisabled||r}),b={isHovered:d,isPressed:(l.isPressed||i)&&!r,isFocused:a,isFocusVisible:c,isDisabled:e.isDisabled||!1,isPending:r??!1},p=ae({...e,values:b,defaultClassName:"react-aria-Button"}),h=$e(o.id),y=$e(),m=o["aria-labelledby"];r&&(m?m=`${m} ${y}`:o["aria-label"]&&(m=`${h} ${y}`));let g=s.useRef(r);s.useEffect(()=>{let E={"aria-labelledby":m||h};(!g.current&&a&&r||g.current&&a&&!r)&&yt(E,"assertive"),g.current=r},[r,a,m,h]);let v=oe(e,{global:!0});return delete v.onClick,x.createElement(ee.button,{...W(v,p,o,u,f),type:o.type==="submit"&&r?"button":o.type,id:h,ref:n,"aria-labelledby":m,slot:e.slot||void 0,"aria-disabled":r?"true":o["aria-disabled"],"data-disabled":e.isDisabled||void 0,"data-pressed":b.isPressed||void 0,"data-hovered":d||void 0,"data-focused":a||void 0,"data-pending":r||void 0,"data-focus-visible":c||void 0},x.createElement(Hh.Provider,{value:{id:y}},p.children))}),im=/Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;function um(t,e){if(e){for(const n in t)n.startsWith("on")&&!im.test(n)&&(t[n]=void 0);t.href=void 0,t.target=void 0}return t}const am=typeof document<"u"?x.useInsertionEffect??x.useLayoutEffect:()=>{};function ct(t,e,n){let[l,r]=s.useState(t||e),o=s.useRef(l),i=s.useRef(t!==void 0),u=t!==void 0;s.useEffect(()=>{i.current,i.current=u},[u]);let a=u?t:l;am(()=>{o.current=a});let[,c]=s.useReducer(()=>({}),{}),f=s.useCallback((d,...b)=>{let p=typeof d=="function"?d(o.current):d;Object.is(o.current,p)||(o.current=p,r(p),c(),n==null||n(p,...b))},[n]);return[a,f]}const ra=s.createContext({}),sm=s.forwardRef(function(e,n){[e,n]=ve(e,n,ra);let{children:l,level:r=3,className:o,...i}=e,u=ee[`h${r}`];return x.createElement(u,{...i,ref:n,className:o??"react-aria-Heading"},l)}),oa=t=>t?"true":void 0;function ge(t,e){return Th(t,(n,l)=>{const r=typeof e=="function"?e(l)??"":e??"";return Lt(r,n??"")??""})}const fe=(t,e,n)=>typeof t=="function"?t({className:e}):e,cm=t=>I.jsx("svg",{"aria-hidden":"true","aria-label":"Chevron down icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:I.jsx("path",{clipRule:"evenodd",d:"M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06",fill:"currentColor",fillRule:"evenodd"})}),dm=t=>I.jsx("svg",{"aria-hidden":"true","aria-label":"Chevron up icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:I.jsx("path",{clipRule:"evenodd",d:"M13.03 10.53a.75.75 0 0 1-1.06 0L8 6.56l-3.97 3.97a.75.75 0 0 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1 0 1.06",fill:"currentColor",fillRule:"evenodd"})}),fm=({height:t=9,width:e=9,...n})=>I.jsx("svg",{"aria-hidden":"true","aria-label":"External link icon",fill:"none",height:t,role:"presentation",viewBox:"0 0 7 7",width:e,xmlns:"http://www.w3.org/2000/svg",...n,children:I.jsx("path",{d:"M1.20592 6.84333L0.379822 6.01723L4.52594 1.8672H1.37819L1.38601 0.731812H6.48742V5.83714H5.34421L5.35203 2.6933L1.20592 6.84333Z",fill:"currentColor"})}),pm=t=>I.jsx("svg",{"aria-hidden":"true","aria-label":"Close icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:I.jsx("path",{clipRule:"evenodd",d:"M3.47 3.47a.75.75 0 0 1 1.06 0L8 6.94l3.47-3.47a.75.75 0 1 1 1.06 1.06L9.06 8l3.47 3.47a.75.75 0 1 1-1.06 1.06L8 9.06l-3.47 3.47a.75.75 0 0 1-1.06-1.06L6.94 8 3.47 4.53a.75.75 0 0 1 0-1.06Z",fill:"currentColor",fillRule:"evenodd"})}),ni=t=>I.jsx("svg",{"aria-hidden":"true","aria-label":"Info icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:I.jsx("path",{clipRule:"evenodd",d:"M8 13.5a5.5 5.5 0 1 0 0-11a5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m1-9.5a1 1 0 1 1-2 0a1 1 0 0 1 2 0m-.25 3a.75.75 0 0 0-1.5 0V11a.75.75 0 0 0 1.5 0z",fill:"currentColor",fillRule:"evenodd"})}),bm=t=>I.jsx("svg",{"aria-hidden":"true","aria-label":"Warning icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:I.jsx("path",{clipRule:"evenodd",d:"M7.134 2.994L2.217 11.5a1 1 0 0 0 .866 1.5h9.834a1 1 0 0 0 .866-1.5L8.866 2.993a1 1 0 0 0-1.732 0m3.03-.75c-.962-1.665-3.366-1.665-4.329 0L.918 10.749c-.963 1.666.24 3.751 2.165 3.751h9.834c1.925 0 3.128-2.085 2.164-3.751zM8 5a.75.75 0 0 1 .75.75v2a.75.75 0 0 1-1.5 0v-2A.75.75 0 0 1 8 5m1 5.75a1 1 0 1 1-2 0a1 1 0 0 1 2 0",fill:"currentColor",fillRule:"evenodd"})}),li=t=>I.jsx("svg",{"aria-hidden":"true","aria-label":"Danger icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:I.jsx("path",{clipRule:"evenodd",d:"M8 13.5a5.5 5.5 0 1 0 0-11a5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m1-4.5a1 1 0 1 1-2 0a1 1 0 0 1 2 0M8.75 5a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0z",fill:"currentColor",fillRule:"evenodd"})}),hm=t=>I.jsx("svg",{"aria-hidden":"true","aria-label":"Success icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:I.jsx("path",{clipRule:"evenodd",d:"M13.5 8a5.5 5.5 0 1 1-11 0a5.5 5.5 0 0 1 11 0M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0m-3.9-1.55a.75.75 0 1 0-1.2-.9L7.419 8.858L6.03 7.47a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.13-.08z",fill:"currentColor",fillRule:"evenodd"})}),ia=s.createContext({}),mm=s.createContext({placement:"bottom"}),gm=typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;function ri(t){return t.dataset.liveAnnouncer==="true"||t.dataset.reactAriaTopLayer!==void 0}let Yt=new WeakMap,Be=[];function Vr(t,e){let n=Se(t==null?void 0:t[0]),l=e instanceof n.Element?{root:e}:e,r=(l==null?void 0:l.root)??document.body,o=(l==null?void 0:l.shouldUseInert)&&gm,i=new Set(t),u=new Set,a=m=>o&&m instanceof n.HTMLElement?m.inert:m.getAttribute("aria-hidden")==="true",c=(m,g)=>{o&&m instanceof n.HTMLElement?m.inert=g:g?m.setAttribute("aria-hidden","true"):(m.removeAttribute("aria-hidden"),m instanceof n.HTMLElement&&(m.inert=!1))},f=new Set;if(Qe())for(let m of t){let g=m;for(;g&&g!==r;){let v=g.getRootNode();"shadowRoot"in v&&f.add(v.shadowRoot),g=v.parentNode}}let d=m=>{for(let C of m.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))i.add(C);let g=C=>{if(u.has(C)||i.has(C)||C.parentElement&&u.has(C.parentElement)&&C.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let R of i)if(ne(C,R))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},v=yu(re(m),m,NodeFilter.SHOW_ELEMENT,{acceptNode:g}),E=g(m);if(E===NodeFilter.FILTER_ACCEPT&&b(m),E!==NodeFilter.FILTER_REJECT){let C=v.nextNode();for(;C!=null;)b(C),C=v.nextNode()}},b=m=>{let g=Yt.get(m)??0;a(m)&&g===0||(g===0&&c(m,!0),u.add(m),Yt.set(m,g+1))};Be.length&&Be[Be.length-1].disconnect(),d(r);let p=new MutationObserver(m=>{for(let g of m)if(g.type==="childList"){if(g.target.isConnected&&![...i,...u].some(v=>ne(v,g.target)))for(let v of g.addedNodes)(v instanceof HTMLElement||v instanceof SVGElement)&&ri(v)?i.add(v):v instanceof Element&&d(v);if(Qe()){for(let v of f)if(!v.isConnected){p.disconnect();break}}}});p.observe(r,{childList:!0,subtree:!0});let h=new Set;if(Qe())for(let m of f){let g=new MutationObserver(v=>{for(let E of v)if(E.type==="childList"){if(E.target.isConnected&&![...i,...u].some(C=>ne(C,E.target)))for(let C of E.addedNodes)(C instanceof HTMLElement||C instanceof SVGElement)&&ri(C)?i.add(C):C instanceof Element&&d(C);if(Qe()){for(let C of f)if(!C.isConnected){p.disconnect();break}}}});g.observe(m,{childList:!0,subtree:!0}),h.add(g)}let y={visibleNodes:i,hiddenNodes:u,observe(){p.observe(r,{childList:!0,subtree:!0})},disconnect(){p.disconnect()}};return Be.push(y),()=>{if(p.disconnect(),Qe())for(let m of h)m.disconnect();for(let m of u){let g=Yt.get(m);g!=null&&(g===1?(c(m,!1),Yt.delete(m)):Yt.set(m,g-1))}y===Be[Be.length-1]?(Be.pop(),Be.length&&Be[Be.length-1].observe()):Be.splice(Be.indexOf(y),1)}}function ym(t){let e=Be[Be.length-1];if(e&&!e.visibleNodes.has(t))return e.visibleNodes.add(t),()=>{e.visibleNodes.delete(t)}}const Le={top:"top",bottom:"top",left:"left",right:"left"},Qn={top:"bottom",bottom:"top",left:"right",right:"left"},$m={top:"left",left:"top"},rr={top:"height",left:"width"},ua={width:"totalWidth",height:"totalHeight"},Nn={};let vm=()=>typeof document<"u"?window.visualViewport:null;function oi(t,e){let n=0,l=0,r=0,o=0,i=0,u=0,a={},c=((e==null?void 0:e.scale)??1)>1;if(t.tagName==="BODY"||t.tagName==="HTML"){let f=document.documentElement;r=f.clientWidth,o=f.clientHeight,n=(e==null?void 0:e.width)??r,l=(e==null?void 0:e.height)??o,a.top=f.scrollTop||t.scrollTop,a.left=f.scrollLeft||t.scrollLeft,e&&(i=e.offsetTop,u=e.offsetLeft)}else({width:n,height:l,top:i,left:u}=mn(t,!1)),a.top=t.scrollTop,a.left=t.scrollLeft,r=n,o=l;return pu()&&(t.tagName==="BODY"||t.tagName==="HTML")&&c&&(a.top=0,a.left=0,i=(e==null?void 0:e.pageTop)??0,u=(e==null?void 0:e.pageLeft)??0),{width:n,height:l,totalWidth:r,totalHeight:o,scroll:a,top:i,left:u}}function xm(t){return{top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}}function ii(t,e,n,l,r,o,i){let u=r.scroll[t]??0,a=l[rr[t]],c=i[t]+l.scroll[Le[t]]+o,f=i[t]+l.scroll[Le[t]]+a-o,d=e-u+l.scroll[Le[t]]+i[t]-l[Le[t]],b=e-u+n+l.scroll[Le[t]]+i[t]-l[Le[t]];return df?Math.max(f-b,c-d):0}function Cm(t){let e=window.getComputedStyle(t);return{top:parseInt(e.marginTop,10)||0,bottom:parseInt(e.marginBottom,10)||0,left:parseInt(e.marginLeft,10)||0,right:parseInt(e.marginRight,10)||0}}function ui(t){if(Nn[t])return Nn[t];let[e,n]=t.split(" "),l=Le[e]||"right",r=$m[l];Le[n]||(n="center");let o=rr[l],i=rr[r];return Nn[t]={placement:e,crossPlacement:n,axis:l,crossAxis:r,size:o,crossSize:i},Nn[t]}function Ml(t,e,n,l,r,o,i,u,a,c,f){let{placement:d,crossPlacement:b,axis:p,crossAxis:h,size:y,crossSize:m}=l,g={};g[h]=t[h]??0,b==="center"?g[h]+=((t[m]??0)-(n[m]??0))/2:b!==h&&(g[h]+=(t[m]??0)-(n[m]??0)),g[h]+=o;const v=t[h]-n[m]+a+c,E=t[h]+t[m]-a-c;if(g[h]=fn(g[h],v,E),d===p){let C=u?f[y]:f[ua[y]];g[Qn[p]]=Math.floor(C-t[p]+r)}else g[p]=Math.floor(t[p]+t[y]+r);return g}function Em(t,e,n,l,r,o,i,u,a,c,f){let d=(t.top!=null?t.top:a[ua.height]-(t.bottom??0)-i)-(a.scroll.top??0),b=c?n.top:0,p={top:Math.max(e.top+b,((f==null?void 0:f.offsetTop)??e.top)+b),bottom:Math.min(e.top+e.height+b,((f==null?void 0:f.offsetTop)??0)+((f==null?void 0:f.height)??0))};return u!=="top"?Math.max(0,p.bottom-d-((r.top??0)+(r.bottom??0)+o)):Math.max(0,d+i-p.top-((r.top??0)+(r.bottom??0)+o))}function ai(t,e,n,l,r,o,i,u){let{placement:a,axis:c,size:f}=o;return a===c?Math.max(0,n[c]-(i.scroll[c]??0)-(t[c]+(u?e[c]:0))-(l[c]??0)-l[Qn[c]]-r):Math.max(0,t[f]+t[c]+(u?e[c]:0)-n[c]-n[f]+(i.scroll[c]??0)-(l[c]??0)-l[Qn[c]]-r)}function wm(t,e,n,l,r,o,i,u,a,c,f,d,b,p,h,y,m,g){let v=ui(t),{size:E,crossAxis:C,crossSize:R,placement:T,crossPlacement:F}=v,B=Ml(e,u,n,v,f,d,c,b,h,y,a),L=f,M=ai(u,c,e,r,o+f,v,a,m);if(i&&n[E]>M){let O=ui(`${Qn[T]} ${F}`),X=Ml(e,u,n,O,f,d,c,b,h,y,a);ai(u,c,e,r,o+f,O,a,m)>M&&(v=O,B=X,L=f)}let V="bottom";v.axis==="top"?v.placement==="top"?V="top":v.placement==="bottom"&&(V="bottom"):v.crossAxis==="top"&&(v.crossPlacement==="top"?V="bottom":v.crossPlacement==="bottom"&&(V="top"));let H=ii(C,B[C],n[R],u,a,o,c);B[C]+=H;let j=Em(B,u,c,b,r,o,n.height,V,a,m,g);p&&p{if(!n||l===null)return;let r=o=>{let i=U(o);if(!e.current||i instanceof Node&&!ne(i,e.current)||i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement)return;let u=l||aa.get(e.current);u&&u()};return window.addEventListener("scroll",r,!0),()=>{window.removeEventListener("scroll",r,!0)}},[n,l,e])}let be=typeof document<"u"?window.visualViewport:null;function Pm(t){let{direction:e}=Pe(),{arrowSize:n,targetRef:l,overlayRef:r,arrowRef:o,scrollRef:i=r,placement:u="bottom",containerPadding:a=12,shouldFlip:c=!0,boundaryElement:f=typeof document<"u"?document.body:null,offset:d=0,crossOffset:b=0,shouldUpdatePosition:p=!0,isOpen:h=!0,onClose:y,maxHeight:m,arrowBoundaryOffset:g=0}=t,[v,E]=s.useState(null),C=[p,u,r.current,l.current,o==null?void 0:o.current,i.current,a,c,f,d,b,h,e,m,g,n],R=s.useRef(be==null?void 0:be.scale);s.useEffect(()=>{h&&(R.current=be==null?void 0:be.scale)},[h]);let T=s.useCallback(()=>{var j,$;if(p===!1||!h||!r.current||!l.current||!f||(be==null?void 0:be.scale)!==R.current)return;let L=null;if(i.current&&xt(i.current)){let D=(j=ie())==null?void 0:j.getBoundingClientRect(),A=i.current.getBoundingClientRect();L={type:"top",offset:((D==null?void 0:D.top)??0)-A.top},L.offset>A.height/2&&(L.type="bottom",L.offset=((D==null?void 0:D.bottom)??0)-A.bottom)}let M=r.current;!m&&r.current&&(M.style.top="0px",M.style.bottom="",M.style.maxHeight=((($=window.visualViewport)==null?void 0:$.height)??window.innerHeight)+"px");let V=Sm({placement:Am(u,e),overlayNode:r.current,targetNode:l.current,scrollNode:i.current||r.current,padding:a,shouldFlip:c,boundaryElement:f,offset:d,crossOffset:b,maxHeight:m,arrowSize:n??(o!=null&&o.current?fl(o.current,!0).width:0),arrowBoundaryOffset:g});if(!V.position)return;M.style.top="",M.style.bottom="",M.style.left="",M.style.right="",Object.keys(V.position).forEach(D=>M.style[D]=V.position[D]+"px"),M.style.maxHeight=V.maxHeight!=null?V.maxHeight+"px":"";let H=ie();if(L&&H&&i.current){let D=H.getBoundingClientRect(),A=i.current.getBoundingClientRect(),w=D[L.type]-A[L.type];i.current.scrollTop+=w-L.offset}E(V)},C);le(T,C),Tm(T),dn({ref:r,onResize:T}),dn({ref:l,onResize:T});let F=s.useRef(!1);le(()=>{let L,M=()=>{F.current=!0,clearTimeout(L),L=setTimeout(()=>{F.current=!1},500),T()},V=()=>{F.current&&M()};return be==null||be.addEventListener("resize",M),be==null||be.addEventListener("scroll",V),()=>{be==null||be.removeEventListener("resize",M),be==null||be.removeEventListener("scroll",V)}},[T]);let B=s.useCallback(()=>{F.current||y==null||y()},[y,F]);return km({triggerRef:l,isOpen:h,onClose:y&&B}),{overlayProps:{style:{position:v?"absolute":"fixed",top:v?void 0:0,left:v?void 0:0,zIndex:1e5,...v==null?void 0:v.position,maxHeight:(v==null?void 0:v.maxHeight)??"100vh"}},placement:(v==null?void 0:v.placement)??null,triggerAnchorPoint:(v==null?void 0:v.triggerAnchorPoint)??null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:v==null?void 0:v.arrowOffsetLeft,top:v==null?void 0:v.arrowOffsetTop}},updatePosition:T}}function Tm(t){le(()=>(window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}),[t])}function Am(t,e){return e==="rtl"?t.replace("start","right").replace("end","left"):t.replace("start","left").replace("end","right")}const di=x.createContext(null),or="react-aria-focus-scope-restore";let se=null;function Or(t){let{children:e,contain:n,restoreFocus:l,autoFocus:r}=t,o=s.useRef(null),i=s.useRef(null),u=s.useRef([]),{parentNode:a}=s.useContext(di)||{},c=s.useMemo(()=>new ur({scopeRef:u}),[u]);le(()=>{let b=a||me.root;if(me.getTreeNode(b.scopeRef)&&se&&!el(se,b.scopeRef)){let p=me.getTreeNode(se);p&&(b=p)}b.addChild(c),me.addNode(c)},[c,a]),le(()=>{let b=me.getTreeNode(u);b&&(b.contain=!!n)},[n]),le(()=>{var y;let b=(y=o.current)==null?void 0:y.nextSibling,p=[],h=m=>m.stopPropagation();for(;b&&b!==i.current;)p.push(b),b.addEventListener(or,h),b=b.nextSibling;return u.current=p,()=>{for(let m of p)m.removeEventListener(or,h)}},[e]),Lm(u,l,n),Mm(u,n),zm(u,l,n),Im(u,r),s.useEffect(()=>{const b=ie(re(u.current?u.current[0]:void 0));let p=null;if(Oe(b,u.current)){for(let h of me.traverse())h.scopeRef&&Oe(b,h.scopeRef.current)&&(p=h);p===me.getTreeNode(u)&&(se=p.scopeRef)}},[u]),le(()=>()=>{var p,h;let b=((h=(p=me.getTreeNode(u))==null?void 0:p.parent)==null?void 0:h.scopeRef)??null;(u===se||el(u,se))&&(!b||me.getTreeNode(b))&&(se=b),me.removeTreeNode(u)},[u]);let f=s.useMemo(()=>Bm(u),[]),d=s.useMemo(()=>({focusManager:f,parentNode:c}),[c,f]);return x.createElement(di.Provider,{value:d},x.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:o}),e,x.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:i}))}function Bm(t){return{focusNext(e={}){let n=t.current,{from:l,tabbable:r,wrap:o,accept:i}=e,u=l||ie(re(n[0]??void 0)),a=n[0].previousElementSibling,c=mt(n),f=ze(c,{tabbable:r,accept:i},n);f.currentNode=Oe(u,n)?u:a;let d=f.nextNode();return!d&&o&&(f.currentNode=a,d=f.nextNode()),d&&et(d,!0),d},focusPrevious(e={}){let n=t.current,{from:l,tabbable:r,wrap:o,accept:i}=e,u=l||ie(re(n[0]??void 0)),a=n[n.length-1].nextElementSibling,c=mt(n),f=ze(c,{tabbable:r,accept:i},n);f.currentNode=Oe(u,n)?u:a;let d=f.previousNode();return!d&&o&&(f.currentNode=a,d=f.previousNode()),d&&et(d,!0),d},focusFirst(e={}){let n=t.current,{tabbable:l,accept:r}=e,o=mt(n),i=ze(o,{tabbable:l,accept:r},n);i.currentNode=n[0].previousElementSibling;let u=i.nextNode();return u&&et(u,!0),u},focusLast(e={}){let n=t.current,{tabbable:l,accept:r}=e,o=mt(n),i=ze(o,{tabbable:l,accept:r},n);i.currentNode=n[n.length-1].nextElementSibling;let u=i.previousNode();return u&&et(u,!0),u}}}function mt(t){return t[0].parentElement}function nn(t){let e=me.getTreeNode(se);for(;e&&e.scopeRef!==t;){if(e.contain)return!1;e=e.parent}return!0}function Km(t){if(!t.form)return Array.from(re(t).querySelectorAll(`input[type="radio"][name="${CSS.escape(t.name)}"]`)).filter(l=>!l.form);const e=t.form.elements.namedItem(t.name);let n=Se(t);return e instanceof n.RadioNodeList?Array.from(e).filter(l=>l instanceof n.HTMLInputElement):e instanceof n.HTMLInputElement?[e]:[]}function Rm(t){if(t.checked)return!0;const e=Km(t);return e.length>0&&!e.some(n=>n.checked)}function Mm(t,e){let n=s.useRef(void 0),l=s.useRef(void 0);le(()=>{let r=t.current;if(!e){l.current&&(cancelAnimationFrame(l.current),l.current=void 0);return}const o=re(r?r[0]:void 0);let i=c=>{if(c.key!=="Tab"||c.altKey||c.ctrlKey||c.metaKey||!nn(t)||c.isComposing)return;let f=ie(o),d=t.current;if(!d||!Oe(f,d))return;let b=mt(d),p=ze(b,{tabbable:!0},d);if(!f)return;p.currentNode=f;let h=c.shiftKey?p.previousNode():p.nextNode();h||(p.currentNode=c.shiftKey?d[d.length-1].nextElementSibling:d[0].previousElementSibling,h=c.shiftKey?p.previousNode():p.nextNode()),c.preventDefault(),h&&(et(h,!0),h instanceof Se(h).HTMLInputElement&&h.select())},u=c=>{(!se||el(se,t))&&Oe(U(c),t.current)?(se=t,n.current=U(c)):nn(t)&&!at(U(c),t)?n.current?n.current.focus():se&&se.current&&ir(se.current):nn(t)&&(n.current=U(c))},a=c=>{l.current&&cancelAnimationFrame(l.current),l.current=requestAnimationFrame(()=>{var p;let f=bn(),d=(f==="virtual"||f===null)&&an()&&bu(),b=ie(o);if(!d&&b&&nn(t)&&!at(b,t)){se=t;let h=U(c);h&&h.isConnected?(n.current=h,(p=n.current)==null||p.focus()):se.current&&ir(se.current)}})};return o.addEventListener("keydown",i,!1),o.addEventListener("focusin",u,!1),r==null||r.forEach(c=>c.addEventListener("focusin",u,!1)),r==null||r.forEach(c=>c.addEventListener("focusout",a,!1)),()=>{o.removeEventListener("keydown",i,!1),o.removeEventListener("focusin",u,!1),r==null||r.forEach(c=>c.removeEventListener("focusin",u,!1)),r==null||r.forEach(c=>c.removeEventListener("focusout",a,!1))}},[t,e]),le(()=>()=>{l.current&&cancelAnimationFrame(l.current)},[l])}function sa(t){return at(t)}function Oe(t,e){return!t||!e?!1:e.some(n=>ne(n,t))}function at(t,e=null){if(t instanceof Element&&t.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of me.traverse(me.getTreeNode(e)))if(n&&Oe(t,n.current))return!0;return!1}function Fm(t){return at(t,se)}function el(t,e){var l;let n=(l=me.getTreeNode(e))==null?void 0:l.parent;for(;n;){if(n.scopeRef===t)return!0;n=n.parent}return!1}function et(t,e=!1){if(t!=null&&!e)try{xe(t)}catch{}else if(t!=null)try{t.focus()}catch{}}function ca(t,e=!0){let n=t[0].previousElementSibling,l=mt(t),r=ze(l,{tabbable:e},t);r.currentNode=n;let o=r.nextNode();return e&&!o&&(l=mt(t),r=ze(l,{tabbable:!1},t),r.currentNode=n,o=r.nextNode()),o}function ir(t,e=!0){et(ca(t,e))}function Im(t,e){const n=x.useRef(e);s.useEffect(()=>{if(n.current){se=t;const l=re(t.current?t.current[0]:void 0);!Oe(ie(l),se.current)&&t.current&&ir(t.current)}n.current=!1},[t])}function Lm(t,e,n){le(()=>{if(e||n)return;let l=t.current;const r=re(l?l[0]:void 0);let o=i=>{let u=U(i);Oe(u,t.current)?se=t:sa(u)||(se=null)};return r.addEventListener("focusin",o,!1),l==null||l.forEach(i=>i.addEventListener("focusin",o,!1)),()=>{r.removeEventListener("focusin",o,!1),l==null||l.forEach(i=>i.removeEventListener("focusin",o,!1))}},[t,e,n])}function fi(t){let e=me.getTreeNode(se);for(;e&&e.scopeRef!==t;){if(e.nodeToRestore)return!1;e=e.parent}return(e==null?void 0:e.scopeRef)===t}function zm(t,e,n){const l=s.useRef(typeof document<"u"?ie(re(t.current?t.current[0]:void 0)):null);le(()=>{let r=t.current;const o=re(r?r[0]:void 0);if(!e||n)return;let i=()=>{(!se||el(se,t))&&Oe(ie(o),t.current)&&(se=t)};return o.addEventListener("focusin",i,!1),r==null||r.forEach(u=>u.addEventListener("focusin",i,!1)),()=>{o.removeEventListener("focusin",i,!1),r==null||r.forEach(u=>u.removeEventListener("focusin",i,!1))}},[t,n]),le(()=>{const r=re(t.current?t.current[0]:void 0);if(!e)return;let o=i=>{if(i.key!=="Tab"||i.altKey||i.ctrlKey||i.metaKey||!nn(t)||i.isComposing)return;let u=r.activeElement;if(!at(u,t)||!fi(t))return;let a=me.getTreeNode(t);if(!a)return;let c=a.nodeToRestore,f=ze(r.body,{tabbable:!0});f.currentNode=u;let d=i.shiftKey?f.previousNode():f.nextNode();if((!c||!c.isConnected||c===r.body)&&(c=void 0,a.nodeToRestore=void 0),(!d||!at(d,t))&&c){f.currentNode=c;do d=i.shiftKey?f.previousNode():f.nextNode();while(at(d,t));i.preventDefault(),i.stopPropagation(),d?et(d,!0):sa(c)?et(c,!0):u.blur()}};return n||r.addEventListener("keydown",o,!0),()=>{n||r.removeEventListener("keydown",o,!0)}},[t,e,n]),le(()=>{const r=re(t.current?t.current[0]:void 0);if(!e)return;let o=me.getTreeNode(t);if(o)return o.nodeToRestore=l.current??void 0,()=>{let i=me.getTreeNode(t);if(!i)return;let u=i.nodeToRestore,a=ie(r);if(e&&u&&(a&&at(a,t)||a===r.body&&fi(t))){let c=me.clone();requestAnimationFrame(()=>{if(r.activeElement===r.body){let f=c.getTreeNode(t);for(;f;){if(f.nodeToRestore&&f.nodeToRestore.isConnected){pi(f.nodeToRestore);return}f=f.parent}for(f=c.getTreeNode(t);f;){if(f.scopeRef&&f.scopeRef.current&&me.getTreeNode(f.scopeRef)){let d=ca(f.scopeRef.current,!0);pi(d);return}f=f.parent}}})}}},[t,e])}function pi(t){t.dispatchEvent(new CustomEvent(or,{bubbles:!0,cancelable:!0}))&&et(t)}function ze(t,e,n){let l=e!=null&&e.tabbable?Du:Su,r=(t==null?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null,o=re(r),i=yu(o,t||o,NodeFilter.SHOW_ELEMENT,{acceptNode(u){return ne(e==null?void 0:e.from,u)||e!=null&&e.tabbable&&u.tagName==="INPUT"&&u.getAttribute("type")==="radio"&&(!Rm(u)||i.currentNode.tagName==="INPUT"&&i.currentNode.type==="radio"&&i.currentNode.name===u.name)?NodeFilter.FILTER_REJECT:l(u)&&(!n||Oe(u,n))&&(!(e!=null&&e.accept)||e.accept(u))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return e!=null&&e.from&&(i.currentNode=e.from),i}class jr{constructor(){this.fastMap=new Map,this.root=new ur({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,n,l){let r=this.fastMap.get(n??null);if(!r)return;let o=new ur({scopeRef:e});r.addChild(o),o.parent=r,this.fastMap.set(e,o),l&&(o.nodeToRestore=l)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let n=this.fastMap.get(e);if(!n)return;let l=n.parent;for(let o of this.traverse())o!==n&&n.nodeToRestore&&o.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&Oe(o.nodeToRestore,n.scopeRef.current)&&(o.nodeToRestore=n.nodeToRestore);let r=n.children;l&&(l.removeChild(n),r.size>0&&r.forEach(o=>l&&l.addChild(o))),this.fastMap.delete(n.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let n of e.children)yield*this.traverse(n)}clone(){var n;let e=new jr;for(let l of this.traverse())e.addTreeNode(l.scopeRef,((n=l.parent)==null?void 0:n.scopeRef)??null,l.nodeToRestore);return e}}class ur{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}}let me=new jr;function Nm(t){let{ref:e,onInteractOutside:n,isDisabled:l,onInteractOutsideStart:r}=t,o=s.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),i=we(a=>{n&&bi(a,e)&&(r&&r(a),o.current.isPointerDown=!0)}),u=we(a=>{n&&n(a)});s.useEffect(()=>{let a=o.current;if(l)return;const c=e.current,f=re(c);if(typeof PointerEvent<"u"){let d=b=>{a.isPointerDown&&bi(b,e)&&u(b),a.isPointerDown=!1};return f.addEventListener("pointerdown",i,!0),f.addEventListener("click",d,!0),()=>{f.removeEventListener("pointerdown",i,!0),f.removeEventListener("click",d,!0)}}},[e,l])}function bi(t,e){if(t.button>0)return!1;let n=U(t);if(n){const l=n.ownerDocument;if(!l||!ne(l.documentElement,n)||n.closest("[data-react-aria-top-layer]"))return!1}return e.current?!t.composedPath().includes(e.current):!1}const Ue=[];function da(t,e){let{onClose:n,shouldCloseOnBlur:l,isOpen:r,isDismissable:o=!1,isKeyboardDismissDisabled:i=!1,shouldCloseOnInteractOutside:u}=t,a=s.useRef(void 0);s.useEffect(()=>{if(r&&!Ue.includes(e))return Ue.push(e),()=>{let h=Ue.indexOf(e);h>=0&&Ue.splice(h,1)}},[r,e]);let c=()=>{Ue[Ue.length-1]===e&&n&&n()},f=h=>{const y=Ue[Ue.length-1];a.current=y,(!u||u(U(h)))&&y===e&&h.stopPropagation()},d=h=>{(!u||u(U(h)))&&(Ue[Ue.length-1]===e&&h.stopPropagation(),a.current===e&&c()),a.current=void 0},b=h=>{h.key==="Escape"&&!i&&!h.nativeEvent.isComposing&&(h.stopPropagation(),h.preventDefault(),c())};Nm({ref:e,onInteractOutside:o&&r?d:void 0,onInteractOutsideStart:f});let{focusWithinProps:p}=dl({isDisabled:!l,onBlurWithin:h=>{!h.relatedTarget||Fm(h.relatedTarget)||(!u||u(h.relatedTarget))&&(n==null||n())}});return{overlayProps:{onKeyDown:b,...p},underlayProps:{}}}const un=typeof document<"u"&&window.visualViewport;let Vn=0,Fl;function fa(t={}){let{isDisabled:e}=t;le(()=>{if(!e)return Vn++,Vn===1&&(vt()?Fl=Om():Fl=Vm()),()=>{Vn--,Vn===0&&Fl()}},[e])}function Vm(){let t=window.innerWidth-document.documentElement.clientWidth;return ft(t>0&&("scrollbarGutter"in document.documentElement.style?Wn(document.documentElement,"scrollbarGutter","stable"):Wn(document.documentElement,"paddingRight",`${t}px`)),Wn(document.documentElement,"overflow","hidden"))}function Om(){let t=Wn(document.documentElement,"overflow","hidden"),e,n=!1,l=f=>{let d=U(f);e=st(d)?d:Xe(d,!0),n=!1;let b=d.ownerDocument.defaultView.getSelection();b&&!b.isCollapsed&&b.containsNode(d,!0)&&(n=!0),f.composedPath().some(p=>p instanceof HTMLInputElement&&p.type==="range")&&(n=!0),"selectionStart"in d&&"selectionEnd"in d&&d.selectionStart{if(!(f.touches.length===2||n)){if(!e||e===document.documentElement||e===document.body){f.preventDefault();return}e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&f.preventDefault()}},u=f=>{var p;let d=U(f),b=f.relatedTarget;if(b&&rn(b))b.focus({preventScroll:!0}),hi(b,rn(d));else if(!b){let h=(p=d.parentElement)==null?void 0:p.closest("[tabindex]");h==null||h.focus({preventScroll:!0})}},a=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(f){let d=ie(),b=d!=null&&rn(d);a.call(this,{...f,preventScroll:!0}),(!f||!f.preventScroll)&&hi(this,b)};let c=ft(Il(document,"touchstart",l,{passive:!1,capture:!0}),Il(document,"touchmove",i,{passive:!1,capture:!0}),Il(document,"blur",u,!0));return()=>{t(),c(),r.remove(),HTMLElement.prototype.focus=a}}function Wn(t,e,n){let l=t.style[e];return t.style[e]=n,()=>{t.style[e]=l}}function Il(t,e,n,l){return t.addEventListener(e,n,l),()=>{t.removeEventListener(e,n,l)}}function hi(t,e){e||!un?mi(t):un.addEventListener("resize",()=>mi(t),{once:!0})}function mi(t){let e=document.scrollingElement||document.documentElement,n=t;for(;n&&n!==e;){let l=Xe(n);if(l!==document.documentElement&&l!==document.body&&l!==n){let r=l.getBoundingClientRect(),o=n.getBoundingClientRect();if(o.topr.top+n.clientHeight){let i=r.bottom;un&&(i=Math.min(i,un.offsetTop+un.height));let u=o.top-r.top-((i-r.top)/2-o.height/2);l.scrollTo({top:Math.max(0,Math.min(l.scrollHeight-l.clientHeight,l.scrollTop+u)),behavior:"smooth"})}}n=l.parentElement}}function jm(t,e){let{triggerRef:n,popoverRef:l,groupRef:r,isNonModal:o,isKeyboardDismissDisabled:i,shouldCloseOnInteractOutside:u,...a}=t,c=a.trigger==="SubmenuTrigger",{overlayProps:f,underlayProps:d}=da({isOpen:e.isOpen,onClose:e.close,shouldCloseOnBlur:!0,isDismissable:!o||c,isKeyboardDismissDisabled:i,shouldCloseOnInteractOutside:u},r??l),{overlayProps:b,arrowProps:p,placement:h,triggerAnchorPoint:y}=Pm({...a,targetRef:n,overlayRef:l,isOpen:e.isOpen,onClose:o&&!c?e.close:null});return fa({isDisabled:o||!e.isOpen}),s.useEffect(()=>{if(e.isOpen&&l.current)return o?ym((r==null?void 0:r.current)??l.current):Vr([(r==null?void 0:r.current)??l.current],{shouldUseInert:!0})},[o,e.isOpen,l,r]),{popoverProps:W(f,b),arrowProps:p,underlayProps:d,placement:h,triggerAnchorPoint:y}}var pa={};pa={dismiss:"تجاهل"};var ba={};ba={dismiss:"Отхвърляне"};var ha={};ha={dismiss:"Odstranit"};var ma={};ma={dismiss:"Luk"};var ga={};ga={dismiss:"Schließen"};var ya={};ya={dismiss:"Απόρριψη"};var $a={};$a={dismiss:"Dismiss"};var va={};va={dismiss:"Descartar"};var xa={};xa={dismiss:"Lõpeta"};var Ca={};Ca={dismiss:"Hylkää"};var Ea={};Ea={dismiss:"Rejeter"};var wa={};wa={dismiss:"התעלם"};var Sa={};Sa={dismiss:"Odbaci"};var Da={};Da={dismiss:"Elutasítás"};var ka={};ka={dismiss:"Ignora"};var Pa={};Pa={dismiss:"閉じる"};var Ta={};Ta={dismiss:"무시"};var Aa={};Aa={dismiss:"Atmesti"};var Ba={};Ba={dismiss:"Nerādīt"};var Ka={};Ka={dismiss:"Lukk"};var Ra={};Ra={dismiss:"Negeren"};var Ma={};Ma={dismiss:"Zignoruj"};var Fa={};Fa={dismiss:"Descartar"};var Ia={};Ia={dismiss:"Dispensar"};var La={};La={dismiss:"Revocare"};var za={};za={dismiss:"Пропустить"};var Na={};Na={dismiss:"Zrušiť"};var Va={};Va={dismiss:"Opusti"};var Oa={};Oa={dismiss:"Odbaci"};var ja={};ja={dismiss:"Avvisa"};var _a={};_a={dismiss:"Kapat"};var Ha={};Ha={dismiss:"Скасувати"};var Wa={};Wa={dismiss:"取消"};var Ua={};Ua={dismiss:"關閉"};var Ga={};Ga={"ar-AE":pa,"bg-BG":ba,"cs-CZ":ha,"da-DK":ma,"de-DE":ga,"el-GR":ya,"en-US":$a,"es-ES":va,"et-EE":xa,"fi-FI":Ca,"fr-FR":Ea,"he-IL":wa,"hr-HR":Sa,"hu-HU":Da,"it-IT":ka,"ja-JP":Pa,"ko-KR":Ta,"lt-LT":Aa,"lv-LV":Ba,"nb-NO":Ka,"nl-NL":Ra,"pl-PL":Ma,"pt-BR":Fa,"pt-PT":Ia,"ro-RO":La,"ru-RU":za,"sk-SK":Na,"sl-SI":Va,"sr-SP":Oa,"sv-SE":ja,"tr-TR":_a,"uk-UA":Ha,"zh-CN":Wa,"zh-TW":Ua};const _m=Symbol.for("react-aria.i18n.locale"),Hm=Symbol.for("react-aria.i18n.strings");let Pt;class pl{constructor(e,n="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,l])=>l)),this.defaultLocale=n}getStringForLocale(e,n){let r=this.getStringsForLocale(n)[e];if(!r)throw new Error(`Could not find intl message ${e} in ${n} locale`);return r}getStringsForLocale(e){let n=this.strings[e];return n||(n=Wm(e,this.strings,this.defaultLocale),this.strings[e]=n),n}static getGlobalDictionaryForPackage(e){if(typeof window>"u")return null;let n=window[_m];if(Pt===void 0){let r=window[Hm];if(!r)return null;Pt={};for(let o in r)Pt[o]=new pl({[n]:r[o]},n)}let l=Pt==null?void 0:Pt[e];if(!l)throw new Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return l}}function Wm(t,e,n="en-US"){if(e[t])return e[t];let l=Um(t);if(e[l])return e[l];for(let r in e)if(r.startsWith(l+"-"))return e[r];return e[n]}function Um(t){return Intl.Locale?new Intl.Locale(t).language:t.split("-")[0]}const gi=new Map,yi=new Map;class Gm{constructor(e,n){this.locale=e,this.strings=n}format(e,n){let l=this.strings.getStringForLocale(e,this.locale);return typeof l=="function"?l(n,this):l}plural(e,n,l="cardinal"){let r=n["="+e];if(r)return typeof r=="function"?r():r;let o=this.locale+":"+l,i=gi.get(o);i||(i=new Intl.PluralRules(this.locale,{type:l}),gi.set(o,i));let u=i.select(e);return r=n[u]||n.other,typeof r=="function"?r():r}number(e){let n=yi.get(this.locale);return n||(n=new Intl.NumberFormat(this.locale),yi.set(this.locale,n)),n.format(e)}select(e,n){let l=e[n]||e.other;return typeof l=="function"?l():l}}const $i=new WeakMap;function qm(t){let e=$i.get(t);return e||(e=new pl(t),$i.set(t,e)),e}function Zm(t,e){return e&&pl.getGlobalDictionaryForPackage(e)||qm(t)}function _e(t,e){let{locale:n}=Pe(),l=Zm(t,e);return s.useMemo(()=>new Gm(n,l),[n,l])}const vi={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function wn(t={}){let{style:e,isFocusable:n}=t,[l,r]=s.useState(!1),{focusWithinProps:o}=dl({isDisabled:!n,onFocusWithinChange:u=>r(u)}),i=s.useMemo(()=>l?e:e?{...vi,...e}:vi,[l]);return{visuallyHiddenProps:{...o,style:i}}}function _r(t){let{children:e,elementType:n="div",isFocusable:l,style:r,...o}=t,{visuallyHiddenProps:i}=wn(t);return x.createElement(n,W(o,i),e)}function Ym(t){return t&&t.__esModule?t.default:t}function ar(t){let{onDismiss:e,...n}=t,l=_e(Ym(Ga),"@react-aria/overlays"),r=cn(n,l.format("dismiss")),o=()=>{e&&e()};return x.createElement(_r,null,x.createElement("button",{...r,tabIndex:-1,onClick:o,style:{width:1,height:1}}))}const Xm=x.forwardRef(({children:t,...e},n)=>{let l=s.useRef(!1),r=s.useContext(hn),o=W(r||{},{...e,register(){l.current=!0,r&&r.register()}});return o.ref=Te(n||(r==null?void 0:r.ref)),Ar(r,o.ref),s.useEffect(()=>{l.current||(l.current=!0)},[]),x.createElement(hn.Provider,{value:o},t)});function Jm({children:t}){let e=s.useMemo(()=>({register:()=>{}}),[]);return x.createElement(hn.Provider,{value:e},t)}const Qm=s.createContext({});function e4(){return s.useContext(Qm)??{}}const qa=x.createContext(null);function sr(t){let e=dt(),{portalContainer:n=e?null:document.body,isExiting:l}=t,[r,o]=s.useState(!1),i=s.useMemo(()=>({contain:r,setContain:o}),[r,o]),{getContainer:u}=e4();if(!t.portalContainer&&u&&(n=u()),!n)return null;let a=t.children;return t.disableFocusManagement||(a=x.createElement(Or,{restoreFocus:!0,contain:(t.shouldContainFocus||r)&&!l},a)),a=x.createElement(qa.Provider,{value:i},x.createElement(Jm,null,a)),du.createPortal(a,n)}function Za(){let t=s.useContext(qa),e=t==null?void 0:t.setContain;le(()=>{e==null||e(!0)},[e])}function bl(t){let[e,n]=ct(t.isOpen,t.defaultOpen||!1,t.onOpenChange);const l=s.useCallback(()=>{n(!0)},[n]),r=s.useCallback(()=>{n(!1)},[n]),o=s.useCallback(()=>{n(!e)},[n,e]);return{isOpen:e,setOpen:n,open:l,close:r,toggle:o}}const Hr=s.createContext(null),xi=s.createContext(null),t4=s.forwardRef(function(e,n){[e,n]=ve(e,n,Hr);let l=s.useContext(St),r=bl(e),o=e.isOpen!=null||e.defaultOpen!=null||!l?r:l,i=Ul(n,o.isOpen)||e.isExiting||!1,u=Kh(),{direction:a}=Pe();if(u){let c=e.children;return typeof c=="function"&&(c=c({trigger:e.trigger||null,placement:"bottom",isEntering:!1,isExiting:!1,defaultChildren:null})),x.createElement(x.Fragment,null,c)}return o&&!o.isOpen&&!i?null:x.createElement(n4,{...e,triggerRef:e.triggerRef,state:o,popoverRef:n,isExiting:i,dir:a})});function n4({state:t,isExiting:e,UNSTABLE_portalContainer:n,clearContexts:l,...r}){var M,V;let o=s.useRef(null),i=s.useRef(null),u=s.useContext(xi),a=u&&r.trigger==="SubmenuTrigger",{popoverProps:c,underlayProps:f,arrowProps:d,placement:b,triggerAnchorPoint:p}=jm({...r,offset:r.offset??8,arrowRef:o,groupRef:a?u:i},t),h=r.popoverRef,y=Br(h,!!b)||r.isEntering||!1,m=ae({...r,defaultClassName:"react-aria-Popover",values:{trigger:r.trigger||null,placement:b,isEntering:y,isExiting:e}}),g=!r.isNonModal||r.trigger==="SubmenuTrigger",[v,E]=s.useState(!1);le(()=>{h.current&&E(g&&!h.current.querySelector("[role=dialog]"))},[h,g]),s.useEffect(()=>{v&&(r.trigger!=="SubmenuTrigger"||bn()!=="pointer")&&h.current&&!xt(h.current)&&xe(h.current)},[v,h,r.trigger]);let C=s.useMemo(()=>{let H=m.children;if(l)for(let j of l)H=x.createElement(j.Provider,{value:null},H);return H},[m.children,l]),[R,T]=s.useState(null),F=s.useCallback(()=>{r.triggerRef.current&&T(r.triggerRef.current.getBoundingClientRect().width+"px")},[r.triggerRef]);le(F,[F]),dn({ref:(M=m.style)!=null&&M["--trigger-width"]?void 0:r.triggerRef,onResize:F});let B={...c.style,"--trigger-anchor-point":p?`${p.x}px ${p.y}px`:void 0,...m.style,"--trigger-width":((V=m.style)==null?void 0:V["--trigger-width"])||R},L=x.createElement(ee.div,{...W(oe(r,{global:!0}),c),...m,role:v?"dialog":void 0,tabIndex:v?-1:void 0,"aria-label":r["aria-label"],"aria-labelledby":r["aria-labelledby"],ref:h,slot:r.slot||void 0,style:B,dir:r.dir,"data-trigger":r.trigger,"data-placement":b,"data-entering":y||void 0,"data-exiting":e||void 0},!r.isNonModal&&x.createElement(ar,{onDismiss:t.close}),x.createElement(mm.Provider,{value:{...d,placement:b,ref:o}},C),x.createElement(ar,{onDismiss:t.close}));return a?x.createElement(sr,{...r,shouldContainFocus:v,isExiting:e,portalContainer:n??(u==null?void 0:u.current)??void 0},L):x.createElement(sr,{...r,shouldContainFocus:v,isExiting:e,portalContainer:n},!r.isNonModal&&t.isOpen&&x.createElement("div",{"data-testid":"underlay",...f,style:{position:"fixed",inset:0}}),x.createElement("div",{ref:i,style:{display:"contents"}},x.createElement(xi.Provider,{value:i},L)))}class Ge{constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue="",this["aria-label"]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}get childNodes(){throw new Error("childNodes is not supported")}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e["aria-label"]=this["aria-label"],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,n,l){let r=this.clone();return n.addDescendants(r,e),r}}class hl extends Ge{filter(e,n,l){let[r,o]=Xa(e,n,this.firstChildKey,l),i=this.clone();return i.firstChildKey=r,i.lastChildKey=o,i}}const mo=class mo extends Ge{};mo.type="header";let Ci=mo;const go=class go extends Ge{};go.type="loader";let tl=go;const yo=class yo extends hl{filter(e,n,l){if(l(this.textValue,this)){let r=this.clone();return n.addDescendants(r,e),r}return null}};yo.type="item";let cr=yo;const $o=class $o extends hl{filter(e,n,l){let r=super.filter(e,n,l);if(r&&r.lastChildKey!==null){let o=e.getItem(r.lastChildKey);if(o&&o.type!=="header")return r}return null}};$o.type="section";let dr=$o;class Ya{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey!=null?this.keyMap.get(this.firstKey):void 0;for(;e;)yield e,e=e.nextKey!=null?this.keyMap.get(e.nextKey):void 0}getChildren(e){let n=this.keyMap;return{*[Symbol.iterator](){let l=n.get(e),r=(l==null?void 0:l.firstChildKey)!=null?n.get(l.firstChildKey):null;for(;r;)yield r,r=r.nextKey!=null?n.get(r.nextKey):void 0}}}getKeyBefore(e){let n=this.keyMap.get(e);if(!n)return null;if(n.prevKey!=null){for(n=this.keyMap.get(n.prevKey);n&&n.type!=="item"&&n.lastChildKey!=null;)n=this.keyMap.get(n.lastChildKey);return(n==null?void 0:n.key)??null}return n.parentKey}getKeyAfter(e){let n=this.keyMap.get(e);if(!n)return null;if(n.type!=="item"&&n.firstChildKey!=null)return n.firstChildKey;for(;n;){if(n.nextKey!=null)return n.nextKey;if(n.parentKey!=null)n=this.keyMap.get(n.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey!=null?this.keyMap.get(this.lastKey):null;for(;(e==null?void 0:e.lastChildKey)!=null;)e=this.keyMap.get(e.lastChildKey);return(e==null?void 0:e.key)??null}getItem(e){return this.keyMap.get(e)??null}at(){throw new Error("Not implemented")}clone(){let e=this.constructor,n=new e;return n.keyMap=new Map(this.keyMap),n.firstKey=this.firstKey,n.lastKey=this.lastKey,n.itemCount=this.itemCount,n}addNode(e){if(this.frozen)throw new Error("Cannot add a node to a frozen collection");e.type==="item"&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,n){this.addNode(e);let l=n.getChildren(e.key);for(let r of l)this.addDescendants(r,n)}removeNode(e){if(this.frozen)throw new Error("Cannot remove a node to a frozen collection");let n=this.keyMap.get(e);n!=null&&n.type==="item"&&this.itemCount--,this.keyMap.delete(e)}commit(e,n,l=!1){if(this.frozen)throw new Error("Cannot commit a frozen collection");this.firstKey=e,this.lastKey=n,this.frozen=!l}filter(e){let n=new this.constructor,[l,r]=Xa(this,n,this.firstKey,e);return n==null||n.commit(l,r),n}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}}function Xa(t,e,n,l){if(n==null)return[null,null];let r=null,o=null,i=t.getItem(n);for(;i!=null;){let u=i.filter(t,e,l);u!=null&&(u.nextKey=null,o&&(u.prevKey=o.key,o.nextKey=u.key),r==null&&(r=u),e.addNode(u),o=u),i=i.nextKey!=null?t.getItem(i.nextKey):null}if(o&&o.type==="separator"){let u=o.prevKey;e.removeNode(o.key),u!=null?(o=e.getItem(u),o.nextKey=null):o=null}return[(r==null?void 0:r.key)??null,(o==null?void 0:o.key)??null]}class Ja{constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){var e;return((e=this.parentNode)==null?void 0:e.isConnected)||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.indexthis.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}}function Wr(t){let{children:e,items:n,idScope:l,addIdAndValue:r,dependencies:o=[]}=t,i=s.useMemo(()=>{},[e]),u=s.useMemo(()=>new WeakMap,[...o,i]);return s.useMemo(()=>{if(n&&typeof e=="function"){let a=[];for(let c of n){let f=r4(c)?c:null,d=f?u.get(f):null;if(!d){d=e(c);let b=d.props.id??(c==null?void 0:c.key)??(c==null?void 0:c.id);l!=null&&d.props.id==null&&b!=null&&(b=l+":"+b);let p=b??a.length;d=s.cloneElement(d,r?{key:p,id:b,value:c}:{key:p}),f&&u.set(f,d)}a.push(d)}return a}else if(typeof e!="function")return e},[e,n,u,l,r])}function r4(t){switch(typeof t){case"object":return t!=null;case"function":case"symbol":return!0;default:return!1}}var Ll={exports:{}},zl={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Ei;function o4(){if(Ei)return zl;Ei=1;var t=Cp();function e(d,b){return d===b&&(d!==0||1/d===1/b)||d!==d&&b!==b}var n=typeof Object.is=="function"?Object.is:e,l=t.useState,r=t.useEffect,o=t.useLayoutEffect,i=t.useDebugValue;function u(d,b){var p=b(),h=l({inst:{value:p,getSnapshot:b}}),y=h[0].inst,m=h[1];return o(function(){y.value=p,y.getSnapshot=b,a(y)&&m({inst:y})},[d,p,b]),r(function(){return a(y)&&m({inst:y}),d(function(){a(y)&&m({inst:y})})},[d]),i(p),p}function a(d){var b=d.getSnapshot;d=d.value;try{var p=b();return!n(d,p)}catch{return!0}}function c(d,b){return b()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:u;return zl.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:f,zl}var wi;function i4(){return wi||(wi=1,Ll.exports=o4()),Ll.exports}var u4=i4();const Qa=s.createContext(!1),gn=s.createContext(null);function Ur(t){if(s.useContext(gn))return t.content;let{collection:n,document:l}=d4(t.createCollection);return x.createElement(x.Fragment,null,x.createElement(Bh,null,x.createElement(gn.Provider,{value:l},t.content)),x.createElement(a4,{render:t.children,collection:n}))}function a4({collection:t,render:e}){return e(t)}function s4(t,e,n){let l=dt(),r=s.useRef(l);r.current=l;let o=s.useCallback(()=>r.current?n():e(),[e,n]);return u4.useSyncExternalStore(t,o)}const c4=typeof x.useSyncExternalStore=="function"?x.useSyncExternalStore:s4;function d4(t){let[e]=s.useState(()=>new l4((t==null?void 0:t())||new Ya)),n=s.useCallback(i=>e.subscribe(i),[e]),l=s.useCallback(()=>{let i=e.getCollection();return e.isSSR&&e.resetAfterSSR(),i},[e]),r=s.useCallback(()=>(e.isSSR=!0,e.getCollection()),[e]);return{collection:c4(n,l,r),document:e}}const fr=s.createContext(null);function f4(t){var n;return n=class extends Ge{},n.type=t,n}function es(t,e,n,l,r,o){typeof t=="string"&&(t=f4(t));let i=s.useCallback(a=>{a==null||a.setProps(e,n,t,l,o)},[e,n,l,o,t]),u=s.useContext(fr);if(u){let a=u.ownerDocument.nodesByProps.get(e);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(e,n,t,l,o),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(e,a)),r?x.createElement(fr.Provider,{value:a},r):null}return x.createElement(t.type,{ref:i},r)}function Sn(t,e){let n=({node:r})=>e(r.props,r.props.ref,r),l=s.forwardRef((r,o)=>{let i=s.useContext(er);if(!s.useContext(Qa)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(r,o)}return es(t,r,o,"children"in r?r.children:null,null,a=>x.createElement(er.Provider,{value:i},x.createElement(n,{node:a})))});return l.displayName=e.name,l}function ml(t,e,n=ts){let l=({node:o})=>e(o.props,o.props.ref,o),r=s.forwardRef((o,i)=>{let u=n(o);return es(t,o,i,null,u,a=>x.createElement(l,{node:a}))??x.createElement(x.Fragment,null)});return r.displayName=e.name,r}function ts(t){return Wr({...t,addIdAndValue:!0})}const Si=s.createContext(null);function Dn(t){let e=s.useContext(Si),n=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),l=t.idScope??(e==null?void 0:e.idScope),r=ts({...t,idScope:l,dependencies:n});return s.useContext(gn)&&(r=x.createElement(p4,null,r)),e=s.useMemo(()=>({dependencies:n,idScope:l}),[l,...n]),x.createElement(Si.Provider,{value:e},r)}function p4({children:t}){let e=s.useContext(gn),n=s.useMemo(()=>x.createElement(gn.Provider,{value:null},x.createElement(Qa.Provider,{value:!0},t)),[t]);return dt()?x.createElement(fr.Provider,{value:e},n):kr.createPortal(n,e)}const b4=s.createContext(null),Gr={CollectionRoot({collection:t,renderDropIndicator:e}){return Di(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:n}){return Di(t,e,n)}};function Di(t,e,n){return Wr({items:e?t.getChildren(e.key):t,dependencies:[n],children(l){if(l.type==="content")return x.createElement(x.Fragment,null);let r=l.render(l);return!n||l.type!=="item"?r:x.createElement(x.Fragment,null,n({type:"item",key:l.key,dropPosition:"before"}),r,h4(t,l,n))}})}function h4(t,e,n){let l=e.key,r=t.getKeyAfter(l),o=r!=null?t.getItem(r):null;for(;o!=null&&o.type!=="item";)r=t.getKeyAfter(o.key),o=r!=null?t.getItem(r):null;let i=e.nextKey!=null?t.getItem(e.nextKey):null;for(;i!=null&&i.type!=="item";)i=i.nextKey!=null?t.getItem(i.nextKey):null;let u=[];if(i==null){let a=e;for(;(a==null?void 0:a.type)==="item"&&(!o||a.parentKey!==o.parentKey&&o.level{b.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),re(b.target).activeElement!==b.target&&Ne(b.target),r&&r({...b,type:"longpress"}),u.current=void 0},o),b.pointerType==="touch")){let p=y=>{y.preventDefault()},h=Se(b.target);a(b.target,"contextmenu",p,{once:!0}),a(h,"pointerup",()=>{setTimeout(()=>{c(b.target,"contextmenu",p)},30)},{once:!0})}},onPressEnd(b){u.current&&clearTimeout(u.current),l&&(b.pointerType==="mouse"||b.pointerType==="touch")&&l({...b,type:"longpressend"})}}),d=$n(r&&!e?i:void 0);return{longPressProps:W(f,d)}}function js(t,e,n){let{type:l}=t,{isOpen:r}=e;s.useEffect(()=>{n&&n.current&&aa.set(n.current,e.close)});let o;l==="menu"?o=!0:l==="listbox"&&(o="listbox");let i=$e();return{triggerProps:{"aria-haspopup":o,"aria-expanded":r,"aria-controls":r?i:void 0,onPress:e.toggle},overlayProps:{id:i}}}function E4(t){return t&&t.__esModule?t.default:t}function w4(t,e,n){let{type:l="menu",isDisabled:r,trigger:o="press"}=t,i=$e(),{triggerProps:u,overlayProps:a}=js({type:l},e,n),c=p=>{if(!r&&!(o==="longPress"&&!p.altKey)&&n&&n.current)switch(p.key){case"Enter":case" ":if(o==="longPress"||p.isDefaultPrevented())return;case"ArrowDown":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("first");break;case"ArrowUp":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("last");break;default:"continuePropagation"in p&&p.continuePropagation()}},f=_e(E4(Vs),"@react-aria/menu"),{longPressProps:d}=Os({isDisabled:r||o!=="longPress",accessibilityDescription:f.format("longPressMessage"),onLongPressStart(){e.close()},onLongPress(){e.open("first")}}),b={preventFocusOnPress:!0,onPressStart(p){p.pointerType!=="touch"&&p.pointerType!=="keyboard"&&!r&&(Ne(p.target),e.open(p.pointerType==="virtual"?"first":null))},onPress(p){p.pointerType==="touch"&&!r&&(Ne(p.target),e.toggle())}};return delete u.onPress,{menuTriggerProps:{...u,...o==="press"?b:d,id:i,onKeyDown:c},menuProps:{...a,"aria-labelledby":i,autoFocus:e.focusStrategy||!0,onClose:e.close}}}function br(t){return jn()?t.altKey:t.ctrlKey}function Un(t,e){var r,o;let n=`[data-key="${CSS.escape(String(e))}"]`,l=(r=t.current)==null?void 0:r.dataset.collection;return l&&(n=`[data-collection="${CSS.escape(l)}"]${n}`),(o=t.current)==null?void 0:o.querySelector(n)}const _s=new WeakMap;function S4(t){let e=$e();return _s.set(t,e),e}function D4(t){return _s.get(t)}const k4=1e3;function P4(t){let{keyboardDelegate:e,selectionManager:n,onTypeSelect:l}=t,r=s.useRef({search:"",timeout:void 0}).current,o=i=>{let u=T4(i.key);if(!(!u||i.ctrlKey||i.metaKey||!ne(i.currentTarget,U(i))||r.search.length===0&&u===" ")){if(u===" "&&r.search.trim().length>0&&(i.preventDefault(),"continuePropagation"in i||i.stopPropagation()),r.search+=u,e.getKeyForSearch!=null){let a=e.getKeyForSearch(r.search,n.focusedKey);a==null&&(a=e.getKeyForSearch(r.search)),a!=null&&(n.setFocusedKey(a),l&&l(a))}clearTimeout(r.timeout),r.timeout=setTimeout(()=>{r.search=""},k4)}};return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?o:void 0}}}function T4(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}function Zr(t){let{selectionManager:e,keyboardDelegate:n,ref:l,autoFocus:r=!1,shouldFocusWrap:o=!1,disallowEmptySelection:i=!1,disallowSelectAll:u=!1,escapeKeyBehavior:a="clearSelection",selectOnFocus:c=e.selectionBehavior==="replace",disallowTypeAhead:f=!1,shouldUseVirtualFocus:d,allowsTabNavigation:b=!1,scrollRef:p=l,linkBehavior:h="action"}=t,{direction:y}=Pe(),m=Ot(),g=$=>{var A,w,P,k,K,_,Z,S,N,O,X,J,de,Ce;if($.altKey&&$.key==="Tab"&&$.preventDefault(),!l.current||!ne(l.current,U($)))return;const D=(z,Y)=>{if(z!=null){if(e.isLink(z)&&h==="selection"&&c&&!br($)){kr.flushSync(()=>{e.setFocusedKey(z,Y)});let ue=Un(l,z),Re=e.getItemProps(z);ue&&m.open(ue,$,Re.href,Re.routerOptions);return}if(e.setFocusedKey(z,Y),e.isLink(z)&&h==="override")return;$.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(z):c&&!br($)&&e.replaceSelection(z)}};switch($.key){case"ArrowDown":if(n.getKeyBelow){let z=e.focusedKey!=null?(A=n.getKeyBelow)==null?void 0:A.call(n,e.focusedKey):(w=n.getFirstKey)==null?void 0:w.call(n);z==null&&o&&(z=(P=n.getFirstKey)==null?void 0:P.call(n,e.focusedKey)),z!=null&&($.preventDefault(),D(z))}break;case"ArrowUp":if(n.getKeyAbove){let z=e.focusedKey!=null?(k=n.getKeyAbove)==null?void 0:k.call(n,e.focusedKey):(K=n.getLastKey)==null?void 0:K.call(n);z==null&&o&&(z=(_=n.getLastKey)==null?void 0:_.call(n,e.focusedKey)),z!=null&&($.preventDefault(),D(z))}break;case"ArrowLeft":if(n.getKeyLeftOf){let z=e.focusedKey!=null?(Z=n.getKeyLeftOf)==null?void 0:Z.call(n,e.focusedKey):(S=n.getFirstKey)==null?void 0:S.call(n);z==null&&o&&(z=y==="rtl"?(N=n.getFirstKey)==null?void 0:N.call(n,e.focusedKey):(O=n.getLastKey)==null?void 0:O.call(n,e.focusedKey)),z!=null&&($.preventDefault(),D(z,y==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){let z=e.focusedKey!=null?(X=n.getKeyRightOf)==null?void 0:X.call(n,e.focusedKey):(J=n.getFirstKey)==null?void 0:J.call(n);z==null&&o&&(z=y==="rtl"?(de=n.getLastKey)==null?void 0:de.call(n,e.focusedKey):(Ce=n.getFirstKey)==null?void 0:Ce.call(n,e.focusedKey)),z!=null&&($.preventDefault(),D(z,y==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(e.focusedKey===null&&$.shiftKey)return;$.preventDefault();let z=n.getFirstKey(e.focusedKey,Tt($));e.setFocusedKey(z),z!=null&&(Tt($)&&$.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(z):c&&e.replaceSelection(z))}break;case"End":if(n.getLastKey){if(e.focusedKey===null&&$.shiftKey)return;$.preventDefault();let z=n.getLastKey(e.focusedKey,Tt($));e.setFocusedKey(z),z!=null&&(Tt($)&&$.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(z):c&&e.replaceSelection(z))}break;case"PageDown":if(n.getKeyPageBelow&&e.focusedKey!=null){let z=n.getKeyPageBelow(e.focusedKey);z!=null&&($.preventDefault(),D(z))}break;case"PageUp":if(n.getKeyPageAbove&&e.focusedKey!=null){let z=n.getKeyPageAbove(e.focusedKey);z!=null&&($.preventDefault(),D(z))}break;case"a":Tt($)&&e.selectionMode==="multiple"&&u!==!0&&($.preventDefault(),e.selectAll());break;case"Escape":a==="clearSelection"&&!i&&e.selectedKeys.size!==0&&($.stopPropagation(),$.preventDefault(),e.clearSelection());break;case"Tab":if(!b){if($.shiftKey)l.current.focus();else{let z=ze(l.current,{tabbable:!0}),Y,ue;do ue=z.lastChild(),ue&&(Y=ue);while(ue);let Re=ie();Y&&(!xt(Y)||Re&&!Du(Re))&&Ne(Y)}break}}},v=s.useRef({top:0,left:0});Qt(p,"scroll",()=>{var $,D;v.current={top:(($=p.current)==null?void 0:$.scrollTop)??0,left:((D=p.current)==null?void 0:D.scrollLeft)??0}});let E=$=>{var D,A;if(e.isFocused){ne($.currentTarget,U($))||e.setFocused(!1);return}if(ne($.currentTarget,U($))){if(e.setFocused(!0),e.focusedKey==null){let w=k=>{k!=null&&(e.setFocusedKey(k),c&&!e.isSelected(k)&&e.replaceSelection(k))},P=$.relatedTarget;P&&$.currentTarget.compareDocumentPosition(P)&Node.DOCUMENT_POSITION_FOLLOWING?w(e.lastSelectedKey??((D=n.getLastKey)==null?void 0:D.call(n))):w(e.firstSelectedKey??((A=n.getFirstKey)==null?void 0:A.call(n)))}else p.current&&(p.current.scrollTop=v.current.top,p.current.scrollLeft=v.current.left);if(e.focusedKey!=null&&p.current){let w=Un(l,e.focusedKey);w instanceof HTMLElement&&(!xt(w)&&!d&&Ne(w),bn()==="keyboard"&&it(w,{containingElement:l.current}))}}},C=$=>{ne($.currentTarget,$.relatedTarget)||e.setFocused(!1)},R=s.useRef(!1);Qt(l,wp,d?$=>{let{detail:D}=$;$.stopPropagation(),e.setFocused(!0),(D==null?void 0:D.focusStrategy)==="first"&&(R.current=!0)}:void 0),No(()=>{var $;if(R.current){let D=(($=n.getFirstKey)==null?void 0:$.call(n))??null;if(D==null){let A=ie();ns(l.current),qr(A,null),e.collection.size>0&&(R.current=!1)}else e.setFocusedKey(D),R.current=!1}},[e.collection]),No(()=>{e.collection.size>0&&(R.current=!1)},[e.focusedKey]),Qt(l,Ep,d?$=>{var D;$.stopPropagation(),e.setFocused(!1),(D=$.detail)!=null&&D.clearFocusKey&&e.setFocusedKey(null)}:void 0);const T=s.useRef(r),F=s.useRef(!1);s.useEffect(()=>{var $,D;if(T.current){let A=null;r==="first"&&(A=(($=n.getFirstKey)==null?void 0:$.call(n))??null),r==="last"&&(A=((D=n.getLastKey)==null?void 0:D.call(n))??null);let w=e.selectedKeys;if(w.size){for(let P of w)if(e.canSelectItem(P)){A=P;break}}e.setFocused(!0),e.setFocusedKey(A),A==null&&!d&&l.current&&xe(l.current),e.collection.size>0&&(T.current=!1,F.current=!0)}});let B=s.useRef(e.focusedKey),L=s.useRef(null);s.useEffect(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==B.current||F.current)&&p.current&&l.current){let $=bn(),D=Un(l,e.focusedKey);if(!(D instanceof HTMLElement))return;($==="keyboard"||F.current)&&(L.current&&cancelAnimationFrame(L.current),L.current=requestAnimationFrame(()=>{p.current&&(_n(p.current,D),$!=="virtual"&&it(D,{containingElement:l.current}))}))}!d&&e.isFocused&&e.focusedKey==null&&B.current!=null&&l.current&&xe(l.current),B.current=e.focusedKey,F.current=!1}),s.useEffect(()=>()=>{L.current&&cancelAnimationFrame(L.current)},[]),Qt(l,"react-aria-focus-scope-restore",$=>{$.preventDefault(),e.setFocused(!0)});let M={onKeyDown:g,onFocus:E,onBlur:C,onMouseDown($){p.current===U($)&&$.preventDefault()}},{typeSelectProps:V}=P4({keyboardDelegate:n,selectionManager:e});f||(M=W(V,M));let H;d||(H=e.focusedKey==null?0:-1);let j=S4(e.collection);return{collectionProps:W(M,{tabIndex:H,"data-collection":j})}}class hr{constructor(e){this.ref=e}getItemRect(e){let n=this.ref.current;if(!n)return null;let l=e!=null?Un(this.ref,e):null;if(!l)return null;let r=n.getBoundingClientRect(),o=l.getBoundingClientRect();return{x:o.left-r.left-n.clientLeft+n.scrollLeft,y:o.top-r.top-n.clientTop+n.scrollTop,width:o.width,height:o.height}}getContentSize(){let e=this.ref.current;return{width:(e==null?void 0:e.scrollWidth)??0,height:(e==null?void 0:e.scrollHeight)??0}}getVisibleRect(){let e=this.ref.current;return{x:(e==null?void 0:e.scrollLeft)??0,y:(e==null?void 0:e.scrollTop)??0,width:(e==null?void 0:e.clientWidth)??0,height:(e==null?void 0:e.clientHeight)??0}}}class gl{constructor(...e){if(e.length===1){let n=e[0];this.collection=n.collection,this.ref=n.ref,this.collator=n.collator,this.disabledKeys=n.disabledKeys||new Set,this.disabledBehavior=n.disabledBehavior||"all",this.orientation=n.orientation||"vertical",this.direction=n.direction,this.layout=n.layout||"stack",this.layoutDelegate=n.layoutDelegate||new hr(n.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new hr(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}isDisabled(e){var n,l;return this.disabledBehavior==="all"&&(((n=e.props)==null?void 0:n.isDisabled)||this.disabledKeys.has(e.key))&&((l=e.props)==null?void 0:l.disabledBehavior)!=="selection"}findNextNonDisabled(e,n,l=!1){let r=e;for(;r!=null;){let o=this.collection.getItem(r);if((o==null?void 0:o.type)==="item"&&(l||!this.isDisabled(o)))return r;r=n(r)}return null}getNextKey(e,n){let l=e;return l=this.collection.getKeyAfter(l),this.findNextNonDisabled(l,r=>this.collection.getKeyAfter(r),n==null?void 0:n.includeDisabled)}getPreviousKey(e,n){let l=e;return l=this.collection.getKeyBefore(l),this.findNextNonDisabled(l,r=>this.collection.getKeyBefore(r),n==null?void 0:n.includeDisabled)}findKey(e,n,l){let r=e,o=this.layoutDelegate.getItemRect(r);if(!o||r==null)return null;let i=o;do{if(r=n(r),r==null)break;o=this.layoutDelegate.getItemRect(r)}while(o&&l(i,o)&&r!=null);return r}isSameRow(e,n){return e.y===n.y||e.x!==n.x}isSameColumn(e,n){return e.x===n.x||e.y!==n.y}getKeyBelow(e,n){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,l=>this.getNextKey(l,n),this.isSameRow):this.getNextKey(e,n)}getKeyAbove(e,n){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,l=>this.getPreviousKey(l,n),this.isSameRow):this.getPreviousKey(e,n)}getNextColumn(e,n,l){return n?this.getPreviousKey(e,l):this.getNextKey(e,l)}getKeyRightOf(e,n){let l=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[l]?(e=this.layoutDelegate[l](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[l](r),n==null?void 0:n.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl",n):this.findKey(e,r=>this.getNextColumn(r,this.direction==="rtl",n),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl",n):null}getKeyLeftOf(e,n){let l=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[l]?(e=this.layoutDelegate[l](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[l](r),n==null?void 0:n.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr",n):this.findKey(e,r=>this.getNextColumn(r,this.direction==="ltr",n),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr",n):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyAfter(n))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(e){let n=this.ref.current,l=this.layoutDelegate.getItemRect(e);if(!l)return null;if(n&&!st(n))return this.getFirstKey();let r=e;if(this.orientation==="horizontal"){let o=Math.max(0,l.x+l.width-this.layoutDelegate.getVisibleRect().width);for(;l&&l.x>o&&r!=null;)r=this.getKeyAbove(r),l=r==null?null:this.layoutDelegate.getItemRect(r)}else{let o=Math.max(0,l.y+l.height-this.layoutDelegate.getVisibleRect().height);for(;l&&l.y>o&&r!=null;)r=this.getKeyAbove(r),l=r==null?null:this.layoutDelegate.getItemRect(r)}return r??this.getFirstKey()}getKeyPageBelow(e){let n=this.ref.current,l=this.layoutDelegate.getItemRect(e);if(!l)return null;if(n&&!st(n))return this.getLastKey();let r=e;if(this.orientation==="horizontal"){let o=Math.min(this.layoutDelegate.getContentSize().width,l.x-l.width+this.layoutDelegate.getVisibleRect().width);for(;l&&l.xr[0]o||new gl({collection:n,disabledKeys:l,disabledBehavior:c,ref:r,collator:a,layoutDelegate:i,orientation:u}),[o,i,n,l,r,a,c,u]),{collectionProps:d}=Zr({...t,ref:r,selectionManager:e,keyboardDelegate:f});return{listProps:d}}function Yr(t){let{id:e,selectionManager:n,key:l,ref:r,shouldSelectOnPressUp:o,shouldUseVirtualFocus:i,focus:u,isDisabled:a,onAction:c,allowsDifferentPressOrigin:f,linkBehavior:d="action"}=t,b=Ot();e=$e(e);let p=K=>{if(K.pointerType==="keyboard"&&br(K))n.toggleSelection(l);else{if(n.selectionMode==="none")return;if(n.isLink(l)){if(d==="selection"&&r.current){let _=n.getItemProps(l);b.open(r.current,K,_.href,_.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(d==="override"||d==="none")return}n.selectionMode==="single"?n.isSelected(l)&&!n.disallowEmptySelection?n.toggleSelection(l):n.replaceSelection(l):K&&K.shiftKey?n.extendSelection(l):n.selectionBehavior==="toggle"||K&&(Tt(K)||K.pointerType==="touch"||K.pointerType==="virtual")?n.toggleSelection(l):n.replaceSelection(l)}};s.useEffect(()=>{l===n.focusedKey&&n.isFocused&&(i?ns(r.current):u?u():ie()!==r.current&&r.current&&xe(r.current))},[r,l,n.focusedKey,n.childFocusStrategy,n.isFocused,i]),a=a||n.isDisabled(l);let h={};!i&&!a?h={tabIndex:l===n.focusedKey?0:-1,onFocus(K){U(K)===r.current&&n.setFocusedKey(l)}}:a&&(h.onMouseDown=K=>{K.preventDefault()}),s.useEffect(()=>{a&&n.focusedKey===l&&n.setFocusedKey(null)},[n,a,l]);let y=n.isLink(l)&&d==="override",m=c&&t.UNSTABLE_itemBehavior==="action",g=n.isLink(l)&&d!=="selection"&&d!=="none",v=!a&&n.canSelectItem(l)&&!y&&!m,E=(c||g)&&!a,C=E&&(n.selectionBehavior==="replace"?!v:!v||n.isEmpty),R=E&&v&&n.selectionBehavior==="replace",T=C||R,F=s.useRef(null),B=T&&v,L=s.useRef(!1),M=s.useRef(!1),V=n.getItemProps(l),H=K=>{var _;c&&(c(),(_=r.current)==null||_.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))),g&&r.current&&b.open(r.current,K,V.href,V.routerOptions)},j={ref:r};if(o?(j.onPressStart=K=>{F.current=K.pointerType,L.current=B,K.pointerType==="keyboard"&&(!T||Ti(K.key))&&p(K)},f?(j.onPressUp=C?void 0:K=>{K.pointerType==="mouse"&&v&&p(K)},j.onPress=C?H:K=>{K.pointerType!=="keyboard"&&K.pointerType!=="mouse"&&v&&p(K)}):j.onPress=K=>{if(C||R&&K.pointerType!=="mouse"){if(K.pointerType==="keyboard"&&!Pi(K.key))return;H(K)}else K.pointerType!=="keyboard"&&v&&p(K)}):(j.onPressStart=K=>{F.current=K.pointerType,L.current=B,M.current=C,v&&(K.pointerType==="mouse"&&!C||K.pointerType==="keyboard"&&(!E||Ti(K.key)))&&p(K)},j.onPress=K=>{(K.pointerType==="touch"||K.pointerType==="pen"||K.pointerType==="virtual"||K.pointerType==="keyboard"&&T&&Pi(K.key)||K.pointerType==="mouse"&&M.current)&&(T?H(K):v&&p(K))}),h["data-collection"]=D4(n.collection),h["data-key"]=l,j.preventFocusOnPress=i,i&&(j=W(j,{onPressStart(K){K.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(l))},onPress(K){K.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(l))}})),V)for(let K of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])V[K]&&(j[K]=ft(j[K],V[K]));let{pressProps:$,isPressed:D}=lt(j),A=R?K=>{F.current==="mouse"&&(K.stopPropagation(),K.preventDefault(),H(K))}:void 0,{longPressProps:w}=Os({isDisabled:!B,onLongPress(K){K.pointerType==="touch"&&(p(K),n.setSelectionBehavior("toggle"))}}),P=K=>{F.current==="touch"&&L.current&&K.preventDefault()},k=d!=="none"&&n.isLink(l)?K=>{tt.isOpening||K.preventDefault()}:void 0;return{itemProps:W(h,v||C||i&&!a?$:{},B?w:{},{onDoubleClick:A,onDragStartCapture:P,onClick:k,id:e},i?{onMouseDown:K=>K.preventDefault()}:void 0),isPressed:D,isSelected:n.isSelected(l),isFocused:n.isFocused&&n.focusedKey===l,isDisabled:a,allowsSelection:v,hasAction:T}}function Pi(t){return t==="Enter"}function Ti(t){return t===" "}function Ee(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function At(t){return ln(t,0)}function ln(t,e){if(e<0)return;let n=0;for(let l of t){if(n===e)return l;n++}}function On(t){let e;for(let n of t)e=n;return e}const Ai=new WeakMap;function Hs(t){let e=Ai.get(t);if(e!=null)return e;let n=0,l=r=>{for(let o of r)o.type==="section"?l(Ee(o,t)):o.type==="item"&&n++};return l(t),Ai.set(t,n),n}function B4(t){let e=bl(t),[n,l]=s.useState(null),[r,o]=s.useState([]),i=()=>{o([]),e.close()};return{focusStrategy:n,...e,open(c=null){l(c),e.open()},toggle(c=null){l(c),e.toggle()},close(){i()},expandedKeysStack:r,openSubmenu:(c,f)=>{o(d=>f>d.length?d:[...d.slice(0,f),c])},closeSubmenu:(c,f)=>{o(d=>d[f]===c?d.slice(0,f):d)}}}function nl(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function Xr(t){return K4(t)}function K4(t,e){for(let n of t)return n}function Ws(t){let e;for(let n of t)e=n;return e}function Vl(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let l=[...Bi(t,e),e],r=[...Bi(t,n),n],o=l.slice(0,r.length).findIndex((i,u)=>i!==r[u]);return o!==-1?(e=l[o],n=r[o],e.index-n.index):l.findIndex(i=>i===n)>=0?1:(r.findIndex(i=>i===e)>=0,-1)}function Bi(t,e){let n=[],l=e;for(;(l==null?void 0:l.parentKey)!=null;)l=t.getItem(l.parentKey),l&&n.unshift(l);return n}class He extends Set{constructor(e,n,l){super(e),e instanceof He?(this.anchorKey=n??e.anchorKey,this.currentKey=l??e.currentKey):(this.anchorKey=n??null,this.currentKey=l??null)}}class yl{constructor(e,n,l){this.collection=e,this.state=n,this.allowsCellSelection=(l==null?void 0:l.allowsCellSelection)??!1,this._isSelectAll=null,this.layoutDelegate=(l==null?void 0:l.layoutDelegate)||null,this.fullCollection=(l==null?void 0:l.fullCollection)||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,n){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let n=this.getKey(e);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=e.every(l=>n.has(l)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let n of this.state.selectedKeys){let l=this.collection.getItem(n);(!e||l&&Vl(this.collection,l,e)<0)&&(e=l)}return(e==null?void 0:e.key)??null}get lastSelectedKey(){let e=null;for(let n of this.state.selectedKeys){let l=this.collection.getItem(n);(!e||l&&Vl(this.collection,l,e)>0)&&(e=l)}return(e==null?void 0:e.key)??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let l;if(this.state.selectedKeys==="all")l=new He([n],n,n);else{let r=this.state.selectedKeys,o=r.anchorKey??n;l=new He(r,o,n);for(let i of this.getKeyRange(o,r.currentKey??n))l.delete(i);for(let i of this.getKeyRange(n,o))this.canSelectItem(i)&&l.add(i)}this.state.setSelectedKeys(l)}getKeyRange(e,n){let l=this.collection.getItem(e),r=this.collection.getItem(n);return l&&r?Vl(this.collection,l,r)<=0?this.getKeyRangeInternal(e,n):this.getKeyRangeInternal(n,e):[]}getKeyRangeInternal(e,n){var o;if((o=this.layoutDelegate)!=null&&o.getKeyRange)return this.layoutDelegate.getKeyRange(e,n);let l=[],r=e;for(;r!=null;){let i=this.collection.getItem(r);if(i&&(i.type==="item"||i.type==="cell"&&this.allowsCellSelection)&&l.push(r),r===n)return l;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let n=this.collection.getItem(e);if(!n||n.type==="cell"&&this.allowsCellSelection)return e;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let l=new He(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);l.has(n)?l.delete(n):this.canSelectItem(n)&&(l.add(n),l.anchorKey=n,l.currentKey=n),!(this.disallowEmptySelection&&l.size===0)&&this.state.setSelectedKeys(l)}replaceSelection(e){if(this.selectionMode==="none")return;let n=this.getKey(e);if(n==null)return;let l=this.canSelectItem(n)?new He([n],n,n):new He;this.state.setSelectedKeys(l)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new He;for(let l of e){let r=this.getKey(l);if(r!=null&&(n.add(r),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let e=this.fullCollection??this.collection,n=[],l=r=>{var o;for(;r!=null;){if(this.canSelectItemIn(r,e)){let i=e.getItem(r);(i==null?void 0:i.type)==="item"&&n.push(r),i!=null&&i.hasChildNodes&&(this.allowsCellSelection||i.type!=="item")&&l(((o=Xr(nl(i,e)))==null?void 0:o.key)??null)}r=e.getKeyAfter(r)}};return l(e.getFirstKey()),n}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new He)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(e.size!==n.size)return!1;for(let l of e)if(!n.has(l))return!1;for(let l of n)if(!e.has(l))return!1;return!0}canSelectItem(e){return this.canSelectItemIn(e,this.collection)}canSelectItemIn(e,n){var r;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let l=n.getItem(e);return!(!l||(r=l==null?void 0:l.props)!=null&&r.isDisabled||l.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var l,r;let n=this.collection.getItem(e);return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!((l=n==null?void 0:n.props)!=null&&l.isDisabled))&&((r=n==null?void 0:n.props)==null?void 0:r.disabledBehavior)!=="selection"}isLink(e){var n,l;return!!((l=(n=this.collection.getItem(e))==null?void 0:n.props)!=null&&l.href)}getItemProps(e){var n;return(n=this.collection.getItem(e))==null?void 0:n.props}withCollection(e){return new yl(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}}class R4{build(e,n){return this.context=n,Ki(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:n,items:l}=e;if(x.isValidElement(n)&&n.type===x.Fragment)yield*this.iterateCollection({children:n.props.children,items:l});else if(typeof n=="function"){if(!l)throw new Error("props.children was a function but props.items is missing");let r=0;for(let o of l)yield*this.getFullNode({value:o,index:r},{renderer:n}),r++}else{let r=[];x.Children.forEach(n,i=>{i&&r.push(i)});let o=0;for(let i of r){let u=this.getFullNode({element:i,index:o},{});for(let a of u)o++,yield a}}}getKey(e,n,l,r){if(e.key!=null)return e.key;if(n.type==="cell"&&n.key!=null)return`${r}${n.key}`;let o=n.value;if(o!=null){let i=o.key??o.id;if(i==null)throw new Error("No key found for item");return i}return r?`${r}.${n.index}`:`$.${n.index}`}getChildState(e,n){return{renderer:n.renderer||e.renderer}}*getFullNode(e,n,l,r){if(x.isValidElement(e.element)&&e.element.type===x.Fragment){let a=[];x.Children.forEach(e.element.props.children,f=>{a.push(f)});let c=e.index??0;for(const f of a)yield*this.getFullNode({element:f,index:c++},n,l,r);return}let o=e.element;if(!o&&e.value&&n&&n.renderer){let a=this.cache.get(e.value);if(a&&(!a.shouldInvalidate||!a.shouldInvalidate(this.context))){a.index=e.index,a.parentKey=r?r.key:null,yield a;return}o=n.renderer(e.value)}if(x.isValidElement(o)){let a=o.type;if(typeof a!="function"&&typeof a.getCollectionNode!="function"){let b=o.type;throw new Error(`Unknown element <${b}> in collection.`)}let c=a.getCollectionNode(o.props,this.context),f=e.index??0,d=c.next();for(;!d.done&&d.value;){let b=d.value;e.index=f;let p=b.key??null;p==null&&(p=b.element?null:this.getKey(o,e,n,l));let y=[...this.getFullNode({...b,key:p,index:f,wrapper:M4(e.wrapper,b.wrapper)},this.getChildState(n,b),l?`${l}${o.key}`:o.key,r)];for(let m of y){if(m.value=b.value??e.value??null,m.value&&this.cache.set(m.value,m),e.type&&m.type!==e.type)throw new Error(`Unsupported type <${Ol(m.type)}> in <${Ol((r==null?void 0:r.type)??"unknown parent type")}>. Only <${Ol(e.type)}> is supported.`);f++,yield m}d=c.next(y)}return}if(e.key==null||e.type==null)return;let i=this,u={type:e.type,props:e.props,key:e.key,parentKey:r?r.key:null,value:e.value??null,level:((r==null?void 0:r.level)??0)+((r==null?void 0:r.type)==="item"?1:0),index:e.index,rendered:e.rendered,textValue:e.textValue??"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:Ki(function*(){if(!e.hasChildNodes||!e.childNodes)return;let a=0;for(let c of e.childNodes()){c.key!=null&&(c.key=`${u.key}${c.key}`);let f=i.getFullNode({...c,index:a},i.getChildState(n,c),u.key,u);for(let d of f)a++,yield d}})};yield u}constructor(){this.cache=new WeakMap}}function Ki(t){let e=[],n=null;return{*[Symbol.iterator](){for(let l of e)yield l;n||(n=t());for(let l of n)e.push(l),yield l}}}function M4(t,e){if(t&&e)return n=>t(e(n));if(t)return t;if(e)return e}function Ol(t){return t[0].toUpperCase()+t.slice(1)}function Us(t,e,n){let l=s.useMemo(()=>new R4,[]),{children:r,items:o,collection:i}=t;return s.useMemo(()=>{if(i)return i;let a=l.build({children:r,items:o},n);return e(a)},[l,r,o,i,n,e])}function F4(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function Jr(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:l,selectionBehavior:r="toggle",disabledBehavior:o="all"}=t,i=s.useRef(!1),[,u]=s.useState(!1),a=s.useRef(null),c=s.useRef(null),[,f]=s.useState(null),d=s.useMemo(()=>Ri(t.selectedKeys),[t.selectedKeys]),b=s.useMemo(()=>Ri(t.defaultSelectedKeys,new He),[t.defaultSelectedKeys]),[p,h]=ct(d,b,t.onSelectionChange),y=s.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[m,g]=s.useState(r);r==="replace"&&m==="toggle"&&typeof p=="object"&&p.size===0&&g("replace");let v=s.useRef(r);return s.useEffect(()=>{r!==v.current&&(g(r),v.current=r)},[r]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:m,setSelectionBehavior:g,get isFocused(){return i.current},setFocused(E){i.current=E,u(E)},get focusedKey(){return a.current},get childFocusStrategy(){return c.current},setFocusedKey(E,C="first"){a.current=E,c.current=C,f(E)},selectedKeys:p,setSelectedKeys(E){(l||!F4(E,p))&&h(E)},disabledKeys:y,disabledBehavior:o}}function Ri(t,e){return t?t==="all"?"all":new He(t):e}const I4=s.createContext(null),xo=class xo extends Ge{filter(e,n,l){let r=e.getItem(this.firstChildKey);if(r&&l(r.textValue,this)){let o=this.clone();return n.addDescendants(o,e),o}return null}};xo.type="submenutrigger";let Mi=xo;function L4(t,e){let{role:n="dialog"}=t,l=sn();l=t["aria-label"]?void 0:l;let r=s.useRef(!1);return s.useEffect(()=>{if(e.current&&!xt(e.current)){xe(e.current);let o=setTimeout(()=>{(ie()===e.current||ie()===document.body)&&(r.current=!0,e.current&&(e.current.blur(),xe(e.current)),r.current=!1)},500);return()=>{clearTimeout(o)}}},[e]),Za(),s.useRef(!1),s.useEffect(()=>{}),{dialogProps:{...oe(t,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":t["aria-labelledby"]||l,onBlur:o=>{r.current&&o.stopPropagation()}},titleProps:{id:l}}}const Gs=s.createContext(null),St=s.createContext(null);function z4(t){let e=B4(t),n=s.useRef(null),{triggerProps:l,overlayProps:r}=js({type:"dialog"},e,n);return l.id=$e(),r["aria-labelledby"]=l.id,x.createElement(Me,{values:[[St,e],[I4,e],[Gs,r],[Hr,{trigger:"DialogTrigger",triggerRef:n,"aria-labelledby":r["aria-labelledby"]}]]},x.createElement(Xm,{...l,ref:n,isPressed:e.isOpen},t.children))}const N4=s.forwardRef(function(e,n){let l=e["aria-labelledby"];[e,n]=ve(e,n,Gs);let{dialogProps:r,titleProps:o}=L4({...e,"aria-labelledby":l},n),i=s.useContext(St);!r["aria-label"]&&!r["aria-labelledby"]&&e["aria-labelledby"]&&(r["aria-labelledby"]=e["aria-labelledby"]);let u=ae({defaultClassName:"react-aria-Dialog",className:e.className,style:e.style,children:e.children,values:{close:(i==null?void 0:i.close)||(()=>{})}}),a=oe(e,{global:!0});return x.createElement(ee.section,{...W(a,u,r),render:e.render,ref:n,slot:e.slot||void 0},x.createElement(Me,{values:[[ra,{slots:{[gt]:{},title:{...o,level:2}}}],[En,{slots:{[gt]:{},close:{onPress:()=>i==null?void 0:i.close()}}}]]},u.children))});function V4(t,e,n){let{overlayProps:l,underlayProps:r}=da({...t,isOpen:e.isOpen,onClose:e.close},n);return fa({isDisabled:!e.isOpen}),Za(),s.useEffect(()=>{if(e.isOpen&&n.current)return Vr([n.current],{shouldUseInert:!0})},[e.isOpen,n]),{modalProps:W(l),underlayProps:r}}const O4=s.createContext(null),Qr=s.createContext(null),j4=s.forwardRef(function(e,n){if(s.useContext(Qr))return x.createElement(Fi,{...e,modalRef:n},e.children);let{isDismissable:r,isKeyboardDismissDisabled:o,isOpen:i,defaultOpen:u,onOpenChange:a,children:c,isEntering:f,isExiting:d,UNSTABLE_portalContainer:b,shouldCloseOnInteractOutside:p,...h}=e;return x.createElement(qs,{isDismissable:r,isKeyboardDismissDisabled:o,isOpen:i,defaultOpen:u,onOpenChange:a,isEntering:f,isExiting:d,UNSTABLE_portalContainer:b,shouldCloseOnInteractOutside:p},x.createElement(Fi,{...h,modalRef:n},c))});function _4(t,e){[t,e]=ve(t,e,O4);let n=s.useContext(St),l=bl(t),r=t.isOpen!=null||t.defaultOpen!=null||!n?l:n,o=Te(e),i=s.useRef(null),u=Ul(o,r.isOpen),a=Ul(i,r.isOpen),c=u||a||t.isExiting||!1,f=dt();return!r.isOpen&&!c||f?null:x.createElement(H4,{...t,state:r,isExiting:c,overlayRef:o,modalRef:i})}const qs=s.forwardRef(_4);function H4({UNSTABLE_portalContainer:t,...e}){let n=e.modalRef,{state:l}=e,{modalProps:r,underlayProps:o}=V4(e,l,n),i=Br(e.overlayRef)||e.isEntering||!1,u=ae({...e,defaultClassName:"react-aria-ModalOverlay",values:{isEntering:i,isExiting:e.isExiting,state:l}}),a=ub(),c,f;if(typeof document<"u"){let b=st(document.body)?document.body:document.scrollingElement||document.documentElement,p=b.getBoundingClientRect().width%1,h=b.getBoundingClientRect().height%1;c=b.scrollWidth-p,f=b.scrollHeight-h}let d={...u.style,"--visual-viewport-width":a.width+"px","--visual-viewport-height":a.height+"px","--page-width":c!==void 0?c+"px":void 0,"--page-height":f!==void 0?f+"px":void 0};return x.createElement(sr,{isExiting:e.isExiting,portalContainer:t},x.createElement(ee.div,{...W(oe(e,{global:!0}),o),...u,style:d,ref:e.overlayRef,"data-entering":i||void 0,"data-exiting":e.isExiting||void 0},x.createElement(Me,{values:[[Qr,{modalProps:r,modalRef:n,isExiting:e.isExiting,isDismissable:e.isDismissable}],[St,l]]},u.children)))}function Fi(t){let{modalProps:e,modalRef:n,isExiting:l,isDismissable:r}=s.useContext(Qr),o=s.useContext(St),i=s.useMemo(()=>pt(t.modalRef,n),[t.modalRef,n]),u=Te(i),a=Br(u),c=ae({...t,defaultClassName:"react-aria-Modal",values:{isEntering:a,isExiting:l,state:o}});return x.createElement(ee.div,{...W(oe(t,{global:!0}),e),...c,ref:u,"data-entering":a||void 0,"data-exiting":l||void 0},r&&x.createElement(ar,{onDismiss:o.close}),c.children)}const W4=x.forwardRef(({children:t,...e},n)=>{n=Te(n);let{pressProps:l}=lt({...e,ref:n}),{focusableProps:r}=wt(e,n),o=x.Children.only(t);s.useEffect(()=>{},[n,e.isDisabled]);let i=parseInt(x.version,10)<19?o.ref:o.props.ref;return x.cloneElement(o,{...W(l,r,o.props),ref:pt(i,n)})}),Ii=({children:t,className:e,slot:n,style:l,variant:r,...o})=>{const i=s.useMemo(()=>gh({variant:r}),[r]);return I.jsx(Nr,{"aria-label":"Close",className:ge(e,i),"data-slot":"close-button",slot:n,style:l,...o,children:u=>typeof t=="function"?t(u):t??I.jsx(pm,{"data-slot":"close-button-icon"})})},U4=Object.assign(Ii,{Root:Ii}),je=s.createContext({}),Li=({children:t,...e})=>{const n=s.useMemo(()=>({slots:ul(),placement:void 0}),[]);return I.jsx(je,{value:n,children:I.jsx(z4,{"data-slot":"alert-dialog-root",...e,children:t})})},G4=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(je);return I.jsx(W4,{children:I.jsx("div",{className:fe(l==null?void 0:l.trigger,e),"data-slot":"alert-dialog-trigger",role:"button",...n,children:t})})},q4=({children:t,className:e,isDismissable:n=!1,isKeyboardDismissDisabled:l=!0,onClick:r,variant:o,...i})=>{const{slots:u}=s.useContext(je),a=s.useMemo(()=>ul({variant:o}),[o]),c=s.useMemo(()=>({slots:{...u,...a}}),[u,a]);return I.jsx(qs,{className:ge(e,a==null?void 0:a.backdrop()),"data-slot":"alert-dialog-backdrop",isDismissable:n,isKeyboardDismissDisabled:l,onClick:f=>{f.stopPropagation(),r==null||r(f)},...i,children:f=>I.jsxs(je,{value:c,children:[typeof t=="function"?t(f):t," "]})})},Z4=({children:t,className:e,placement:n="auto",size:l,...r})=>{const{slots:o}=s.useContext(je),i=s.useMemo(()=>ul({size:l}),[l]),u=s.useMemo(()=>({placement:n,slots:{...o,...i}}),[n,o,i]);return I.jsx(j4,{className:ge(e,i==null?void 0:i.container()),"data-placement":n,"data-slot":"alert-dialog-container",...r,children:a=>I.jsx(je,{value:u,children:typeof t=="function"?t(a):t})})},Y4=({children:t,className:e,...n})=>{const{placement:l,slots:r}=s.useContext(je);return I.jsx(N4,{className:fe(r==null?void 0:r.dialog,e),"data-placement":l,"data-slot":"alert-dialog-dialog",role:"alertdialog",...n,children:t})},X4=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(je);return I.jsx("div",{className:fe(l==null?void 0:l.header,e),"data-slot":"alert-dialog-header",...n,children:t})},J4=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(je);return I.jsx(sm,{className:fe(l==null?void 0:l.heading,e),"data-slot":"alert-dialog-heading",slot:"title",...n,children:t})},Q4=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(je);return I.jsx("div",{className:fe(l==null?void 0:l.body,e),"data-slot":"alert-dialog-body",...n,children:t})},eg=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(je);return I.jsx("div",{className:fe(l==null?void 0:l.footer,e),"data-slot":"alert-dialog-footer",...n,children:t})},tg=({children:t,className:e,status:n="danger",...l})=>{const r=s.useMemo(()=>ul({status:n}),[n]),o=()=>{switch(n){case"default":return I.jsx(ni,{"data-slot":"alert-dialog-default-icon"});case"accent":return I.jsx(ni,{"data-slot":"alert-dialog-default-icon"});case"success":return I.jsx(hm,{"data-slot":"alert-dialog-default-icon"});case"warning":return I.jsx(bm,{"data-slot":"alert-dialog-default-icon"});case"danger":return I.jsx(li,{"data-slot":"alert-dialog-default-icon"});default:return I.jsx(li,{"data-slot":"alert-dialog-default-icon"})}};return I.jsx(De.div,{className:r==null?void 0:r.icon({className:e}),"data-slot":"alert-dialog-icon",...l,children:t??o()})},ng=({className:t,...e})=>{const{slots:n}=s.useContext(je);return I.jsx(U4,{className:ge(t,n==null?void 0:n.closeTrigger()),"data-slot":"alert-dialog-close-trigger",slot:"close",...e})},V0=Object.assign(Li,{Root:Li,Trigger:G4,Backdrop:q4,Container:Z4,Dialog:Y4,Header:X4,Heading:J4,Body:Q4,Footer:eg,Icon:tg,CloseTrigger:ng});function lg(t){let e=Pn({usage:"search",...t}),n=s.useCallback((o,i)=>i.length===0?!0:(o=o.normalize("NFC"),i=i.normalize("NFC"),e.compare(o.slice(0,i.length),i)===0),[e]),l=s.useCallback((o,i)=>i.length===0?!0:(o=o.normalize("NFC"),i=i.normalize("NFC"),e.compare(o.slice(-i.length),i)===0),[e]),r=s.useCallback((o,i)=>{if(i.length===0)return!0;o=o.normalize("NFC"),i=i.normalize("NFC");let u=0,a=i.length;for(;u+a<=o.length;u++){let c=o.slice(u,u+a);if(e.compare(i,c)===0)return!0}return!1},[e]);return s.useMemo(()=>({startsWith:n,endsWith:l,contains:r}),[n,l,r])}const eo=s.createContext({}),Zs=s.createContext(null),Ys={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},Xs={...Ys,customError:!0,valid:!1},Xt={isInvalid:!1,validationDetails:Ys,validationErrors:[]},rg=s.createContext({}),zi="__reactAriaFormValidationState";function og(t){if(t[zi]){let{realtimeValidation:e,displayValidation:n,updateValidation:l,resetValidation:r,commitValidation:o}=t[zi];return{realtimeValidation:e,displayValidation:n,updateValidation:l,resetValidation:r,commitValidation:o}}return ig(t)}function ig(t){let{isInvalid:e,validationState:n,name:l,value:r,builtinValidation:o,validate:i,validationBehavior:u="aria"}=t;n&&(e||(e=n==="invalid"));let a=e!==void 0?{isInvalid:e,validationErrors:[],validationDetails:Xs}:null,c=s.useMemo(()=>{if(!i||r==null)return null;let M=ug(i,r);return Ni(M)},[i,r]);o!=null&&o.validationDetails.valid&&(o=void 0);let f=s.useContext(rg),d=s.useMemo(()=>l?Array.isArray(l)?l.flatMap(M=>mr(f[M])):mr(f[l]):[],[f,l]),[b,p]=s.useState(f),[h,y]=s.useState(!1);f!==b&&(p(f),y(!1));let m=s.useMemo(()=>Ni(h?[]:d),[h,d]),g=s.useRef(Xt),[v,E]=s.useState(Xt),C=s.useRef(Xt),R=()=>{if(!T)return;F(!1);let M=c||o||g.current;jl(M,C.current)||(C.current=M,E(M))},[T,F]=s.useState(!1);return s.useEffect(R),{realtimeValidation:a||m||c||o||Xt,displayValidation:u==="native"?a||m||v:a||m||c||o||v,updateValidation(M){u==="aria"&&!jl(v,M)?E(M):g.current=M},resetValidation(){let M=Xt;jl(M,C.current)||(C.current=M,E(M)),u==="native"&&F(!1),y(!0)},commitValidation(){u==="native"&&F(!0),y(!0)}}}function mr(t){return t?Array.isArray(t)?t:[t]:[]}function ug(t,e){if(typeof t=="function"){let n=t(e);if(n&&typeof n!="boolean")return mr(n)}return[]}function Ni(t){return t.length?{isInvalid:!0,validationErrors:t,validationDetails:Xs}:null}function jl(t,e){return t===e?!0:!!t&&!!e&&t.isInvalid===e.isInvalid&&t.validationErrors.length===e.validationErrors.length&&t.validationErrors.every((n,l)=>n===e.validationErrors[l])&&Object.entries(t.validationDetails).every(([n,l])=>e.validationDetails[n]===l)}const to=s.createContext(null);var Js={};Js={colorSwatchPicker:"تغييرات الألوان",dropzoneLabel:"DropZone",selectPlaceholder:"حدد عنصرًا",tableResizer:"أداة تغيير الحجم"};var Qs={};Qs={colorSwatchPicker:"Цветови мостри",dropzoneLabel:"DropZone",selectPlaceholder:"Изберете предмет",tableResizer:"Преоразмерител"};var ec={};ec={colorSwatchPicker:"Vzorky barev",dropzoneLabel:"Místo pro přetažení",selectPlaceholder:"Vyberte položku",tableResizer:"Změna velikosti"};var tc={};tc={colorSwatchPicker:"Farveprøver",dropzoneLabel:"DropZone",selectPlaceholder:"Vælg et element",tableResizer:"Størrelsesændring"};var nc={};nc={colorSwatchPicker:"Farbfelder",dropzoneLabel:"Ablegebereich",selectPlaceholder:"Element wählen",tableResizer:"Größenanpassung"};var lc={};lc={colorSwatchPicker:"Χρωματικά δείγματα",dropzoneLabel:"DropZone",selectPlaceholder:"Επιλέξτε ένα αντικείμενο",tableResizer:"Αλλαγή μεγέθους"};var rc={};rc={selectPlaceholder:"Select an item",tableResizer:"Resizer",dropzoneLabel:"DropZone",colorSwatchPicker:"Color swatches"};var oc={};oc={colorSwatchPicker:"Muestras de colores",dropzoneLabel:"DropZone",selectPlaceholder:"Seleccionar un artículo",tableResizer:"Cambiador de tamaño"};var ic={};ic={colorSwatchPicker:"Värvinäidised",dropzoneLabel:"DropZone",selectPlaceholder:"Valige üksus",tableResizer:"Suuruse muutja"};var uc={};uc={colorSwatchPicker:"Värimallit",dropzoneLabel:"DropZone",selectPlaceholder:"Valitse kohde",tableResizer:"Koon muuttaja"};var ac={};ac={colorSwatchPicker:"Échantillons de couleurs",dropzoneLabel:"DropZone",selectPlaceholder:"Sélectionner un élément",tableResizer:"Redimensionneur"};var sc={};sc={colorSwatchPicker:"דוגמיות צבע",dropzoneLabel:"DropZone",selectPlaceholder:"בחר פריט",tableResizer:"שינוי גודל"};var cc={};cc={colorSwatchPicker:"Uzorci boja",dropzoneLabel:"Zona spuštanja",selectPlaceholder:"Odaberite stavku",tableResizer:"Promjena veličine"};var dc={};dc={colorSwatchPicker:"Színtárak",dropzoneLabel:"DropZone",selectPlaceholder:"Válasszon ki egy elemet",tableResizer:"Átméretező"};var fc={};fc={colorSwatchPicker:"Campioni di colore",dropzoneLabel:"Zona di rilascio",selectPlaceholder:"Seleziona un elemento",tableResizer:"Ridimensionamento"};var pc={};pc={colorSwatchPicker:"カラースウォッチ",dropzoneLabel:"ドロップゾーン",selectPlaceholder:"項目を選択",tableResizer:"サイズ変更ツール"};var bc={};bc={colorSwatchPicker:"색상 견본",dropzoneLabel:"드롭 영역",selectPlaceholder:"항목 선택",tableResizer:"크기 조정기"};var hc={};hc={colorSwatchPicker:"Spalvų pavyzdžiai",dropzoneLabel:"„DropZone“",selectPlaceholder:"Pasirinkite elementą",tableResizer:"Dydžio keitiklis"};var mc={};mc={colorSwatchPicker:"Krāsu paraugi",dropzoneLabel:"DropZone",selectPlaceholder:"Izvēlēties vienumu",tableResizer:"Izmēra mainītājs"};var gc={};gc={colorSwatchPicker:"Fargekart",dropzoneLabel:"Droppsone",selectPlaceholder:"Velg et element",tableResizer:"Størrelsesendrer"};var yc={};yc={colorSwatchPicker:"kleurstalen",dropzoneLabel:"DropZone",selectPlaceholder:"Selecteer een item",tableResizer:"Resizer"};var $c={};$c={colorSwatchPicker:"Próbki kolorów",dropzoneLabel:"Strefa upuszczania",selectPlaceholder:"Wybierz element",tableResizer:"Zmiana rozmiaru"};var vc={};vc={colorSwatchPicker:"Amostras de cores",dropzoneLabel:"DropZone",selectPlaceholder:"Selecione um item",tableResizer:"Redimensionador"};var xc={};xc={colorSwatchPicker:"Amostras de cores",dropzoneLabel:"DropZone",selectPlaceholder:"Selecione um item",tableResizer:"Redimensionador"};var Cc={};Cc={colorSwatchPicker:"Specimene de culoare",dropzoneLabel:"Zonă de plasare",selectPlaceholder:"Selectați un element",tableResizer:"Instrument de redimensionare"};var Ec={};Ec={colorSwatchPicker:"Цветовые образцы",dropzoneLabel:"DropZone",selectPlaceholder:"Выберите элемент",tableResizer:"Средство изменения размера"};var wc={};wc={colorSwatchPicker:"Vzorkovníky farieb",dropzoneLabel:"DropZone",selectPlaceholder:"Vyberte položku",tableResizer:"Nástroj na zmenu veľkosti"};var Sc={};Sc={colorSwatchPicker:"Barvne palete",dropzoneLabel:"DropZone",selectPlaceholder:"Izberite element",tableResizer:"Spreminjanje velikosti"};var Dc={};Dc={colorSwatchPicker:"Uzorci boje",dropzoneLabel:"DropZone",selectPlaceholder:"Izaberite stavku",tableResizer:"Promena veličine"};var kc={};kc={colorSwatchPicker:"Färgrutor",dropzoneLabel:"DropZone",selectPlaceholder:"Välj en artikel",tableResizer:"Storleksändrare"};var Pc={};Pc={colorSwatchPicker:"Renk örnekleri",dropzoneLabel:"Bırakma Bölgesi",selectPlaceholder:"Bir öğe seçin",tableResizer:"Yeniden boyutlandırıcı"};var Tc={};Tc={colorSwatchPicker:"Зразки кольорів",dropzoneLabel:"DropZone",selectPlaceholder:"Виберіть елемент",tableResizer:"Засіб змінення розміру"};var Ac={};Ac={colorSwatchPicker:"颜色色板",dropzoneLabel:"放置区域",selectPlaceholder:"选择一个项目",tableResizer:"尺寸调整器"};var Bc={};Bc={colorSwatchPicker:"色票",dropzoneLabel:"放置區",selectPlaceholder:"選取項目",tableResizer:"大小調整器"};var Kc={};Kc={"ar-AE":Js,"bg-BG":Qs,"cs-CZ":ec,"da-DK":tc,"de-DE":nc,"el-GR":lc,"en-US":rc,"es-ES":oc,"et-EE":ic,"fi-FI":uc,"fr-FR":ac,"he-IL":sc,"hr-HR":cc,"hu-HU":dc,"it-IT":fc,"ja-JP":pc,"ko-KR":bc,"lt-LT":hc,"lv-LV":mc,"nb-NO":gc,"nl-NL":yc,"pl-PL":$c,"pt-BR":vc,"pt-PT":xc,"ro-RO":Cc,"ru-RU":Ec,"sk-SK":wc,"sl-SI":Sc,"sr-SP":Dc,"sv-SE":kc,"tr-TR":Pc,"uk-UA":Tc,"zh-CN":Ac,"zh-TW":Bc};const qe=s.createContext({}),no=s.createContext(null),ag=s.forwardRef(function(e,n){let{render:l}=s.useContext(no);return x.createElement(x.Fragment,null,l(e,n))});function lo(t,e){var o;let n=t==null?void 0:t.renderDropIndicator,l=(o=t==null?void 0:t.isVirtualDragging)==null?void 0:o.call(t),r=s.useCallback(i=>{if(l||e!=null&&e.isDropTarget(i))return n?n(i):x.createElement(ag,{target:i})},[e==null?void 0:e.target,l,n]);return t!=null&&t.useDropIndicator?r:void 0}function Rc(t,e,n){var o,i,u;let l=t.focusedKey,r=null;if((o=e==null?void 0:e.isVirtualDragging)!=null&&o.call(e)&&((i=n==null?void 0:n.target)==null?void 0:i.type)==="item"&&(r=n.target.key,n.target.dropPosition==="after")){let a=n.collection.getKeyAfter(r),c=null;if(a!=null){let f=((u=n.collection.getItem(r))==null?void 0:u.level)??0;for(;a!=null;){let d=n.collection.getItem(a);if(!d)break;if(d.type!=="item"){a=n.collection.getKeyAfter(a);continue}if((d.level??0)<=f)break;c=a,a=n.collection.getKeyAfter(a)}}r=a??c??r}return s.useMemo(()=>new Set([l,r].filter(a=>a!=null)),[l,r])}const $l=new WeakMap;function sg(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}function Mc(t,e){let n=$l.get(t);if(!n)throw new Error("Unknown list");return`${n.id}-option-${sg(e)}`}function cg(t,e,n){let l=oe(t,{labelable:!0}),r=t.selectionBehavior||"toggle",o=t.orientation||"vertical",i=t.linkBehavior||(r==="replace"?"action":"override");r==="toggle"&&i==="action"&&(i="override");let{listProps:u}=A4({...t,ref:n,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,linkBehavior:i}),{focusWithinProps:a}=dl({onFocusWithin:t.onFocus,onBlurWithin:t.onBlur,onFocusWithinChange:t.onFocusChange}),c=$e(t.id);$l.set(e,{id:c,shouldUseVirtualFocus:t.shouldUseVirtualFocus,shouldSelectOnPressUp:t.shouldSelectOnPressUp,shouldFocusOnHover:t.shouldFocusOnHover,isVirtualized:t.isVirtualized,onAction:t.onAction,linkBehavior:i,UNSTABLE_itemBehavior:t.UNSTABLE_itemBehavior});let{labelProps:f,fieldProps:d}=al({...t,id:c,labelElementType:"span"});return{labelProps:f,listBoxProps:W(l,a,e.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},{role:"listbox","aria-orientation":o,...W(d,u)})}}function dg(t,e,n){var L,M;let{key:l}=t,r=$l.get(e),o=t.isDisabled??e.selectionManager.isDisabled(l),i=t.isSelected??e.selectionManager.isSelected(l),u=t.shouldSelectOnPressUp??(r==null?void 0:r.shouldSelectOnPressUp),a=t.shouldFocusOnHover??(r==null?void 0:r.shouldFocusOnHover),c=t.shouldUseVirtualFocus??(r==null?void 0:r.shouldUseVirtualFocus),f=t.isVirtualized??(r==null?void 0:r.isVirtualized),d=sn(),b=sn(),p={role:"option","aria-disabled":o||void 0,"aria-selected":e.selectionManager.selectionMode!=="none"?i:void 0,"aria-label":t["aria-label"],"aria-labelledby":d,"aria-describedby":b},h=e.collection.getItem(l);if(f){let V=Number(h==null?void 0:h.index);p["aria-posinset"]=Number.isNaN(V)?void 0:V+1,p["aria-setsize"]=Hs(e.collection)}let y=r!=null&&r.onAction?()=>{var V;return(V=r==null?void 0:r.onAction)==null?void 0:V.call(r,l)}:void 0,m=Mc(e,l),{itemProps:g,isPressed:v,isFocused:E,hasAction:C,allowsSelection:R}=Yr({selectionManager:e.selectionManager,key:l,ref:n,shouldSelectOnPressUp:u,allowsDifferentPressOrigin:u&&a,isVirtualized:f,shouldUseVirtualFocus:c,isDisabled:o,onAction:y||(L=h==null?void 0:h.props)!=null&&L.onAction?ft((M=h==null?void 0:h.props)==null?void 0:M.onAction,y):void 0,linkBehavior:r==null?void 0:r.linkBehavior,UNSTABLE_itemBehavior:r==null?void 0:r.UNSTABLE_itemBehavior,id:m}),{hoverProps:T}=Fe({isDisabled:o||!a,onHoverStart(){zt()||(e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(l))}}),F=oe(h==null?void 0:h.props);delete F.id;let B=hu(h==null?void 0:h.props);return{optionProps:{...p,...W(F,g,T,B),id:m},labelProps:{id:d},descriptionProps:{id:b},isFocused:E,isFocusVisible:E&&e.selectionManager.isFocused&&zt(),isSelected:i,isDisabled:o,isPressed:v,allowsSelection:R,hasAction:C}}function fg(t){let{heading:e,"aria-label":n}=t,l=$e();return{itemProps:{role:"presentation"},headingProps:e?{id:l,role:"presentation",onMouseDown:r=>{r.preventDefault()}}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":e?l:void 0}}}class gr{constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let n=i=>{if(this.keyMap.set(i.key,i),i.childNodes&&i.type==="section")for(let u of i.childNodes)n(u)};for(let i of e)n(i);let l=null,r=0,o=0;for(let[i,u]of this.keyMap)l?(l.nextKey=i,u.prevKey=l.key):(this.firstKey=i,u.prevKey=void 0),u.type==="item"&&(u.index=r++),(u.type==="section"||u.type==="item")&&o++,l=u,l.nextKey=void 0;this._size=o,this.lastKey=(l==null?void 0:l.key)??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);return n?n.prevKey??null:null}getKeyAfter(e){let n=this.keyMap.get(e);return n?n.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}getChildren(e){let n=this.keyMap.get(e);return(n==null?void 0:n.childNodes)||[]}}function Fc(t){let{filter:e,layoutDelegate:n}=t,l=Jr(t),r=s.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),o=s.useCallback(c=>e?new gr(e(c)):new gr(c),[e]),i=s.useMemo(()=>({suppressTextValueWarning:t.suppressTextValueWarning}),[t.suppressTextValueWarning]),u=Us(t,o,i),a=s.useMemo(()=>new yl(u,l,{layoutDelegate:n}),[u,l,n]);return Ic(u,a),{collection:u,disabledKeys:r,selectionManager:a}}function pg(t,e){let n=s.useMemo(()=>e?t.collection.filter(e):t.collection,[t.collection,e]),l=t.selectionManager.withCollection(n);return Ic(n,l),{collection:n,selectionManager:l,disabledKeys:t.disabledKeys}}function Ic(t,e){const n=s.useRef(null);s.useEffect(()=>{if(e.focusedKey!=null&&!t.getItem(e.focusedKey)&&n.current){let l=n.current.getKeyAfter(e.focusedKey),r=null;for(;l!=null;){let o=t.getItem(l);if(o&&o.type==="item"&&!e.isDisabled(l)){r=l;break}l=n.current.getKeyAfter(l)}if(r==null)for(l=n.current.getKeyBefore(e.focusedKey);l!=null;){let o=t.getItem(l);if(o&&o.type==="item"&&!e.isDisabled(l)){r=l;break}l=n.current.getKeyBefore(l)}e.setFocusedKey(r)}n.current=t},[t,e])}const vl=s.createContext(null),Wt=s.createContext(null),bg=s.forwardRef(function(e,n){[e,n]=ve(e,n,vl);let l=s.useContext(Wt);return l?x.createElement(Lc,{state:l,props:e,listBoxRef:n}):x.createElement(Ur,{content:x.createElement(Dn,e)},r=>x.createElement(hg,{props:e,listBoxRef:n,collection:r}))});function hg({props:t,listBoxRef:e,collection:n}){t={...t,collection:n,children:null,items:null};let{layoutDelegate:l}=s.useContext(pe),r=Fc({...t,layoutDelegate:l});return x.createElement(Lc,{state:r,props:t,listBoxRef:e})}function Lc({state:t,props:e,listBoxRef:n}){[e,n]=ve(e,n,pr);let{dragAndDropHooks:l,layout:r="stack",orientation:o="vertical",filter:i}=e,u=pg(t,i),{collection:a,selectionManager:c}=u,f=!!(l!=null&&l.useDraggableCollectionState),d=!!(l!=null&&l.useDroppableCollectionState),{direction:b}=Pe(),{disabledBehavior:p,disabledKeys:h}=c,y=Pn({usage:"search",sensitivity:"base"}),{isVirtualized:m,layoutDelegate:g,dropTargetDelegate:v,CollectionRoot:E}=s.useContext(pe),C=s.useMemo(()=>e.keyboardDelegate||new gl({collection:a,collator:y,ref:n,disabledKeys:h,disabledBehavior:p,layout:r,orientation:o,direction:b,layoutDelegate:g}),[a,y,n,p,h,o,b,e.keyboardDelegate,r,g]),{listBoxProps:R}=cg({...e,shouldSelectOnPressUp:f||e.shouldSelectOnPressUp,keyboardDelegate:C,isVirtualized:m},u,n);s.useRef(f),s.useRef(d),s.useEffect(()=>{},[f,d]);let T,F,B,L=!1,M=null,V=s.useRef(null);if(f&&l){T=l.useDraggableCollectionState({collection:a,selectionManager:c,preview:l.renderDragPreview?V:void 0}),l.useDraggableCollection({},T,n);let K=l.DragPreview;M=l.renderDragPreview?x.createElement(K,{ref:V},l.renderDragPreview):null}if(d&&l){F=l.useDroppableCollectionState({collection:a,selectionManager:c});let K=l.dropTargetDelegate||v||new l.ListDropTargetDelegate(a,n,{orientation:o,layout:r,direction:b});B=l.useDroppableCollection({keyboardDelegate:C,dropTargetDelegate:K},F,n),L=F.isDropTarget({type:"root"})}let{focusProps:H,isFocused:j,isFocusVisible:$}=Ve(),D=u.collection.size===0,A={isDropTarget:L,isEmpty:D,isFocused:j,isFocusVisible:$,layout:e.layout||"stack",orientation:o,state:u},w=ae({...e,children:void 0,defaultClassName:"react-aria-ListBox",values:A}),P=null;D&&e.renderEmptyState&&(P=x.createElement("div",{role:"option",style:{display:"contents"}},e.renderEmptyState(A)));let k=oe(e,{global:!0});return x.createElement(Or,null,x.createElement(ee.div,{...W(k,w,R,H,B==null?void 0:B.collectionProps),ref:n,slot:e.slot||void 0,onScroll:e.onScroll,"data-drop-target":L||void 0,"data-empty":D||void 0,"data-focused":j||void 0,"data-focus-visible":$||void 0,"data-layout":e.layout||"stack","data-orientation":o},x.createElement(Me,{values:[[vl,e],[Wt,u],[qe,{dragAndDropHooks:l,dragState:T,dropState:F}],[v4,{elementType:"div"}],[no,{render:yg}],[b4,{name:"ListBoxSection",render:zc}]]},x.createElement(rs,null,x.createElement(E,{collection:a,scrollRef:n,persistedKeys:Rc(c,l,F),renderDropIndicator:lo(l,F)}))),P,M))}function zc(t,e,n,l="react-aria-ListBoxSection"){let r=s.useContext(Wt),{dragAndDropHooks:o,dropState:i}=s.useContext(qe),{CollectionBranch:u}=s.useContext(pe),[a,c]=xn(),{headingProps:f,groupProps:d}=fg({heading:c,"aria-label":t["aria-label"]??void 0}),b=ae({...t,id:void 0,children:void 0,defaultClassName:l,values:void 0}),p=oe(t,{global:!0});return delete p.id,x.createElement(ee.section,{...W(p,b,d),ref:e},x.createElement(y4.Provider,{value:{...f,ref:a}},x.createElement(u,{collection:r.collection,parent:n,renderDropIndicator:lo(o,i)})))}const mg=ml(dr,zc),gg=Sn(cr,function(e,n,l){let r=Te(n),o=s.useContext(Wt),{dragAndDropHooks:i,dragState:u,dropState:a}=s.useContext(qe),c=u&&!(u.isDisabled||u.selectionManager.isDisabled(l.key)),{optionProps:f,labelProps:d,descriptionProps:b,...p}=dg({key:l.key,"aria-label":e==null?void 0:e["aria-label"]},o,r),{hoverProps:h,isHovered:y}=Fe({isDisabled:!p.allowsSelection&&!p.hasAction&&!c,onHoverStart:l.props.onHoverStart,onHoverChange:l.props.onHoverChange,onHoverEnd:l.props.onHoverEnd}),{keyboardProps:m}=cl(e),{focusProps:g}=Lr(e),v=null;u&&i&&(v=i.useDraggableItem({key:l.key,hasAction:p.hasAction},u));let E=null;a&&i&&(E=i.useDroppableItem({target:{type:"item",key:l.key,dropPosition:"on"}},a,r));let C=u&&u.isDragging(l.key),R=ae({...e,id:void 0,children:e.children,defaultClassName:"react-aria-ListBoxItem",values:{...p,isHovered:y,selectionMode:o.selectionManager.selectionMode,selectionBehavior:o.selectionManager.selectionBehavior,allowsDragging:!!u,isDragging:C,isDropTarget:E==null?void 0:E.isDropTarget}});s.useEffect(()=>{l.textValue},[l.textValue]);let T=e.href?ee.a:ee.div,F=oe(e,{global:!0});return delete F.id,delete F.onClick,e.href&&f.tabIndex==null&&(f.tabIndex=-1),x.createElement(T,{...W(F,R,f,h,m,g,v==null?void 0:v.dragProps,E==null?void 0:E.dropProps),ref:r,"data-allows-dragging":!!u||void 0,"data-selected":p.isSelected||void 0,"data-disabled":p.isDisabled||void 0,"data-hovered":y||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":p.isFocusVisible||void 0,"data-pressed":p.isPressed||void 0,"data-dragging":C||void 0,"data-drop-target":(E==null?void 0:E.isDropTarget)||void 0,"data-selection-mode":o.selectionManager.selectionMode==="none"?void 0:o.selectionManager.selectionMode},x.createElement(Me,{values:[[kn,{slots:{[gt]:d,label:d,description:b}}],[os,{isSelected:p.isSelected}]]},R.children))});function yg(t,e){e=Te(e);let{dragAndDropHooks:n,dropState:l}=s.useContext(qe),{dropIndicatorProps:r,isHidden:o,isDropTarget:i}=n.useDropIndicator(t,l,e);return o?null:x.createElement(vg,{...t,dropIndicatorProps:r,isDropTarget:i,ref:e})}function $g(t,e){let{dropIndicatorProps:n,isDropTarget:l,...r}=t,o=ae({...r,defaultClassName:"react-aria-DropIndicator",values:{isDropTarget:l}});return x.createElement(x.Fragment,null,x.createElement(ee.div,{...n,...o,role:"option",ref:e,"data-drop-target":l||void 0}))}const vg=s.forwardRef($g);Sn(tl,function(e,n,l){let r=s.useContext(Wt),{isLoading:o,onLoadMore:i,scrollOffset:u,...a}=e,c=s.useRef(null),f=s.useMemo(()=>({onLoadMore:i,collection:r==null?void 0:r.collection,sentinelRef:c,scrollOffset:u}),[i,u,r==null?void 0:r.collection]);Cu(f,c);let d=ae({...a,id:void 0,children:l.rendered,defaultClassName:"react-aria-ListBoxLoadingIndicator",values:void 0}),b={tabIndex:-1};return x.createElement(x.Fragment,null,x.createElement("div",{style:{position:"relative",width:0,height:0},inert:Eu(!0)},x.createElement("div",{"data-testid":"loadMoreSentinel",ref:c,style:{position:"absolute",height:1,width:1}})),o&&d.children&&x.createElement(x.Fragment,null,x.createElement(ee.div,{...W(oe(e,{global:!0}),b),...d,role:"option",ref:n},d.children)))});function xg(t){let{description:e,errorMessage:n,isInvalid:l,validationState:r}=t,{labelProps:o,fieldProps:i}=al(t),u=sn([!!e,!!n,l,r]),a=sn([!!e,!!n,l,r]);return i=W(i,{"aria-describedby":[u,a,t["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:o,fieldProps:i,descriptionProps:{id:u},errorMessageProps:{id:a}}}function Nc(t,e,n){let{validationBehavior:l,focus:r}=t;le(()=>{if(l==="native"&&(n!=null&&n.current)&&!n.current.disabled){let c=e.realtimeValidation.isInvalid?e.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(c),n.current.hasAttribute("title")||(n.current.title=""),e.realtimeValidation.isInvalid||e.updateValidation(Eg(n.current))}});let o=s.useRef(!1),i=we(()=>{o.current||e.resetValidation()}),u=we(c=>{var d,b;e.displayValidation.isInvalid||e.commitValidation();let f=(d=n==null?void 0:n.current)==null?void 0:d.form;!c.defaultPrevented&&n&&f&&wg(f)===n.current&&(r?r():(b=n.current)==null||b.focus(),ea("keyboard")),c.preventDefault()}),a=we(()=>{e.commitValidation()});s.useEffect(()=>{let c=n==null?void 0:n.current;if(!c)return;let f=c.form,d=f==null?void 0:f.reset;return f&&(f.reset=()=>{o.current=!window.event||window.event.type==="message"&&U(window.event)instanceof MessagePort,d==null||d.call(f),o.current=!1}),c.addEventListener("invalid",u),c.addEventListener("change",a),f==null||f.addEventListener("reset",i),()=>{c.removeEventListener("invalid",u),c.removeEventListener("change",a),f==null||f.removeEventListener("reset",i),f&&(f.reset=d)}},[n,l])}function Cg(t){let e=t.validity;return{badInput:e.badInput,customError:e.customError,patternMismatch:e.patternMismatch,rangeOverflow:e.rangeOverflow,rangeUnderflow:e.rangeUnderflow,stepMismatch:e.stepMismatch,tooLong:e.tooLong,tooShort:e.tooShort,typeMismatch:e.typeMismatch,valueMissing:e.valueMissing,valid:e.valid}}function Eg(t){return{isInvalid:!t.validity.valid,validationDetails:Cg(t),validationErrors:t.validationMessage?[t.validationMessage]:[]}}function wg(t){var e;for(let n=0;n{var v;(v=d.onClick)==null||v.call(d,g),Fp(g,y,t.href,t.routerOptions)}})}}const Dg=s.createContext(null),kg=s.forwardRef(function(e,n){[e,n]=ve(e,n,Dg);let l=e.href&&!e.isDisabled?"a":"span",{linkProps:r,isPressed:o}=Sg({...e,elementType:l},n),i=ee[l],{hoverProps:u,isHovered:a}=Fe(e),{focusProps:c,isFocused:f,isFocusVisible:d}=Ve(),b=ae({...e,defaultClassName:"react-aria-Link",values:{isCurrent:!!e["aria-current"],isDisabled:e.isDisabled||!1,isPressed:o,isHovered:a,isFocused:f,isFocusVisible:d}}),p=oe(e,{global:!0});return delete p.onClick,x.createElement(i,{ref:n,slot:e.slot||void 0,...W(p,b,r,u,c),"data-focused":f||void 0,"data-hovered":a||void 0,"data-pressed":o||void 0,"data-focus-visible":d||void 0,"data-current":!!e["aria-current"]||void 0,"data-disabled":e.isDisabled||void 0},b.children)}),Vc=s.createContext({}),Vi=({children:t,className:e,...n})=>{const l=x.useMemo(()=>Ch(),[]);return I.jsx(Vc,{value:{slots:l},children:I.jsx(kg,{...n,className:ge(e,l==null?void 0:l.base()),children:r=>I.jsx(I.Fragment,{children:typeof t=="function"?t(r):t})})})},Pg=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(Vc);return I.jsx(De.span,{className:fe(l==null?void 0:l.icon,e),"data-default-icon":oa(!t),"data-slot":"link-icon",...n,children:t??I.jsx(fm,{"data-slot":"link-default-icon"})})},O0=Object.assign(Vi,{Root:Vi,Icon:Pg});function Tg(t={}){let{isReadOnly:e}=t,[n,l]=ct(t.isSelected,t.defaultSelected||!1,t.onChange),[r]=s.useState(n);function o(u){e||l(u)}function i(){e||l(!n)}return{isSelected:n,defaultSelected:t.defaultSelected??r,setSelected:o,toggle:i}}const Ag=s.createContext({}),Bg="__button_group_child",Oi=({children:t,className:e,fullWidth:n,isDisabled:l,isIconOnly:r,size:o,slot:i,style:u,variant:a,[Bg]:c,...f})=>{const d=s.useContext(Ag),b=c===!0,p=o??(b?d==null?void 0:d.size:void 0),h=a??(b?d==null?void 0:d.variant:void 0),y=l??(b?d==null?void 0:d.isDisabled:void 0),m=n??(b?d==null?void 0:d.fullWidth:void 0),g=bh({fullWidth:m,isIconOnly:r,size:p,variant:h});return I.jsx(Nr,{className:ge(e,g),"data-slot":"button",isDisabled:y,slot:i,style:u,...f,children:v=>typeof t=="function"?t(v):t})},j0=Object.assign(Oi,{Root:Oi}),Ut=s.createContext({}),ji=({children:t,className:e,variant:n="default",...l})=>{const r=x.useMemo(()=>hh({variant:n}),[n]),o=I.jsx(De.div,{className:r.base({className:e}),"data-slot":"card",...l,children:t});return I.jsx(Ut,{value:{slots:r},children:n==="transparent"?o:I.jsx(ia,{value:{variant:n},children:o})})},Kg=({className:t,...e})=>{const{slots:n}=s.useContext(Ut);return I.jsx(De.div,{className:fe(n==null?void 0:n.header,t),"data-slot":"card-header",...e})},Rg=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(Ut);return I.jsx(De.h3,{className:fe(l==null?void 0:l.title,e),"data-slot":"card-title",...n,children:t})},Mg=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(Ut);return I.jsx(De.p,{className:fe(l==null?void 0:l.description,e),"data-slot":"card-description",...n,children:t})},Fg=({className:t,...e})=>{const{slots:n}=s.useContext(Ut);return I.jsx(De.div,{className:fe(n==null?void 0:n.content,t),"data-slot":"card-content",...e})},Ig=({className:t,...e})=>{const{slots:n}=s.useContext(Ut);return I.jsx(De.div,{className:fe(n==null?void 0:n.footer,t),"data-slot":"card-footer",...e})},_0=Object.assign(ji,{Root:ji,Header:Kg,Title:Rg,Description:Mg,Content:Fg,Footer:Ig}),Lg=new WeakMap;function zg(t=!0){let[e,n]=s.useState(t),l=s.useRef(!1),r=s.useCallback(o=>{l.current=!0,n(!!o)},[]);return le(()=>{l.current||n(!1)},[]),[r,e]}function _i(t=!0){let e=$e(),[n,l]=zg(t);return{id:l?e:void 0,ref:n}}const Oc={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},jc={...Oc,customError:!0,valid:!1},Bt={isInvalid:!1,validationDetails:Oc,validationErrors:[]},Ng=s.createContext({}),yn="__reactAriaFormValidationState";function ro(t){if(t[yn]){let{realtimeValidation:e,displayValidation:n,updateValidation:l,resetValidation:r,commitValidation:o}=t[yn];return{realtimeValidation:e,displayValidation:n,updateValidation:l,resetValidation:r,commitValidation:o}}return Vg(t)}function Vg(t){let{isInvalid:e,validationState:n,name:l,value:r,builtinValidation:o,validate:i,validationBehavior:u="aria"}=t;n&&(e||(e=n==="invalid"));let a=e!==void 0?{isInvalid:e,validationErrors:[],validationDetails:jc}:null,c=s.useMemo(()=>{if(!i||r==null)return null;let M=Og(i,r);return Hi(M)},[i,r]);o!=null&&o.validationDetails.valid&&(o=void 0);let f=s.useContext(Ng),d=s.useMemo(()=>l?Array.isArray(l)?l.flatMap(M=>yr(f[M])):yr(f[l]):[],[f,l]),[b,p]=s.useState(f),[h,y]=s.useState(!1);f!==b&&(p(f),y(!1));let m=s.useMemo(()=>Hi(h?[]:d),[h,d]),g=s.useRef(Bt),[v,E]=s.useState(Bt),C=s.useRef(Bt),R=()=>{if(!T)return;F(!1);let M=c||o||g.current;_l(M,C.current)||(C.current=M,E(M))},[T,F]=s.useState(!1);return s.useEffect(R),{realtimeValidation:a||m||c||o||Bt,displayValidation:u==="native"?a||m||v:a||m||c||o||v,updateValidation(M){u==="aria"&&!_l(v,M)?E(M):g.current=M},resetValidation(){let M=Bt;_l(M,C.current)||(C.current=M,E(M)),u==="native"&&F(!1),y(!0)},commitValidation(){u==="native"&&F(!0),y(!0)}}}function yr(t){return t?Array.isArray(t)?t:[t]:[]}function Og(t,e){if(typeof t=="function"){let n=t(e);if(n&&typeof n!="boolean")return yr(n)}return[]}function Hi(t){return t.length?{isInvalid:!0,validationErrors:t,validationDetails:jc}:null}function _l(t,e){return t===e?!0:!!t&&!!e&&t.isInvalid===e.isInvalid&&t.validationErrors.length===e.validationErrors.length&&t.validationErrors.every((n,l)=>n===e.validationErrors[l])&&Object.entries(t.validationDetails).every(([n,l])=>e.validationDetails[n]===l)}function jg(t,e,n){let{isDisabled:l=!1,isReadOnly:r=!1,value:o,name:i,form:u,children:a,isRequired:c,validationBehavior:f="aria","aria-label":d,"aria-labelledby":b,"aria-describedby":p,onPressStart:h,onPressEnd:y,onPressChange:m,onPress:g,onPressUp:v,onClick:E}=t,C=ro({...t,value:e.isSelected}),{isInvalid:R,validationErrors:T,validationDetails:F}=C.displayValidation;Nc(t,C,n);let B=k=>{k.stopPropagation(),e.setSelected(U(k).checked)},{pressProps:L,isPressed:M}=lt({onPressStart:h,onPressEnd:y,onPressChange:m,onPress:g,onPressUp:v,onClick:E,isDisabled:l}),[V,H]=s.useState(!1),{pressProps:j}=lt({onPressStart(k){if(k.pointerType==="keyboard"||k.pointerType==="virtual"){k.continuePropagation();return}h==null||h(k),m==null||m(!0),H(!0)},onPressEnd(k){if(k.pointerType==="keyboard"||k.pointerType==="virtual"){k.continuePropagation();return}y==null||y(k),m==null||m(!1),H(!1)},onPressUp(k){if(k.pointerType==="keyboard"||k.pointerType==="virtual"){k.continuePropagation();return}v==null||v(k)},onClick:E,onPress(k){var Z;if(k.pointerType==="keyboard"||k.pointerType==="virtual"){k.continuePropagation();return}g==null||g(k),e.toggle(),(Z=n.current)==null||Z.focus();let{[yn]:K}=t,{commitValidation:_}=K||C;_()},isDisabled:l||r}),{focusableProps:$}=wt(t,n),D=W(L,$),A=oe(t,{labelable:!0});il(n,e.defaultSelected,e.setSelected);let w=_i(),P=_i();return{labelProps:W(j,{onClick:k=>k.preventDefault()}),inputProps:W(A,{checked:e.isSelected,"aria-required":c&&f==="aria"||void 0,required:c&&f==="native","aria-invalid":R||t.validationState==="invalid"||void 0,"aria-errormessage":t["aria-errormessage"],"aria-controls":t["aria-controls"],"aria-readonly":r||void 0,"aria-describedby":[w.id,P.id,p].filter(Boolean).join(" ")||void 0,onChange:B,disabled:l,...o==null?{}:{value:o},name:i,form:u,type:"checkbox",...D}),descriptionProps:w,errorMessageProps:P,isSelected:e.isSelected,isPressed:M||V,isDisabled:l,isReadOnly:r,isInvalid:R||t.validationState==="invalid",validationErrors:T,validationDetails:F}}function _c(t,e,n){let{labelProps:l,inputProps:r,descriptionProps:o,errorMessageProps:i,isSelected:u,isPressed:a,isDisabled:c,isReadOnly:f,isInvalid:d,validationErrors:b,validationDetails:p}=jg(t,e,n),{isIndeterminate:h}=t;return s.useEffect(()=>{n.current&&(n.current.indeterminate=!!h)}),{labelProps:W(l,s.useMemo(()=>({onMouseDown:y=>y.preventDefault()}),[])),inputProps:r,descriptionProps:o,errorMessageProps:i,isSelected:u,isPressed:a,isDisabled:c,isReadOnly:f,isInvalid:d,validationErrors:b,validationDetails:p}}const _g=typeof document<"u"?x.useInsertionEffect??x.useLayoutEffect:()=>{};function Hc(t,e,n){let[l,r]=s.useState(t||e),o=s.useRef(l),i=s.useRef(t!==void 0),u=t!==void 0;s.useEffect(()=>{i.current,i.current=u},[u]);let a=u?t:l;_g(()=>{o.current=a});let[,c]=s.useReducer(()=>({}),{}),f=s.useCallback((d,...b)=>{let p=typeof d=="function"?d(o.current):d;Object.is(o.current,p)||(o.current=p,r(p),c(),n==null||n(p,...b))},[n]);return[a,f]}function Hg(t={}){let{isReadOnly:e}=t,[n,l]=Hc(t.isSelected,t.defaultSelected||!1,t.onChange),[r]=s.useState(n);function o(u){e||l(u)}function i(){e||l(!n)}return{isSelected:n,defaultSelected:t.defaultSelected??r,setSelected:o,toggle:i}}function Wg(t,e,n){const l=Hg({isReadOnly:t.isReadOnly||e.isReadOnly,isSelected:e.isSelected(t.value),defaultSelected:e.defaultValue.includes(t.value),onChange(y){y?e.addValue(t.value):e.removeValue(t.value),t.onChange&&t.onChange(y)}});let{name:r,form:o,descriptionId:i,errorMessageId:u,validationBehavior:a}=Lg.get(e);a=t.validationBehavior??a;let{realtimeValidation:c}=ro({...t,value:l.isSelected,name:void 0,validationBehavior:"aria"}),f=s.useRef(Bt),d=()=>{e.setInvalid(t.value,c.isInvalid?c:f.current)};s.useEffect(d);let b=e.realtimeValidation.isInvalid?e.realtimeValidation:c,p=a==="native"?e.displayValidation:b,h=_c({...t,isReadOnly:t.isReadOnly||e.isReadOnly,isDisabled:t.isDisabled||e.isDisabled,name:t.name||r,form:t.form||o,isRequired:t.isRequired??e.isRequired,validationBehavior:a,[yn]:{realtimeValidation:b,displayValidation:p,resetValidation:e.resetValidation,commitValidation:e.commitValidation,updateValidation(y){f.current=y,d()}}},l,n);return{...h,inputProps:{...h.inputProps,"aria-describedby":[h.inputProps["aria-describedby"],e.isInvalid?u:null,i].filter(Boolean).join(" ")||void 0}}}const oo=s.createContext(null),Wc=s.createContext(null),Ug=s.createContext(null),Uc=s.createContext(null);function Gg(t,e){let{validationBehavior:n}=vn(to)||{},l=t.validationBehavior??n??"native",r=s.useContext(Ug),o=Te(s.useMemo(()=>pt(e,t.inputRef!==void 0?t.inputRef:null),[e,t.inputRef])),i={...Fr(t),children:typeof t.children=="function"?!0:t.children,value:t.value,validationBehavior:l};return[r?Wg(i,r,o):_c(i,Tg(t),o),o]}const H0=s.forwardRef(function(e,n){let{inputRef:l=null,...r}=e;[e,n]=ve(r,n,oo);let[o,i]=Gg(e,l);return x.createElement(Uc.Provider,{value:{...o,inputRef:i,defaultClassName:"react-aria-Checkbox",isIndeterminate:e.isIndeterminate,isRequired:e.isRequired}},x.createElement(qg,{...e,ref:n}))}),qg=s.forwardRef(function(e,n){let{labelProps:l,inputProps:r,isSelected:o,isDisabled:i,isReadOnly:u,isPressed:a,isInvalid:c,inputRef:f,defaultClassName:d,isIndeterminate:b,isRequired:p}=s.useContext(Uc),{isFocused:h,isFocusVisible:y,focusProps:m}=Ve(),g=i||u,{hoverProps:v,isHovered:E}=Fe({...e,isDisabled:g}),C=ae({...e,defaultClassName:d,values:{isSelected:o,isIndeterminate:b||!1,isPressed:a,isHovered:E,isFocused:h,isFocusVisible:y,isDisabled:i,isReadOnly:u,isInvalid:c,isRequired:p||!1}}),R=oe(e,{global:!0});return delete R.id,delete R.onClick,x.createElement(ee.label,{...W(R,l,v,C),ref:n,slot:e.slot||void 0,"data-selected":o||void 0,"data-indeterminate":b||void 0,"data-pressed":a||void 0,"data-hovered":E||void 0,"data-focused":h||void 0,"data-focus-visible":y||void 0,"data-disabled":i||void 0,"data-readonly":u||void 0,"data-invalid":c||void 0,"data-required":p||void 0},x.createElement(_r,{elementType:"span"},x.createElement("input",{...W(r,m),ref:f})),C.children)}),Gc=s.createContext({}),Wi=({children:t,className:e,color:n,size:l,variant:r,...o})=>{const i=x.useMemo(()=>mh({color:n,size:l,variant:r}),[n,l,r]),u=x.useMemo(()=>typeof t=="string"||typeof t=="number"?I.jsx(qc,{children:t}):t,[t]);return I.jsx(Gc,{value:{slots:i},children:I.jsx(De.span,{...o,className:fe(i.base,e),"data-slot":"chip",children:u})})},qc=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(Gc);return I.jsx(De.span,{className:fe(l==null?void 0:l.label,e),"data-slot":"chip-label",...n,children:t})},W0=Object.assign(Wi,{Root:Wi,Label:qc});function io(t){let{onMoveStart:e,onMove:n,onMoveEnd:l}=t,r=s.useRef({didMove:!1,lastPosition:null,id:null}),{addGlobalListener:o,removeGlobalListener:i}=Et(),u=s.useCallback((b,p,h,y)=>{h===0&&y===0||(r.current.didMove||(r.current.didMove=!0,e==null||e({type:"movestart",pointerType:p,shiftKey:b.shiftKey,metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey})),n==null||n({type:"move",pointerType:p,deltaX:h,deltaY:y,shiftKey:b.shiftKey,metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey}))},[e,n,r]),a=we(u),c=s.useCallback((b,p)=>{nr(),r.current.didMove&&(l==null||l({type:"moveend",pointerType:p,shiftKey:b.shiftKey,metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey}))},[l,r]),f=we(c);return{moveProps:s.useMemo(()=>{let b={},p=()=>{na(),r.current.didMove=!1};{let y=g=>{var v,E;if(g.pointerId===r.current.id){let C=g.pointerType||"mouse";a(g,C,g.pageX-(((v=r.current.lastPosition)==null?void 0:v.pageX)??0),g.pageY-(((E=r.current.lastPosition)==null?void 0:E.pageY)??0)),r.current.lastPosition={pageX:g.pageX,pageY:g.pageY}}},m=g=>{if(g.pointerId===r.current.id){let v=g.pointerType||"mouse";f(g,v),r.current.id=null;let E=Se(U(g));i(E,"pointermove",y,!1),i(E,"pointerup",m,!1),i(E,"pointercancel",m,!1)}};b.onPointerDown=g=>{if(g.button===0&&r.current.id==null){p(),g.stopPropagation(),g.preventDefault(),r.current.lastPosition={pageX:g.pageX,pageY:g.pageY},r.current.id=g.pointerId;let v=Se(U(g));o(v,"pointermove",y,!1),o(v,"pointerup",m,!1),o(v,"pointercancel",m,!1)}}}let h=(y,m,g)=>{p(),a(y,"keyboard",m,g),f(y,"keyboard")};return b.onKeyDown=y=>{switch(y.key){case"Left":case"ArrowLeft":y.preventDefault(),y.stopPropagation(),h(y,-1,0);break;case"Right":case"ArrowRight":y.preventDefault(),y.stopPropagation(),h(y,1,0);break;case"Up":case"ArrowUp":y.preventDefault(),y.stopPropagation(),h(y,0,-1);break;case"Down":case"ArrowDown":y.preventDefault(),y.stopPropagation(),h(y,0,1);break}},b},[o,i,r])}}const xl=s.createContext({});let Zg=t=>{let{onHoverStart:e,onHoverChange:n,onHoverEnd:l,...r}=t;return r};const Yg=Cn(function(e,n){[e,n]=ve(e,n,xl);let{hoverProps:l,isHovered:r}=Fe({...e,isDisabled:e.disabled}),{isFocused:o,isFocusVisible:i,focusProps:u}=Ve({isTextInput:!0,autoFocus:e.autoFocus}),a=!!e["aria-invalid"]&&e["aria-invalid"]!=="false",c=ae({...e,values:{isHovered:r,isFocused:o,isFocusVisible:i,isDisabled:e.disabled||!1,isInvalid:a},defaultClassName:"react-aria-Input"});return x.createElement(ee.input,{...W(Zg(e),u,l),...c,ref:n,"data-focused":o||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":i||void 0,"data-invalid":a||void 0})});function Zc(t,e){let{inputElementType:n="input",isDisabled:l=!1,isRequired:r=!1,isReadOnly:o=!1,type:i="text",validationBehavior:u="aria"}=t,[a,c]=Hc(t.value,t.defaultValue||"",t.onChange),{focusableProps:f}=wt(t,e),d=ro({...t,value:a}),{isInvalid:b,validationErrors:p,validationDetails:h}=d.displayValidation,{labelProps:y,fieldProps:m,descriptionProps:g,errorMessageProps:v}=xg({...t,isInvalid:b,errorMessage:t.errorMessage||p}),E=oe(t,{labelable:!0});const C={type:i,pattern:t.pattern};let[R]=s.useState(a);return il(e,t.defaultValue??R,c),Nc(t,d,e),{labelProps:y,inputProps:W(E,n==="input"?C:void 0,{disabled:l,readOnly:o,required:r&&u==="native","aria-required":r&&u==="aria"||void 0,"aria-invalid":b||void 0,"aria-errormessage":t["aria-errormessage"],"aria-activedescendant":t["aria-activedescendant"],"aria-autocomplete":t["aria-autocomplete"],"aria-haspopup":t["aria-haspopup"],"aria-controls":t["aria-controls"],value:a,onChange:T=>c(U(T).value),autoComplete:t.autoComplete,autoCapitalize:t.autoCapitalize,maxLength:t.maxLength,minLength:t.minLength,name:t.name,form:t.form,placeholder:t.placeholder,inputMode:t.inputMode,autoCorrect:t.autoCorrect,spellCheck:t.spellCheck,[parseInt(x.version,10)>=17?"enterKeyHint":"enterkeyhint"]:t.enterKeyHint,onCopy:t.onCopy,onCut:t.onCut,onPaste:t.onPaste,onCompositionEnd:t.onCompositionEnd,onCompositionStart:t.onCompositionStart,onCompositionUpdate:t.onCompositionUpdate,onSelect:t.onSelect,onBeforeInput:t.onBeforeInput,onInput:t.onInput,...f,...m}),descriptionProps:g,errorMessageProps:v,isInvalid:b,validationErrors:p,validationDetails:h}}const uo=new WeakMap;function $r(t,e){let n=uo.get(t);if(!n)throw new Error("Unknown slider state");return`${n.id}-${e}`}function Xg(t,e,n){let{labelProps:l,fieldProps:r}=al(t),o=t.orientation==="vertical";uo.set(e,{id:l.id??r.id,"aria-describedby":t["aria-describedby"],"aria-details":t["aria-details"]});let{direction:i}=Pe(),{addGlobalListener:u,removeGlobalListener:a}=Et();const c=s.useRef(null),f=i==="rtl",d=s.useRef(null),{moveProps:b}=io({onMoveStart(){d.current=null},onMove({deltaX:m,deltaY:g}){if(!n.current)return;let{height:v,width:E}=n.current.getBoundingClientRect(),C=o?v:E;d.current==null&&c.current!=null&&(d.current=e.getThumbPercent(c.current)*C);let R=o?g:m;if((o||f)&&(R=-R),d.current+=R,c.current!=null&&n.current){const T=fn(d.current/C,0,1);e.setThumbPercent(c.current,T)}},onMoveEnd(){c.current!=null&&(e.setThumbDragging(c.current,!1),c.current=null)}});let p=s.useRef(void 0),h=(m,g,v,E)=>{if(n.current&&!t.isDisabled&&e.values.every((C,R)=>!e.isThumbDragging(R))){let{height:C,width:R,top:T,left:F}=n.current.getBoundingClientRect(),B=o?C:R,H=((o?E:v)-(o?T:F))/B;(i==="rtl"||o)&&(H=1-H);let j=e.getPercentValue(H),$,D=e.values.findIndex(A=>j-A<0);if(D===0)$=D;else if(D===-1)$=e.values.length-1;else{let A=e.values[D-1],w=e.values[D];Math.abs(A-j)=0&&e.isThumbEditable($)?(m.preventDefault(),c.current=$,e.setFocusedThumb($),p.current=g,e.setThumbDragging(c.current,!0),e.setThumbValue($,j),u(window,"mouseup",y,!1),u(window,"touchend",y,!1),u(window,"pointerup",y,!1)):c.current=null}},y=m=>{var v;(m.pointerId??((v=m.changedTouches)==null?void 0:v[0].identifier))===p.current&&(c.current!=null&&(e.setThumbDragging(c.current,!1),c.current=null),a(window,"mouseup",y,!1),a(window,"touchend",y,!1),a(window,"pointerup",y,!1))};return"htmlFor"in l&&l.htmlFor&&(delete l.htmlFor,l.onClick=()=>{var m;(m=document.getElementById($r(e,0)))==null||m.focus(),ea("keyboard")}),{labelProps:l,groupProps:{role:"group",...r},trackProps:W({onMouseDown(m){m.button!==0||m.altKey||m.ctrlKey||m.metaKey||h(m,void 0,m.clientX,m.clientY)},onPointerDown(m){m.pointerType==="mouse"&&(m.button!==0||m.altKey||m.ctrlKey||m.metaKey)||h(m,m.pointerId,m.clientX,m.clientY)},onTouchStart(m){h(m,m.changedTouches[0].identifier,m.changedTouches[0].clientX,m.changedTouches[0].clientY)},style:{position:"relative",touchAction:"none"}},b),outputProps:{htmlFor:e.values.map((m,g)=>$r(e,g)).join(" "),"aria-live":"off"}}}function Jg(t,e){let{index:n=0,isRequired:l,validationState:r,isInvalid:o,trackRef:i,inputRef:u,orientation:a=e.orientation,name:c,form:f}=t,d=t.isDisabled||e.isDisabled,b=a==="vertical",{direction:p}=Pe(),{addGlobalListener:h,removeGlobalListener:y}=Et(),m=uo.get(e);const{labelProps:g,fieldProps:v}=al({...t,id:$r(e,n),"aria-labelledby":`${m.id} ${t["aria-labelledby"]??""}`.trim()}),E=e.values[n],C=s.useCallback(()=>{u.current&&Ne(u.current)},[u]),R=e.focusedThumb===n;s.useEffect(()=>{R&&C()},[R,C]);let T=p==="rtl",F=s.useRef(null),{keyboardProps:B}=cl({onKeyDown(A){let{getThumbMaxValue:w,getThumbMinValue:P,decrementThumb:k,incrementThumb:K,setThumbValue:_,setThumbDragging:Z,pageSize:S}=e;if(!/^(PageUp|PageDown|Home|End)$/.test(A.key)){A.continuePropagation();return}switch(A.preventDefault(),Z(n,!0),A.key){case"PageUp":K(n,S);break;case"PageDown":k(n,S);break;case"Home":_(n,P(n));break;case"End":_(n,w(n));break}Z(n,!1)}}),{moveProps:L}=io({onMoveStart(){F.current=null,e.setThumbDragging(n,!0)},onMove({deltaX:A,deltaY:w,pointerType:P,shiftKey:k}){const{getThumbPercent:K,setThumbPercent:_,decrementThumb:Z,incrementThumb:S,step:N,pageSize:O}=e;if(!i.current)return;let{width:X,height:J}=i.current.getBoundingClientRect(),de=b?J:X;if(F.current==null&&(F.current=K(n)*de),P==="keyboard")A>0&&T||A<0&&!T||w>0?Z(n,k?O:N):S(n,k?O:N);else{let Ce=b?w:A;(b||T)&&(Ce=-Ce),F.current+=Ce,_(n,fn(F.current/de,0,1))}},onMoveEnd(){e.setThumbDragging(n,!1)}});e.setThumbEditable(n,!d);const{focusableProps:M}=wt(W(t,{onFocus:()=>e.setFocusedThumb(n),onBlur:()=>e.setFocusedThumb(void 0)}),u);let V=s.useRef(void 0),H=A=>{C(),V.current=A,e.setThumbDragging(n,!0),h(window,"mouseup",j,!1),h(window,"touchend",j,!1),h(window,"pointerup",j,!1)},j=A=>{var P;(A.pointerId??((P=A.changedTouches)==null?void 0:P[0].identifier))===V.current&&(C(),e.setThumbDragging(n,!1),y(window,"mouseup",j,!1),y(window,"touchend",j,!1),y(window,"pointerup",j,!1))},$=e.getThumbPercent(n);(b||p==="rtl")&&($=1-$);let D=d?{}:W(B,L,{onMouseDown:A=>{A.button!==0||A.altKey||A.ctrlKey||A.metaKey||H()},onPointerDown:A=>{A.button!==0||A.altKey||A.ctrlKey||A.metaKey||H(A.pointerId)},onTouchStart:A=>{H(A.changedTouches[0].identifier)}});return il(u,e.defaultValues[n],A=>{e.setThumbValue(n,A)}),{inputProps:W(M,v,{type:"range",tabIndex:d?void 0:0,min:e.getThumbMinValue(n),max:e.getThumbMaxValue(n),step:e.step,value:E,name:c,form:f,disabled:d,"aria-orientation":a,"aria-valuetext":e.getThumbValueLabel(n),"aria-required":l||void 0,"aria-invalid":o||r==="invalid"||void 0,"aria-errormessage":t["aria-errormessage"],"aria-describedby":[m["aria-describedby"],t["aria-describedby"]].filter(Boolean).join(" "),"aria-details":[m["aria-details"],t["aria-details"]].filter(Boolean).join(" "),onChange:A=>{e.setThumbValue(n,parseFloat(U(A).value))}}),thumbProps:{...D,style:{position:"absolute",[b?"top":"left"]:`${$*100}%`,transform:"translate(-50%, -50%)",touchAction:"none"}},labelProps:g,isDragging:e.isThumbDragging(n),isDisabled:d,isFocused:R}}const Qg=0,e3=100,t3=1;function n3(t){const{isDisabled:e=!1,minValue:n=Qg,maxValue:l=e3,numberFormatter:r,step:o=t3,orientation:i="horizontal"}=t;let u=s.useMemo(()=>{let S=(l-n)/10;return S=Zt(S,0,S+o,o),Math.max(S,o)},[o,l,n]),a=s.useCallback(S=>S==null?void 0:S.map((N,O)=>{let X=O===0?n:S[O-1],J=O===S.length-1?l:S[O+1];return Zt(N,X,J,o)}),[n,l,o]),c=s.useMemo(()=>a(Gi(t.value)),[t.value,a]),f=s.useMemo(()=>a(Gi(t.defaultValue)??[n]),[t.defaultValue,n,a]),d=qi(t.value,t.defaultValue,t.onChange),b=qi(t.value,t.defaultValue,t.onChangeEnd);const[p,h]=ct(c,f,d);let[y]=s.useState(p);const[m,g]=s.useState(new Array(p.length).fill(!1)),v=s.useRef(new Array(p.length).fill(!0)),[E,C]=s.useState(void 0),R=s.useRef(p),T=s.useRef(m);let F=S=>{R.current=S,h(S)},B=S=>{T.current=S,g(S)};function L(S){return(S-n)/(l-n)}function M(S){return S===0?n:p[S-1]}function V(S){return S===p.length-1?l:p[S+1]}function H(S){return v.current[S]}function j(S,N){v.current[S]=N}function $(S,N){if(e||!H(S))return;const O=M(S),X=V(S);N=Zt(N,O,X,o);let J=Ui(R.current,S,N);F(J)}function D(S,N){if(e||!H(S))return;N&&(R.current=p);const O=T.current[S];T.current=Ui(T.current,S,N),B(T.current),b&&O&&!T.current.some(Boolean)&&b(R.current)}let A=s.useRef(null);function w(S=p){switch(typeof S=="number"&&(S=[S]),S.length){case 0:return"";case 1:return r.format(S[0]);case 2:return r.formatRange(S[0],S[1]);default:{let N=S.map(X=>r.format(X)),O=A.current;return(!O||O.resolvedOptions().locale!==r.resolvedOptions().locale)&&(O=A.current=new Intl.ListFormat(r.resolvedOptions().locale,{type:"unit"})),O.format(N)}}}function P(S,N){$(S,K(N))}function k(S){return Math.round((S-n)/o)*o+n}function K(S){const N=S*(l-n)+n;return _h(k(N),n,l)}function _(S,N=1){let O=Math.max(N,o);$(S,Zt(p[S]+O,n,l,o))}function Z(S,N=1){let O=Math.max(N,o);$(S,Zt(p[S]-O,n,l,o))}return{values:p,defaultValues:t.defaultValue!==void 0?f:y,getThumbValue:S=>p[S],setThumbValue:$,setThumbPercent:P,isThumbDragging:S=>m[S],setThumbDragging:D,focusedThumb:E,setFocusedThumb:C,getThumbPercent:S=>L(p[S]),getValuePercent:L,getThumbValueLabel:S=>w(p[S]),getFormattedValue:w,getThumbMinValue:M,getThumbMaxValue:V,getPercentValue:K,isThumbEditable:H,setThumbEditable:j,incrementThumb:_,decrementThumb:Z,step:o,pageSize:u,orientation:i,isDisabled:e}}function Ui(t,e,n){return t[e]===n?t:[...t.slice(0,e),n,...t.slice(e+1)]}function Gi(t){if(t!=null)return Array.isArray(t)?t:[t]}function qi(t,e,n){return l=>{typeof t=="number"||typeof e=="number"?n==null||n(l[0]):n==null||n(l)}}const l3=s.createContext(null),ao=s.createContext(null),so=s.createContext(null),r3=s.createContext(null),U0=s.forwardRef(function(e,n){[e,n]=ve(e,n,l3);let l=s.useRef(null),r=jh(e.formatOptions),o=n3({...e,numberFormatter:r}),[i,u]=xn(!e["aria-label"]&&!e["aria-labelledby"]),{groupProps:a,trackProps:c,labelProps:f,outputProps:d}=Xg({...e,label:u},o,l),b=ae({...e,values:{orientation:o.orientation,isDisabled:o.isDisabled,state:o},defaultClassName:"react-aria-Slider"}),p=oe(e,{global:!0});return delete p.id,x.createElement(Me,{values:[[ao,o],[so,{...c,ref:l}],[r3,d],[Ht,{...f,ref:i}]]},x.createElement(ee.div,{...W(p,b,a),ref:n,slot:e.slot||void 0,"data-orientation":o.orientation,"data-disabled":o.isDisabled||void 0}))}),G0=s.forwardRef(function(e,n){[e,n]=ve(e,n,so);let l=s.useContext(ao),{onHoverStart:r,onHoverEnd:o,onHoverChange:i,...u}=e,{hoverProps:a,isHovered:c}=Fe({onHoverStart:r,onHoverEnd:o,onHoverChange:i}),f=ae({...e,defaultClassName:"react-aria-SliderTrack",values:{orientation:l.orientation,isDisabled:l.isDisabled,isHovered:c,state:l}});return x.createElement(ee.div,{...W(u,a),...f,ref:n,"data-hovered":c||void 0,"data-orientation":l.orientation||void 0,"data-disabled":l.isDisabled||void 0})}),q0=s.forwardRef(function(e,n){let{inputRef:l=null}=e,r=s.useContext(ao),{ref:o}=vn(so),{index:i=0}=e,u=s.useRef(null),a=l||u,[c,f]=xn(!e["aria-label"]&&!e["aria-labelledby"]),{thumbProps:d,inputProps:b,labelProps:p,isDragging:h,isFocused:y,isDisabled:m}=Jg({...e,index:i,trackRef:o,inputRef:a,label:f},r),{focusProps:g,isFocusVisible:v}=Ve(),{hoverProps:E,isHovered:C}=Fe(e),R=ae({...e,defaultClassName:"react-aria-SliderThumb",values:{state:r,isHovered:C,isDragging:h,isFocused:y,isFocusVisible:v,isDisabled:m}}),T=oe(e,{global:!0});return delete T.id,x.createElement(ee.div,{...W(T,d,E),...R,ref:n,style:{...d.style,...R.style},"data-hovered":C||void 0,"data-dragging":h||void 0,"data-focused":y||void 0,"data-focus-visible":v||void 0,"data-disabled":m||void 0},x.createElement(_r,null,x.createElement("input",{ref:a,...W(b,g)})),x.createElement(Me,{values:[[Ht,{...p,ref:c}]]},R.children))});var Yc={};Yc={buttonLabel:"عرض المقترحات",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} خيار`,other:()=>`${e.number(t.optionCount)} خيارات`})} متاحة.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`المجموعة المدخلة ${t.groupTitle}, مع ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} خيار`,other:()=>`${e.number(t.groupCount)} خيارات`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", محدد",other:""},t.isSelected)}`,listboxLabel:"مقترحات",selectedAnnouncement:t=>`${t.optionText}، محدد`};var Xc={};Xc={buttonLabel:"Покажи предложения",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} опция`,other:()=>`${e.number(t.optionCount)} опции`})} на разположение.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Въведена група ${t.groupTitle}, с ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} опция`,other:()=>`${e.number(t.groupCount)} опции`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", избрани",other:""},t.isSelected)}`,listboxLabel:"Предложения",selectedAnnouncement:t=>`${t.optionText}, избрани`};var Jc={};Jc={buttonLabel:"Zobrazit doporučení",countAnnouncement:(t,e)=>`K dispozici ${e.plural(t.optionCount,{one:()=>`je ${e.number(t.optionCount)} možnost`,other:()=>`jsou/je ${e.number(t.optionCount)} možnosti/-í`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Zadaná skupina „${t.groupTitle}“ ${e.plural(t.groupCount,{one:()=>`s ${e.number(t.groupCount)} možností`,other:()=>`se ${e.number(t.groupCount)} možnostmi`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:" (vybráno)",other:""},t.isSelected)}`,listboxLabel:"Návrhy",selectedAnnouncement:t=>`${t.optionText}, vybráno`};var Qc={};Qc={buttonLabel:"Vis forslag",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} mulighed tilgængelig`,other:()=>`${e.number(t.optionCount)} muligheder tilgængelige`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Angivet gruppe ${t.groupTitle}, med ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} mulighed`,other:()=>`${e.number(t.groupCount)} muligheder`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valgt",other:""},t.isSelected)}`,listboxLabel:"Forslag",selectedAnnouncement:t=>`${t.optionText}, valgt`};var ed={};ed={buttonLabel:"Empfehlungen anzeigen",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} Option`,other:()=>`${e.number(t.optionCount)} Optionen`})} verfügbar.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Eingetretene Gruppe ${t.groupTitle}, mit ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} Option`,other:()=>`${e.number(t.groupCount)} Optionen`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", ausgewählt",other:""},t.isSelected)}`,listboxLabel:"Empfehlungen",selectedAnnouncement:t=>`${t.optionText}, ausgewählt`};var td={};td={buttonLabel:"Προβολή προτάσεων",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} επιλογή`,other:()=>`${e.number(t.optionCount)} επιλογές `})} διαθέσιμες.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Εισαγμένη ομάδα ${t.groupTitle}, με ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} επιλογή`,other:()=>`${e.number(t.groupCount)} επιλογές`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", επιλεγμένο",other:""},t.isSelected)}`,listboxLabel:"Προτάσεις",selectedAnnouncement:t=>`${t.optionText}, επιλέχθηκε`};var nd={};nd={focusAnnouncement:(t,e)=>`${e.select({true:()=>`Entered group ${t.groupTitle}, with ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} option`,other:()=>`${e.number(t.groupCount)} options`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selected",other:""},t.isSelected)}`,countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} option`,other:()=>`${e.number(t.optionCount)} options`})} available.`,selectedAnnouncement:t=>`${t.optionText}, selected`,buttonLabel:"Show suggestions",listboxLabel:"Suggestions"};var ld={};ld={buttonLabel:"Mostrar sugerencias",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opción`,other:()=>`${e.number(t.optionCount)} opciones`})} disponible(s).`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Se ha unido al grupo ${t.groupTitle}, con ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opción`,other:()=>`${e.number(t.groupCount)} opciones`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", seleccionado",other:""},t.isSelected)}`,listboxLabel:"Sugerencias",selectedAnnouncement:t=>`${t.optionText}, seleccionado`};var rd={};rd={buttonLabel:"Kuva soovitused",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} valik`,other:()=>`${e.number(t.optionCount)} valikud`})} saadaval.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Sisestatud rühm ${t.groupTitle}, valikuga ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} valik`,other:()=>`${e.number(t.groupCount)} valikud`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valitud",other:""},t.isSelected)}`,listboxLabel:"Soovitused",selectedAnnouncement:t=>`${t.optionText}, valitud`};var od={};od={buttonLabel:"Näytä ehdotukset",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} vaihtoehto`,other:()=>`${e.number(t.optionCount)} vaihtoehdot`})} saatavilla.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Mentiin ryhmään ${t.groupTitle}, ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} vaihtoehdon`,other:()=>`${e.number(t.groupCount)} vaihtoehdon`})} kanssa.`,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valittu",other:""},t.isSelected)}`,listboxLabel:"Ehdotukset",selectedAnnouncement:t=>`${t.optionText}, valittu`};var id={};id={buttonLabel:"Afficher les suggestions",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} option`,other:()=>`${e.number(t.optionCount)} options`})} disponible(s).`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Groupe ${t.groupTitle} rejoint, avec ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} option`,other:()=>`${e.number(t.groupCount)} options`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", sélectionné(s)",other:""},t.isSelected)}`,listboxLabel:"Suggestions",selectedAnnouncement:t=>`${t.optionText}, sélectionné`};var ud={};ud={buttonLabel:"הצג הצעות",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`אפשרות ${e.number(t.optionCount)}`,other:()=>`${e.number(t.optionCount)} אפשרויות`})} במצב זמין.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`נכנס לקבוצה ${t.groupTitle}, עם ${e.plural(t.groupCount,{one:()=>`אפשרות ${e.number(t.groupCount)}`,other:()=>`${e.number(t.groupCount)} אפשרויות`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", נבחר",other:""},t.isSelected)}`,listboxLabel:"הצעות",selectedAnnouncement:t=>`${t.optionText}, נבחר`};var ad={};ad={buttonLabel:"Prikaži prijedloge",countAnnouncement:(t,e)=>`Dostupno još: ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcija`,other:()=>`${e.number(t.optionCount)} opcije/a`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Unesena skupina ${t.groupTitle}, s ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opcijom`,other:()=>`${e.number(t.groupCount)} opcije/a`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", odabranih",other:""},t.isSelected)}`,listboxLabel:"Prijedlozi",selectedAnnouncement:t=>`${t.optionText}, odabrano`};var sd={};sd={buttonLabel:"Javaslatok megjelenítése",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} lehetőség`,other:()=>`${e.number(t.optionCount)} lehetőség`})} áll rendelkezésre.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Belépett a(z) ${t.groupTitle} csoportba, amely ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} lehetőséget`,other:()=>`${e.number(t.groupCount)} lehetőséget`})} tartalmaz. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", kijelölve",other:""},t.isSelected)}`,listboxLabel:"Javaslatok",selectedAnnouncement:t=>`${t.optionText}, kijelölve`};var cd={};cd={buttonLabel:"Mostra suggerimenti",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opzione disponibile`,other:()=>`${e.number(t.optionCount)} opzioni disponibili`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Ingresso nel gruppo ${t.groupTitle}, con ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opzione`,other:()=>`${e.number(t.groupCount)} opzioni`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selezionato",other:""},t.isSelected)}`,listboxLabel:"Suggerimenti",selectedAnnouncement:t=>`${t.optionText}, selezionato`};var dd={};dd={buttonLabel:"候補を表示",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} 個のオプション`,other:()=>`${e.number(t.optionCount)} 個のオプション`})}を利用できます。`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`入力されたグループ ${t.groupTitle}、${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} 個のオプション`,other:()=>`${e.number(t.groupCount)} 個のオプション`})}を含む。`,other:""},t.isGroupChange)}${t.optionText}${e.select({true:"、選択済み",other:""},t.isSelected)}`,listboxLabel:"候補",selectedAnnouncement:t=>`${t.optionText}、選択済み`};var fd={};fd={buttonLabel:"제안 사항 표시",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)}개 옵션`,other:()=>`${e.number(t.optionCount)}개 옵션`})}을 사용할 수 있습니다.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`입력한 그룹 ${t.groupTitle}, ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)}개 옵션`,other:()=>`${e.number(t.groupCount)}개 옵션`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", 선택됨",other:""},t.isSelected)}`,listboxLabel:"제안",selectedAnnouncement:t=>`${t.optionText}, 선택됨`};var pd={};pd={buttonLabel:"Rodyti pasiūlymus",countAnnouncement:(t,e)=>`Yra ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} parinktis`,other:()=>`${e.number(t.optionCount)} parinktys (-ių)`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Įvesta grupė ${t.groupTitle}, su ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} parinktimi`,other:()=>`${e.number(t.groupCount)} parinktimis (-ių)`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", pasirinkta",other:""},t.isSelected)}`,listboxLabel:"Pasiūlymai",selectedAnnouncement:t=>`${t.optionText}, pasirinkta`};var bd={};bd={buttonLabel:"Rādīt ieteikumus",countAnnouncement:(t,e)=>`Pieejamo opciju skaits: ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcija`,other:()=>`${e.number(t.optionCount)} opcijas`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Ievadīta grupa ${t.groupTitle}, ar ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opciju`,other:()=>`${e.number(t.groupCount)} opcijām`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", atlasīta",other:""},t.isSelected)}`,listboxLabel:"Ieteikumi",selectedAnnouncement:t=>`${t.optionText}, atlasīta`};var hd={};hd={buttonLabel:"Vis forslag",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} alternativ`,other:()=>`${e.number(t.optionCount)} alternativer`})} finnes.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Angitt gruppe ${t.groupTitle}, med ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} alternativ`,other:()=>`${e.number(t.groupCount)} alternativer`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valgt",other:""},t.isSelected)}`,listboxLabel:"Forslag",selectedAnnouncement:t=>`${t.optionText}, valgt`};var md={};md={buttonLabel:"Suggesties weergeven",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} optie`,other:()=>`${e.number(t.optionCount)} opties`})} beschikbaar.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Groep ${t.groupTitle} ingevoerd met ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} optie`,other:()=>`${e.number(t.groupCount)} opties`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", geselecteerd",other:""},t.isSelected)}`,listboxLabel:"Suggesties",selectedAnnouncement:t=>`${t.optionText}, geselecteerd`};var gd={};gd={buttonLabel:"Wyświetlaj sugestie",countAnnouncement:(t,e)=>`dostępna/dostępne(-nych) ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcja`,other:()=>`${e.number(t.optionCount)} opcje(-i)`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Dołączono do grupy ${t.groupTitle}, z ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opcją`,other:()=>`${e.number(t.groupCount)} opcjami`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", wybrano",other:""},t.isSelected)}`,listboxLabel:"Sugestie",selectedAnnouncement:t=>`${t.optionText}, wybrano`};var yd={};yd={buttonLabel:"Mostrar sugestões",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opção`,other:()=>`${e.number(t.optionCount)} opções`})} disponível.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Grupo inserido ${t.groupTitle}, com ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opção`,other:()=>`${e.number(t.groupCount)} opções`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selecionado",other:""},t.isSelected)}`,listboxLabel:"Sugestões",selectedAnnouncement:t=>`${t.optionText}, selecionado`};var $d={};$d={buttonLabel:"Apresentar sugestões",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opção`,other:()=>`${e.number(t.optionCount)} opções`})} disponível.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Grupo introduzido ${t.groupTitle}, com ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opção`,other:()=>`${e.number(t.groupCount)} opções`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selecionado",other:""},t.isSelected)}`,listboxLabel:"Sugestões",selectedAnnouncement:t=>`${t.optionText}, selecionado`};var vd={};vd={buttonLabel:"Afișare sugestii",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opțiune`,other:()=>`${e.number(t.optionCount)} opțiuni`})} disponibile.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Grup ${t.groupTitle} introdus, cu ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opțiune`,other:()=>`${e.number(t.groupCount)} opțiuni`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selectat",other:""},t.isSelected)}`,listboxLabel:"Sugestii",selectedAnnouncement:t=>`${t.optionText}, selectat`};var xd={};xd={buttonLabel:"Показать предложения",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} параметр`,other:()=>`${e.number(t.optionCount)} параметров`})} доступно.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Введенная группа ${t.groupTitle}, с ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} параметром`,other:()=>`${e.number(t.groupCount)} параметрами`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", выбранными",other:""},t.isSelected)}`,listboxLabel:"Предложения",selectedAnnouncement:t=>`${t.optionText}, выбрано`};var Cd={};Cd={buttonLabel:"Zobraziť návrhy",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} možnosť`,other:()=>`${e.number(t.optionCount)} možnosti/-í`})} k dispozícii.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Zadaná skupina ${t.groupTitle}, s ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} možnosťou`,other:()=>`${e.number(t.groupCount)} možnosťami`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", vybraté",other:""},t.isSelected)}`,listboxLabel:"Návrhy",selectedAnnouncement:t=>`${t.optionText}, vybraté`};var Ed={};Ed={buttonLabel:"Prikaži predloge",countAnnouncement:(t,e)=>`Na voljo je ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcija`,other:()=>`${e.number(t.optionCount)} opcije`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Vnesena skupina ${t.groupTitle}, z ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opcija`,other:()=>`${e.number(t.groupCount)} opcije`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", izbrano",other:""},t.isSelected)}`,listboxLabel:"Predlogi",selectedAnnouncement:t=>`${t.optionText}, izbrano`};var wd={};wd={buttonLabel:"Prikaži predloge",countAnnouncement:(t,e)=>`Dostupno još: ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcija`,other:()=>`${e.number(t.optionCount)} opcije/a`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Unesena grupa ${t.groupTitle}, s ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opcijom`,other:()=>`${e.number(t.groupCount)} optione/a`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", izabranih",other:""},t.isSelected)}`,listboxLabel:"Predlozi",selectedAnnouncement:t=>`${t.optionText}, izabrano`};var Sd={};Sd={buttonLabel:"Visa förslag",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} alternativ`,other:()=>`${e.number(t.optionCount)} alternativ`})} tillgängliga.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Ingick i gruppen ${t.groupTitle} med ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} alternativ`,other:()=>`${e.number(t.groupCount)} alternativ`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valda",other:""},t.isSelected)}`,listboxLabel:"Förslag",selectedAnnouncement:t=>`${t.optionText}, valda`};var Dd={};Dd={buttonLabel:"Önerileri göster",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} seçenek`,other:()=>`${e.number(t.optionCount)} seçenekler`})} kullanılabilir.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Girilen grup ${t.groupTitle}, ile ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} seçenek`,other:()=>`${e.number(t.groupCount)} seçenekler`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", seçildi",other:""},t.isSelected)}`,listboxLabel:"Öneriler",selectedAnnouncement:t=>`${t.optionText}, seçildi`};var kd={};kd={buttonLabel:"Показати пропозиції",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} параметр`,other:()=>`${e.number(t.optionCount)} параметри(-ів)`})} доступно.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Введена група ${t.groupTitle}, з ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} параметр`,other:()=>`${e.number(t.groupCount)} параметри(-ів)`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", вибрано",other:""},t.isSelected)}`,listboxLabel:"Пропозиції",selectedAnnouncement:t=>`${t.optionText}, вибрано`};var Pd={};Pd={buttonLabel:"显示建议",countAnnouncement:(t,e)=>`有 ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} 个选项`,other:()=>`${e.number(t.optionCount)} 个选项`})}可用。`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`进入了 ${t.groupTitle} 组,其中有 ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} 个选项`,other:()=>`${e.number(t.groupCount)} 个选项`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", 已选择",other:""},t.isSelected)}`,listboxLabel:"建议",selectedAnnouncement:t=>`${t.optionText}, 已选择`};var Td={};Td={buttonLabel:"顯示建議",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} 選項`,other:()=>`${e.number(t.optionCount)} 選項`})} 可用。`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`輸入的群組 ${t.groupTitle}, 有 ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} 選項`,other:()=>`${e.number(t.groupCount)} 選項`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", 已選取",other:""},t.isSelected)}`,listboxLabel:"建議",selectedAnnouncement:t=>`${t.optionText}, 已選取`};var Ad={};Ad={"ar-AE":Yc,"bg-BG":Xc,"cs-CZ":Jc,"da-DK":Qc,"de-DE":ed,"el-GR":td,"en-US":nd,"es-ES":ld,"et-EE":rd,"fi-FI":od,"fr-FR":id,"he-IL":ud,"hr-HR":ad,"hu-HU":sd,"it-IT":cd,"ja-JP":dd,"ko-KR":fd,"lt-LT":pd,"lv-LV":bd,"nb-NO":hd,"nl-NL":md,"pl-PL":gd,"pt-BR":yd,"pt-PT":$d,"ro-RO":vd,"ru-RU":xd,"sk-SK":Cd,"sl-SI":Ed,"sr-SP":wd,"sv-SE":Sd,"tr-TR":Dd,"uk-UA":kd,"zh-CN":Pd,"zh-TW":Td};function o3(t){return t&&t.__esModule?t.default:t}function i3(t,e){let{buttonRef:n,popoverRef:l,inputRef:r,listBoxRef:o,keyboardDelegate:i,layoutDelegate:u,shouldFocusWrap:a,isReadOnly:c,isDisabled:f}=t,d=s.useRef(null);n=n??d;let b=_e(o3(Ad),"@react-aria/combobox"),{menuTriggerProps:p,menuProps:h}=w4({type:"listbox",isDisabled:f||c},e,n);$l.set(e,{id:h.id});let{collection:y}=e,{disabledKeys:m}=e.selectionManager,g=s.useMemo(()=>i||new gl({collection:y,disabledKeys:m,ref:o,layoutDelegate:u}),[i,u,y,m,o]),{collectionProps:v}=Zr({selectionManager:e.selectionManager,keyboardDelegate:g,disallowTypeAhead:!0,disallowEmptySelection:!0,shouldFocusWrap:a,ref:r,isVirtualized:!0}),E=Ot(),C=z=>{if(!z.nativeEvent.isComposing)switch(z.key){case"Enter":case"Tab":if(e.isOpen&&z.key==="Enter"&&z.preventDefault(),e.isOpen&&o.current&&e.selectionManager.focusedKey!=null){let Y=e.collection.getItem(e.selectionManager.focusedKey);if(Y!=null&&Y.props.href){let ue=o.current.querySelector(`[data-key="${CSS.escape(e.selectionManager.focusedKey.toString())}"]`);z.key==="Enter"&&ue instanceof HTMLAnchorElement&&E.open(ue,z,Y.props.href,Y.props.routerOptions),e.close();break}else if(Y!=null&&Y.props.onAction){Y.props.onAction(),e.close();break}}(z.key==="Enter"||e.isOpen)&&e.commit();break;case"Escape":(!e.selectionManager.isEmpty||e.inputValue===""||t.allowsCustomValue)&&z.continuePropagation(),e.revert();break;case"ArrowDown":e.open("first","manual");break;case"ArrowUp":e.open("last","manual");break;case"ArrowLeft":case"ArrowRight":e.selectionManager.setFocusedKey(null);break}},R=z=>{let Y=(n==null?void 0:n.current)&&n.current===z.relatedTarget,ue=ne(l.current,z.relatedTarget);Y||ue||(t.onBlur&&t.onBlur(z),e.setFocused(!1))},T=z=>{e.isFocused||(t.onFocus&&t.onFocus(z),e.setFocused(!0))},F=u3([e.selectionManager.selectedKeys,e.selectionManager.selectionMode]),{isInvalid:B,validationErrors:L,validationDetails:M}=e.displayValidation,{labelProps:V,inputProps:H,descriptionProps:j,errorMessageProps:$}=Zc({...t,isRequired:t.selectionMode==="multiple"?t.isRequired&&e.selectionManager.isEmpty:t.isRequired,onChange:e.setInputValue,onKeyDown:c?t.onKeyDown:ft(e.isOpen&&v.onKeyDown,C,t.onKeyDown),onBlur:R,value:e.inputValue,defaultValue:e.defaultInputValue,onFocus:T,autoComplete:"off",validate:void 0,[yn]:e,"aria-describedby":[F,t["aria-describedby"]].filter(Boolean).join(" ")||void 0},r);il(r,e.defaultValue,e.setValue);let D=z=>{var Y;z.pointerType==="touch"&&((Y=r.current)==null||Y.focus(),e.toggle(null,"manual"))},A=z=>{var Y;z.pointerType!=="touch"&&((Y=r.current)==null||Y.focus(),e.toggle(z.pointerType==="keyboard"||z.pointerType==="virtual"?"first":null,"manual"))},w=cn({id:p.id,"aria-label":b.format("buttonLabel"),"aria-labelledby":t["aria-labelledby"]||V.id}),P=cn({id:h.id,"aria-label":b.format("listboxLabel"),"aria-labelledby":t["aria-labelledby"]||V.id}),k=s.useRef(0),K=z=>{var Dt,An;if(f||c)return;if(z.timeStamp-k.current<500){z.preventDefault(),(Dt=r.current)==null||Dt.focus();return}let Y=U(z).getBoundingClientRect(),ue=z.changedTouches[0],Re=Math.ceil(Y.left+.5*Y.width),El=Math.ceil(Y.top+.5*Y.height);ue.clientX===Re&&ue.clientY===El&&(z.preventDefault(),(An=r.current)==null||An.focus(),e.toggle(null,"manual"),k.current=z.timeStamp)},_=e.selectionManager.focusedKey!=null&&e.isOpen?e.collection.getItem(e.selectionManager.focusedKey):void 0,Z=(_==null?void 0:_.parentKey)??null,S=e.selectionManager.focusedKey??null,N=s.useRef(Z),O=s.useRef(S);s.useEffect(()=>{if(jn()&&_!=null&&S!=null&&S!==O.current){let z=e.selectionManager.isSelected(S),Y=Z!=null?e.collection.getItem(Z):null,ue=(Y==null?void 0:Y["aria-label"])||(typeof(Y==null?void 0:Y.rendered)=="string"?Y.rendered:"")||"",Re=b.format("focusAnnouncement",{isGroupChange:(Y&&Z!==N.current)??!1,groupTitle:ue,groupCount:Y?[...Ee(Y,e.collection)].length:0,optionText:_["aria-label"]||_.textValue||"",isSelected:z});yt(Re)}N.current=Z,O.current=S});let X=Hs(e.collection),J=s.useRef(X),de=s.useRef(e.isOpen);s.useEffect(()=>{let z=e.isOpen!==de.current&&(e.selectionManager.focusedKey==null||jn());if(e.isOpen&&(z||X!==J.current)){let Y=b.format("countAnnouncement",{optionCount:X});yt(Y)}J.current=X,de.current=e.isOpen});let Ce=s.useRef(e.selectedKey);return s.useEffect(()=>{if(jn()&&e.isFocused&&e.selectedItem&&e.selectedKey!==Ce.current){let z=e.selectedItem["aria-label"]||e.selectedItem.textValue||"",Y=b.format("selectedAnnouncement",{optionText:z});yt(Y)}Ce.current=e.selectedKey}),s.useEffect(()=>{if(e.isOpen)return Vr([r.current,l.current].filter(z=>z!=null))},[e.isOpen,r,l]),Tr(()=>{!_&&r.current&&ie(re(r.current))===r.current&&qr(r.current,null)},[_]),Qt(o,"react-aria-item-action",e.isOpen?()=>{e.close()}:void 0),{labelProps:V,buttonProps:{...p,...w,excludeFromTabOrder:!0,preventFocusOnPress:!0,onPress:D,onPressStart:A,isDisabled:f||c},inputProps:W(H,{role:"combobox","aria-expanded":p["aria-expanded"],"aria-controls":e.isOpen?h.id:void 0,"aria-autocomplete":"list","aria-activedescendant":_?Mc(e,_.key):void 0,onTouchEnd:K,autoCorrect:"off",spellCheck:"false"}),listBoxProps:W(h,P,{autoFocus:e.focusStrategy||!0,shouldUseVirtualFocus:!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,linkBehavior:"selection",UNSTABLE_itemBehavior:"action"}),valueProps:{id:F},descriptionProps:j,errorMessageProps:$,isInvalid:B,validationErrors:L,validationDetails:M}}function u3(t=[]){let e=$e(),[n,l]=s.useState(!0),[r,o]=s.useState(t);return r.some((i,u)=>!Object.is(i,t[u]))&&(l(!0),o(t)),s.useEffect(()=>{n&&!document.getElementById(e)&&l(!1)},[e,n,r]),n?e:void 0}function a3(t){var To;let{defaultFilter:e,menuTrigger:n="input",allowsEmptyCollection:l=!1,allowsCustomValue:r,shouldCloseOnBlur:o=!0,selectionMode:i="single"}=t,[u,a]=s.useState(!1),[c,f]=s.useState(!1),[d,b]=s.useState(null),p=s.useMemo(()=>t.defaultValue!==void 0?t.defaultValue:i==="single"?t.defaultSelectedKey??null:[],[t.defaultValue,t.defaultSelectedKey,i]),h=s.useMemo(()=>t.value!==void 0?t.value:i==="single"?t.selectedKey:void 0,[t.value,t.selectedKey,i]),[y,m]=ct(h,p,t.onChange),g=i==="single"&&Array.isArray(y)?y[0]:y,v=Q=>{var ce;if(i==="single"){let he=Array.isArray(Q)?Q[0]??null:Q;m(he),he!==g&&((ce=t.onSelectionChange)==null||ce.call(t,he))}else{let he=[];Array.isArray(Q)?he=Q:Q!=null&&(he=[Q]),m(he)}},{collection:E,selectionManager:C,disabledKeys:R}=Fc({...t,items:t.items??t.defaultItems,selectionMode:i,disallowEmptySelection:i==="single",allowDuplicateSelectionEvents:!0,selectedKeys:s.useMemo(()=>c3(g),[g]),onSelectionChange:Q=>{var ce;if(Q!=="all")if(i==="single"){let he=Q.values().next().value??null;he===g?((ce=t.onSelectionChange)==null||ce.call(t,he),X(),S()):v(he)}else v([...Q])}}),T=i==="single"?C.firstSelectedKey:null,F=s.useMemo(()=>[...C.selectedKeys].map(Q=>E.getItem(Q)).filter(Q=>Q!=null),[C.selectedKeys,E]),[B,L]=ct(t.inputValue,Zi(t.defaultInputValue,T,E)||"",t.onInputChange),[M]=s.useState(g),[V]=s.useState(B),H=E,j=s.useMemo(()=>t.items!=null||!e?E:s3(E,B,e),[E,B,e,t.items]),[$,D]=s.useState(j),A=s.useRef("focus"),P=bl({...t,onOpenChange:Q=>{t.onOpenChange&&t.onOpenChange(Q,Q?A.current:void 0),C.setFocused(Q),Q||C.setFocusedKey(null)},isOpen:void 0,defaultOpen:void 0}),k=(Q=null,ce)=>{let he=ce==="manual"||ce==="focus"&&n==="focus";(l||j.size>0||he&&H.size>0||t.items)&&(he&&!P.isOpen&&t.items===void 0&&a(!0),A.current=ce,b(Q),P.open())},K=(Q=null,ce)=>{let he=ce==="manual"||ce==="focus"&&n==="focus";!(l||j.size>0||he&&H.size>0||t.items)&&!P.isOpen||(he&&!P.isOpen&&t.items===void 0&&a(!0),P.isOpen||(A.current=ce),Z(Q))},_=s.useCallback(()=>{D(u?H:j)},[u,H,j]),Z=s.useCallback((Q=null)=>{P.isOpen&&_(),b(Q),P.toggle()},[P,_]),S=s.useCallback(()=>{P.isOpen&&(_(),P.close())},[P,_]),[N,O]=s.useState(B),X=()=>{var ce;let Q=T!=null?((ce=E.getItem(T))==null?void 0:ce.textValue)??"":"";O(Q),L(Q)},J=s.useRef(g),de=s.useRef(T!=null?((To=E.getItem(T))==null?void 0:To.textValue)??"":"");s.useEffect(()=>{var ce;c&&(j.size>0||l)&&!P.isOpen&&B!==N&&n!=="manual"&&k(null,"input"),!u&&!l&&P.isOpen&&j.size===0&&S(),g!=null&&g!==J.current&&i==="single"&&S(),B!==N&&(C.setFocusedKey(null),a(!1),i==="single"&&B===""&&(t.inputValue===void 0||h===void 0)&&v(null)),g!==J.current&&(t.inputValue===void 0||h===void 0)?X():N!==B&&O(B);let Q=T!=null?((ce=E.getItem(T))==null?void 0:ce.textValue)??"":"";!c&&T!=null&&t.inputValue===void 0&&T===J.current&&de.current!==Q&&(O(Q),L(Q)),J.current=g,de.current=Q});let Ce=og({...t,value:s.useMemo(()=>Array.isArray(g)&&g.length===0?null:{inputValue:B,value:g,selectedKey:T},[B,T,g])}),z=()=>{r&&T==null?Y():ue()},Y=()=>{if(i==="multiple"){O(B),S();return}let Q=null;J.current=Q,v(Q),S()},ue=(Q=!1)=>{var ce,he,Ao;if(h!==void 0&&t.inputValue!==void 0){let Bo=T!=null?((ce=E.getItem(T))==null?void 0:ce.textValue)??"":"";(Q||i==="multiple"||B!==Bo)&&((he=t.onSelectionChange)==null||he.call(t,T),(Ao=t.onChange)==null||Ao.call(t,g)),O(Bo),S()}else X(),S()};const Re=()=>{var Q;if(r){const ce=T!=null?((Q=E.getItem(T))==null?void 0:Q.textValue)??"":"";B===ce?ue():Y()}else ue()};let El=()=>{P.isOpen&&C.focusedKey!=null?C.isSelected(C.focusedKey)&&i==="single"?ue(!0):C.select(C.focusedKey):Re()},Dt=s.useRef([B,g]),An=Q=>{Q?(Dt.current=[B,g],n==="focus"&&!t.isReadOnly&&k(null,"focus")):(o&&Re(),(B!==Dt.current[0]||g!==Dt.current[1])&&Ce.commitValidation()),f(Q)},xp=s.useMemo(()=>P.isOpen?u?H:j:$,[P.isOpen,H,j,u,$]),Po=t.defaultSelectedKey??(i==="single"?M:null);return{...Ce,...P,focusStrategy:d,toggle:K,open:k,close:Re,selectionManager:C,value:g,defaultValue:p??M,setValue:v,selectedKey:T,selectedItems:F,defaultSelectedKey:Po,setSelectedKey:v,disabledKeys:R,isFocused:c,setFocused:An,selectedItem:F[0]??null,collection:xp,inputValue:B,defaultInputValue:Zi(t.defaultInputValue,Po,E)??V,setInputValue:L,commit:El,revert:z}}function s3(t,e,n){return new gr(Bd(t,t,e,n))}function Bd(t,e,n,l){let r=[];for(let o of e)if(o.type==="section"&&o.hasChildNodes){let i=Bd(t,nl(o,t),n,l);[...i].some(u=>u.type==="item")&&r.push({...o,childNodes:i})}else o.type==="item"&&l(o.textValue,n)?r.push({...o}):o.type!=="item"&&r.push({...o});return r}function Zi(t,e,n){var l;return t==null&&e!=null?((l=n.getItem(e))==null?void 0:l.textValue)??"":t}function c3(t){if(t!==void 0)return t===null?[]:Array.isArray(t)?t:[t]}const d3=s.createContext(null),Kd=s.createContext(null),f3=Cn(function(e,n){[e,n]=ve(e,n,d3);let{children:l,isDisabled:r=!1,isInvalid:o=!1,isRequired:i=!1,isReadOnly:u=!1}=e,a=s.useMemo(()=>x.createElement(vl.Provider,{value:{items:e.items??e.defaultItems}},typeof l=="function"?l({isOpen:!1,isDisabled:r,isInvalid:o,isRequired:i,defaultChildren:null,isReadOnly:u}):l),[l,r,o,i,u,e.items,e.defaultItems]);return x.createElement(Ur,{content:a},c=>x.createElement(b3,{props:e,collection:c,comboBoxRef:n}))}),p3=[Ht,En,xl,eo,kn];function b3({props:t,collection:e,comboBoxRef:n}){let{name:l,formValue:r="key",allowsCustomValue:o}=t;o&&(r="text");let{validationBehavior:i}=vn(to)||{},u=t.validationBehavior??i??"native",{contains:a}=lg({sensitivity:"base"}),c=a3({...t,defaultFilter:t.defaultFilter||a,items:t.items,children:void 0,collection:e,validationBehavior:u}),f=s.useRef(null),d=s.useRef(null),b=s.useRef(null),p=s.useRef(null),h=s.useRef(null),[y,m]=xn(!t["aria-label"]&&!t["aria-labelledby"]),{buttonProps:g,inputProps:v,listBoxProps:E,labelProps:C,descriptionProps:R,errorMessageProps:T,valueProps:F,...B}=i3({...Fr(t),label:m,inputRef:d,buttonRef:f,listBoxRef:p,popoverRef:h,name:r==="text"?l:void 0,validationBehavior:u},c),[L,M]=s.useState(null),V=s.useCallback(()=>{var w;if(d.current&&!b.current){let P=(w=f.current)==null?void 0:w.getBoundingClientRect(),k=d.current.getBoundingClientRect(),K=P?Math.min(P.left,k.left):k.left,_=P?Math.max(P.right,k.right):k.right;M(_-K+"px")}},[f,d,M]);dn({ref:d,onResize:V});let H=s.useMemo(()=>({get current(){return b.current||d.current}}),[b,d]),j=s.useMemo(()=>({isOpen:c.isOpen,isDisabled:t.isDisabled||!1,isInvalid:B.isInvalid||!1,isRequired:t.isRequired||!1,isReadOnly:t.isReadOnly||!1}),[c.isOpen,t.isDisabled,B.isInvalid,t.isRequired,t.isReadOnly]),$=ae({...t,values:j,defaultClassName:"react-aria-ComboBox"}),D=oe(t,{global:!0});delete D.id;let A=[];if(l&&r==="key"){let w=Array.isArray(c.value)?c.value:[c.value];w.length===0&&(w=[null]),A=w.map((P,k)=>x.createElement("input",{key:k,type:"hidden",name:l,form:t.form,value:P??""}))}return x.createElement(Me,{values:[[Kd,c],[Ht,{...C,ref:y}],[En,{...g,ref:f,isPressed:c.isOpen}],[xl,{...v,ref:d}],[St,c],[Hr,{ref:h,triggerRef:H,scrollRef:p,placement:"bottom start",isNonModal:!0,trigger:"ComboBox",style:{"--trigger-width":L},clearContexts:p3}],[vl,{...E,ref:p}],[Wt,c],[kn,{slots:{description:R,errorMessage:T}}],[eo,{ref:b,isInvalid:B.isInvalid,isDisabled:t.isDisabled||!1}],[Zs,B],[h3,F]]},x.createElement(ee.div,{...D,...$,ref:n,slot:t.slot||void 0,"data-focused":c.isFocused||void 0,"data-open":c.isOpen||void 0,"data-disabled":t.isDisabled||void 0,"data-readonly":t.isReadOnly||void 0,"data-invalid":B.isInvalid||void 0,"data-required":t.isRequired||void 0},$.children,A))}const h3=s.createContext(null),Tn=s.createContext({}),Yi=({children:t,className:e,fullWidth:n,menuTrigger:l="focus",variant:r,...o})=>{const i=x.useMemo(()=>yh({fullWidth:n}),[n]);return I.jsx(Tn,{value:{slots:i,variant:r},children:I.jsx(f3,{"data-slot":"combo-box",menuTrigger:l,...o,className:ge(e,i==null?void 0:i.base()),children:u=>I.jsx(I.Fragment,{children:typeof t=="function"?t(u):t})})})},m3=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(Tn),r=fe(l==null?void 0:l.inputGroup,e);return I.jsx("div",{className:r,"data-slot":"combo-box-input-group",...n,children:t})},g3=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(Tn),r=s.useContext(Kd);return I.jsx(Nr,{className:ge(e,l==null?void 0:l.trigger()),"data-open":oa(r==null?void 0:r.isOpen),"data-slot":"combo-box-trigger",...n,children:t??I.jsx(cm,{"data-slot":"combo-box-trigger-default-icon"})})},y3=({children:t,className:e,placement:n="bottom",...l})=>{const{slots:r}=s.useContext(Tn);return I.jsx(ia,{value:{variant:"default"},children:I.jsx(t4,{...l,className:ge(e,r==null?void 0:r.popover()),"data-slot":"combo-box-popover",placement:n,children:t})})},Z0=Object.assign(Yi,{Root:Yi,InputGroup:m3,Trigger:g3,Popover:y3}),$3=({...t})=>{const e=s.useId();return I.jsxs("svg",{"data-slot":"spinner-icon",viewBox:"0 0 24 24",...t,children:[I.jsxs("defs",{children:[I.jsxs("linearGradient",{id:`«data-slot-icon-def-1»-${e}`,x1:"50%",x2:"50%",y1:"5.271%",y2:"91.793%",children:[I.jsx("stop",{offset:"0%",stopColor:"currentColor"}),I.jsx("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:.55})]}),I.jsxs("linearGradient",{id:`«data-slot-icon-def-2»-${e}`,x1:"50%",x2:"50%",y1:"15.24%",y2:"87.15%",children:[I.jsx("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:0}),I.jsx("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:.55})]})]}),I.jsxs("g",{fill:"none",children:[I.jsx("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),I.jsx("path",{d:"M8.749.021a1.5 1.5 0 0 1 .497 2.958A7.5 7.5 0 0 0 3 10.375a7.5 7.5 0 0 0 7.5 7.5v3c-5.799 0-10.5-4.7-10.5-10.5C0 5.23 3.726.865 8.749.021",fill:`url(#«data-slot-icon-def-1»-${e})`,transform:"translate(1.5 1.625)"}),I.jsx("path",{d:"M15.392 2.673a1.5 1.5 0 0 1 2.119-.115A10.48 10.48 0 0 1 21 10.375c0 5.8-4.701 10.5-10.5 10.5v-3a7.5 7.5 0 0 0 5.007-13.084a1.5 1.5 0 0 1-.115-2.118",fill:`url(#«data-slot-icon-def-2»-${e})`,transform:"translate(1.5 1.625)"})]})]})},Xi=({className:t,color:e,size:n,...l})=>I.jsx(De.span,{"data-slot":"spinner",...l,className:Dh({className:t,color:e,size:n}),children:I.jsx($3,{"aria-hidden":!0,"aria-label":"Loading",role:"presentation"})}),Y0=Object.assign(Xi,{Root:Xi});function v3(t,e){let n=e==null?void 0:e.isDisabled,[l,r]=s.useState(!1);return le(()=>{if(t!=null&&t.current&&!n){let o=()=>{if(t.current){let u=ze(t.current,{tabbable:!0});r(!!u.nextNode())}};o();let i=new MutationObserver(o);return i.observe(t.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{i.disconnect()}}}),n?!1:l}var Rd={};Rd={deselectedItem:t=>`${t.item} غير المحدد`,longPressToSelect:"اضغط مطولًا للدخول إلى وضع التحديد.",select:"تحديد",selectedAll:"جميع العناصر المحددة.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"لم يتم تحديد عناصر",one:()=>`${e.number(t.count)} عنصر محدد`,other:()=>`${e.number(t.count)} عنصر محدد`})}.`,selectedItem:t=>`${t.item} المحدد`};var Md={};Md={deselectedItem:t=>`${t.item} не е избран.`,longPressToSelect:"Натиснете и задръжте за да влезете в избирателен режим.",select:"Изберете",selectedAll:"Всички елементи са избрани.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Няма избрани елементи",one:()=>`${e.number(t.count)} избран елемент`,other:()=>`${e.number(t.count)} избрани елементи`})}.`,selectedItem:t=>`${t.item} избран.`};var Fd={};Fd={deselectedItem:t=>`Položka ${t.item} není vybrána.`,longPressToSelect:"Dlouhým stisknutím přejdete do režimu výběru.",select:"Vybrat",selectedAll:"Vybrány všechny položky.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nevybrány žádné položky",one:()=>`Vybrána ${e.number(t.count)} položka`,other:()=>`Vybráno ${e.number(t.count)} položek`})}.`,selectedItem:t=>`Vybrána položka ${t.item}.`};var Id={};Id={deselectedItem:t=>`${t.item} ikke valgt.`,longPressToSelect:"Lav et langt tryk for at aktivere valgtilstand.",select:"Vælg",selectedAll:"Alle elementer valgt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ingen elementer valgt",one:()=>`${e.number(t.count)} element valgt`,other:()=>`${e.number(t.count)} elementer valgt`})}.`,selectedItem:t=>`${t.item} valgt.`};var Ld={};Ld={deselectedItem:t=>`${t.item} nicht ausgewählt.`,longPressToSelect:"Gedrückt halten, um Auswahlmodus zu öffnen.",select:"Auswählen",selectedAll:"Alle Elemente ausgewählt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Keine Elemente ausgewählt",one:()=>`${e.number(t.count)} Element ausgewählt`,other:()=>`${e.number(t.count)} Elemente ausgewählt`})}.`,selectedItem:t=>`${t.item} ausgewählt.`};var zd={};zd={deselectedItem:t=>`Δεν επιλέχθηκε το στοιχείο ${t.item}.`,longPressToSelect:"Πατήστε παρατεταμένα για να μπείτε σε λειτουργία επιλογής.",select:"Επιλογή",selectedAll:"Επιλέχθηκαν όλα τα στοιχεία.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Δεν επιλέχθηκαν στοιχεία",one:()=>`Επιλέχθηκε ${e.number(t.count)} στοιχείο`,other:()=>`Επιλέχθηκαν ${e.number(t.count)} στοιχεία`})}.`,selectedItem:t=>`Επιλέχθηκε το στοιχείο ${t.item}.`};var Nd={};Nd={deselectedItem:t=>`${t.item} not selected.`,select:"Select",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"No items selected",one:()=>`${e.number(t.count)} item selected`,other:()=>`${e.number(t.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:t=>`${t.item} selected.`,longPressToSelect:"Long press to enter selection mode."};var Vd={};Vd={deselectedItem:t=>`${t.item} no seleccionado.`,longPressToSelect:"Mantenga pulsado para abrir el modo de selección.",select:"Seleccionar",selectedAll:"Todos los elementos seleccionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ningún elemento seleccionado",one:()=>`${e.number(t.count)} elemento seleccionado`,other:()=>`${e.number(t.count)} elementos seleccionados`})}.`,selectedItem:t=>`${t.item} seleccionado.`};var Od={};Od={deselectedItem:t=>`${t.item} pole valitud.`,longPressToSelect:"Valikurežiimi sisenemiseks vajutage pikalt.",select:"Vali",selectedAll:"Kõik üksused valitud.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Üksusi pole valitud",one:()=>`${e.number(t.count)} üksus valitud`,other:()=>`${e.number(t.count)} üksust valitud`})}.`,selectedItem:t=>`${t.item} valitud.`};var jd={};jd={deselectedItem:t=>`Kohdetta ${t.item} ei valittu.`,longPressToSelect:"Siirry valintatilaan painamalla pitkään.",select:"Valitse",selectedAll:"Kaikki kohteet valittu.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ei yhtään kohdetta valittu",one:()=>`${e.number(t.count)} kohde valittu`,other:()=>`${e.number(t.count)} kohdetta valittu`})}.`,selectedItem:t=>`${t.item} valittu.`};var _d={};_d={deselectedItem:t=>`${t.item} non sélectionné.`,longPressToSelect:"Appuyez de manière prolongée pour passer en mode de sélection.",select:"Sélectionner",selectedAll:"Tous les éléments sélectionnés.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Aucun élément sélectionné",one:()=>`${e.number(t.count)} élément sélectionné`,other:()=>`${e.number(t.count)} éléments sélectionnés`})}.`,selectedItem:t=>`${t.item} sélectionné.`};var Hd={};Hd={deselectedItem:t=>`${t.item} לא נבחר.`,longPressToSelect:"הקשה ארוכה לכניסה למצב בחירה.",select:"בחר",selectedAll:"כל הפריטים נבחרו.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"לא נבחרו פריטים",one:()=>`פריט ${e.number(t.count)} נבחר`,other:()=>`${e.number(t.count)} פריטים נבחרו`})}.`,selectedItem:t=>`${t.item} נבחר.`};var Wd={};Wd={deselectedItem:t=>`Stavka ${t.item} nije odabrana.`,longPressToSelect:"Dugo pritisnite za ulazak u način odabira.",select:"Odaberite",selectedAll:"Odabrane su sve stavke.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nije odabrana nijedna stavka",one:()=>`Odabrana je ${e.number(t.count)} stavka`,other:()=>`Odabrano je ${e.number(t.count)} stavki`})}.`,selectedItem:t=>`Stavka ${t.item} je odabrana.`};var Ud={};Ud={deselectedItem:t=>`${t.item} nincs kijelölve.`,longPressToSelect:"Nyomja hosszan a kijelöléshez.",select:"Kijelölés",selectedAll:"Az összes elem kijelölve.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Egy elem sincs kijelölve",one:()=>`${e.number(t.count)} elem kijelölve`,other:()=>`${e.number(t.count)} elem kijelölve`})}.`,selectedItem:t=>`${t.item} kijelölve.`};var Gd={};Gd={deselectedItem:t=>`${t.item} non selezionato.`,longPressToSelect:"Premi a lungo per passare alla modalità di selezione.",select:"Seleziona",selectedAll:"Tutti gli elementi selezionati.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nessun elemento selezionato",one:()=>`${e.number(t.count)} elemento selezionato`,other:()=>`${e.number(t.count)} elementi selezionati`})}.`,selectedItem:t=>`${t.item} selezionato.`};var qd={};qd={deselectedItem:t=>`${t.item} が選択されていません。`,longPressToSelect:"長押しして選択モードを開きます。",select:"選択",selectedAll:"すべての項目を選択しました。",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"項目が選択されていません",one:()=>`${e.number(t.count)} 項目を選択しました`,other:()=>`${e.number(t.count)} 項目を選択しました`})}。`,selectedItem:t=>`${t.item} を選択しました。`};var Zd={};Zd={deselectedItem:t=>`${t.item}이(가) 선택되지 않았습니다.`,longPressToSelect:"선택 모드로 들어가려면 길게 누르십시오.",select:"선택",selectedAll:"모든 항목이 선택되었습니다.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"선택된 항목이 없습니다",one:()=>`${e.number(t.count)}개 항목이 선택되었습니다`,other:()=>`${e.number(t.count)}개 항목이 선택되었습니다`})}.`,selectedItem:t=>`${t.item}이(가) 선택되었습니다.`};var Yd={};Yd={deselectedItem:t=>`${t.item} nepasirinkta.`,longPressToSelect:"Norėdami įjungti pasirinkimo režimą, paspauskite ir palaikykite.",select:"Pasirinkti",selectedAll:"Pasirinkti visi elementai.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nepasirinktas nė vienas elementas",one:()=>`Pasirinktas ${e.number(t.count)} elementas`,other:()=>`Pasirinkta elementų: ${e.number(t.count)}`})}.`,selectedItem:t=>`Pasirinkta: ${t.item}.`};var Xd={};Xd={deselectedItem:t=>`Vienums ${t.item} nav atlasīts.`,longPressToSelect:"Ilgi turiet nospiestu. lai ieslēgtu atlases režīmu.",select:"Atlasīt",selectedAll:"Atlasīti visi vienumi.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nav atlasīts neviens vienums",one:()=>`Atlasīto vienumu skaits: ${e.number(t.count)}`,other:()=>`Atlasīto vienumu skaits: ${e.number(t.count)}`})}.`,selectedItem:t=>`Atlasīts vienums ${t.item}.`};var Jd={};Jd={deselectedItem:t=>`${t.item} er ikke valgt.`,longPressToSelect:"Bruk et langt trykk for å gå inn i valgmodus.",select:"Velg",selectedAll:"Alle elementer er valgt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ingen elementer er valgt",one:()=>`${e.number(t.count)} element er valgt`,other:()=>`${e.number(t.count)} elementer er valgt`})}.`,selectedItem:t=>`${t.item} er valgt.`};var Qd={};Qd={deselectedItem:t=>`${t.item} niet geselecteerd.`,longPressToSelect:"Druk lang om de selectiemodus te openen.",select:"Selecteren",selectedAll:"Alle items geselecteerd.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Geen items geselecteerd",one:()=>`${e.number(t.count)} item geselecteerd`,other:()=>`${e.number(t.count)} items geselecteerd`})}.`,selectedItem:t=>`${t.item} geselecteerd.`};var ef={};ef={deselectedItem:t=>`Nie zaznaczono ${t.item}.`,longPressToSelect:"Naciśnij i przytrzymaj, aby wejść do trybu wyboru.",select:"Zaznacz",selectedAll:"Wszystkie zaznaczone elementy.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nie zaznaczono żadnych elementów",one:()=>`${e.number(t.count)} zaznaczony element`,other:()=>`${e.number(t.count)} zaznaczonych elementów`})}.`,selectedItem:t=>`Zaznaczono ${t.item}.`};var tf={};tf={deselectedItem:t=>`${t.item} não selecionado.`,longPressToSelect:"Mantenha pressionado para entrar no modo de seleção.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(t.count)} item selecionado`,other:()=>`${e.number(t.count)} itens selecionados`})}.`,selectedItem:t=>`${t.item} selecionado.`};var nf={};nf={deselectedItem:t=>`${t.item} não selecionado.`,longPressToSelect:"Prima continuamente para entrar no modo de seleção.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(t.count)} item selecionado`,other:()=>`${e.number(t.count)} itens selecionados`})}.`,selectedItem:t=>`${t.item} selecionado.`};var lf={};lf={deselectedItem:t=>`${t.item} neselectat.`,longPressToSelect:"Apăsați lung pentru a intra în modul de selectare.",select:"Selectare",selectedAll:"Toate elementele selectate.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Niciun element selectat",one:()=>`${e.number(t.count)} element selectat`,other:()=>`${e.number(t.count)} elemente selectate`})}.`,selectedItem:t=>`${t.item} selectat.`};var rf={};rf={deselectedItem:t=>`${t.item} не выбрано.`,longPressToSelect:"Нажмите и удерживайте для входа в режим выбора.",select:"Выбрать",selectedAll:"Выбраны все элементы.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Нет выбранных элементов",one:()=>`${e.number(t.count)} элемент выбран`,other:()=>`${e.number(t.count)} элементов выбрано`})}.`,selectedItem:t=>`${t.item} выбрано.`};var of={};of={deselectedItem:t=>`Nevybraté položky: ${t.item}.`,longPressToSelect:"Dlhším stlačením prejdite do režimu výberu.",select:"Vybrať",selectedAll:"Všetky vybraté položky.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Žiadne vybraté položky",one:()=>`${e.number(t.count)} vybratá položka`,other:()=>`Počet vybratých položiek:${e.number(t.count)}`})}.`,selectedItem:t=>`Vybraté položky: ${t.item}.`};var uf={};uf={deselectedItem:t=>`Element ${t.item} ni izbran.`,longPressToSelect:"Za izbirni način pritisnite in dlje časa držite.",select:"Izberite",selectedAll:"Vsi elementi so izbrani.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Noben element ni izbran",one:()=>`${e.number(t.count)} element je izbran`,other:()=>`${e.number(t.count)} elementov je izbranih`})}.`,selectedItem:t=>`Element ${t.item} je izbran.`};var af={};af={deselectedItem:t=>`${t.item} nije izabrano.`,longPressToSelect:"Dugo pritisnite za ulazak u režim biranja.",select:"Izaberite",selectedAll:"Izabrane su sve stavke.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nije izabrana nijedna stavka",one:()=>`Izabrana je ${e.number(t.count)} stavka`,other:()=>`Izabrano je ${e.number(t.count)} stavki`})}.`,selectedItem:t=>`${t.item} je izabrano.`};var sf={};sf={deselectedItem:t=>`${t.item} ej markerat.`,longPressToSelect:"Tryck länge när du vill öppna väljarläge.",select:"Markera",selectedAll:"Alla markerade objekt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Inga markerade objekt",one:()=>`${e.number(t.count)} markerat objekt`,other:()=>`${e.number(t.count)} markerade objekt`})}.`,selectedItem:t=>`${t.item} markerat.`};var cf={};cf={deselectedItem:t=>`${t.item} seçilmedi.`,longPressToSelect:"Seçim moduna girmek için uzun basın.",select:"Seç",selectedAll:"Tüm ögeler seçildi.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Hiçbir öge seçilmedi",one:()=>`${e.number(t.count)} öge seçildi`,other:()=>`${e.number(t.count)} öge seçildi`})}.`,selectedItem:t=>`${t.item} seçildi.`};var df={};df={deselectedItem:t=>`${t.item} не вибрано.`,longPressToSelect:"Виконайте довге натиснення, щоб перейти в режим вибору.",select:"Вибрати",selectedAll:"Усі елементи вибрано.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Жодних елементів не вибрано",one:()=>`${e.number(t.count)} елемент вибрано`,other:()=>`Вибрано елементів: ${e.number(t.count)}`})}.`,selectedItem:t=>`${t.item} вибрано.`};var ff={};ff={deselectedItem:t=>`未选择 ${t.item}。`,longPressToSelect:"长按以进入选择模式。",select:"选择",selectedAll:"已选择所有项目。",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"未选择项目",one:()=>`已选择 ${e.number(t.count)} 个项目`,other:()=>`已选择 ${e.number(t.count)} 个项目`})}。`,selectedItem:t=>`已选择 ${t.item}。`};var pf={};pf={deselectedItem:t=>`未選取「${t.item}」。`,longPressToSelect:"長按以進入選擇模式。",select:"選取",selectedAll:"已選取所有項目。",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"未選取任何項目",one:()=>`已選取 ${e.number(t.count)} 個項目`,other:()=>`已選取 ${e.number(t.count)} 個項目`})}。`,selectedItem:t=>`已選取「${t.item}」。`};var Cl={};Cl={"ar-AE":Rd,"bg-BG":Md,"cs-CZ":Fd,"da-DK":Id,"de-DE":Ld,"el-GR":zd,"en-US":Nd,"es-ES":Vd,"et-EE":Od,"fi-FI":jd,"fr-FR":_d,"he-IL":Hd,"hr-HR":Wd,"hu-HU":Ud,"it-IT":Gd,"ja-JP":qd,"ko-KR":Zd,"lt-LT":Yd,"lv-LV":Xd,"nb-NO":Jd,"nl-NL":Qd,"pl-PL":ef,"pt-BR":tf,"pt-PT":nf,"ro-RO":lf,"ru-RU":rf,"sk-SK":of,"sl-SI":uf,"sr-SP":af,"sv-SE":sf,"tr-TR":cf,"uk-UA":df,"zh-CN":ff,"zh-TW":pf};function x3(t){return t&&t.__esModule?t.default:t}function C3(t,e){let{getRowText:n=u=>{var a,c,f;return((c=(a=e.collection).getTextValue)==null?void 0:c.call(a,u))??((f=e.collection.getItem(u))==null?void 0:f.textValue)}}=t,l=_e(x3(Cl),"@react-aria/grid"),r=e.selectionManager.rawSelection,o=s.useRef(r),i=s.useCallback(()=>{var d;if(!e.selectionManager.isFocused||r===o.current){o.current=r;return}let u=Ji(r,o.current),a=Ji(o.current,r),c=e.selectionManager.selectionBehavior==="replace",f=[];if(e.selectionManager.selectedKeys.size===1&&c){let b=e.selectionManager.selectedKeys.keys().next().value;if(b!=null&&e.collection.getItem(b)){let p=n(b);p&&f.push(l.format("selectedItem",{item:p}))}}else if(u.size===1&&a.size===0){let b=u.keys().next().value;if(b!=null){let p=n(b);p&&f.push(l.format("selectedItem",{item:p}))}}else if(a.size===1&&u.size===0){let b=a.keys().next().value;if(b!=null&&e.collection.getItem(b)){let p=n(b);p&&f.push(l.format("deselectedItem",{item:p}))}}e.selectionManager.selectionMode==="multiple"&&(f.length===0||r==="all"||r.size>1||o.current==="all"||((d=o.current)==null?void 0:d.size)>1)&&f.push(r==="all"?l.format("selectedAll"):l.format("selectedCount",{count:r.size})),f.length>0&&yt(f.join(" ")),o.current=r},[r,e.selectionManager.selectedKeys,e.selectionManager.isFocused,e.selectionManager.selectionBehavior,e.selectionManager.selectionMode,e.collection,n,l]);Tr(()=>{if(e.selectionManager.isFocused)i();else{let u=requestAnimationFrame(i);return()=>cancelAnimationFrame(u)}},[r,e.selectionManager.isFocused])}function Ji(t,e){let n=new Set;if(t==="all"||e==="all")return n;for(let l of t.keys())e.has(l)||n.add(l);return n}function E3(t){return t&&t.__esModule?t.default:t}function w3(t){let e=_e(E3(Cl),"@react-aria/grid"),n=ta(),l=(n==="pointer"||n==="virtual"||n==null)&&typeof window<"u"&&"ontouchstart"in window,r=s.useMemo(()=>{let i=t.selectionManager.selectionMode,u=t.selectionManager.selectionBehavior,a;return l&&(a=e.format("longPressToSelect")),u==="replace"&&i!=="none"&&t.hasItemActions?a:void 0},[t.selectionManager.selectionMode,t.selectionManager.selectionBehavior,t.hasItemActions,e,l]);return $n(r)}const S3=s.createContext({}),D3=s.createContext(null),k3=Cn(function(e,n){[e,n]=ve(e,n,D3);let{validationBehavior:l}=vn(to)||{},r=e.validationBehavior??l??"native",o=s.useRef(null);[e,o]=ve(e,o,ls);let[i,u]=xn(!e["aria-label"]&&!e["aria-labelledby"]),[a,c]=s.useState("input"),{labelProps:f,inputProps:d,descriptionProps:b,errorMessageProps:p,...h}=Zc({...Fr(e),inputElementType:a,label:u,validationBehavior:r},o),y=s.useCallback(v=>{o.current=v,v&&c(v instanceof HTMLTextAreaElement?"textarea":"input")},[o]),m=ae({...e,values:{isDisabled:e.isDisabled||!1,isInvalid:h.isInvalid,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1},defaultClassName:"react-aria-TextField"}),g=oe(e,{global:!0});return delete g.id,x.createElement(ee.div,{...g,...m,ref:n,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":h.isInvalid||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0},x.createElement(Me,{values:[[Ht,{...f,ref:i}],[xl,{...d,ref:y}],[S3,{...d,ref:y}],[eo,{role:"presentation",isInvalid:h.isInvalid,isDisabled:e.isDisabled||!1}],[kn,{slots:{description:b,errorMessage:p}}],[Zs,h]]},m.children))}),bf=s.createContext({}),Qi=({children:t,className:e,fullWidth:n,variant:l,...r})=>{const o=x.useMemo(()=>Ph({fullWidth:n}),[n]);return I.jsx(k3,{"data-slot":"textfield",...r,className:ge(e,o),children:i=>I.jsx(bf,{value:{variant:l},children:I.jsx(I.Fragment,{children:typeof t=="function"?t(i):t})})})},eu=({className:t,fullWidth:e,variant:n,...l})=>{const r=s.useContext(bf),o=s.useContext(Tn),i=n??r.variant??o.variant;return I.jsx(Yg,{className:ge(t,vh({fullWidth:e,variant:i})),"data-slot":"input",...l})},X0=Object.assign(eu,{Root:eu}),J0=Object.assign(Qi,{Root:Qi}),tu=({children:t,className:e,isDisabled:n,isInvalid:l,isRequired:r,...o})=>I.jsx(Rh,{className:xh({isRequired:r,isDisabled:n,isInvalid:l,className:e}),"data-slot":"label",...o,children:t}),Q0=Object.assign(tu,{Root:tu}),nu=({children:t,className:e,...n})=>I.jsx(x4,{className:$h({className:e}),"data-slot":"description",slot:"description",...n,children:t}),ey=Object.assign(nu,{Root:nu});function P3(t){return t&&t.__esModule?t.default:t}function T3(t,e){let{key:n}=t,l=e.selectionManager,r=$e(),o=!e.selectionManager.canSelectItem(n),i=e.selectionManager.isSelected(n),u=()=>l.toggleSelection(n);const a=_e(P3(Cl),"@react-aria/grid");return{checkboxProps:{id:r,"aria-label":a.format("select"),isSelected:i,isDisabled:o,onChange:u}}}const lu=10,ru=5;class A3{setup(e,n,l){this.delegate=e,this.state=n,this.direction=l}getDropTargetFromPoint(e,n,l){let r=this.delegate.getDropTargetFromPoint(e,n,l);return!r||r.type==="root"?r:this.resolveDropTarget(r,e,n,l)}resolveDropTarget(e,n,l,r){let o=this.pointerTracking,i=l-o.lastY,u=n-o.lastX,a=o.yDirection,c=o.xDirection;if(Math.abs(i)>ru&&(a=i>0?"down":"up",o.yDirection=a,o.lastY=l),Math.abs(u)>lu&&(c=u>0?"right":"left",o.xDirection=c,o.lastX=n),e.dropPosition==="before"){let b=this.state.collection.getKeyBefore(e.key);for(;b!=null;){let p=this.state.collection.getItem(b);if((p==null?void 0:p.type)==="item")break;b=(p==null?void 0:p.parentKey)??null}if(b!=null){let p={type:"item",key:b,dropPosition:"after"};r(p)&&(e=p)}}let f=this.getPotentialTargets(e,r);if(f.length===0)return{type:"root"};let d;return f.length>1?d=this.selectTarget(f,e,n,l,a,c):(d=f[0],o.boundaryContext=null),d}getPotentialTargets(e,n){if(e.dropPosition==="on")return[e];let l=e,r=this.state.collection,o=r.getItem(l.key);for(;o&&(o==null?void 0:o.type)!=="item"&&o.nextKey!=null;)l.key=o.nextKey,o=r.getItem(o.nextKey);let i=[l];if(o&&o.hasChildNodes&&this.state.expandedKeys.has(o.key)&&r.getChildren&&l.dropPosition==="after"){let c=o.firstChildKey!=null?r.getItem(o.firstChildKey):null;for(;c&&c.type!=="item";)c=c.nextKey!=null?r.getItem(c.nextKey):null;if((c==null?void 0:c.type)==="item"){const f={type:"item",key:c.key,dropPosition:"before"};return n(f)?[f]:[]}}if((o==null?void 0:o.nextKey)!=null)return[e];let u=o==null?void 0:o.parentKey,a=[];for(;u!=null;){let c=r.getItem(u),f=(c==null?void 0:c.nextKey)!=null?r.getItem(c.nextKey):null;if(!f||f.parentKey!==u){let b={type:"item",key:u,dropPosition:"after"};if(n(b)&&a.push(b),f)break}u=c==null?void 0:c.parentKey}if(a.length>0&&i.push(...a),i.length===1){let c=r.getKeyAfter(l.key),f=c!=null?r.getItem(c):null;if(c!=null&&f&&o&&f.level!=null&&o.level!=null&&f.level>o.level){let d={type:"item",key:c,dropPosition:"before"};if(n(d))return[d]}}return i.filter(n)}selectTarget(e,n,l,r,o,i){if(e.length<2)return e[0];let u=this.pointerTracking,a=this.state.collection.getItem(n.key),c=a==null?void 0:a.parentKey;if(c==null)return e[0];if(!u.boundaryContext||u.boundaryContext.parentKey!==c){let h=u.yDirection==="up"?e.length-1:0;u.boundaryContext={parentKey:c,preferredTargetIndex:h,lastSwitchY:r,lastSwitchX:l}}let f=u.boundaryContext,d=Math.abs(l-f.lastSwitchX);if(Math.abs(r-f.lastSwitchY)>ru&&o){let h=f.preferredTargetIndex||0;o==="down"&&h===0?f.preferredTargetIndex=e.length-1:o==="up"&&h===e.length-1&&(f.preferredTargetIndex=0),u.xDirection=null}if(d>lu&&i){let h=f.preferredTargetIndex||0;i==="left"?this.direction==="ltr"?h0&&(f.preferredTargetIndex=h-1,f.lastSwitchX=l):i==="right"&&(this.direction==="ltr"?h>0&&(f.preferredTargetIndex=h-1,f.lastSwitchX=l):h{var f,d,b;let i=this.keyMap.get(o.key);e.visitNode&&(o=e.visitNode(o)),this.keyMap.set(o.key,o);let u=new Set,a=null,c=!1;if(o.type==="item"){for(let p of o.childNodes)if(((f=p.props)==null?void 0:f.colSpan)!==void 0){c=!0;break}}for(let p of o.childNodes)p.type==="cell"&&c&&(p.colspan=(d=p.props)==null?void 0:d.colSpan,p.colSpan=(b=p.props)==null?void 0:b.colSpan,p.colIndex=a?(a.colIndex??a.index)+(a.colSpan??1):p.index),p.type==="cell"&&p.parentKey==null&&(p.parentKey=o.key),u.add(p.key),a?(a.nextKey=p.key,p.prevKey=a.key):p.prevKey=null,n(p),a=p;if(a&&(a.nextKey=null),i)for(let p of i.childNodes)u.has(p.key)||l(p)},l=o=>{this.keyMap.delete(o.key);for(let i of o.childNodes)this.keyMap.get(i.key)===i&&l(i)},r=null;for(let[o,i]of e.items.entries()){let u={...i,level:i.level??0,key:i.key??"row-"+o,type:i.type??"row",value:i.value??null,hasChildNodes:!0,childNodes:[...i.childNodes],rendered:i.rendered,textValue:i.textValue??"",index:i.index??o};r?(r.nextKey=u.key,u.prevKey=r.key):u.prevKey=null,this.rows.push(u),n(u),r=u}r&&(r.nextKey=null)}*[Symbol.iterator](){yield*[...this.rows]}get size(){return[...this.rows].length}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);return n?n.prevKey??null:null}getKeyAfter(e){let n=this.keyMap.get(e);return n?n.nextKey??null:null}getFirstKey(){var e;return(e=[...this.rows][0])==null?void 0:e.key}getLastKey(){var n;let e=[...this.rows];return(n=e[e.length-1])==null?void 0:n.key}getItem(e){return this.keyMap.get(e)??null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}getChildren(e){let n=this.keyMap.get(e);return(n==null?void 0:n.childNodes)||[]}}const hf="row-header-column-"+Math.random().toString(36).slice(2);let vr="row-header-column-"+Math.random().toString(36).slice(2);for(;hf===vr;)vr="row-header-column-"+Math.random().toString(36).slice(2);function mf(t,e){if(e.length===0)return[];let n=[],l=new Map;for(let a of e){let c=a.parentKey,f=[a];for(;c!=null;){let d=t.get(c);if(!d)break;if(l.has(d)){d.colSpan??(d.colSpan=0),d.colSpan++,d.colspan=d.colSpan;let{column:b,index:p}=l.get(d);if(p>f.length)break;for(let h=p;ha.length)),o=Array(r).fill(0).map(()=>[]),i=0;for(let a of n){let c=r-1;for(let f of a){if(f){let d=o[c],b=d.reduce((p,h)=>p+(h.colSpan??1),0);if(b0&&(d[d.length-1].nextKey=p.key,p.prevKey=d[d.length-1].key),d.push(p)}d.length>0&&(d[d.length-1].nextKey=f.key,f.prevKey=d[d.length-1].key),f.level=c,f.colIndex=i,d.push(f)}c--}i++}let u=0;for(let a of o){let c=a.reduce((f,d)=>f+(d.colSpan??1),0);if(c({type:"headerrow",key:"headerrow-"+c,index:c,value:null,rendered:null,level:0,hasChildNodes:!0,childNodes:a,textValue:""}))}class K3 extends B3{constructor(e,n,l){let r=new Set,o=null,i=[];if(l!=null&&l.showSelectionCheckboxes){let d={type:"column",key:hf,value:null,textValue:"",level:0,index:l!=null&&l.showDragButtons?1:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isSelectionCell:!0}};i.unshift(d)}if(l!=null&&l.showDragButtons){let d={type:"column",key:vr,value:null,textValue:"",level:0,index:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isDragButtonCell:!0}};i.unshift(d)}let u=[],a=new Map,c=d=>{switch(d.type){case"body":o=d;break;case"column":a.set(d.key,d),d.hasChildNodes||(i.push(d),d.props.isRowHeader&&r.add(d.key));break;case"item":u.push(d);return}for(let b of d.childNodes)c(b)};for(let d of e)c(d);let f=mf(a,i);if(f.forEach((d,b)=>u.splice(b,0,d)),super({columnCount:i.length,items:u,visitNode:d=>(d.column=i[d.index],d)}),this._size=0,this.columns=i,this.rowHeaderColumnKeys=r,this.body=o,this.headerRows=f,this._size=[...o.childNodes].length,this.rowHeaderColumnKeys.size===0){let d=this.columns.find(b=>{var p,h;return!((p=b.props)!=null&&p.isDragButtonCell)&&!((h=b.props)!=null&&h.isSelectionCell)});d&&this.rowHeaderColumnKeys.add(d.key)}}*[Symbol.iterator](){yield*this.body.childNodes}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);return(n==null?void 0:n.prevKey)??null}getKeyAfter(e){let n=this.keyMap.get(e);return(n==null?void 0:n.nextKey)??null}getFirstKey(){var e;return((e=Xr(this.body.childNodes))==null?void 0:e.key)??null}getLastKey(){var e;return((e=Ws(this.body.childNodes))==null?void 0:e.key)??null}getItem(e){return e===this.body.key?this.body:this.keyMap.get(e)??null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}getChildren(e){if(e===this.body.key)return this.body.childNodes;let n=this.getItem(e);return(n==null?void 0:n.type)==="item"?[...n.childNodes].filter(l=>l.type==="cell"):super.getChildren(e)}getTextValue(e){let n=this.getItem(e);if(!n)return"";if(n.textValue)return n.textValue;let l=this.rowHeaderColumnKeys;if(l){let r=[];for(let o of n.childNodes){let i=this.columns[o.index];if(l.has(i.key)&&o.textValue&&r.push(o.textValue),r.length===l.size)break}return r.join(" ")}return""}}function R3(t){return t!=null&&(!isNaN(t)||String(t).match(/^(\d+)(?=%$)/)!==null)}function M3(t){if(!t||typeof t=="number")return 1;let e=t.match(/^(.+)(?=fr$)/);return e?parseFloat(e[0]):1}function co(t,e){if(typeof t=="string"){let n=t.match(/^(\d+)(?=%$)/);if(!n)throw new Error("Only percentages or numbers are supported for static column widths");return e*(parseFloat(n[0])/100)}return t}function gf(t,e){return t!=null?co(t,e):Number.MAX_SAFE_INTEGER}function yf(t,e){return t!=null?co(t,e):0}function F3(t,e,n,l,r){let o=!1,i=e.map((u,a)=>{let c=n.get(u.key)!=null?n.get(u.key)??"1fr":u.width??u.defaultWidth??(l==null?void 0:l(a))??"1fr",f=!1,d=0,b=0,p=0;R3(c)?(d=co(c,t),f=!0):(b=M3(c),b<=0&&(f=!0));let h=yf(u.minWidth??(r==null?void 0:r(a))??0,t),y=gf(u.maxWidth,t),m=Math.max(h,Math.min(d,y));return f?p=m:d>m&&(f=!0,p=m),f||(o=!0),{frozen:f,baseSize:d,hypotheticalMainSize:m,min:h,max:y,flex:b,targetMainSize:p,violation:0}});for(;o;){let u=0,a=0;i.forEach(d=>{d.frozen?u+=d.targetMainSize:(u+=d.baseSize,a+=d.flex)});let c=t-u;c>0&&i.forEach(d=>{if(!d.frozen){let b=d.flex/a;d.targetMainSize=d.baseSize+b*c}});let f=0;i.forEach(d=>{if(d.violation=0,!d.frozen){let{min:b,max:p,targetMainSize:h}=d;d.targetMainSize=Math.max(b,Math.min(h,p)),d.violation=d.targetMainSize-h,f+=d.violation}}),o=!1,i.forEach(d=>{f===0||Math.sign(f)===Math.sign(d.violation)?d.frozen=!0:d.frozen||(o=!0)})}return I3(i)}function I3(t){let e=0,n=0,l=[];return t.forEach(function(r){let o=r.targetMainSize,i=Math.round(o+e)-n;e+=o,n+=i,l.push(i)}),l}class L3{constructor(e){this.columnWidths=new Map,this.columnMinWidths=new Map,this.columnMaxWidths=new Map,this.getDefaultWidth=(e==null?void 0:e.getDefaultWidth)??(()=>"1fr"),this.getDefaultMinWidth=(e==null?void 0:e.getDefaultMinWidth)??(()=>75)}splitColumnsIntoControlledAndUncontrolled(e){return e.reduce((n,l)=>(l.props.width!=null?n[0].set(l.key,l):n[1].set(l.key,l),n),[new Map,new Map])}recombineColumns(e,n,l,r){return new Map(e.map(o=>l.has(o.key)?[o.key,n.get(o.key)]:[o.key,r.get(o.key).props.width]))}getInitialUncontrolledWidths(e){return new Map(Array.from(e).map(([n,l])=>{var r;return[n,l.props.defaultWidth??((r=this.getDefaultWidth)==null?void 0:r.call(this,l))??"1fr"]}))}getColumnWidth(e){return this.columnWidths.get(e)??0}getColumnMinWidth(e){return this.columnMinWidths.get(e)??0}getColumnMaxWidth(e){return this.columnMaxWidths.get(e)??0}resizeColumnWidth(e,n,l,r){let o=this.columnWidths,i=!0,u=new Map;return r=Math.max(this.getColumnMinWidth(l),Math.min(this.getColumnMaxWidth(l),Math.floor(r))),e.columns.forEach(a=>{a.key===l?(u.set(a.key,r),i=!1):i?u.set(a.key,o.get(a.key)??0):u.set(a.key,a.props.width??n.get(a.key))}),u}buildColumnWidths(e,n,l){return this.columnWidths=new Map,this.columnMinWidths=new Map,this.columnMaxWidths=new Map,F3(e,n.columns.map(o=>({...o.props,key:o.key})),l,o=>this.getDefaultWidth(n.columns[o]),o=>this.getDefaultMinWidth(n.columns[o])).forEach((o,i)=>{let u=n.columns[i].key,a=n.columns[i];this.columnWidths.set(u,o),this.columnMinWidths.set(u,yf(a.props.minWidth??this.getDefaultMinWidth(a),e)),this.columnMaxWidths.set(u,gf(a.props.maxWidth,e))}),this.columnWidths}}function z3(t,e){let{getDefaultWidth:n,getDefaultMinWidth:l,tableWidth:r=0}=t,[o,i]=s.useState(null),u=s.useMemo(()=>new L3({getDefaultWidth:n,getDefaultMinWidth:l}),[n,l]),[a,c]=s.useMemo(()=>u.splitColumnsIntoControlledAndUncontrolled(e.collection.columns),[e.collection.columns,u]),[f,d]=s.useState(()=>u.getInitialUncontrolledWidths(c)),[b,p]=s.useState(e.collection.columns);if(e.collection.columns!==b){if(e.collection.columns.length!==b.length||e.collection.columns.some((E,C)=>E.key!==b[C].key)){let E=u.getInitialUncontrolledWidths(c);d(E)}p(e.collection.columns)}let h=s.useMemo(()=>u.recombineColumns(e.collection.columns,f,c,a),[e.collection.columns,f,c,a,u]),y=s.useCallback(E=>{i(E)},[i]),m=s.useCallback((E,C)=>{let R=u.resizeColumnWidth(e.collection,f,E,C),T=new Map(Array.from(c).map(([F])=>[F,R.get(F)]));return T.set(E,C),d(T),R},[c,d,u,e.collection,f]),g=s.useCallback(()=>{i(null)},[i]),v=s.useMemo(()=>u.buildColumnWidths(r,e.collection,h),[r,e.collection,h,u]);return s.useMemo(()=>({resizingColumn:o,updateResizedColumns:m,startResize:y,endResize:g,getColumnWidth:E=>u.getColumnWidth(E),getColumnMinWidth:E=>u.getColumnMinWidth(E),getColumnMaxWidth:E=>u.getColumnMaxWidth(E),tableState:e,columnWidths:v}),[u,v,o,m,y,g,e])}function N3(t){let{collection:e,focusMode:n}=t,l=t.UNSAFE_selectionState||Jr(t),r=s.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),o=l.setFocusedKey;l.setFocusedKey=(a,c)=>{var f,d;if(n==="cell"&&a!=null){let b=e.getItem(a);if((b==null?void 0:b.type)==="item"){let p=nl(b,e);c==="last"?a=((f=Ws(p))==null?void 0:f.key)??null:a=((d=Xr(p))==null?void 0:d.key)??null}}o(a,c)};let i=s.useMemo(()=>new yl(e,l),[e,l]);const u=s.useRef(null);return s.useEffect(()=>{if(l.focusedKey!=null&&u.current&&!e.getItem(l.focusedKey)){const a=u.current.getItem(l.focusedKey),c=(a==null?void 0:a.parentKey)!=null&&(a.type==="cell"||a.type==="rowheader"||a.type==="column")?u.current.getItem(a.parentKey):a;if(!c){l.setFocusedKey(null);return}const f=u.current.rows,d=e.rows,b=f.length-d.length;let p=Math.min(b>1?Math.max(c.index-b+1,0):c.index,d.length-1),h=null;for(;p>=0;){if(!i.isDisabled(d[p].key)&&d[p].type!=="headerrow"){h=d[p];break}pc.index&&(p=c.index),p--)}if(h){const y=h.hasChildNodes?[...nl(h,e)]:[],m=h.hasChildNodes&&c!==a&&a&&a.index({showSelectionCheckboxes:r&&l!=="none",showDragButtons:o,selectionMode:l,columns:[]}),[t.children,r,l,o]),a=Us(t,s.useCallback(p=>new K3(p,null,u),[u]),u),{disabledKeys:c,selectionManager:f}=N3({...t,collection:a,disabledBehavior:t.disabledBehavior||"selection"}),[d,b]=ct(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,t.onExpandedChange);return{collection:a,disabledKeys:c,selectionManager:f,showSelectionCheckboxes:t.showSelectionCheckboxes||!1,sortDescriptor:t.sortDescriptor??null,isKeyboardNavigationDisabled:a.size===0||e,setKeyboardNavigationDisabled:n,sort(p,h){var y,m;(m=t.onSortChange)==null||m.call(t,{column:p,direction:h??(((y=t.sortDescriptor)==null?void 0:y.column)===p?V3[t.sortDescriptor.direction]:"ascending")})},expandedKeys:d,toggleKey(p){b(h=>{let y=new Set(h);return y.has(p)?y.delete(p):y.add(p),y})},treeColumn:i}}function j3(t,e){let n=s.useMemo(()=>e?t.collection.filter(e):t.collection,[t.collection,e]),l=t.selectionManager.withCollection(n);return{...t,collection:n,selectionManager:l}}class $f{constructor(e){if(this.collection=e.collection,this.disabledKeys=e.disabledKeys,this.disabledBehavior=e.disabledBehavior||"all",this.direction=e.direction,this.collator=e.collator,!e.layout&&!e.ref)throw new Error("Either a layout or a ref must be specified.");this.layoutDelegate=e.layoutDelegate||(e.layout?new _3(e.layout):new hr(e.ref)),this.focusMode=e.focusMode??"row"}isCell(e){return e.type==="cell"}isRow(e){return e.type==="row"||e.type==="item"}isDisabled(e){var n,l;return this.disabledBehavior==="all"&&(((n=e.props)==null?void 0:n.isDisabled)||this.disabledKeys.has(e.key))&&((l=e.props)==null?void 0:l.disabledBehavior)!=="selection"}findPreviousKey(e,n,l=!1){let r=e!=null?this.collection.getKeyBefore(e):this.collection.getLastKey();for(;r!=null;){let o=this.collection.getItem(r);if(!o)return null;if((l||!this.isDisabled(o))&&(!n||n(o)))return r;r=this.collection.getKeyBefore(r)}return null}findNextKey(e,n,l=!1){let r=e!=null?this.collection.getKeyAfter(e):this.collection.getFirstKey();for(;r!=null;){let o=this.collection.getItem(r);if(!o)return null;if((l||!this.isDisabled(o))&&(!n||n(o)))return r;if(r=this.collection.getKeyAfter(r),r==null)return null}return null}getKeyForItemInRowByIndex(e,n=0){if(n<0)return null;let l=this.collection.getItem(e);if(!l)return null;let r=0;for(let o of Ee(l,this.collection)){if(o.colSpan&&o.colSpan+r>n||(o.colSpan&&(r=r+o.colSpan-1),r===n))return o.key??null;r++}return null}getKeyBelow(e,n){let l=e,r=this.collection.getItem(l);if(!r||(this.isCell(r)&&(l=r.parentKey??null),l==null))return null;if(l=this.findNextKey(l,o=>o.type==="item",n==null?void 0:n.includeDisabled),l!=null){if(this.isCell(r)){let o=r.colIndex?r.colIndex:r.index;return this.getKeyForItemInRowByIndex(l,o)}if(this.focusMode==="row")return l}return null}getKeyAbove(e,n){let l=e,r=this.collection.getItem(l);if(!r||(this.isCell(r)&&(l=r.parentKey??null),l==null))return null;if(l=this.findPreviousKey(l,o=>o.type==="item",n==null?void 0:n.includeDisabled),l!=null){if(this.isCell(r)){let o=r.colIndex?r.colIndex:r.index;return this.getKeyForItemInRowByIndex(l,o)}if(this.focusMode==="row")return l}return null}getKeyRightOf(e){var l,r;let n=this.collection.getItem(e);if(!n)return null;if(this.isRow(n)){let o=Ee(n,this.collection);return(this.direction==="rtl"?(l=On(o))==null?void 0:l.key:(r=At(o))==null?void 0:r.key)??null}if(this.isCell(n)&&n.parentKey!=null){let o=this.collection.getItem(n.parentKey);if(!o)return null;let i=Ee(o,this.collection),u=(this.direction==="rtl"?ln(i,n.index-1):ln(i,n.index+1))??null;return u?u.key??null:this.focusMode==="row"?n.parentKey??null:(this.direction==="rtl"?this.getFirstKey(e):this.getLastKey(e))??null}return null}getKeyLeftOf(e){var l,r;let n=this.collection.getItem(e);if(!n)return null;if(this.isRow(n)){let o=Ee(n,this.collection);return(this.direction==="rtl"?(l=At(o))==null?void 0:l.key:(r=On(o))==null?void 0:r.key)??null}if(this.isCell(n)&&n.parentKey!=null){let o=this.collection.getItem(n.parentKey);if(!o)return null;let i=Ee(o,this.collection),u=(this.direction==="rtl"?ln(i,n.index+1):ln(i,n.index-1))??null;return u?u.key??null:this.focusMode==="row"?n.parentKey??null:(this.direction==="rtl"?this.getLastKey(e):this.getFirstKey(e))??null}return null}getFirstKey(e,n){var o,i;let l=e??null,r;if(l!=null){if(r=this.collection.getItem(l),!r)return null;if(this.isCell(r)&&!n&&r.parentKey!=null){let u=this.collection.getItem(r.parentKey);return u?((o=At(Ee(u,this.collection)))==null?void 0:o.key)??null:null}}if(l=this.findNextKey(void 0,u=>u.type==="item"),l!=null&&(r&&this.isCell(r)&&n||this.focusMode==="cell")){let u=this.collection.getItem(l);if(!u)return null;l=((i=At(Ee(u,this.collection)))==null?void 0:i.key)??null}return l}getLastKey(e,n){var o,i;let l=e??null,r;if(l!=null){if(r=this.collection.getItem(l),!r)return null;if(this.isCell(r)&&!n&&r.parentKey!=null){let u=this.collection.getItem(r.parentKey);if(!u)return null;let a=Ee(u,this.collection);return((o=On(a))==null?void 0:o.key)??null}}if(l=this.findPreviousKey(void 0,u=>u.type==="item"),l!=null&&(r&&this.isCell(r)&&n||this.focusMode==="cell")){let u=this.collection.getItem(l);if(!u)return null;let a=Ee(u,this.collection);l=((i=On(a))==null?void 0:i.key)??null}return l}getKeyPageAbove(e){let n=e,l=this.layoutDelegate.getItemRect(n);if(!l)return null;let r=Math.max(0,l.y+l.height-this.layoutDelegate.getVisibleRect().height);for(;l&&l.y>r&&n!=null&&(n=this.getKeyAbove(n)??null,n!=null);)l=this.layoutDelegate.getItemRect(n);return n}getKeyPageBelow(e){let n=e,l=this.layoutDelegate.getItemRect(n);if(!l)return null;let r=this.layoutDelegate.getVisibleRect().height,o=Math.min(this.layoutDelegate.getContentSize().height,l.y+r);for(;l&&l.y+l.heightc.type==="item"),l==null&&!i&&(l=this.getFirstKey(),i=!0)}return null}}class _3{constructor(e){this.layout=e}getContentSize(){return this.layout.getContentSize()}getItemRect(e){var n;return((n=this.layout.getLayoutInfo(e))==null?void 0:n.rect)||null}getVisibleRect(){return this.layout.virtualizer.visibleRect}}const fo=new WeakMap;function H3(t,e,n){let{isVirtualized:l,disallowTypeAhead:r,keyboardDelegate:o,focusMode:i,scrollRef:u,getRowText:a,onRowAction:c,onCellAction:f,escapeKeyBehavior:d="clearSelection",shouldSelectOnPressUp:b}=t,{selectionManager:p}=e;!t["aria-label"]&&!t["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let h=Pn({usage:"search",sensitivity:"base"}),{direction:y}=Pe(),m=e.selectionManager.disabledBehavior,g=s.useMemo(()=>o||new $f({collection:e.collection,disabledKeys:e.disabledKeys,disabledBehavior:m,ref:n,direction:y,collator:h,focusMode:i}),[o,e.collection,e.disabledKeys,m,n,y,h,i]),{collectionProps:v}=Zr({ref:n,selectionManager:p,keyboardDelegate:g,isVirtualized:l,scrollRef:u,disallowTypeAhead:r,escapeKeyBehavior:d}),E=$e(t.id);fo.set(e,{keyboardDelegate:g,actions:{onRowAction:c,onCellAction:f},shouldSelectOnPressUp:b});let C=w3({selectionManager:p,hasItemActions:!!(c||f)}),R=oe(t,{labelable:!0}),T=s.useCallback(M=>{if(p.isFocused){ne(M.currentTarget,U(M))||p.setFocused(!1);return}ne(M.currentTarget,U(M))&&p.setFocused(!0)},[p]),F=s.useMemo(()=>({onBlur:v.onBlur,onFocus:T}),[T,v.onBlur]),B=v3(n,{isDisabled:e.collection.size!==0}),L=W(R,{role:"grid",id:E,"aria-multiselectable":p.selectionMode==="multiple"?"true":void 0},e.isKeyboardNavigationDisabled?F:v,e.collection.size===0&&{tabIndex:B?-1:0}||void 0,C);return l&&(L["aria-rowcount"]=e.collection.size,L["aria-colcount"]=e.collection.columnCount),C3({getRowText:a},e),{gridProps:L}}const po=new WeakMap;function xr(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}function vf(t,e){let n=po.get(t);if(!n)throw new Error("Unknown grid");return`${n}-${xr(e)}`}function xf(t,e,n){let l=po.get(t);if(!l)throw new Error("Unknown grid");return`${l}-${xr(e)}-${xr(n)}`}function Cr(t,e){return[...t.collection.rowHeaderColumnKeys].map(n=>xf(t,e,n)).join(" ")}var Cf={};Cf={ascending:"تصاعدي",ascendingSort:t=>`ترتيب حسب العمود ${t.columnName} بترتيب تصاعدي`,columnSize:t=>`${t.value} بالبكسل`,descending:"تنازلي",descendingSort:t=>`ترتيب حسب العمود ${t.columnName} بترتيب تنازلي`,resizerDescription:"اضغط على مفتاح Enter لبدء تغيير الحجم",select:"تحديد",selectAll:"تحديد الكل",sortable:"عمود قابل للترتيب",collapse:"طي",expand:"تمديد"};var Ef={};Ef={ascending:"възходящ",ascendingSort:t=>`сортирано по колона ${t.columnName} във възходящ ред`,columnSize:t=>`${t.value} пиксела`,descending:"низходящ",descendingSort:t=>`сортирано по колона ${t.columnName} в низходящ ред`,resizerDescription:"Натиснете „Enter“, за да започнете да преоразмерявате",select:"Изберете",selectAll:"Изберете всичко",sortable:"сортираща колона",collapse:"Свиване",expand:"Разширяване"};var wf={};wf={ascending:"vzestupně",ascendingSort:t=>`řazeno vzestupně podle sloupce ${t.columnName}`,columnSize:t=>`${t.value} pixelů`,descending:"sestupně",descendingSort:t=>`řazeno sestupně podle sloupce ${t.columnName}`,resizerDescription:"Stisknutím klávesy Enter začnete měnit velikost",select:"Vybrat",selectAll:"Vybrat vše",sortable:"sloupec s možností řazení",collapse:"Sbalit",expand:"Roztáhnout"};var Sf={};Sf={ascending:"stigende",ascendingSort:t=>`sorteret efter kolonne ${t.columnName} i stigende rækkefølge`,columnSize:t=>`${t.value} pixels`,descending:"faldende",descendingSort:t=>`sorteret efter kolonne ${t.columnName} i faldende rækkefølge`,resizerDescription:"Tryk på Enter for at ændre størrelse",select:"Vælg",selectAll:"Vælg alle",sortable:"sorterbar kolonne",collapse:"Skjul",expand:"Udvid"};var Df={};Df={ascending:"aufsteigend",ascendingSort:t=>`sortiert nach Spalte ${t.columnName} in aufsteigender Reihenfolge`,columnSize:t=>`${t.value} Pixel`,descending:"absteigend",descendingSort:t=>`sortiert nach Spalte ${t.columnName} in absteigender Reihenfolge`,resizerDescription:"Eingabetaste zum Starten der Größenänderung drücken",select:"Auswählen",selectAll:"Alles auswählen",sortable:"sortierbare Spalte",collapse:"Reduzieren",expand:"Erweitern"};var kf={};kf={ascending:"αύξουσα",ascendingSort:t=>`διαλογή ανά στήλη ${t.columnName} σε αύξουσα σειρά`,columnSize:t=>`${t.value} pixel`,descending:"φθίνουσα",descendingSort:t=>`διαλογή ανά στήλη ${t.columnName} σε φθίνουσα σειρά`,resizerDescription:"Πατήστε Enter για έναρξη της αλλαγής μεγέθους",select:"Επιλογή",selectAll:"Επιλογή όλων",sortable:"Στήλη διαλογής",collapse:"Σύμπτυξη",expand:"Ανάπτυξη"};var Pf={};Pf={select:"Select",selectAll:"Select All",sortable:"sortable column",ascending:"ascending",descending:"descending",ascendingSort:t=>`sorted by column ${t.columnName} in ascending order`,descendingSort:t=>`sorted by column ${t.columnName} in descending order`,columnSize:t=>`${t.value} pixels`,resizerDescription:"Press Enter to start resizing",expand:"Expand",collapse:"Collapse"};var Tf={};Tf={ascending:"ascendente",ascendingSort:t=>`ordenado por columna ${t.columnName} en sentido ascendente`,columnSize:t=>`${t.value} píxeles`,descending:"descendente",descendingSort:t=>`ordenado por columna ${t.columnName} en orden descendente`,resizerDescription:"Pulse Intro para empezar a redimensionar",select:"Seleccionar",selectAll:"Seleccionar todos",sortable:"columna ordenable",collapse:"Contraer",expand:"Ampliar"};var Af={};Af={ascending:"tõusev järjestus",ascendingSort:t=>`sorditud veeru järgi ${t.columnName} tõusvas järjestuses`,columnSize:t=>`${t.value} pikslit`,descending:"laskuv järjestus",descendingSort:t=>`sorditud veeru järgi ${t.columnName} laskuvas järjestuses`,resizerDescription:"Suuruse muutmise alustamiseks vajutage klahvi Enter",select:"Vali",selectAll:"Vali kõik",sortable:"sorditav veerg",collapse:"Ahenda",expand:"Laienda"};var Bf={};Bf={ascending:"nouseva",ascendingSort:t=>`lajiteltu sarakkeen ${t.columnName} mukaan nousevassa järjestyksessä`,columnSize:t=>`${t.value} pikseliä`,descending:"laskeva",descendingSort:t=>`lajiteltu sarakkeen ${t.columnName} mukaan laskevassa järjestyksessä`,resizerDescription:"Aloita koon muutos painamalla Enter-näppäintä",select:"Valitse",selectAll:"Valitse kaikki",sortable:"lajiteltava sarake",collapse:"Pienennä",expand:"Laajenna"};var Kf={};Kf={ascending:"croissant",ascendingSort:t=>`trié en fonction de la colonne ${t.columnName} par ordre croissant`,columnSize:t=>`${t.value} pixels`,descending:"décroissant",descendingSort:t=>`trié en fonction de la colonne ${t.columnName} par ordre décroissant`,resizerDescription:"Appuyez sur Entrée pour commencer le redimensionnement.",select:"Sélectionner",selectAll:"Sélectionner tout",sortable:"colonne triable",collapse:"Réduire",expand:"Développer"};var Rf={};Rf={ascending:"עולה",ascendingSort:t=>`מוין לפי עמודה ${t.columnName} בסדר עולה`,columnSize:t=>`${t.value} פיקסלים`,descending:"יורד",descendingSort:t=>`מוין לפי עמודה ${t.columnName} בסדר יורד`,resizerDescription:"הקש Enter כדי לשנות את הגודל",select:"בחר",selectAll:"בחר הכול",sortable:"עמודה שניתן למיין",collapse:"כווץ",expand:"הרחב"};var Mf={};Mf={ascending:"rastući",ascendingSort:t=>`razvrstano po stupcima ${t.columnName} rastućem redoslijedom`,columnSize:t=>`${t.value} piksela`,descending:"padajući",descendingSort:t=>`razvrstano po stupcima ${t.columnName} padajućim redoslijedom`,resizerDescription:"Pritisnite Enter da biste započeli promenu veličine",select:"Odaberite",selectAll:"Odaberite sve",sortable:"stupac koji se može razvrstati",collapse:"Sažmi",expand:"Proširi"};var Ff={};Ff={ascending:"növekvő",ascendingSort:t=>`rendezve a(z) ${t.columnName} oszlop szerint, növekvő sorrendben`,columnSize:t=>`${t.value} képpont`,descending:"csökkenő",descendingSort:t=>`rendezve a(z) ${t.columnName} oszlop szerint, csökkenő sorrendben`,resizerDescription:"Nyomja le az Enter billentyűt az átméretezés megkezdéséhez",select:"Kijelölés",selectAll:"Összes kijelölése",sortable:"rendezendő oszlop",collapse:"Összecsukás",expand:"Kibontás"};var If={};If={ascending:"crescente",ascendingSort:t=>`in ordine crescente in base alla colonna ${t.columnName}`,columnSize:t=>`${t.value} pixel`,descending:"decrescente",descendingSort:t=>`in ordine decrescente in base alla colonna ${t.columnName}`,resizerDescription:"Premi Invio per iniziare a ridimensionare",select:"Seleziona",selectAll:"Seleziona tutto",sortable:"colonna ordinabile",collapse:"Comprimi",expand:"Espandi"};var Lf={};Lf={ascending:"昇順",ascendingSort:t=>`列 ${t.columnName} を昇順で並べ替え`,columnSize:t=>`${t.value} ピクセル`,descending:"降順",descendingSort:t=>`列 ${t.columnName} を降順で並べ替え`,resizerDescription:"Enter キーを押してサイズ変更を開始",select:"選択",selectAll:"すべて選択",sortable:"並べ替え可能な列",collapse:"折りたたむ",expand:"展開"};var zf={};zf={ascending:"오름차순",ascendingSort:t=>`${t.columnName} 열을 기준으로 오름차순으로 정렬됨`,columnSize:t=>`${t.value} 픽셀`,descending:"내림차순",descendingSort:t=>`${t.columnName} 열을 기준으로 내림차순으로 정렬됨`,resizerDescription:"크기 조정을 시작하려면 Enter를 누르세요.",select:"선택",selectAll:"모두 선택",sortable:"정렬 가능한 열",collapse:"접기",expand:"펼치기"};var Nf={};Nf={ascending:"didėjančia tvarka",ascendingSort:t=>`surikiuota pagal stulpelį ${t.columnName} didėjančia tvarka`,columnSize:t=>`${t.value} piks.`,descending:"mažėjančia tvarka",descendingSort:t=>`surikiuota pagal stulpelį ${t.columnName} mažėjančia tvarka`,resizerDescription:"Paspauskite „Enter“, kad pradėtumėte keisti dydį",select:"Pasirinkti",selectAll:"Pasirinkti viską",sortable:"rikiuojamas stulpelis",collapse:"Sutraukti",expand:"Išskleisti"};var Vf={};Vf={ascending:"augošā secībā",ascendingSort:t=>`kārtots pēc kolonnas ${t.columnName} augošā secībā`,columnSize:t=>`${t.value} pikseļi`,descending:"dilstošā secībā",descendingSort:t=>`kārtots pēc kolonnas ${t.columnName} dilstošā secībā`,resizerDescription:"Nospiediet Enter, lai sāktu izmēru mainīšanu",select:"Atlasīt",selectAll:"Atlasīt visu",sortable:"kārtojamā kolonna",collapse:"Sakļaut",expand:"Izvērst"};var Of={};Of={ascending:"stigende",ascendingSort:t=>`sortert etter kolonne ${t.columnName} i stigende rekkefølge`,columnSize:t=>`${t.value} piksler`,descending:"synkende",descendingSort:t=>`sortert etter kolonne ${t.columnName} i synkende rekkefølge`,resizerDescription:"Trykk på Enter for å starte størrelsesendring",select:"Velg",selectAll:"Velg alle",sortable:"kolonne som kan sorteres",collapse:"Skjul",expand:"Utvid"};var jf={};jf={ascending:"oplopend",ascendingSort:t=>`gesorteerd in oplopende volgorde in kolom ${t.columnName}`,columnSize:t=>`${t.value} pixels`,descending:"aflopend",descendingSort:t=>`gesorteerd in aflopende volgorde in kolom ${t.columnName}`,resizerDescription:"Druk op Enter om het formaat te wijzigen",select:"Selecteren",selectAll:"Alles selecteren",sortable:"sorteerbare kolom",collapse:"Samenvouwen",expand:"Uitvouwen"};var _f={};_f={ascending:"rosnąco",ascendingSort:t=>`posortowano według kolumny ${t.columnName} w porządku rosnącym`,columnSize:t=>`Liczba pikseli: ${t.value}`,descending:"malejąco",descendingSort:t=>`posortowano według kolumny ${t.columnName} w porządku malejącym`,resizerDescription:"Naciśnij Enter, aby rozpocząć zmienianie rozmiaru",select:"Zaznacz",selectAll:"Zaznacz wszystko",sortable:"kolumna z możliwością sortowania",collapse:"Zwiń",expand:"Rozwiń"};var Hf={};Hf={ascending:"crescente",ascendingSort:t=>`classificado pela coluna ${t.columnName} em ordem crescente`,columnSize:t=>`${t.value} pixels`,descending:"decrescente",descendingSort:t=>`classificado pela coluna ${t.columnName} em ordem decrescente`,resizerDescription:"Pressione Enter para começar a redimensionar",select:"Selecionar",selectAll:"Selecionar tudo",sortable:"coluna classificável",collapse:"Recolher",expand:"Expandir"};var Wf={};Wf={ascending:"ascendente",ascendingSort:t=>`Ordenar por coluna ${t.columnName} em ordem ascendente`,columnSize:t=>`${t.value} pixels`,descending:"descendente",descendingSort:t=>`Ordenar por coluna ${t.columnName} em ordem descendente`,resizerDescription:"Prima Enter para iniciar o redimensionamento",select:"Selecionar",selectAll:"Selecionar tudo",sortable:"Coluna ordenável",collapse:"Colapsar",expand:"Expandir"};var Uf={};Uf={ascending:"crescătoare",ascendingSort:t=>`sortate după coloana ${t.columnName} în ordine crescătoare`,columnSize:t=>`${t.value} pixeli`,descending:"descrescătoare",descendingSort:t=>`sortate după coloana ${t.columnName} în ordine descrescătoare`,resizerDescription:"Apăsați pe Enter pentru a începe redimensionarea",select:"Selectare",selectAll:"Selectare totală",sortable:"coloană sortabilă",collapse:"Restrângeți",expand:"Extindeți"};var Gf={};Gf={ascending:"возрастание",ascendingSort:t=>`сортировать столбец ${t.columnName} в порядке возрастания`,columnSize:t=>`${t.value} пикс.`,descending:"убывание",descendingSort:t=>`сортировать столбец ${t.columnName} в порядке убывания`,resizerDescription:"Нажмите клавишу Enter для начала изменения размеров",select:"Выбрать",selectAll:"Выбрать все",sortable:"сортируемый столбец",collapse:"Свернуть",expand:"Развернуть"};var qf={};qf={ascending:"vzostupne",ascendingSort:t=>`zoradené zostupne podľa stĺpca ${t.columnName}`,columnSize:t=>`Počet pixelov: ${t.value}`,descending:"zostupne",descendingSort:t=>`zoradené zostupne podľa stĺpca ${t.columnName}`,resizerDescription:"Stlačením klávesu Enter začnete zmenu veľkosti",select:"Vybrať",selectAll:"Vybrať všetko",sortable:"zoraditeľný stĺpec",collapse:"Zbaliť",expand:"Rozbaliť"};var Zf={};Zf={ascending:"naraščajoče",ascendingSort:t=>`razvrščeno po stolpcu ${t.columnName} v naraščajočem vrstnem redu`,columnSize:t=>`${t.value} slikovnih pik`,descending:"padajoče",descendingSort:t=>`razvrščeno po stolpcu ${t.columnName} v padajočem vrstnem redu`,resizerDescription:"Pritisnite tipko Enter da začnete spreminjati velikost",select:"Izberite",selectAll:"Izberite vse",sortable:"razvrstljivi stolpec",collapse:"Strni",expand:"Razširi"};var Yf={};Yf={ascending:"rastući",ascendingSort:t=>`sortirano po kolonama ${t.columnName} rastućim redosledom`,columnSize:t=>`${t.value} piksela`,descending:"padajući",descendingSort:t=>`sortirano po kolonama ${t.columnName} padajućim redosledom`,resizerDescription:"Pritisnite Enter da biste započeli promenu veličine",select:"Izaberite",selectAll:"Izaberite sve",sortable:"kolona koja se može sortirati",collapse:" Skupi",expand:"Proširi"};var Xf={};Xf={ascending:"stigande",ascendingSort:t=>`sorterat på kolumn ${t.columnName} i stigande ordning`,columnSize:t=>`${t.value} pixlar`,descending:"fallande",descendingSort:t=>`sorterat på kolumn ${t.columnName} i fallande ordning`,resizerDescription:"Tryck på Retur för att börja ändra storlek",select:"Markera",selectAll:"Markera allt",sortable:"sorterbar kolumn",collapse:"Dölj",expand:"Expandera"};var Jf={};Jf={ascending:"artan sırada",ascendingSort:t=>`${t.columnName} sütuna göre artan düzende sırala`,columnSize:t=>`${t.value} piksel`,descending:"azalan sırada",descendingSort:t=>`${t.columnName} sütuna göre azalan düzende sırala`,resizerDescription:"Yeniden boyutlandırmak için Enter'a basın",select:"Seç",selectAll:"Tümünü Seç",sortable:"Sıralanabilir sütun",collapse:"Daralt",expand:"Genişlet"};var Qf={};Qf={ascending:"висхідний",ascendingSort:t=>`відсортовано за стовпцем ${t.columnName} у висхідному порядку`,columnSize:t=>`${t.value} пікс.`,descending:"низхідний",descendingSort:t=>`відсортовано за стовпцем ${t.columnName} у низхідному порядку`,resizerDescription:"Натисніть Enter, щоб почати зміну розміру",select:"Вибрати",selectAll:"Вибрати все",sortable:"сортувальний стовпець",collapse:"Згорнути",expand:"Розгорнути"};var ep={};ep={ascending:"升序",ascendingSort:t=>`按列 ${t.columnName} 升序排序`,columnSize:t=>`${t.value} 像素`,descending:"降序",descendingSort:t=>`按列 ${t.columnName} 降序排序`,resizerDescription:"按“输入”键开始调整大小。",select:"选择",selectAll:"全选",sortable:"可排序的列",collapse:"折叠",expand:"扩展"};var tp={};tp={ascending:"遞增",ascendingSort:t=>`已依據「${t.columnName}」欄遞增排序`,columnSize:t=>`${t.value} 像素`,descending:"遞減",descendingSort:t=>`已依據「${t.columnName}」欄遞減排序`,resizerDescription:"按 Enter 鍵以開始調整大小",select:"選取",selectAll:"全選",sortable:"可排序的欄",collapse:"收合",expand:"展開"};var Gt={};Gt={"ar-AE":Cf,"bg-BG":Ef,"cs-CZ":wf,"da-DK":Sf,"de-DE":Df,"el-GR":kf,"en-US":Pf,"es-ES":Tf,"et-EE":Af,"fi-FI":Bf,"fr-FR":Kf,"he-IL":Rf,"hr-HR":Mf,"hu-HU":Ff,"it-IT":If,"ja-JP":Lf,"ko-KR":zf,"lt-LT":Nf,"lv-LV":Vf,"nb-NO":Of,"nl-NL":jf,"pl-PL":_f,"pt-BR":Hf,"pt-PT":Wf,"ro-RO":Uf,"ru-RU":Gf,"sk-SK":qf,"sl-SI":Zf,"sr-SP":Yf,"sv-SE":Xf,"tr-TR":Jf,"uk-UA":Qf,"zh-CN":ep,"zh-TW":tp};class W3 extends $f{isCell(e){return e.type==="cell"||e.type==="rowheader"||e.type==="column"}getKeyBelow(e,n){let l=this.collection.getItem(e);if(!l)return null;if(l.type==="column"){let r=At(Ee(l,this.collection));if(r)return r.key;let o=this.getFirstKey();return o==null||!this.collection.getItem(o)?null:super.getKeyForItemInRowByIndex(o,l.index)}return super.getKeyBelow(e,n)}getKeyAbove(e,n){let l=this.collection.getItem(e);if(!l)return null;if(l.type==="column"){let i=l.parentKey!=null?this.collection.getItem(l.parentKey):null;return i&&i.type==="column"?i.key:null}let r=super.getKeyAbove(e,n),o=r!=null?this.collection.getItem(r):null;return o&&o.type!=="headerrow"?r:this.isCell(l)?this.collection.columns[l.index].key:this.collection.columns[0].key}findNextColumnKey(e){let n=this.findNextKey(e.key,r=>r.type==="column");if(n!=null)return n;let l=this.collection.headerRows[e.level];for(let r of Ee(l,this.collection))if(r.type==="column")return r.key;return null}findPreviousColumnKey(e){let n=this.findPreviousKey(e.key,o=>o.type==="column");if(n!=null)return n;let l=this.collection.headerRows[e.level],r=[...Ee(l,this.collection)];for(let o=r.length-1;o>=0;o--){let i=r[o];if(i.type==="column")return i.key}return null}getKeyRightOf(e){let n=this.collection.getItem(e);return n?n.type==="column"?this.direction==="rtl"?this.findPreviousColumnKey(n):this.findNextColumnKey(n):super.getKeyRightOf(e):null}getKeyLeftOf(e){let n=this.collection.getItem(e);return n?n.type==="column"?this.direction==="rtl"?this.findNextColumnKey(n):this.findPreviousColumnKey(n):super.getKeyLeftOf(e):null}getKeyForSearch(e,n){if(!this.collator)return null;let l=this.collection,r=n??this.getFirstKey();if(r==null)return null;let o=l.getItem(r);(o==null?void 0:o.type)==="cell"&&(r=o.parentKey??null);let i=!1;for(;r!=null;){let u=l.getItem(r);if(!u)return null;if(u.textValue){let a=u.textValue.slice(0,e.length);if(this.collator.compare(a,e)===0)return u.key}for(let a of Ee(u,this.collection)){let c=l.columns[a.index];if(l.rowHeaderColumnKeys.has(c.key)&&a.textValue){let f=a.textValue.slice(0,e.length);if(this.collator.compare(f,e)===0){let d=n!=null?l.getItem(n):o;return(d==null?void 0:d.type)==="cell"?a.key:u.key}}}r=this.getKeyBelow(r),r==null&&!i&&(r=this.getFirstKey(),i=!0)}return null}}function U3(t){return t&&t.__esModule?t.default:t}function G3(t,e,n){let{keyboardDelegate:l,isVirtualized:r,layoutDelegate:o,layout:i}=t,u=Pn({usage:"search",sensitivity:"base"}),{direction:a}=Pe(),c=e.selectionManager.disabledBehavior,f=s.useMemo(()=>l||new W3({collection:e.collection,disabledKeys:e.disabledKeys,disabledBehavior:c,ref:n,direction:a,collator:u,layoutDelegate:o,layout:i}),[l,e.collection,e.disabledKeys,c,n,a,u,o,i]),d=$e(t.id);po.set(e,d);let{gridProps:b}=H3({...t,id:d,keyboardDelegate:f},e,n);r&&(b["aria-rowcount"]=e.collection.size+e.collection.headerRows.length),e.treeColumn!=null&&(b.role="treegrid");let{column:p,direction:h}=e.sortDescriptor||{},y=_e(U3(Gt),"@react-aria/table"),m=s.useMemo(()=>{var E;let v=((E=e.collection.columns.find(C=>C.key===p))==null?void 0:E.textValue)??"";return h&&p?y.format(`${h}Sort`,{columnName:v}):void 0},[h,p,e.collection.columns]),g=$n(m);return Tr(()=>{m&&yt(m,"assertive",500)},[m]),{gridProps:W(b,g,{"aria-describedby":[g["aria-describedby"],b["aria-describedby"]].filter(Boolean).join(" ")})}}function np(t,e,n){let{node:l,isVirtualized:r,focusMode:o="child",shouldSelectOnPressUp:i,onAction:u}=t,{direction:a}=Pe(),{keyboardDelegate:c,actions:{onCellAction:f}}=fo.get(e),d=s.useRef(null),b=()=>{if(n.current){let v=ze(n.current);if(o==="child"){if(xt(n.current)&&n.current!==ie())return;let E=e.selectionManager.childFocusStrategy==="last"?Hl(v):v.firstChild();if(E){xe(E);return}}(d.current!=null&&l.key!==d.current||!xt(n.current))&&xe(n.current)}},{itemProps:p,isPressed:h}=Yr({selectionManager:e.selectionManager,key:l.key,ref:n,isVirtualized:r,focus:b,shouldSelectOnPressUp:i,onAction:f?()=>f(l.key):u,isDisabled:e.collection.size===0}),y=v=>{var R,T,F,B,L;let E=ie();if(!ne(v.currentTarget,U(v))||e.isKeyboardNavigationDisabled||!n.current||!E)return;let C=ze(n.current);switch(C.currentNode=E,v.key){case"ArrowLeft":{let M=a==="rtl"?C.nextNode():C.previousNode();if(o==="child"&&M===n.current&&(M=null),v.preventDefault(),v.stopPropagation(),M)xe(M),it(M,{containingElement:Xe(n.current)});else{if(((R=c.getKeyLeftOf)==null?void 0:R.call(c,l.key))!==l.key){(T=n.current.parentElement)==null||T.dispatchEvent(new KeyboardEvent(v.nativeEvent.type,v.nativeEvent));break}o==="cell"&&a==="rtl"?(xe(n.current),it(n.current,{containingElement:Xe(n.current)})):(C.currentNode=n.current,M=a==="rtl"?C.firstChild():Hl(C),M&&(xe(M),it(M,{containingElement:Xe(n.current)})))}break}case"ArrowRight":{let M=a==="rtl"?C.previousNode():C.nextNode();if(o==="child"&&M===n.current&&(M=null),v.preventDefault(),v.stopPropagation(),M)xe(M),it(M,{containingElement:Xe(n.current)});else{if(((F=c.getKeyRightOf)==null?void 0:F.call(c,l.key))!==l.key){(B=n.current.parentElement)==null||B.dispatchEvent(new KeyboardEvent(v.nativeEvent.type,v.nativeEvent));break}o==="cell"&&a==="ltr"?(xe(n.current),it(n.current,{containingElement:Xe(n.current)})):(C.currentNode=n.current,M=a==="rtl"?Hl(C):C.firstChild(),M&&(xe(M),it(M,{containingElement:Xe(n.current)})))}break}case"ArrowUp":case"ArrowDown":!v.altKey&&ne(n.current,U(v))&&(v.stopPropagation(),v.preventDefault(),(L=n.current.parentElement)==null||L.dispatchEvent(new KeyboardEvent(v.nativeEvent.type,v.nativeEvent)));break}},m=v=>{if(d.current=l.key,U(v)!==n.current){zt()||e.selectionManager.setFocusedKey(l.key);return}requestAnimationFrame(()=>{o==="child"&&ie()===n.current&&b()})},g=W(p,{role:"gridcell",onKeyDownCapture:y,"aria-colspan":l.colSpan,"aria-colindex":l.colIndex!=null?l.colIndex+1:void 0,colSpan:r?void 0:l.colSpan,onFocus:m});return r&&(g["aria-colindex"]=(l.colIndex??l.index)+1),i&&g.tabIndex!=null&&g.onPointerDown==null&&(g.onPointerDown=v=>{let E=v.currentTarget,C=E.getAttribute("tabindex");E.removeAttribute("tabindex"),requestAnimationFrame(()=>{C!=null&&E.setAttribute("tabindex",C)})}),{gridCellProps:g,isPressed:h}}function Hl(t){let e=null,n=null;do n=t.lastChild(),n&&(e=n);while(n);return e}function q3(t){return t&&t.__esModule?t.default:t}function Z3(t,e,n){var g,v;let{node:l}=t,r=l.props.allowsSorting,{gridCellProps:o}=np({...t,focusMode:"child"},e,n),i=l.props.isSelectionCell&&e.selectionManager.selectionMode==="single",{pressProps:u,isPressed:a}=lt({isDisabled:!r||i,onPress(){e.sort(l.key)},ref:n}),{focusableProps:c}=wt({},n),f,d=((g=e.sortDescriptor)==null?void 0:g.column)===l.key,b=(v=e.sortDescriptor)==null?void 0:v.direction;l.props.allowsSorting&&!an()&&(f=d?b:"none");let p=_e(q3(Gt),"@react-aria/table"),h;r&&(h=`${p.format("sortable")}`,d&&b&&an()&&(h=`${h}, ${p.format(b)}`));let y=$n(h),m=e.collection.size===0;return s.useEffect(()=>{m&&e.selectionManager.focusedKey===l.key&&e.selectionManager.setFocusedKey(null)},[m,e.selectionManager,l.key]),{columnHeaderProps:{...W(c,o,u,y,m?{tabIndex:-1}:null),role:"columnheader",id:vf(e,l.key),"aria-colspan":l.colSpan&&l.colSpan>1?l.colSpan:void 0,"aria-sort":f},isPressed:a}}function Y3(t,e,n){var h,y;let{node:l,isVirtualized:r,shouldSelectOnPressUp:o,onAction:i}=t,{actions:u,shouldSelectOnPressUp:a}=fo.get(e),c=u.onRowAction?()=>{var m;return(m=u.onRowAction)==null?void 0:m.call(u,l.key)}:i,{itemProps:f,...d}=Yr({selectionManager:e.selectionManager,key:l.key,ref:n,isVirtualized:r,shouldSelectOnPressUp:a||o,onAction:c||(h=l==null?void 0:l.props)!=null&&h.onAction?ft((y=l==null?void 0:l.props)==null?void 0:y.onAction,c):void 0,isDisabled:e.collection.size===0}),b=e.selectionManager.isSelected(l.key),p={role:"row","aria-selected":e.selectionManager.selectionMode!=="none"?b:void 0,"aria-disabled":d.isDisabled||void 0,...f};return r&&(p["aria-rowindex"]=l.index+1),{rowProps:p,...d}}function X3(t){return t&&t.__esModule?t.default:t}const ou={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function J3(t,e,n){var y,m;let{node:l,isVirtualized:r}=t,{rowProps:o,...i}=Y3(t,e,n),{direction:u}=Pe();r&&e.treeColumn==null?o["aria-rowindex"]=l.index+1+e.collection.headerRows.length:delete o["aria-rowindex"];let a=e.treeColumn!=null&&(e.expandedKeys==="all"||e.expandedKeys.has(l.key)),c=_e(X3(Gt),"@react-aria/table"),f=cn({"aria-label":a?c.format("collapse"):c.format("expand"),"aria-labelledby":Cr(e,l.key)}),d={},b={};if(e.treeColumn!=null){let g=e.collection.getItem(l.key);if(g!=null){let v=iu(e.collection,l),E=((y=g.props)==null?void 0:y.hasChildRows)||((m=g.props)==null?void 0:m.UNSTABLE_childItems)||(v==null?void 0:v.type)!=="cell",C=e.collection.getItem(l.parentKey),R=C.type==="tablebody"||C.type==="body",T=iu(e.collection,C);for(;T&&T.type!=="item"&&T.prevKey!=null;)T=e.collection.getItem(T.prevKey);d={onKeyDown:F=>{F.key===ou.expand[u]&&e.selectionManager.focusedKey===g.key&&E&&e.expandedKeys!=="all"&&!e.expandedKeys.has(g.key)?(e.toggleKey(g.key),F.stopPropagation()):F.key===ou.collapse[u]&&e.selectionManager.focusedKey===g.key&&(e.expandedKeys!=="all"?E&&e.expandedKeys.has(g.key)?(e.toggleKey(g.key),F.stopPropagation()):!e.expandedKeys.has(g.key)&&g.parentKey!=null&&g.level>0&&(e.selectionManager.setFocusedKey(g.parentKey),F.stopPropagation()):e.expandedKeys==="all"&&(e.toggleKey(g.key),F.stopPropagation()))},"aria-expanded":E?e.expandedKeys==="all"||e.expandedKeys.has(l.key):void 0,"aria-level":g.level+1,"aria-posinset":g.index-(R?0:e.collection.columnCount)+1,"aria-setsize":T.index-(R?0:e.collection.columnCount)+1},b={isDisabled:i.isDisabled,onPress:()=>{i.isDisabled||(e.toggleKey(l.key),e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(l.key))},excludeFromTabOrder:!0,preventFocusOnPress:!0,"data-react-aria-prevent-focus":!0,...f}}}let p=Mp(l.props),h=i.hasAction?p:{};return{rowProps:{...W(o,d,h),"aria-labelledby":Cr(e,l.key)},expandButtonProps:b,...i}}function iu(t,e){return"lastChildKey"in e?e.lastChildKey!=null?t.getItem(e.lastChildKey):null:Array.from(e.childNodes).findLast(n=>n.parentKey===e.key)}function Q3(t,e,n){let{node:l,isVirtualized:r}=t,o={role:"row"};return r&&e.treeColumn==null&&(o["aria-rowindex"]=l.index+1),{rowProps:o}}function e0(t,e,n){var i;let{gridCellProps:l,isPressed:r}=np(t,e,n),o=(i=t.node.column)==null?void 0:i.key;return o!=null&&e.collection.rowHeaderColumnKeys.has(o)&&(l.role="rowheader",l.id=xf(e,t.node.parentKey,o)),{gridCellProps:l,isPressed:r}}function t0(t){return t&&t.__esModule?t.default:t}function n0(t,e){let{key:n}=t;const{checkboxProps:l}=T3(t,e);return{checkboxProps:{...l,"aria-labelledby":`${l.id} ${Cr(e,n)}`}}}function l0(t){let{isEmpty:e,isSelectAll:n,selectionMode:l}=t.selectionManager;return{checkboxProps:{"aria-label":_e(t0(Gt),"@react-aria/table").format(l==="single"?"select":"selectAll"),isSelected:n,isDisabled:l!=="multiple"||t.collection.size===0||t.collection.rows.length===1&&t.collection.rows[0].type==="loader",isIndeterminate:!e&&!n,onChange:()=>t.selectionManager.toggleSelectAll()}}}function r0(t){return t&&t.__esModule?t.default:t}function o0(t,e,n){let{column:l,triggerRef:r,isDisabled:o,onResizeStart:i,onResize:u,onResizeEnd:a,"aria-label":c}=t;const f=_e(r0(Gt),"@react-aria/table");let d=$e(),b=e.resizingColumn===l.key,p=s.useRef(b),h=s.useRef(null),y=s.useRef(!1),m=e.tableState.isKeyboardNavigationDisabled,{direction:g}=Pe(),v=s.useCallback(S=>{p.current||(h.current=e.updateResizedColumns(S.key,e.getColumnWidth(S.key)),e.startResize(S.key),e.tableState.setKeyboardNavigationDisabled(!0),i==null||i(h.current)),p.current=!0},[e,i]),E=s.useCallback((S,N)=>{let O=e.updateResizedColumns(S.key,N);u==null||u(O),h.current=O},[e,u]),C=s.useCallback(S=>{p.current&&(h.current==null&&(h.current=e.updateResizedColumns(S.key,e.getColumnWidth(S.key))),e.endResize(),e.tableState.setKeyboardNavigationDisabled(!1),a==null||a(h.current),p.current=!1,r!=null&&r.current&&!y.current&&xe(r.current)),h.current=null},[e,r,a]),{keyboardProps:R}=cl({onKeyDown:S=>{m?(S.key==="Escape"||S.key==="Enter"||S.key===" "||S.key==="Tab")&&(S.preventDefault(),C(l)):(S.continuePropagation(),S.key==="Enter"&&v(l))}});const T=s.useRef(0),{moveProps:F}=io({onMoveStart(){T.current=e.getColumnWidth(l.key),v(l)},onMove(S){let{deltaX:N,deltaY:O,pointerType:X}=S;g==="rtl"&&(N*=-1),X==="keyboard"&&(O!==0&&N===0&&(N=O*-1),N*=10),N!==0&&(T.current+=N,E(l,T.current))},onMoveEnd(S){let{pointerType:N}=S;T.current=0,(N==="mouse"||N==="touch"&&y.current)&&C(l)}});let B=s.useCallback(S=>{var N;m&&((N=F.onKeyDown)==null||N.call(F,S))},[m,F]),L=Math.floor(e.getColumnMinWidth(l.key)),M=Math.floor(e.getColumnMaxWidth(l.key));M===1/0&&(M=Number.MAX_SAFE_INTEGER);let V=Math.floor(e.getColumnWidth(l.key)),H=ta();H==="virtual"&&typeof window<"u"&&"ontouchstart"in window&&(H="touch");let j=(r==null?void 0:r.current)==null&&(H==="keyboard"||H==="virtual")&&!b?f.format("resizerDescription"):void 0,$=$n(j),D={"aria-label":c,"aria-orientation":"horizontal","aria-labelledby":`${d} ${vf(e.tableState,l.key)}`,"aria-valuetext":f.format("columnSize",{value:V}),type:"range",min:L,max:M,value:V,...$};const A=s.useCallback(()=>{n.current&&xe(n.current)},[n]);let w=e.resizingColumn,P=s.useRef(null),k=we(v);s.useEffect(()=>{if(P.current!==w&&w!=null&&w===l.key){y.current=ie()===n.current,k(l);let S=setTimeout(()=>A(),0),N=setTimeout(A,400);return()=>{clearTimeout(S),clearTimeout(N)}}P.current=w},[w,l,A,n]);let K=S=>{let N=e.getColumnWidth(l.key),O=parseFloat(U(S).value);O>N?O=N+10:O=N-10,E(l,O)},{pressProps:_}=lt({preventFocusOnPress:!0,onPressStart:S=>{if(!(S.ctrlKey||S.altKey||S.metaKey||S.shiftKey||S.pointerType==="keyboard")){if(S.pointerType==="virtual"&&e.resizingColumn!=null){C(l);return}A(),S.pointerType!=="virtual"&&v(l)}},onPress:S=>{(S.pointerType==="touch"&&y.current||S.pointerType==="mouse")&&e.resizingColumn!=null&&C(l)}}),{visuallyHiddenProps:Z}=wn();return{resizerProps:W(R,{...F,onKeyDown:B},_,{style:{touchAction:"none"}}),inputProps:W(Z,{id:d,onBlur:()=>{C(l)},onChange:K,disabled:o},D),isResizing:b}}function i0(){return{rowGroupProps:{role:"rowgroup"}}}function lp(){return i0()}function u0(t){return t&&t.__esModule?t.default:t}class a0 extends Ya{withExpandedKeys(e){let n=this.clone();return n.expandedKeys=e,n.frozen=this.frozen,n.rows=Array.from(n.getRows()),n}addNode(e){super.addNode(e),this.columnsDirty||(this.columnsDirty=e.type==="column"),e.type==="tableheader"&&(this.head=e)}getRows(){let e=[];for(let n of this)(n.type==="tablebody"||n.type==="tablefooter")&&e.push(...this.getChildren(n.key));return e}get body(){for(let e of this)if(e.type==="tablebody")return e;return new rl(-2)}commit(e,n,l=!1){this.updateColumns(l),this.firstKey=e,this.lastKey=n,this.rows=[];for(let r of this.getRows()){let o=r.lastChildKey;if(o!=null){let i=this.getItem(o);for(;i&&i.type!=="cell";)i=i.prevKey!=null?this.getItem(i.prevKey):null;if(i){let u=(i.colIndex??i.index)+(i.colSpan??1);if(u!==this.columns.length&&!l)throw new Error(`Cell count must match column count. Found ${u} cells and ${this.columns.length} columns.`)}}this.rows.push(r)}super.commit(e,n,l)}updateColumns(e){if(!this.columnsDirty)return;this.rowHeaderColumnKeys=new Set,this.columns=[];let n=new Map,l=r=>{switch(r.type){case"column":n.set(r.key,r),r.hasChildNodes||(r.index=this.columns.length,this.columns.push(r),r.props.isRowHeader&&this.rowHeaderColumnKeys.add(r.key));break}for(let o of this.getChildren(r.key))l(o)};for(let r of this.getChildren(this.head.key))l(r);if(this.headerRows=mf(n,this.columns),this.columnsDirty=!1,this.rowHeaderColumnKeys.size===0&&this.columns.length>0&&!e)throw new Error("A table must have at least one Column with the isRowHeader prop set to true")}get columnCount(){return this.columns.length}*[Symbol.iterator](){let e=this.firstKey;for(;e!=null;){let n=this.getItem(e);n&&(yield n),e=(n==null?void 0:n.nextKey)??null}}getFirstKey(){for(let e of this)if(e.type==="tablebody")return e.firstChildKey??null;return null}getLastKey(){let e=this.lastKey;if(e==null)return null;let n=this.getItem(e);for(;(n==null?void 0:n.lastChildKey)!=null&&(n.type!=="item"||this.expandedKeys.has(n.key));)n=this.getItem(n.lastChildKey);return n==null?void 0:n.key}getKeyAfter(e){let n=this.getItem(e);if((n==null?void 0:n.type)==="column")return n.nextKey??null;if(!n)return null;if(n.type==="item"&&n.firstChildKey!=null&&this.expandedKeys.has(n.key)){let l=this.getItem(n.firstChildKey);for(;l;){if(l.type==="item")return l.key;l=l.nextKey!=null?this.getItem(l.nextKey):null}}return super.getKeyAfter(e)}getKeyBefore(e){var r;let n=this.getItem(e);if((n==null?void 0:n.type)==="column")return n.prevKey??null;if(!n)return null;let l=null;if(n.prevKey!=null){for(n=this.getItem(n.prevKey);n&&(n.type!=="item"||this.expandedKeys.has(n.key))&&n.lastChildKey!=null;)n=this.getItem(n.lastChildKey);l=(n==null?void 0:n.key)??null}return l==null&&(l=n.parentKey),l!=null&&((r=this.getItem(l))==null?void 0:r.type)==="tableheader"?null:l}getChildren(e){let n=this.getItem(e);if(!n){for(let r of this.headerRows)if(r.key===e)return r.childNodes}let l=this;return(n==null?void 0:n.type)==="tablebody"||(n==null?void 0:n.type)==="tablefooter"?{*[Symbol.iterator](){let r=n.firstChildKey,o=r!=null?l.getItem(r):null;for(;o;){yield o;let i=l.getKeyAfter(o.key);if(o=i!=null?l.getItem(i):null,o&&o.parentKey===n.parentKey)break}}}:{*[Symbol.iterator](){let r=l.getItem(e),o=(r==null?void 0:r.firstChildKey)!=null?l.getItem(r.firstChildKey):null;for(;o&&(yield o,o=o.nextKey!=null?l.getItem(o.nextKey):null,!((r==null?void 0:r.type)==="item"&&(o==null?void 0:o.type)!=="cell")););}}}clone(){let e=super.clone();return e.headerRows=this.headerRows,e.columns=this.columns,e.rows=this.rows,e.rowHeaderColumnKeys=this.rowHeaderColumnKeys,e.head=this.head,e}getTextValue(e){let n=this.getItem(e);if(!n)return"";if(n.textValue)return n.textValue;let l=this.rowHeaderColumnKeys,r=[];for(let o of this.getChildren(e)){let i=this.columns[o.index];if(l.has(i.key)&&o.textValue&&r.push(o.textValue),r.length===l.size)break}return r.join(" ")}constructor(...e){super(...e),this.headerRows=[],this.columns=[],this.rows=[],this.rowHeaderColumnKeys=new Set,this.head=new ll(-1),this.columnsDirty=!0,this.expandedKeys=new Set}}const bo=s.createContext(null),s0=s.forwardRef(function(e,n){let l=Te(n),r=s.useRef(null),o=s.useRef(null),[i,u]=s.useState(0);le(()=>{let c=r.current;for(;c&&c!==l.current&&!st(c);)c=c.parentElement;o.current=c},[l]),dn({ref:o,box:"border-box",onResize(){var c;u(((c=o.current)==null?void 0:c.clientWidth)??0)}}),le(()=>{var c;u(((c=o.current)==null?void 0:c.clientWidth)??0)},[]);let a=s.useMemo(()=>({tableRef:r,scrollRef:o,tableWidth:i,useTableColumnResizeState:z3,onResizeStart:e.onResizeStart,onResize:e.onResize,onResizeEnd:e.onResizeEnd}),[r,i,e.onResizeStart,e.onResize,e.onResizeEnd]);return x.createElement(ee.div,{render:e.render,...oe(e,{global:!0}),ref:l,className:e.className||"react-aria-ResizableTableContainer",style:e.style,onScroll:e.onScroll},x.createElement(bo.Provider,{value:a},e.children))}),c0=s.createContext(null),Ze=s.createContext(null),ho=s.createContext(null),d0=s.forwardRef(function(e,n){var f;[e,n]=ve(e,n,c0);let l=Jr(e),{selectionBehavior:r,selectionMode:o,disallowEmptySelection:i}=l,u=!!((f=e.dragAndDropHooks)!=null&&f.useDraggableCollectionState),a=s.useMemo(()=>({selectionBehavior:o==="none"?null:r,selectionMode:o,disallowEmptySelection:i,allowsDragging:u}),[r,o,i,u]),c=x.createElement(b0.Provider,{value:a},x.createElement(Dn,e));return x.createElement(Ur,{content:c,createCollection:()=>new a0},d=>x.createElement(p0,{props:e,forwardedRef:n,selectionState:l,collection:d}))});let f0=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(pe);return l?x.createElement(ee.div,{...e,ref:n}):x.createElement(ee.table,{...e,ref:n})});const uu={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function p0({props:t,forwardedRef:e,selectionState:n,collection:l}){[t,e]=ve(t,e,pr);let{shouldUseVirtualFocus:r,disallowTypeAhead:o,filter:i,...u}=t,a=s.useContext(bo);e=Te(s.useMemo(()=>pt(e,a==null?void 0:a.tableRef),[e,a==null?void 0:a.tableRef]));let[c,f]=ct(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,t.onExpandedChange);l=s.useMemo(()=>l.withExpandedKeys(c),[l,c]);let d=O3({...u,collection:l,children:void 0,UNSAFE_selectionState:n,expandedKeys:c,onExpandedChange:f}),b=j3(d,i),{isVirtualized:p,layoutDelegate:h,dropTargetDelegate:y,CollectionRoot:m}=s.useContext(pe),{dragAndDropHooks:g}=t,{gridProps:v}=G3({...u,layoutDelegate:h,isVirtualized:p},b,e),E=b.selectionManager,C=!!(g!=null&&g.useDraggableCollectionState),R=!!(g!=null&&g.useDroppableCollectionState);s.useRef(C),s.useRef(R),s.useEffect(()=>{},[C,R]);let T,F,B,L=!1,M=null,V=s.useRef(null),{direction:H}=Pe(),[j]=s.useState(()=>new A3);if(C&&g){T=g.useDraggableCollectionState({collection:b.collection,selectionManager:E,preview:g.renderDragPreview?V:void 0}),g.useDraggableCollection({},T,e);let Z=g.DragPreview;M=g.renderDragPreview?x.createElement(Z,{ref:V},g.renderDragPreview):null}if(R&&g){F=g.useDroppableCollectionState({collection:b.collection,selectionManager:E});let Z=new gl({collection:b.collection,disabledKeys:E.disabledKeys,disabledBehavior:E.disabledBehavior,ref:e,layoutDelegate:h}),S=g.dropTargetDelegate||y||new g.ListDropTargetDelegate(l.rows,e);j.setup(S,d,H),B=g.useDroppableCollection({keyboardDelegate:Z,dropTargetDelegate:j,onDropActivate:N=>{var O;if(N.target.type==="item"){let X=N.target.key,J=d.collection.getItem(X),de=c.has(X);J&&J.hasChildNodes&&(!de||(O=g==null?void 0:g.isVirtualDragging)!=null&&O.call(g))&&d.toggleKey(X)}},onKeyDown:N=>{let O=F==null?void 0:F.target;if(O&&O.type==="item"&&O.dropPosition==="on"){let X=d.collection.getItem(O.key);(N.key===uu.expand[H]&&(X!=null&&X.hasChildNodes)&&!d.expandedKeys.has(O.key)||N.key===uu.collapse[H]&&(X!=null&&X.hasChildNodes)&&d.expandedKeys.has(O.key))&&d.toggleKey(O.key)}}},F,e),L=F.isDropTarget({type:"root"})}let{focusProps:$,isFocused:D,isFocusVisible:A}=Ve(),w=ae({...t,children:void 0,defaultClassName:"react-aria-Table",values:{isDropTarget:L,isFocused:D,isFocusVisible:A,state:b}}),P=!!(C&&!(T!=null&&T.isDisabled)),k=w.style,K=null;a&&(K=a.useTableColumnResizeState({tableWidth:a.tableWidth},b),p||(k={...k,tableLayout:"fixed",width:"min-content"}));let _=oe(t,{global:!0});return x.createElement(Me,{values:[[Ze,b],[ho,K],[qe,{dragAndDropHooks:g,dragState:T,dropState:F}],[no,{render:D0}],[pr,null],[ls,null]]},x.createElement(Or,null,x.createElement(f0,{...W(_,w,v,$,B==null?void 0:B.collectionProps),style:k,ref:e,slot:t.slot||void 0,onScroll:t.onScroll,"data-allows-dragging":P||void 0,"data-drop-target":L||void 0,"data-focused":D||void 0,"data-focus-visible":A||void 0},x.createElement(rs,null,x.createElement(m,{collection:b.collection,scrollRef:(a==null?void 0:a.scrollRef)??e,persistedKeys:Rc(E,g,F)})))),M)}const b0=s.createContext(null),Co=class Co extends Ge{};Co.type="tableheader";let ll=Co,h0=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(pe);return l?x.createElement(ee.div,{...e,ref:n}):x.createElement(ee.thead,{...e,ref:n})});const m0=ml(ll,(t,e)=>{let n=s.useContext(Ze).collection,l=Wr({items:n.headerRows,children:s.useCallback(a=>{switch(a.type){case"headerrow":return x.createElement(y0,{item:a});default:throw new Error("Unsupported node type in TableHeader: "+a.type)}},[])}),{rowGroupProps:r}=lp(),{hoverProps:o,isHovered:i}=Fe({onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),u=ae({...t,children:void 0,defaultClassName:"react-aria-TableHeader",values:{isHovered:i}});return x.createElement(h0,{...W(oe(t,{global:!0}),r,o),...u,ref:e,"data-hovered":i||void 0},l)},t=>x.createElement(Dn,{dependencies:t.dependencies,items:t.columns},t.children));let g0=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(pe);return l?x.createElement("div",{...e,ref:n}):x.createElement("tr",{...e,ref:n})});function y0({item:t}){let e=s.useRef(null),n=s.useContext(Ze),{isVirtualized:l,CollectionBranch:r}=s.useContext(pe),{rowProps:o}=Q3({node:t,isVirtualized:l},n,e),{checkboxProps:i}=l0(n);return x.createElement(g0,{...o,ref:e},x.createElement(Me,{values:[[oo,{slots:{selection:i}}],[Wc,{slots:{selection:i}}]]},x.createElement(r,{collection:n.collection,parent:t})))}const Eo=class Eo extends Ge{};Eo.type="column";let Er=Eo,$0=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(pe);return l?x.createElement(ee.div,{...e,ref:n}):x.createElement(ee.th,{...e,ref:n})});const v0=Sn(Er,(t,e,n)=>{var v,E;let l=Te(e),r=s.useContext(Ze),{isVirtualized:o}=s.useContext(pe),{columnHeaderProps:i,isPressed:u}=Z3({node:n,isVirtualized:o},r,l),{isFocused:a,isFocusVisible:c,focusProps:f}=Ve(),d=s.useContext(ho),b=!1;d&&(b=d.resizingColumn===n.key);let{hoverProps:p,isHovered:h}=Fe({isDisabled:!t.allowsSorting}),y=ae({...t,id:void 0,children:n.rendered,defaultClassName:"react-aria-Column",values:{isHovered:h,isPressed:u,isFocused:a,isFocusVisible:c,allowsSorting:n.props.allowsSorting,sortDirection:((v=r.sortDescriptor)==null?void 0:v.column)===n.key?r.sortDescriptor.direction:void 0,isResizing:b,startResize:()=>{if(d)d.startResize(n.key),r.setKeyboardNavigationDisabled(!0);else throw new Error("Wrap your in a to enable column resizing")},sort:C=>{r.sort(n.key,C)}}}),m=y.style;d&&(m={...m,width:d.getColumnWidth(n.key)});let g=oe(t,{global:!0});return delete g.id,x.createElement($0,{...W(g,i,f,p),...y,style:m,ref:l,"data-hovered":h||void 0,"data-pressed":u||void 0,"data-focused":a||void 0,"data-focus-visible":c||void 0,"data-resizing":b||void 0,"data-allows-sorting":n.props.allowsSorting||void 0,"data-sort-direction":((E=r.sortDescriptor)==null?void 0:E.column)===n.key?r.sortDescriptor.direction:void 0},x.createElement(Me,{values:[[rp,{column:n,triggerRef:l}],[pe,Gr]]},y.children))}),rp=s.createContext(null),x0=s.forwardRef(function(e,n){let l=s.useContext(ho);if(!l)throw new Error("Wrap your
in a to enable column resizing");let r=_e(u0(Kc),"react-aria-components"),{onResizeStart:o,onResize:i,onResizeEnd:u}=s.useContext(bo),{column:a,triggerRef:c}=s.useContext(rp),f=s.useRef(null),{resizerProps:d,inputProps:b,isResizing:p}=o0({column:a,"aria-label":e["aria-label"]||r.format("tableResizer"),onResizeStart:o,onResize:i,onResizeEnd:u,triggerRef:c},l,f),{focusProps:h,isFocused:y,isFocusVisible:m}=Ve(),{hoverProps:g,isHovered:v}=Fe(e),E=l.getColumnMinWidth(a.key)>=l.getColumnWidth(a.key),C=l.getColumnMaxWidth(a.key)<=l.getColumnWidth(a.key),{direction:R}=Pe(),T="both";E?T=R==="rtl"?"right":"left":C?T=R==="rtl"?"left":"right":T="both";let F=Te(n),[B,L]=s.useState("");s.useEffect(()=>{if(!F.current)return;let D=window.getComputedStyle(F.current);L(D.cursor)},[F,T]);let M=ae({...e,defaultClassName:"react-aria-ColumnResizer",values:{isFocused:y,isFocusVisible:m,isResizing:p,isHovered:v,resizableDirection:T}}),[V,H]=s.useState(!1),j=D=>{D.pointerType==="mouse"&&H(!0)};!p&&V&&H(!1);let $=oe(e,{global:!0});return x.createElement(ee.div,{ref:F,role:"presentation",...W($,M,d,{onPointerDown:j},g),"data-hovered":v||void 0,"data-focused":y||void 0,"data-focus-visible":m||void 0,"data-resizing":p||void 0,"data-resizable-direction":T},M.children,x.createElement("input",{ref:f,...W(b,h)}),p&&V&&du.createPortal(x.createElement("div",{style:{position:"fixed",top:0,left:0,bottom:0,right:0,cursor:B}}),document.body))}),wo=class wo extends hl{};wo.type="tablebody";let rl=wo,C0=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(pe);return l?x.createElement(ee.div,{...e,ref:n}):x.createElement(ee.tbody,{...e,ref:n})});const E0=ml(rl,(t,e,n)=>{let l=s.useContext(Ze),{isVirtualized:r}=s.useContext(pe),o=l.collection,{CollectionBranch:i}=s.useContext(pe),{dragAndDropHooks:u,dropState:a}=s.useContext(qe),c=!!(u!=null&&u.useDroppableCollectionState)&&!(a!=null&&a.isDisabled),f=c&&!!a&&(a.isDropTarget({type:"root"})??!1),d=o.size===0,b={isDropTarget:f,isEmpty:d},p=ae({...t,id:void 0,children:void 0,defaultClassName:"react-aria-TableBody",values:b}),h,y=o.columnCount;if(d&&t.renderEmptyState&&l){let v={},E={},C={};r?(E["aria-colspan"]=y,C={display:"contents"}):E.colSpan=y,h=x.createElement(Nt,{role:"row",...v,style:C},x.createElement(Vt,{role:"rowheader",...E,style:C},t.renderEmptyState(b)))}let{rowGroupProps:m}=lp(),g=oe(t,{global:!0});return x.createElement(C0,{...W(g,p,m),ref:e,"data-empty":d||void 0},c&&x.createElement(B0,null),x.createElement(i,{collection:o,parent:n,renderDropIndicator:lo(u,a)}),h)}),So=class So extends hl{};So.type="tablefooter";let au=So;const op=s.createContext({isFocusVisibleWithinRow:!1}),Do=class Do extends Ge{filter(e,n,l){let r=e.getChildren(this.key);for(let o of r)if(l(o.textValue,o)){let i=this.clone();return n.addDescendants(i,e),i}return null}};Do.type="item";let wr=Do,Nt=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(pe);return l?x.createElement(ee.div,{...e,ref:n}):x.createElement(ee.tr,{...e,ref:n})});const w0=ml(wr,(t,e,n)=>{var P;let l=Te(e),r=s.useContext(Ze),{dragAndDropHooks:o,dragState:i,dropState:u}=s.useContext(qe),{isVirtualized:a,CollectionBranch:c}=s.useContext(pe),f=i&&!(i.isDisabled||i.selectionManager.isDisabled(n.key)),{rowProps:d,expandButtonProps:b,...p}=J3({node:n,shouldSelectOnPressUp:!!i,isVirtualized:a},r,l),{isFocused:h,isFocusVisible:y,focusProps:m}=Ve(),{isFocusVisible:g,focusProps:v}=Ve({within:!0}),{hoverProps:E,isHovered:C}=Fe({isDisabled:!p.allowsSelection&&!p.hasAction&&!f,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{checkboxProps:R}=n0({key:n.key},r),T;i&&o&&(T=o.useDraggableItem({key:n.key,hasDragButton:!0},i));let F,B=s.useRef(null),{visuallyHiddenProps:L}=wn();u&&o&&(F=o.useDropIndicator({target:{type:"item",key:n.key,dropPosition:"on"}},u,B));let M=s.useRef(null);s.useEffect(()=>{i&&M.current},[]);let V=i&&i.isDragging(n.key),{children:H,...j}=t,$=t.hasChildItems||((P=r.collection.getItem(n.lastChildKey))==null?void 0:P.type)!=="cell",D=$&&r.expandedKeys.has(n.key),A=ae({...j,id:void 0,defaultClassName:"react-aria-Row",defaultStyle:{"--table-row-level":n.level+1},values:{...p,state:r,isHovered:C,isFocused:h,isFocusVisible:y,selectionMode:r.selectionManager.selectionMode,selectionBehavior:r.selectionManager.selectionBehavior,isDragging:V,isDropTarget:F==null?void 0:F.isDropTarget,isFocusVisibleWithin:g,id:n.key,hasChildItems:$,isExpanded:D,level:n.level+1}}),w=oe(t,{global:!0});return delete w.id,delete w.onClick,x.createElement(x.Fragment,null,F&&!F.isHidden&&x.createElement(Nt,{role:"row",style:{height:0}},x.createElement(Vt,{role:"gridcell",colSpan:r.collection.columnCount,style:{padding:0}},x.createElement("div",{role:"button",...L,...F.dropIndicatorProps,ref:B}))),x.createElement(Nt,{...W(w,A,d,m,E,T==null?void 0:T.dragProps,v),ref:l,"data-disabled":p.isDisabled||void 0,"data-selected":p.isSelected||void 0,"data-hovered":C||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":y||void 0,"data-pressed":p.isPressed||void 0,"data-dragging":V||void 0,"data-drop-target":(F==null?void 0:F.isDropTarget)||void 0,"data-selection-mode":r.selectionManager.selectionMode==="none"?void 0:r.selectionManager.selectionMode,"data-focus-visible-within":g||void 0,"data-expanded":D||void 0,"data-has-child-items":$||void 0,"data-level":n.level+1},x.createElement(Me,{values:[[oo,{slots:{[gt]:{},selection:R}}],[Wc,{slots:{[gt]:{},selection:R}}],[En,{slots:{[gt]:{},chevron:b,drag:{...T==null?void 0:T.dragButtonProps,ref:M,style:{pointerEvents:"none"}}}}],[os,{isSelected:p.isSelected}],[op,{isFocusVisibleWithinRow:g}]]},x.createElement(c,{collection:r.collection,parent:n}))))},t=>{if(t.id==null&&typeof t.children=="function")throw new Error("No id detected for the Row element. The Row element requires a id to be provided to it when the cells are rendered dynamically.");let e=[t.value].concat(t.dependencies);return x.createElement(Dn,{dependencies:e,items:t.columns,idScope:t.id},t.children)}),ko=class ko extends Ge{};ko.type="cell";let Sr=ko,Vt=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(pe);return l?x.createElement(ee.div,{...e,ref:n}):x.createElement(ee.td,{...e,ref:n})});const S0=Sn(Sr,(t,e,n)=>{var F;let l=Te(e),r=s.useContext(Ze),{dragState:o}=s.useContext(qe),{isVirtualized:i}=s.useContext(pe);n.column=r.collection.columns[n.index];let{gridCellProps:u,isPressed:a}=e0({node:n,shouldSelectOnPressUp:!!o,isVirtualized:i},r,l),{isFocused:c,isFocusVisible:f,focusProps:d}=Ve(),{hoverProps:b,isHovered:p}=Fe({}),{isFocusVisibleWithinRow:h}=s.useContext(op),y=n.parentKey!=null?r.selectionManager.isSelected(n.parentKey):!1,m=n.colIndex||n.index,g=r.collection.getItem(n.parentKey),v=g.props.hasChildItems||((F=r.collection.getItem(g.lastChildKey))==null?void 0:F.type)!=="cell",E=v&&r.expandedKeys.has(n.parentKey),C=r.selectionManager.isDisabled(n.parentKey),R=ae({...t,id:void 0,defaultClassName:"react-aria-Cell",values:{isFocused:c,isFocusVisible:f,isFocusVisibleWithinRow:h,isPressed:a,isHovered:p,isSelected:y,id:n.key,columnIndex:m,hasChildItems:v,isExpanded:E,isDisabled:C,level:g.level+1,isTreeColumn:n.column.key===r.treeColumn}}),T=oe(t,{global:!0});return delete T.id,x.createElement(Vt,{...W(T,R,u,d,b),ref:l,"data-focused":c||void 0,"data-focus-visible":f||void 0,"data-focus-visible-within-row":h||void 0,"data-pressed":a||void 0,"data-selected":y||void 0,"data-column-index":m,"data-expanded":E||void 0,"data-has-child-items":v||void 0,"data-level":g.level+1,"data-tree-column":n.column.key===r.treeColumn||void 0,"data-disabled":C||void 0},x.createElement(pe.Provider,{value:Gr},R.children))});function D0(t,e){var c;e=Te(e);let{dragAndDropHooks:n,dropState:l}=s.useContext(qe),r=s.useRef(null),{dropIndicatorProps:o,isHidden:i,isDropTarget:u}=n.useDropIndicator(t,l,r);if(i)return null;let a=l&&t.target.type==="item"?(((c=l.collection.getItem(t.target.key))==null?void 0:c.level)||0)+1:1;return x.createElement(A0,{...t,dropIndicatorProps:o,isDropTarget:u,buttonRef:r,level:a,ref:e})}let k0=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(pe);return l?x.createElement(ee.div,{...e,ref:n}):x.createElement(ee.tr,{...e,ref:n})}),P0=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(pe);return l?x.createElement(ee.div,{...e,ref:n}):x.createElement(ee.td,{...e,ref:n})});function T0(t,e){let{dropIndicatorProps:n,isDropTarget:l,buttonRef:r,level:o,...i}=t,u=s.useContext(Ze),{visuallyHiddenProps:a}=wn(),c=ae({...i,defaultClassName:"react-aria-DropIndicator",defaultStyle:{"--table-row-level":o+1},values:{isDropTarget:l}});return x.createElement(k0,{...oe(t,{global:!0}),...c,role:"row",ref:e,"data-drop-target":l||void 0,"aria-level":o},x.createElement(P0,{role:"gridcell",colSpan:u.collection.columnCount,style:{padding:0}},x.createElement("div",{...a,role:"button",...n,ref:r}),c.children))}const A0=s.forwardRef(T0);function B0(){let t=s.useContext(Ze),{dragAndDropHooks:e,dropState:n}=s.useContext(qe),l=s.useRef(null),{dropIndicatorProps:r}=e.useDropIndicator({target:{type:"root"}},n,l),o=n.isDropTarget({type:"root"}),{visuallyHiddenProps:i}=wn();return!o&&r["aria-hidden"]?null:x.createElement(Nt,{role:"row","aria-hidden":r["aria-hidden"],style:{height:0}},x.createElement(Vt,{role:"gridcell",colSpan:t.collection.columnCount,style:{padding:0}},x.createElement("div",{role:"button",...i,...r,ref:l})))}const K0=Sn(tl,function(e,n,l){let r=s.useContext(Ze),{isVirtualized:o}=s.useContext(pe),{isLoading:i,onLoadMore:u,scrollOffset:a,...c}=e,f=r.collection.columns.length,d=s.useRef(null),b=s.useMemo(()=>({onLoadMore:u,collection:r==null?void 0:r.collection,sentinelRef:d,scrollOffset:a}),[u,a,r==null?void 0:r.collection]);Cu(b,d);let p=ae({...c,id:void 0,children:l.rendered,defaultClassName:"react-aria-TableLoadingIndicator",defaultStyle:{"--table-row-level":l.level+1},values:void 0}),h={},y={},m={};return o?(y["aria-colspan"]=f,m={display:"contents"}):y.colSpan=f,x.createElement(x.Fragment,null,x.createElement(Nt,{style:{height:0},inert:Eu(!0)},x.createElement(Vt,{style:{padding:0,border:0}},x.createElement("div",{"data-testid":"loadMoreSentinel",ref:d,style:{position:"relative",height:1,width:1}}))),i&&p.children&&x.createElement(Nt,{...W(oe(e,{global:!0}),h),...p,role:"row",ref:n,"aria-level":l.level+1,"data-level":l.level+1},x.createElement(Vt,{role:"rowheader",...y,style:m},p.children)))}),ip=s.createContext({}),su=({children:t,className:e,variant:n,...l})=>{const r=x.useMemo(()=>wh({variant:n}),[n]);return I.jsx(gg,{className:ge(e,r.item()),"data-slot":"list-box-item",...l,children:o=>I.jsx(ip,{value:{slots:r,state:o},children:typeof t=="function"?t(o):t})})},up=({children:t,className:e,...n})=>{const{slots:l,state:r}=s.useContext(ip),o=r==null?void 0:r.isSelected,i=typeof t=="function"?t(r??{}):t||I.jsx("svg",{"aria-hidden":"true","data-slot":"list-box-item-indicator--checkmark",fill:"none",role:"presentation",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:o?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 17 18",children:I.jsx("polyline",{points:"1 9 7 14 15 4"})});return I.jsx(De.span,{"aria-hidden":"true",className:fe(l==null?void 0:l.indicator,e),"data-slot":"list-box-item-indicator","data-visible":o||void 0,...n,children:i})},R0=Object.assign(su,{Root:su,Indicator:up}),M0=({children:t,className:e,...n})=>{const l=x.useMemo(()=>Sh({class:typeof e=="string"?e:void 0}),[e]);return I.jsx(mg,{className:l,...n,children:t})},F0=M0;function cu({className:t,variant:e,...n}){const l=x.useMemo(()=>Eh({variant:e}),[e]);return I.jsx(bg,{className:ge(t,l),"data-slot":"list-box",...n})}const ty=Object.assign(cu,{Root:cu,Item:R0,ItemIndicator:up,Section:F0}),Ie=s.createContext({}),Dr=({children:t,className:e,variant:n,...l})=>{const r=x.useMemo(()=>kh({variant:n}),[n]);return I.jsx(Ie,{value:{slots:r},children:I.jsx(De.div,{className:r.base({className:e}),"data-slot":"table",...l,children:t})})};Dr.displayName="HeroUI.Table";const ap=({className:t,...e})=>{const{slots:n}=s.useContext(Ie);return I.jsx(De.div,{className:fe(n==null?void 0:n.scrollContainer,t),"data-slot":"table-scroll-container",...e})};ap.displayName="HeroUI.Table.ScrollContainer";function sp({className:t,...e}){const{slots:n}=s.useContext(Ie);return I.jsx(d0,{className:ge(t,n==null?void 0:n.content()),"data-slot":"table-content",...e})}sp.displayName="HeroUI.Table.Content";function cp({className:t,...e}){const{slots:n}=s.useContext(Ie);return I.jsx(m0,{className:ge(t,n==null?void 0:n.header()),"data-slot":"table-header",...e})}cp.displayName="HeroUI.Table.Header";const dp=x.forwardRef(({className:t,...e},n)=>{const{slots:l}=s.useContext(Ie);return I.jsx(v0,{ref:n,className:ge(t,l==null?void 0:l.column()),"data-slot":"table-column",...e})});dp.displayName="HeroUI.Table.Column";function fp({className:t,...e}){const{slots:n}=s.useContext(Ie);return I.jsx(E0,{className:ge(t,n==null?void 0:n.body()),"data-slot":"table-body",...e})}fp.displayName="HeroUI.Table.Body";function pp({className:t,...e}){const{slots:n}=s.useContext(Ie);return I.jsx(w0,{className:ge(t,n==null?void 0:n.row()),"data-slot":"table-row",...e})}pp.displayName="HeroUI.Table.Row";const bp=x.forwardRef(({className:t,...e},n)=>{const{slots:l}=s.useContext(Ie);return I.jsx(S0,{ref:n,className:ge(t,l==null?void 0:l.cell()),"data-slot":"table-cell",...e})});bp.displayName="HeroUI.Table.Cell";const hp=({className:t,...e})=>{const{slots:n}=s.useContext(Ie);return I.jsx(De.div,{className:fe(n==null?void 0:n.footer,t),"data-slot":"table-footer",...e})};hp.displayName="HeroUI.Table.Footer";const mp=x.forwardRef(({className:t,...e},n)=>I.jsx(s0,{ref:n,className:Lt("table__resizable-container",t),"data-slot":"table-resizable-container",...e}));mp.displayName="HeroUI.Table.ResizableContainer";const gp=x.forwardRef(({className:t,...e},n)=>{const{slots:l}=s.useContext(Ie);return I.jsx(x0,{ref:n,className:ge(t,l==null?void 0:l.columnResizer()),"data-slot":"table-column-resizer",...e})});gp.displayName="HeroUI.Table.ColumnResizer";const yp=x.forwardRef(({className:t,...e},n)=>{const{slots:l}=s.useContext(Ie);return I.jsx(K0,{ref:n,className:fe(l==null?void 0:l.loadMore,t),"data-slot":"table-load-more",...e})});yp.displayName="HeroUI.Table.LoadMore";const $p=({className:t,...e})=>{const{slots:n}=s.useContext(Ie);return I.jsx(De.div,{className:fe(n==null?void 0:n.loadMoreContent,t),"data-slot":"table-load-more-content",...e})};$p.displayName="HeroUI.Table.LoadMoreContent";const vp=x.forwardRef(({children:t,className:e,indicator:n,showIndicator:l=!0,sortDirection:r,...o},i)=>{const{slots:u}=s.useContext(Ie),a=l&&!!r;let c=null;if(a)if(n===void 0)c=I.jsx(dm,{className:u==null?void 0:u.sortableColumnIndicator(),"data-direction":r,"data-slot":"table-sortable-column-indicator"});else if(x.isValidElement(n)){const f=n;c=x.cloneElement(f,{className:fe(u==null?void 0:u.sortableColumnIndicator,f.props.className),"data-direction":r,"data-slot":"table-sortable-column-indicator"})}else c=n;return I.jsxs("span",{ref:i,className:fe(u==null?void 0:u.sortableColumnHeader,e),"data-direction":r,"data-slot":"table-sortable-column-header",...o,children:[t,c]})});vp.displayName="HeroUI.Table.SortableColumnHeader";const I0=Dn,ny=Object.assign(Dr,{Body:fp,Cell:bp,Collection:I0,Column:dp,ColumnResizer:gp,Content:sp,Footer:hp,Header:cp,LoadMore:yp,LoadMoreContent:$p,ResizableContainer:mp,Root:Dr,Row:pp,ScrollContainer:ap,SortableColumnHeader:vp});export{U0 as $,V0 as A,j0 as B,Z0 as C,ey as D,X0 as I,Q0 as L,Y0 as S,J0 as T,ty as a,R0 as b,Xp as c,_0 as d,O0 as e,W0 as f,bh as g,G0 as h,q0 as i,ny as j,H0 as k,i4 as r}; diff --git a/src/gateway/static/dashboard/assets/heroui-DZj66Arc.js b/src/gateway/static/dashboard/assets/heroui-DZj66Arc.js new file mode 100644 index 000000000..c2d80b0a7 --- /dev/null +++ b/src/gateway/static/dashboard/assets/heroui-DZj66Arc.js @@ -0,0 +1,20 @@ +var vo=t=>{throw TypeError(t)};var xo=(t,e,n)=>e.has(t)||vo("Cannot "+n);var Co=(t,e,n)=>(xo(t,e,"read from private field"),n?n.call(t):e.get(t)),Eo=(t,e,n)=>e.has(t)?vo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ml=(t,e,n,l)=>(xo(t,e,"write to private field"),l?l.call(t,n):e.set(t,n),n);import{r as s,$ as g,a as gr,b as Yi,c as up}from"./react-dgEcD0HR.js";import{j as M}from"./tanstack-query-1t81HyiD.js";const ap="react-aria-clear-focus",sp="react-aria-focus";function Jn(t){var n;if(typeof window>"u"||window.navigator==null)return!1;let e=(n=window.navigator.userAgentData)==null?void 0:n.brands;return Array.isArray(e)&&e.some(l=>t.test(l.brand))||t.test(window.navigator.userAgent)}function yr(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)==null?void 0:e.platform)||window.navigator.platform):!1}function rt(t){let e=null;return()=>(e==null&&(e=t()),e)}const yt=rt(function(){return yr(/^Mac/i)}),cp=rt(function(){return yr(/^iPhone/i)}),Xi=rt(function(){return yr(/^iPad/i)||yt()&&navigator.maxTouchPoints>1}),$t=rt(function(){return cp()||Xi()}),Fn=rt(function(){return yt()||$t()}),Ji=rt(function(){return Jn(/AppleWebKit/i)&&!Qi()}),Qi=rt(function(){return Jn(/Chrome/i)}),rn=rt(function(){return Jn(/Android/i)}),dp=rt(function(){return Jn(/Firefox/i)});function Ve(t){if(fp())t.focus({preventScroll:!0});else{let e=pp(t);t.focus(),bp(e)}}let Dn=null;function fp(){if(Dn==null){Dn=!1;try{document.createElement("div").focus({get preventScroll(){return Dn=!0,!0}})}catch{}}return Dn}function pp(t){let e=t.parentNode,n=[],l=document.scrollingElement||document.documentElement;for(;e instanceof HTMLElement&&e!==l;)(e.offsetHeightt});function Nt(){return s.useContext(hp)}function mp(t,e){let n=t.getAttribute("target");return(!n||n==="_self")&&t.origin===location.origin&&!t.hasAttribute("download")&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey}function tt(t,e,n=!0){var a,c;let{metaKey:l,ctrlKey:r,altKey:o,shiftKey:i}=e;dp()&&((c=(a=window.event)==null?void 0:a.type)!=null&&c.startsWith("key"))&&t.target==="_blank"&&(yt()?l=!0:r=!0);let u=Ji()&&yt()&&!Xi()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:l,ctrlKey:r,altKey:o,shiftKey:i}):new MouseEvent("click",{metaKey:l,ctrlKey:r,altKey:o,shiftKey:i,detail:1,bubbles:!0,cancelable:!0});tt.isOpening=n,Ve(t),t.dispatchEvent(u),tt.isOpening=!1}tt.isOpening=!1;function gp(t,e){if(t instanceof HTMLAnchorElement)e(t);else if(t.hasAttribute("data-href")){let n=document.createElement("a");n.href=t.getAttribute("data-href"),t.hasAttribute("data-target")&&(n.target=t.getAttribute("data-target")),t.hasAttribute("data-rel")&&(n.rel=t.getAttribute("data-rel")),t.hasAttribute("data-download")&&(n.download=t.getAttribute("data-download")),t.hasAttribute("data-ping")&&(n.ping=t.getAttribute("data-ping")),t.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=t.getAttribute("data-referrer-policy")),t.appendChild(n),e(n),t.removeChild(n)}}function yp(t,e){gp(t,n=>tt(n,e))}function $p(t){const n=Nt().useHref(t.href??"");return{"data-href":t.href?n:void 0,"data-target":t.target,"data-rel":t.rel,"data-download":t.download,"data-ping":t.ping,"data-referrer-policy":t.referrerPolicy}}function eu(t){const n=Nt().useHref((t==null?void 0:t.href)??"");let l={};if(t)for(let r of["href","target","rel","download","ping","referrerPolicy"])r in t&&(l[r]=r==="href"?n:t[r]);return l}function vp(t,e,n,l){!e.isNative&&t.currentTarget instanceof HTMLAnchorElement&&t.currentTarget.href&&!t.isDefaultPrevented()&&mp(t.currentTarget,t)&&n&&(t.preventDefault(),e.open(t.currentTarget,t,n,l))}const ne=typeof document<"u"?g.useLayoutEffect:()=>{},tu={prefix:String(Math.round(Math.random()*1e10)),current:0},nu=g.createContext(tu),xp=g.createContext(!1);let gl=new WeakMap;function Cp(t=!1){var l,r;let e=s.useContext(nu),n=s.useRef(null);if(n.current===null&&!t){let o=(r=(l=g.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)==null?void 0:l.ReactCurrentOwner)==null?void 0:r.current;if(o){let i=gl.get(o);i==null?gl.set(o,{id:e.current,state:o.memoizedState}):o.memoizedState!==i.state&&(e.current=i.id,gl.delete(o))}n.current=++e.current}return n.current}function Ep(t){let e=s.useContext(nu),n=Cp(!!t),l=`react-aria${e.prefix}`;return t||`${l}-${n}`}function wp(t){let e=g.useId(),[n]=s.useState(ct()),l=n?"react-aria":`react-aria${tu.prefix}`;return t||`${l}-${e}`}const Sp=typeof g.useId=="function"?wp:Ep;function Dp(){return!1}function kp(){return!0}function Pp(t){return()=>{}}function ct(){return typeof g.useSyncExternalStore=="function"?g.useSyncExternalStore(Pp,Dp,kp):s.useContext(xp)}function Ap(t){let[e,n]=s.useState(t),l=s.useRef(e),r=s.useRef(null),o=s.useRef(()=>{if(!r.current)return;let u=r.current.next();if(u.done){r.current=null;return}l.current===u.value?o.current():n(u.value)});ne(()=>{l.current=e,r.current&&o.current()});let i=s.useCallback(u=>{r.current=u(l.current),o.current()},[o]);return[e,i]}let Tp=!!(typeof window<"u"&&window.document&&window.document.createElement),Bt=new Map,Zt;typeof FinalizationRegistry<"u"&&(Zt=new FinalizationRegistry(t=>{Bt.delete(t)}));function $e(t){let[e,n]=s.useState(t),l=s.useRef(null),r=Sp(e),o=s.useRef(null);if(Zt&&Zt.register(o,r),Tp){const i=Bt.get(r);i&&!i.includes(l)?i.push(l):Bt.set(r,[l])}return ne(()=>{let i=r;return()=>{Zt&&Zt.unregister(o),Bt.delete(i)}},[r]),s.useEffect(()=>{let i=l.current;return i&&n(i),()=>{i&&(l.current=null)}}),r}function Bp(t,e){if(t===e)return t;let n=Bt.get(t);if(n)return n.forEach(r=>r.current=e),e;let l=Bt.get(e);return l?(l.forEach(r=>r.current=t),t):e}function on(t=[]){let e=$e(),[n,l]=Ap(e),r=s.useCallback(()=>{l(function*(){yield e,yield document.getElementById(e)?e:void 0})},[e,l]);return ne(r,[e,r,...t]),n}function dt(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}const re=t=>(t==null?void 0:t.ownerDocument)??document,we=t=>t&&"window"in t&&t.window===t?t:re(t).defaultView||window;function Kp(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&typeof t.nodeType=="number"}function Rp(t){return Kp(t)&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in t}let Mp=!1;function Qe(){return Mp}function te(t,e){if(!Qe())return e&&t?t.contains(e):!1;if(!t||!e)return!1;let n=e;for(;n!==null;){if(n===t)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:Rp(n)?n=n.host:n=n.parentNode}return!1}const oe=(t=document)=>{var n;if(!Qe())return t.activeElement;let e=t.activeElement;for(;e&&"shadowRoot"in e&&((n=e.shadowRoot)!=null&&n.activeElement);)e=e.shadowRoot.activeElement;return e};function j(t){if(Qe()&&t.target instanceof Element&&t.target.shadowRoot){if("composedPath"in t)return t.composedPath()[0]??null;if("composedPath"in t.nativeEvent)return t.nativeEvent.composedPath()[0]??null}return t.target}function vt(t){if(!t)return!1;let e=t.getRootNode(),n=we(t);if(!(e instanceof n.Document||e instanceof n.ShadowRoot))return!1;let l=e.activeElement;return l!=null&&t.contains(l)}class Ip{constructor(e,n,l,r){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=i=>{var u;if(i.nodeType===Node.ELEMENT_NODE){const a=i.shadowRoot;if(a){const c=this._doc.createTreeWalker(a,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(c),NodeFilter.FILTER_ACCEPT}else{if(typeof this.filter=="function")return this.filter(i);if((u=this.filter)!=null&&u.acceptNode)return this.filter.acceptNode(i);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=n,this.filter=r??null,this.whatToShow=l??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(e.createTreeWalker(n,l,this._acceptNode));const o=n.shadowRoot;if(o){const i=this._doc.createTreeWalker(o,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(i)}}get currentNode(){return this._currentNode}set currentNode(e){if(!te(this.root,e))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let l=e,r=e;for(this._currentNode=e;l&&l!==this.root;)if(l.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const i=l,u=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});n.push(u),u.currentNode=r,this._currentSetFor.add(u),l=r=i.host}else l=l.parentNode;const o=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(o),o.currentNode=r,this._currentSetFor.add(o),this._walkerStack=n}get doc(){return this._doc}firstChild(){let e=this.currentNode,n=this.nextNode();return te(e,n)?(n&&(this.currentNode=n),n):(this.currentNode=e,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){var n;const e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let r;if(typeof this.filter=="function"?r=this.filter(e):(n=this.filter)!=null&&n.acceptNode&&(r=this.filter.acceptNode(e)),r===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let o=this.nextNode();return o&&(this.currentNode=o),o}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let l=this.nextNode();return l&&(this.currentNode=l),l}else return null}previousNode(){var l;const e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let r=this.previousNode();return r&&(this.currentNode=r),r}else return null;return null}const n=e.previousNode();if(n){if(n.shadowRoot){let o;if(typeof this.filter=="function"?o=this.filter(n):(l=this.filter)!=null&&l.acceptNode&&(o=this.filter.acceptNode(n)),o===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let i=this.lastChild();return i&&(this.currentNode=i),i}return n&&(this.currentNode=n),n}else if(this._walkerStack.length>1){this._walkerStack.shift();let r=this.previousNode();return r&&(this.currentNode=r),r}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}}function lu(t,e,n,l){return Qe()?new Ip(t,e,n,l):t.createTreeWalker(e,n,l)}function ft(...t){return t.length===1&&t[0]?t[0]:e=>{let n=!1;const l=t.map(r=>{const o=wo(r,e);return n||(n=typeof o=="function"),o});if(n)return()=>{l.forEach((r,o)=>{typeof r=="function"?r():wo(t[o],null)})}}}function wo(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function ru(t){var e,n,l="";if(typeof t=="string"||typeof t=="number")l+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e=65&&r.charCodeAt(2)<=90?e[r]=dt(o,i):(r==="className"||r==="UNSAFE_className")&&typeof o=="string"&&typeof i=="string"?e[r]=Fp(o,i):r==="id"&&o&&i?e.id=Bp(o,i):r==="ref"&&o&&i?e.ref=ft(o,i):e[r]=i!==void 0?i:o}}return e}const Lp=new Set(["id"]),zp=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),Np=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),Op=new Set(["dir","lang","hidden","inert","translate"]),So=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),Vp=/^(data-.*)$/;function ie(t,e={}){let{labelable:n,isLink:l,global:r,events:o=r,propNames:i}=e,u={};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(Lp.has(a)||n&&zp.has(a)||l&&Np.has(a)||r&&Op.has(a)||o&&(So.has(a)||a.endsWith("Capture")&&So.has(a.slice(0,-7)))||i!=null&&i.has(a)||Vp.test(a))&&(u[a]=t[a]);return u}let ut=new Map,Fl=new Set;function Do(){if(typeof window>"u")return;function t(l){return"propertyName"in l}let e=l=>{let r=j(l);if(!t(l)||!r)return;let o=ut.get(r);o||(o=new Set,ut.set(r,o),r.addEventListener("transitioncancel",n,{once:!0})),o.add(l.propertyName)},n=l=>{let r=j(l);if(!t(l)||!r)return;let o=ut.get(r);if(o&&(o.delete(l.propertyName),o.size===0&&(r.removeEventListener("transitioncancel",n),ut.delete(r)),ut.size===0)){for(let i of Fl)i();Fl.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?Do():document.addEventListener("DOMContentLoaded",Do));function jp(){for(const[t]of ut)"isConnected"in t&&!t.isConnected&&ut.delete(t)}function ou(t){requestAnimationFrame(()=>{jp(),ut.size===0?t():Fl.add(t)})}function hn(){let t=s.useRef(new Map),e=s.useCallback((r,o,i,u)=>{let a=u!=null&&u.once?(...c)=>{t.current.delete(i),i(...c)}:i;t.current.set(i,{type:o,eventTarget:r,fn:a,options:u}),r.addEventListener(o,a,u)},[]),n=s.useCallback((r,o,i,u)=>{var c;let a=((c=t.current.get(i))==null?void 0:c.fn)||i;r.removeEventListener(o,a,u),t.current.delete(i)},[]),l=s.useCallback(()=>{t.current.forEach((r,o)=>{n(r.eventTarget,r.type,o,r.options)})},[n]);return s.useEffect(()=>l,[l]),{addGlobalListener:e,removeGlobalListener:n,removeAllGlobalListeners:l}}function un(t,e){let{id:n,"aria-label":l,"aria-labelledby":r}=t;return n=$e(n),r&&l?r=[...new Set([n,...r.trim().split(/\s+/)])].join(" "):r&&(r=r.trim().split(/\s+/).join(" ")),!l&&!r&&e&&(l=e),{id:n,"aria-label":l,"aria-labelledby":r}}function ke(t){const e=s.useRef(null),n=s.useRef(void 0),l=s.useCallback(r=>{if(typeof t=="function"){const o=t,i=o(r);return()=>{typeof i=="function"?i():o(null)}}else if(t)return t.current=r,()=>{t.current=null}},[t]);return s.useMemo(()=>({get current(){return e.current},set current(r){e.current=r,n.current&&(n.current(),n.current=void 0),r!=null&&(n.current=l(r))}}),[l])}const _p=g.useInsertionEffect??ne;function Ee(t){const e=s.useRef(null);return _p(()=>{e.current=t},[t]),s.useCallback((...n)=>{const l=e.current;return l==null?void 0:l(...n)},[])}function $r(t,e){const n=s.useRef(!0),l=s.useRef(null);let r=Ee(t);s.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[]),s.useEffect(()=>{let o=l.current;n.current?n.current=!1:(!o||e.some((i,u)=>!Object.is(i,o[u])))&&r(),l.current=e},e)}function ko(t,e){const n=s.useRef(!0),l=s.useRef(null);ne(()=>(n.current=!0,()=>{n.current=!1}),[]),ne(()=>{n.current?n.current=!1:(!l.current||e.some((r,o)=>!Object.is(r,l[o])))&&t(),l.current=e},e)}function Hp(){return typeof window.ResizeObserver<"u"}function an(t){const{ref:e,box:n,onResize:l}=t;let r=Ee(l);s.useEffect(()=>{let o=e==null?void 0:e.current;if(o)if(Hp()){const i=new window.ResizeObserver(u=>{u.length&&r()});return i.observe(o,{box:n}),()=>{o&&i.unobserve(o)}}else return window.addEventListener("resize",r,!1),()=>{window.removeEventListener("resize",r,!1)}},[e,n])}function vr(t,e){ne(()=>{if(t&&t.ref&&e)return t.ref.current=e.current,()=>{t.ref&&(t.ref.current=null)}})}function st(t,e){if(!t)return!1;let n=window.getComputedStyle(t),l=document.scrollingElement||document.documentElement,r=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return t===l&&n.overflow!=="hidden"&&(r=!0),r&&e&&(r=t.scrollHeight!==t.clientHeight||t.scrollWidth!==t.clientWidth),r}function Xe(t,e){let n=t;for(st(n,e)&&(n=n.parentElement);n&&!st(n,e);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function yl(t,e){let n=[],l=document.scrollingElement||document.documentElement;for(;t&&(st(t,e)&&n.push(t),t!==l);)t=t.parentElement;return n}function kt(t){return yt()?t.metaKey:t.ctrlKey}const Wp=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function tn(t){return t instanceof HTMLInputElement&&!Wp.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}let Te=typeof document<"u"&&window.visualViewport;function Up(){let t=ct(),[e,n]=s.useState(()=>t?{width:0,height:0}:$l());return s.useEffect(()=>{let l=u=>{n(a=>u.width===a.width&&u.height===a.height?a:u)},r=()=>{Te&&Te.scale>1||l($l())},o,i=u=>{Te&&Te.scale>1||tn(j(u))&&(o=requestAnimationFrame(()=>{let a=oe();(!a||!tn(a))&&l({width:document.documentElement.clientWidth,height:document.documentElement.clientHeight})}))};return l($l()),$t()&&window.addEventListener("blur",i,!0),Te?Te.addEventListener("resize",r):window.addEventListener("resize",r),()=>{cancelAnimationFrame(o),$t()&&window.removeEventListener("blur",i,!0),Te?Te.removeEventListener("resize",r):window.removeEventListener("resize",r)}},[]),e}function $l(){return{width:Te?Math.min(Te.width*Te.scale,document.documentElement.clientWidth):document.documentElement.clientWidth,height:Te?Te.height*Te.scale:document.documentElement.clientHeight}}let Gp=0;const vl=new Map;function mn(t){let[e,n]=s.useState();return ne(()=>{if(!t)return;let l=vl.get(t);if(l)n(l.element.id);else{let r=`react-aria-description-${Gp++}`;n(r);let o=document.createElement("div");o.id=r,o.style.display="none",o.textContent=t,document.body.appendChild(o),l={refCount:0,element:o},vl.set(t,l)}return l.refCount++,()=>{l&&--l.refCount===0&&(l.element.remove(),vl.delete(t))}},[t]),{"aria-describedby":t?e:void 0}}function Yt(t,e,n,l){let r=Ee(n),o=n==null;s.useEffect(()=>{if(o||!t.current)return;let i=t.current;return i.addEventListener(e,r,l),()=>{i.removeEventListener(e,r,l)}},[t,e,l,o])}function Ln(t,e,n={}){let{block:l="nearest",inline:r="nearest"}=n;if(t===e)return;let o=t.scrollTop,i=t.scrollLeft,u=e.getBoundingClientRect(),a=t.getBoundingClientRect(),c=window.getComputedStyle(e),f=window.getComputedStyle(t),d=document.scrollingElement||document.documentElement,b=t===d,p=t===d?0:a.top,h=t===d?t.clientHeight:a.bottom,$=t===d?0:a.left,y=t===d?t.clientWidth:a.right,m=parseFloat(c.scrollMarginTop)||0,v=parseFloat(c.scrollMarginBottom)||0,E=parseFloat(c.scrollMarginLeft)||0,C=parseFloat(c.scrollMarginRight)||0,R=parseFloat(f.scrollPaddingTop)||0,A=parseFloat(f.scrollPaddingBottom)||0,K=parseFloat(f.scrollPaddingLeft)||0,P=parseFloat(f.scrollPaddingRight)||0,z=parseFloat(f.borderTopWidth)||0,B=parseFloat(f.borderBottomWidth)||0,N=parseFloat(f.borderLeftWidth)||0,U=parseFloat(f.borderRightWidth)||0,_=u.top-m,x=u.bottom+v,S=u.left-E,I=u.right+C,w=t===d?0:N+U,k=t===d?0:z+B,D=t===d?0:t.offsetWidth-t.clientWidth-w,T=t===d?0:t.offsetHeight-t.clientHeight-k,O=p+(b?0:z)+R,Z=h-(b?0:B)-A-T,F=$+(b?0:N)+K,V=y-(b?0:U)-P;f.direction==="rtl"&&!$t()?F+=D:V-=D;let q=_Z,Q=SV;if(q&&l==="start")o+=_-O;else if(q&&l==="center")o+=(_+x)/2-(O+Z)/2;else if(q&&l==="end")o+=x-Z;else if(q&&l==="nearest"){let J=_-O,ge=x-Z;o+=Math.abs(J)<=Math.abs(ge)?J:ge}if(Q&&r==="start")i+=S-F;else if(Q&&r==="center")i+=(S+I)/2-(F+V)/2;else if(Q&&r==="end")i+=I-V;else if(Q&&r==="nearest"){let J=S-F,ge=I-V;i+=Math.abs(J)<=Math.abs(ge)?J:ge}t.scrollTo({left:i,top:o})}function it(t,e={}){var l,r,o;let{containingElement:n}=e;if(t&&t.isConnected){let i=document.scrollingElement||document.documentElement;if(window.getComputedStyle(i).overflow==="hidden"){let{left:a,top:c}=t.getBoundingClientRect(),f=yl(t,!0);for(let p of f)Ln(p,t);let{left:d,top:b}=t.getBoundingClientRect();if(Math.abs(a-d)>1||Math.abs(c-b)>1){f=n?yl(n,!0):[];for(let p of f)Ln(p,n,{block:"center",inline:"center"});for(let p of yl(t,!0))Ln(p,t)}}else{let{left:a,top:c}=t.getBoundingClientRect();(l=t==null?void 0:t.scrollIntoView)==null||l.call(t,{block:"nearest"});let{left:f,top:d}=t.getBoundingClientRect();(Math.abs(a-f)>1||Math.abs(c-d)>1)&&((r=n==null?void 0:n.scrollIntoView)==null||r.call(n,{block:"center",inline:"center"}),(o=t.scrollIntoView)==null||o.call(t,{block:"nearest"}))}}}function iu(t){return t.pointerType===""&&t.isTrusted?!0:rn()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function qp(t){return!rn()&&t.width===0&&t.height===0||t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"}function xr(t,e,n){let l=Ee(r=>{n&&!r.defaultPrevented&&n(e)});s.useEffect(()=>{var o;let r=(o=t==null?void 0:t.current)==null?void 0:o.form;return r==null||r.addEventListener("reset",l),()=>{r==null||r.removeEventListener("reset",l)}},[t])}function uu(t,e){let{collection:n,onLoadMore:l,scrollOffset:r=1}=t,o=s.useRef(null),i=Ee(u=>{for(let a of u)a.isIntersecting&&l&&l()});ne(()=>(e.current&&(o.current=new IntersectionObserver(i,{root:Xe(e==null?void 0:e.current),rootMargin:`0px ${100*r}% ${100*r}% ${100*r}%`}),o.current.observe(e.current)),()=>{o.current&&o.current.disconnect()}),[n,e,r])}function au(t){const e=s.version.split(".");return parseInt(e[0],10)>=19?t:t?"true":void 0}function Cr(t,e=!0){let[n,l]=s.useState(!0),r=n&&e;return ne(()=>{if(r&&t.current&&"getAnimations"in t.current)for(let o of t.current.getAnimations())o instanceof CSSTransition&&o.cancel()},[t,r]),su(t,r,s.useCallback(()=>l(!1),[])),r}function Ll(t,e){let[n,l]=s.useState(e?"open":"closed");switch(n){case"open":e||l("exiting");break;case"closed":case"exiting":e&&l("open");break}let r=n==="exiting";return su(t,r,s.useCallback(()=>{l(o=>o==="exiting"?"closed":o)},[])),r}function su(t,e,n){ne(()=>{if(e&&t.current){if(!("getAnimations"in t.current)){n();return}let l=t.current.getAnimations();if(l.length===0){n();return}let r=!1;return Promise.allSettled(l.map(o=>o.finished)).then(()=>{r||gr.flushSync(()=>{n()})}),()=>{r=!0}}},[t,e,n])}const Zp=typeof Element<"u"&&"checkVisibility"in Element.prototype;function Yp(t){const e=we(t);if(!(t instanceof e.HTMLElement)&&!(t instanceof e.SVGElement))return!1;let{display:n,visibility:l}=t.style,r=n!=="none"&&l!=="hidden"&&l!=="collapse";if(r){const{getComputedStyle:o}=t.ownerDocument.defaultView;let{display:i,visibility:u}=o(t);r=i!=="none"&&u!=="hidden"&&u!=="collapse"}return r}function Xp(t,e){return!t.hasAttribute("hidden")&&!t.hasAttribute("data-react-aria-prevent-focus")&&(t.nodeName==="DETAILS"&&e&&e.nodeName!=="SUMMARY"?t.hasAttribute("open"):!0)}function Er(t,e){return Zp?t.checkVisibility({visibilityProperty:!0})&&!t.closest("[data-react-aria-prevent-focus]"):t.nodeName!=="#comment"&&Yp(t)&&Xp(t,e)&&(!t.parentElement||Er(t.parentElement,t))}const wr=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],Jp=wr.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";wr.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const Qp=wr.join(':not([hidden]):not([tabindex="-1"]),');function cu(t,e){return t.matches(Jp)&&!fu(t)&&((e==null?void 0:e.skipVisibilityCheck)||Er(t))}function du(t){return t.matches(Qp)&&Er(t)&&!fu(t)}function fu(t){let e=t;for(;e!=null;){if(e instanceof e.ownerDocument.defaultView.HTMLElement&&e.inert)return!0;e=e.parentElement}return!1}function Po(t){let e=t==null?void 0:t.defaultView;return(e==null?void 0:e.__webpack_nonce__)||globalThis.__webpack_nonce__||void 0}let xl=new WeakMap;function pu(t){let e=t??(typeof document<"u"?document:void 0);if(!e)return Po(e);if(xl.has(e))return xl.get(e);let n=e.querySelector('meta[property="csp-nonce"]'),l=n&&n instanceof we(n).HTMLMetaElement&&(n.nonce||n.content)||Po(e)||void 0;return l!==void 0&&xl.set(e,l),l}function eb(t,e,n){const{render:l,...r}=e,o=s.useRef(null),i=s.useMemo(()=>ft(n,o),[n,o]);ne(()=>{},[t,l]);const u={...r,ref:i};return l?l(u,void 0):M.jsx(t,{...u})}const Ao={},Se=new Proxy({},{get(t,e){if(typeof e!="string")return;let n=Ao[e];return n||(n=s.forwardRef(eb.bind(null,e)),Ao[e]=n),n}});var tb=/\s+/g,nb=t=>typeof t!="string"||!t?t:t.replace(tb," ").trim(),It=(...t)=>{const e=[],n=l=>{if(!l&&l!==0&&l!==0n)return;if(Array.isArray(l)){for(let o=0,i=l.length;o0?nb(e.join(" ")):void 0},To=t=>t===!1?"false":t===!0?"true":t===0?"0":t,Pe=t=>{if(!t||typeof t!="object")return!0;for(const e in t)return!1;return!0},lb=(t,e)=>{if(t===e)return!0;if(!t||!e)return!1;const n=Object.keys(t),l=Object.keys(e);if(n.length!==l.length)return!1;for(let r=0;r{for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const l=e[n];n in t?t[n]=It(t[n],l):t[n]=l}return t},bu=(t,e)=>{for(let n=0;n{const e=[];bu(t,e);const n=[];for(let l=0;l{const n={};for(const l in t){const r=t[l];if(l in e){const o=e[l];Array.isArray(r)||Array.isArray(o)?n[l]=hu(o,r):typeof r=="object"&&typeof o=="object"&&r&&o?n[l]=zl(r,o):n[l]=o+" "+r}else n[l]=r}for(const l in e)l in t||(n[l]=e[l]);return n},ob={twMerge:!0,twMergeConfig:{}};function ib(){let t=null,e={},n=!1;return{get cachedTwMerge(){return t},set cachedTwMerge(l){t=l},get cachedTwMergeConfig(){return e},set cachedTwMergeConfig(l){e=l},get didTwMergeConfigChange(){return n},set didTwMergeConfigChange(l){n=l},reset(){t=null,e={},n=!1}}}var Je=ib(),ub=t=>{const e=(l,r)=>{const{extend:o=null,slots:i={},variants:u={},compoundVariants:a=[],compoundSlots:c=[],defaultVariants:f={}}=l,d={...ob,...r},b=o!=null&&o.base?It(o.base,l==null?void 0:l.base):l==null?void 0:l.base,p=o!=null&&o.variants&&!Pe(o.variants)?zl(u,o.variants):u,h=o!=null&&o.defaultVariants&&!Pe(o.defaultVariants)?{...o.defaultVariants,...f}:f;!Pe(d.twMergeConfig)&&!lb(d.twMergeConfig,Je.cachedTwMergeConfig)&&(Je.didTwMergeConfigChange=!0,Je.cachedTwMergeConfig=d.twMergeConfig);const $=Pe(o==null?void 0:o.slots),y=Pe(i)?{}:{base:It(l==null?void 0:l.base,$&&(o==null?void 0:o.base)),...i},m=$?y:rb({...o==null?void 0:o.slots},Pe(y)?{base:l==null?void 0:l.base}:y),v=Pe(o==null?void 0:o.compoundVariants)?a:hu(o==null?void 0:o.compoundVariants,a),E=R=>{if(Pe(p)&&Pe(i)&&$)return t(b,R==null?void 0:R.class,R==null?void 0:R.className)(d);if(v&&!Array.isArray(v))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof v}`);if(c&&!Array.isArray(c))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof c}`);const A=(x,S=p,I=null,w=null)=>{const k=S[x];if(!k||Pe(k))return null;const D=(w==null?void 0:w[x])??(R==null?void 0:R[x]);if(D===null)return null;const T=To(D);if(typeof T=="object")return null;const O=h==null?void 0:h[x],Z=T??To(O);return k[Z||"false"]},K=()=>{if(!p)return null;const x=Object.keys(p),S=[];for(let I=0;I{if(!p||typeof p!="object")return null;const I=[];for(const w in p){const k=A(w,p,x,S),D=x==="base"&&typeof k=="string"?k:k&&k[x];D&&I.push(D)}return I},z={};for(const x in R){const S=R[x];S!==void 0&&(z[x]=S)}const B=(x,S)=>{var w;const I=typeof(R==null?void 0:R[x])=="object"?{[x]:(w=R[x])==null?void 0:w.initial}:{};return{...h,...z,...I,...S}},N=(x=[],S)=>{const I=[],w=x.length;for(let k=0;k{const S=N(v,x);if(!Array.isArray(S))return S;const I={},w=t;for(let k=0;k{if(c.length<1)return null;const S={},I=B(null,x);for(let w=0;w{const k=U(w),D=_(w);return S(m[I],P(I,w),k?k[I]:void 0,D?D[I]:void 0,w==null?void 0:w.class,w==null?void 0:w.className)(d)}}return x}return t(b,K(),N(v),R==null?void 0:R.class,R==null?void 0:R.className)(d)},C=()=>{if(!(!p||typeof p!="object"))return Object.keys(p)};return E.variantKeys=C(),E.extend=o,E.base=b,E.slots=m,E.variants=p,E.defaultVariants=h,E.compoundSlots=c,E.compoundVariants=v,E};return{tv:e,createTV:l=>(r,o)=>e(r,o?zl(l,o):l)}};const ab=(t,e)=>{const n=new Array(t.length+e.length);for(let l=0;l({classGroupId:t,validator:e}),mu=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Vn="-",Bo=[],cb="arbitrary..",db=t=>{const e=pb(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:l}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return fb(i);const u=i.split(Vn),a=u[0]===""&&u.length>1?1:0;return gu(u,a,e)},getConflictingClassGroupIds:(i,u)=>{if(u){const a=l[i],c=n[i];return a?c?ab(c,a):a:c||Bo}return n[i]||Bo}}},gu=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],o=n.nextPart.get(r);if(o){const c=gu(t,e+1,o);if(c)return c}const i=n.validators;if(i===null)return;const u=e===0?t.join(Vn):t.slice(e).join(Vn),a=i.length;for(let c=0;ct.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),l=e.slice(0,n);return l?cb+l:void 0})(),pb=t=>{const{theme:e,classGroups:n}=t;return bb(n,e)},bb=(t,e)=>{const n=mu();for(const l in t){const r=t[l];Sr(r,n,l,e)}return n},Sr=(t,e,n,l)=>{const r=t.length;for(let o=0;o{if(typeof t=="string"){mb(t,e,n);return}if(typeof t=="function"){gb(t,e,n,l);return}yb(t,e,n,l)},mb=(t,e,n)=>{const l=t===""?e:yu(e,t);l.classGroupId=n},gb=(t,e,n,l)=>{if($b(t)){Sr(t(l),e,n,l);return}e.validators===null&&(e.validators=[]),e.validators.push(sb(n,t))},yb=(t,e,n,l)=>{const r=Object.entries(t),o=r.length;for(let i=0;i{let n=t;const l=e.split(Vn),r=l.length;for(let o=0;o"isThemeGetter"in t&&t.isThemeGetter===!0,vb=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),l=Object.create(null);const r=(o,i)=>{n[o]=i,e++,e>t&&(e=0,l=n,n=Object.create(null))};return{get(o){let i=n[o];if(i!==void 0)return i;if((i=l[o])!==void 0)return r(o,i),i},set(o,i){o in n?n[o]=i:r(o,i)}}},Nl="!",Ko=":",xb=[],Ro=(t,e,n,l,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:l,isExternal:r}),Cb=t=>{const{prefix:e,experimentalParseClassName:n}=t;let l=r=>{const o=[];let i=0,u=0,a=0,c;const f=r.length;for(let $=0;$a?c-a:void 0;return Ro(o,p,b,h)};if(e){const r=e+Ko,o=l;l=i=>i.startsWith(r)?o(i.slice(r.length)):Ro(xb,!1,i,void 0,!0)}if(n){const r=l;l=o=>n({className:o,parseClassName:r})}return l},Eb=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,l)=>{e.set(n,1e6+l)}),n=>{const l=[];let r=[];for(let o=0;o0&&(r.sort(),l.push(...r),r=[]),l.push(i)):r.push(i)}return r.length>0&&(r.sort(),l.push(...r)),l}},wb=t=>({cache:vb(t.cacheSize),parseClassName:Cb(t),sortModifiers:Eb(t),...db(t)}),Sb=/\s+/,Db=(t,e)=>{const{parseClassName:n,getClassGroupId:l,getConflictingClassGroupIds:r,sortModifiers:o}=e,i=[],u=t.trim().split(Sb);let a="";for(let c=u.length-1;c>=0;c-=1){const f=u[c],{isExternal:d,modifiers:b,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:$}=n(f);if(d){a=f+(a.length>0?" "+a:a);continue}let y=!!$,m=l(y?h.substring(0,$):h);if(!m){if(!y){a=f+(a.length>0?" "+a:a);continue}if(m=l(h),!m){a=f+(a.length>0?" "+a:a);continue}y=!1}const v=b.length===0?"":b.length===1?b[0]:o(b).join(":"),E=p?v+Nl:v,C=E+m;if(i.indexOf(C)>-1)continue;i.push(C);const R=r(m,y);for(let A=0;A0?" "+a:a)}return a},kb=(...t)=>{let e=0,n,l,r="";for(;e{if(typeof t=="string")return t;let e,n="";for(let l=0;l{let n,l,r,o;const i=a=>{const c=e.reduce((f,d)=>d(f),t());return n=wb(c),l=n.cache.get,r=n.cache.set,o=u,u(a)},u=a=>{const c=l(a);if(c)return c;const f=Db(a,n);return r(a,f),f};return o=i,(...a)=>o(kb(...a))},Pb=[],ye=t=>{const e=n=>n[t]||Pb;return e.isThemeGetter=!0,e},vu=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xu=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ab=/^\d+\/\d+$/,Tb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Bb=/\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$/,Kb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Rb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Mb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,St=t=>Ab.test(t),ee=t=>!!t&&!Number.isNaN(Number(t)),ot=t=>!!t&&Number.isInteger(Number(t)),Cl=t=>t.endsWith("%")&&ee(t.slice(0,-1)),Ye=t=>Tb.test(t),Ib=()=>!0,Fb=t=>Bb.test(t)&&!Kb.test(t),Cu=()=>!1,Lb=t=>Rb.test(t),zb=t=>Mb.test(t),Nb=t=>!H(t)&&!W(t),Ob=t=>Ot(t,Su,Cu),H=t=>vu.test(t),pt=t=>Ot(t,Du,Fb),El=t=>Ot(t,Wb,ee),Mo=t=>Ot(t,Eu,Cu),Vb=t=>Ot(t,wu,zb),kn=t=>Ot(t,ku,Lb),W=t=>xu.test(t),Ut=t=>Vt(t,Du),jb=t=>Vt(t,Ub),Io=t=>Vt(t,Eu),_b=t=>Vt(t,Su),Hb=t=>Vt(t,wu),Pn=t=>Vt(t,ku,!0),Ot=(t,e,n)=>{const l=vu.exec(t);return l?l[1]?e(l[1]):n(l[2]):!1},Vt=(t,e,n=!1)=>{const l=xu.exec(t);return l?l[1]?e(l[1]):n:!1},Eu=t=>t==="position"||t==="percentage",wu=t=>t==="image"||t==="url",Su=t=>t==="length"||t==="size"||t==="bg-size",Du=t=>t==="length",Wb=t=>t==="number",Ub=t=>t==="family-name",ku=t=>t==="shadow",Vl=()=>{const t=ye("color"),e=ye("font"),n=ye("text"),l=ye("font-weight"),r=ye("tracking"),o=ye("leading"),i=ye("breakpoint"),u=ye("container"),a=ye("spacing"),c=ye("radius"),f=ye("shadow"),d=ye("inset-shadow"),b=ye("text-shadow"),p=ye("drop-shadow"),h=ye("blur"),$=ye("perspective"),y=ye("aspect"),m=ye("ease"),v=ye("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],R=()=>[...C(),W,H],A=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto","contain","none"],P=()=>[W,H,a],z=()=>[St,"full","auto",...P()],B=()=>[ot,"none","subgrid",W,H],N=()=>["auto",{span:["full",ot,W,H]},ot,W,H],U=()=>[ot,"auto",W,H],_=()=>["auto","min","max","fr",W,H],x=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],S=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...P()],w=()=>[St,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...P()],k=()=>[t,W,H],D=()=>[...C(),Io,Mo,{position:[W,H]}],T=()=>["no-repeat",{repeat:["","x","y","space","round"]}],O=()=>["auto","cover","contain",_b,Ob,{size:[W,H]}],Z=()=>[Cl,Ut,pt],F=()=>["","none","full",c,W,H],V=()=>["",ee,Ut,pt],q=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[ee,Cl,Io,Mo],ge=()=>["","none",h,W,H],Be=()=>["none",ee,W,H],L=()=>["none",ee,W,H],Y=()=>[ee,W,H],ue=()=>[St,"full",...P()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ye],breakpoint:[Ye],color:[Ib],container:[Ye],"drop-shadow":[Ye],ease:["in","out","in-out"],font:[Nb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ye],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ye],shadow:[Ye],spacing:["px",ee],text:[Ye],"text-shadow":[Ye],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",St,H,W,y]}],container:["container"],columns:[{columns:[ee,H,W,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:R()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{start:z()}],end:[{end:z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[ot,"auto",W,H]}],basis:[{basis:[St,"full","auto",u,...P()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ee,St,"auto","initial","none",H]}],grow:[{grow:["",ee,W,H]}],shrink:[{shrink:["",ee,W,H]}],order:[{order:[ot,"first","last","none",W,H]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:N()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:N()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":_()}],"auto-rows":[{"auto-rows":_()}],gap:[{gap:P()}],"gap-x":[{"gap-x":P()}],"gap-y":[{"gap-y":P()}],"justify-content":[{justify:[...x(),"normal"]}],"justify-items":[{"justify-items":[...S(),"normal"]}],"justify-self":[{"justify-self":["auto",...S()]}],"align-content":[{content:["normal",...x()]}],"align-items":[{items:[...S(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...S(),{baseline:["","last"]}]}],"place-content":[{"place-content":x()}],"place-items":[{"place-items":[...S(),"baseline"]}],"place-self":[{"place-self":["auto",...S()]}],p:[{p:P()}],px:[{px:P()}],py:[{py:P()}],ps:[{ps:P()}],pe:[{pe:P()}],pt:[{pt:P()}],pr:[{pr:P()}],pb:[{pb:P()}],pl:[{pl:P()}],m:[{m:I()}],mx:[{mx:I()}],my:[{my:I()}],ms:[{ms:I()}],me:[{me:I()}],mt:[{mt:I()}],mr:[{mr:I()}],mb:[{mb:I()}],ml:[{ml:I()}],"space-x":[{"space-x":P()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":P()}],"space-y-reverse":["space-y-reverse"],size:[{size:w()}],w:[{w:[u,"screen",...w()]}],"min-w":[{"min-w":[u,"screen","none",...w()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[i]},...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",n,Ut,pt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[l,W,El]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cl,H]}],"font-family":[{font:[jb,H,e]}],"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:[r,W,H]}],"line-clamp":[{"line-clamp":[ee,"none",W,El]}],leading:[{leading:[o,...P()]}],"list-image":[{"list-image":["none",W,H]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",W,H]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:[ee,"from-font","auto",W,pt]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[ee,"auto",W,H]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",W,H]}],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",W,H]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:T()}],"bg-size":[{bg:O()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ot,W,H],radial:["",W,H],conic:[ot,W,H]},Hb,Vb]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":V()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...q(),"hidden","none"]}],"divide-style":[{divide:[...q(),"hidden","none"]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ee,W,H]}],"outline-w":[{outline:["",ee,Ut,pt]}],"outline-color":[{outline:k()}],shadow:[{shadow:["","none",f,Pn,kn]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":["none",d,Pn,kn]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[ee,pt]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":["none",b,Pn,kn]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[ee,W,H]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"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":[ee]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[W,H]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"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":C()}],"mask-image-conic-pos":[{"mask-conic":[ee]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:T()}],"mask-size":[{mask:O()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",W,H]}],filter:[{filter:["","none",W,H]}],blur:[{blur:ge()}],brightness:[{brightness:[ee,W,H]}],contrast:[{contrast:[ee,W,H]}],"drop-shadow":[{"drop-shadow":["","none",p,Pn,kn]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:["",ee,W,H]}],"hue-rotate":[{"hue-rotate":[ee,W,H]}],invert:[{invert:["",ee,W,H]}],saturate:[{saturate:[ee,W,H]}],sepia:[{sepia:["",ee,W,H]}],"backdrop-filter":[{"backdrop-filter":["","none",W,H]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[ee,W,H]}],"backdrop-contrast":[{"backdrop-contrast":[ee,W,H]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ee,W,H]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ee,W,H]}],"backdrop-invert":[{"backdrop-invert":["",ee,W,H]}],"backdrop-opacity":[{"backdrop-opacity":[ee,W,H]}],"backdrop-saturate":[{"backdrop-saturate":[ee,W,H]}],"backdrop-sepia":[{"backdrop-sepia":["",ee,W,H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":P()}],"border-spacing-x":[{"border-spacing-x":P()}],"border-spacing-y":[{"border-spacing-y":P()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",W,H]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ee,"initial",W,H]}],ease:[{ease:["linear","initial",m,W,H]}],delay:[{delay:[ee,W,H]}],animate:[{animate:["none",v,W,H]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[$,W,H]}],"perspective-origin":[{"perspective-origin":R()}],rotate:[{rotate:Be()}],"rotate-x":[{"rotate-x":Be()}],"rotate-y":[{"rotate-y":Be()}],"rotate-z":[{"rotate-z":Be()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:Y()}],"skew-x":[{"skew-x":Y()}],"skew-y":[{"skew-y":Y()}],transform:[{transform:[W,H,"","none","gpu","cpu"]}],"transform-origin":[{origin:R()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":["translate-none"],accent:[{accent:k()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:k()}],"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",W,H]}],"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":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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",W,H]}],fill:[{fill:["none",...k()]}],"stroke-w":[{stroke:[ee,Ut,pt,El]}],stroke:[{stroke:["none",...k()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-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-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-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-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"]}},Gb=(t,{cacheSize:e,prefix:n,experimentalParseClassName:l,extend:r={},override:o={}})=>(Xt(t,"cacheSize",e),Xt(t,"prefix",n),Xt(t,"experimentalParseClassName",l),An(t.theme,o.theme),An(t.classGroups,o.classGroups),An(t.conflictingClassGroups,o.conflictingClassGroups),An(t.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),Xt(t,"orderSensitiveModifiers",o.orderSensitiveModifiers),Tn(t.theme,r.theme),Tn(t.classGroups,r.classGroups),Tn(t.conflictingClassGroups,r.conflictingClassGroups),Tn(t.conflictingClassGroupModifiers,r.conflictingClassGroupModifiers),Pu(t,r,"orderSensitiveModifiers"),t),Xt=(t,e,n)=>{n!==void 0&&(t[e]=n)},An=(t,e)=>{if(e)for(const n in e)Xt(t,n,e[n])},Tn=(t,e)=>{if(e)for(const n in e)Pu(t,e,n)},Pu=(t,e,n)=>{const l=e[n];l!==void 0&&(t[n]=t[n]?t[n].concat(l):l)},qb=(t,...e)=>typeof t=="function"?Ol(Vl,t,...e):Ol(()=>Gb(Vl(),t),...e),Zb=Ol(Vl);var Yb=t=>Pe(t)?Zb:qb({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}),Xb=(t,e)=>{const n=It(t);return!n||!((e==null?void 0:e.twMerge)??!0)?n:((!Je.cachedTwMerge||Je.didTwMergeConfigChange)&&(Je.didTwMergeConfigChange=!1,Je.cachedTwMerge=Yb(Je.cachedTwMergeConfig)),Je.cachedTwMerge(n)||void 0)},Jb=(...t)=>e=>Xb(t,e),{tv:De}=ub(Jb);const Qn=De({defaultVariants:{size:"md",status:"danger",variant:"opaque"},slots:{backdrop:"alert-dialog__backdrop",body:"alert-dialog__body",closeTrigger:"alert-dialog__close-trigger",container:"alert-dialog__container",dialog:"alert-dialog__dialog",footer:"alert-dialog__footer",header:"alert-dialog__header",heading:"alert-dialog__heading",icon:"alert-dialog__icon",trigger:"alert-dialog__trigger"},variants:{size:{cover:{dialog:"alert-dialog__dialog--cover"},lg:{dialog:"alert-dialog__dialog--lg"},md:{dialog:"alert-dialog__dialog--md"},sm:{dialog:"alert-dialog__dialog--sm"},xs:{dialog:"alert-dialog__dialog--xs"}},status:{accent:{icon:"alert-dialog__icon--accent"},danger:{icon:"alert-dialog__icon--danger"},default:{icon:"alert-dialog__icon--default"},success:{icon:"alert-dialog__icon--success"},warning:{icon:"alert-dialog__icon--warning"}},variant:{blur:{backdrop:"alert-dialog__backdrop--blur"},opaque:{backdrop:"alert-dialog__backdrop--opaque"},transparent:{backdrop:"alert-dialog__backdrop--transparent"}}}}),Qb=De({base:"button",defaultVariants:{fullWidth:!1,isIconOnly:!1,size:"md",variant:"primary"},variants:{fullWidth:{false:"",true:"button--full-width"},isIconOnly:{true:"button--icon-only"},size:{lg:"button--lg",md:"button--md",sm:"button--sm"},variant:{danger:"button--danger","danger-soft":"button--danger-soft",ghost:"button--ghost",outline:"button--outline",primary:"button--primary",secondary:"button--secondary",tertiary:"button--tertiary"}}}),eh=De({defaultVariants:{variant:"default"},slots:{base:"card",content:"card__content",description:"card__description",footer:"card__footer",header:"card__header",title:"card__title"},variants:{variant:{default:{base:"card--default"},secondary:{base:"card--secondary"},tertiary:{base:"card--tertiary"},transparent:{base:"card--transparent"}}}}),th=De({defaultVariants:{color:"default",variant:"secondary"},slots:{base:"chip",label:"chip__label"},variants:{color:{accent:{base:"chip--accent"},danger:{base:"chip--danger"},default:{base:"chip--default"},success:{base:"chip--success"},warning:{base:"chip--warning"}},size:{lg:{base:"chip--lg"},md:{base:"chip--md"},sm:{base:"chip--sm"}},variant:{primary:{base:"chip--primary"},secondary:{base:"chip--secondary"},soft:{base:"chip--soft"},tertiary:{base:"chip--tertiary"}}}}),nh=De({base:"close-button",defaultVariants:{variant:"default"},variants:{variant:{default:"close-button--default"}}}),lh=De({defaultVariants:{fullWidth:!1},slots:{base:"combo-box",inputGroup:"combo-box__input-group",popover:"combo-box__popover",trigger:"combo-box__trigger"},variants:{fullWidth:{false:{},true:{base:"combo-box--full-width",inputGroup:"combo-box__input-group--full-width"}}}}),rh=De({base:"description"}),oh=De({base:"input",defaultVariants:{fullWidth:!1,variant:"primary"},variants:{fullWidth:{false:"",true:"input--full-width"},variant:{primary:"input--primary",secondary:"input--secondary"}}}),ih=De({base:"label",defaultVariants:{isDisabled:!1,isInvalid:!1,isRequired:!1},variants:{isDisabled:{true:"label--disabled"},isInvalid:{true:"label--invalid"},isRequired:{true:"label--required"}}}),uh=De({slots:{base:"link",icon:"link__icon"}}),ah=De({base:"list-box",defaultVariants:{variant:"default"},variants:{variant:{danger:"list-box--danger",default:"list-box--default"}}}),sh=De({defaultVariants:{variant:"default"},slots:{indicator:"list-box-item__indicator",item:"list-box-item"},variants:{variant:{danger:{item:"list-box-item--danger"},default:{item:"list-box-item--default"}}}}),ch=De({base:"list-box-section"}),dh=De({base:"spinner",defaultVariants:{color:"accent",size:"md"},variants:{color:{accent:"spinner--accent",current:"spinner--current",danger:"spinner--danger",success:"spinner--success",warning:"spinner--warning"},size:{lg:"spinner--lg",md:"spinner--md",sm:"spinner--sm",xl:"spinner--xl"}}}),fh=De({defaultVariants:{variant:"primary"},slots:{base:"table-root",body:"table__body",cell:"table__cell",column:"table__column",columnResizer:"table__column-resizer",content:"table__content",footer:"table__footer",header:"table__header",loadMore:"table__load-more",loadMoreContent:"table__load-more-content",resizableContainer:"table__resizable-container",row:"table__row",scrollContainer:"table__scroll-container",sortableColumnHeader:"table__sortable-column-header",sortableColumnIndicator:"table__sortable-column-indicator"},variants:{variant:{primary:{base:"table-root--primary"},secondary:{base:"table-root--secondary"}}}}),ph=De({base:"textfield",defaultVariants:{fullWidth:!1},variants:{fullWidth:{false:"",true:"textfield--full-width"}}}),mt=Symbol("default");function _e({values:t,children:e}){for(let[n,l]of t)e=g.createElement(n.Provider,{value:l},e);return e}function ce(t){let{className:e,style:n,children:l,defaultClassName:r,defaultChildren:o,defaultStyle:i,values:u,render:a}=t;return s.useMemo(()=>{let c,f,d;return typeof e=="function"?c=e({...u,defaultClassName:r}):c=e,typeof n=="function"?f=n({...u,defaultStyle:i||{}}):f=n,typeof l=="function"?d=l({...u,defaultChildren:o}):l==null?d=o:d=l,{className:c??r,style:f||i?{...i,...f}:void 0,children:d??o,"data-rac":"",render:a?b=>a(b,u):void 0}},[e,n,l,r,o,i,u,a])}function bh(t,e){return n=>e(typeof t=="function"?t(n):t,n)}function el(t,e){let n=s.useContext(t);if(e===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let l=e||mt;if(!n.slots[l]){let r=new Intl.ListFormat().format(Object.keys(n.slots).map(i=>`"${i}"`)),o=e?`Invalid slot "${e}".`:"A slot prop is required.";throw new Error(`${o} Valid slot names are ${r}.`)}return n.slots[l]}return n}function xe(t,e,n){let l=el(n,t.slot)||{},{ref:r,...o}=l,i=ke(s.useMemo(()=>ft(e,r),[e,r])),u=G(o,t);return"style"in o&&o.style&&"style"in t&&t.style&&(typeof o.style=="function"||typeof t.style=="function"?u.style=a=>{let c=typeof o.style=="function"?o.style(a):o.style,f={...a.defaultStyle,...c},d=typeof t.style=="function"?t.style({...a,defaultStyle:f}):t.style;return{...f,...d}}:u.style={...o.style,...t.style}),[u,i]}function Dr(t=!0){let[e,n]=s.useState(t),l=s.useRef(!1),r=s.useCallback(o=>{l.current=!0,n(!!o)},[]);return ne(()=>{l.current||n(!1)},[]),[r,e]}function kr(t){const e=/^(data-.*)$/;let n={};for(const l in t)e.test(l)||(n[l]=t[l]);return n}function hh(t,e,n){let{render:l,...r}=e,o=s.useRef(null),i=s.useMemo(()=>ft(n,o),[n,o]);ne(()=>{},[t,l]);let u={...r,ref:i};return l?l(u,void 0):g.createElement(t,u)}const Fo={},le=new Proxy({},{get(t,e){if(typeof e!="string")return;let n=Fo[e];return n||(n=s.forwardRef(hh.bind(null,e)),Fo[e]=n),n}});typeof HTMLTemplateElement<"u"&&(Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.content.firstChild}}),Object.defineProperty(HTMLTemplateElement.prototype,"appendChild",{configurable:!0,enumerable:!0,value:function(t){return this.content.appendChild(t)}}),Object.defineProperty(HTMLTemplateElement.prototype,"removeChild",{configurable:!0,enumerable:!0,value:function(t){return this.content.removeChild(t)}}),Object.defineProperty(HTMLTemplateElement.prototype,"insertBefore",{configurable:!0,enumerable:!0,value:function(t,e){return this.content.insertBefore(t,e)}}));const jn=s.createContext(!1);function mh(t){if(s.useContext(jn))return g.createElement(g.Fragment,null,t.children);let n=g.createElement(jn.Provider,{value:!0},t.children);return g.createElement("template",null,n)}function gn(t){let e=(n,l)=>s.useContext(jn)?null:t(n,l);return e.displayName=t.displayName||t.name,s.forwardRef(e)}function gh(){return s.useContext(jn)}const tl=s.createContext({}),yh=gn(function(e,n){[e,n]=xe(e,n,tl);let{elementType:l="label",...r}=e,o=le[l];return g.createElement(o,{className:"react-aria-Label",...r,ref:n})});function Au(t){let{id:e,label:n,"aria-labelledby":l,"aria-label":r,labelElementType:o="label"}=t;e=$e(e);let i=$e(),u={};n&&(l=l?`${i} ${l}`:i,u={id:i,htmlFor:o==="label"?e:void 0});let a=un({id:e,"aria-label":r,"aria-labelledby":l});return{labelProps:u,fieldProps:a}}const $h=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),vh=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function xh(t){if(Intl.Locale){let n=new Intl.Locale(t).maximize(),l=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(l)return l.direction==="rtl";if(n.script)return $h.has(n.script)}let e=t.split("-")[0];return vh.has(e)}const Tu=Symbol.for("react-aria.i18n.locale");function Bu(){let t=typeof window<"u"&&window[Tu]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{t="en-US"}return{locale:t,direction:xh(t)?"rtl":"ltr"}}let jl=Bu(),Jt=new Set;function Lo(){jl=Bu();for(let t of Jt)t(jl)}function Ch(){let t=ct(),[e,n]=s.useState(jl);return s.useEffect(()=>(Jt.size===0&&window.addEventListener("languagechange",Lo),Jt.add(n),()=>{Jt.delete(n),Jt.size===0&&window.removeEventListener("languagechange",Lo)}),[]),t?{locale:typeof window<"u"&&window[Tu]||"en-US",direction:"ltr"}:e}const Eh=g.createContext(null);function Re(){let t=Ch();return s.useContext(Eh)||t}function _l(t,e=-1/0,n=1/0){return Math.min(Math.max(t,e),n)}const wh=s.createContext(null),Ku=7e3;let We=null;function gt(t,e="assertive",n=Ku){We?We.announce(t,e,n):(We=new Sh,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?We.announce(t,e,n):setTimeout(()=>{We!=null&&We.isAttached()&&(We==null||We.announce(t,e,n))},100))}class Sh{constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}isAttached(){var e;return(e=this.node)==null?void 0:e.isConnected}createLog(e){let n=document.createElement("div");return n.setAttribute("role","log"),n.setAttribute("aria-live",e),n.setAttribute("aria-relevant","additions"),n}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,n="assertive",l=Ku){var o,i;if(!this.node)return;let r=document.createElement("div");typeof e=="object"?(r.setAttribute("role","img"),r.setAttribute("aria-labelledby",e["aria-labelledby"])):r.textContent=e,n==="assertive"?(o=this.assertiveLog)==null||o.appendChild(r):(i=this.politeLog)==null||i.appendChild(r),e!==""&&setTimeout(()=>{r.remove()},l)}clear(e){this.node&&((!e||e==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||e==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}}function Pr(t){let e=t;return e.nativeEvent=t,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function Ru(t,e){Object.defineProperty(t,"target",{value:e}),Object.defineProperty(t,"currentTarget",{value:e})}function Mu(t){let e=s.useRef({isFocused:!1,observer:null});return ne(()=>{const n=e.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]),s.useCallback(n=>{let l=j(n);if(l instanceof HTMLButtonElement||l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement||l instanceof HTMLSelectElement){e.current.isFocused=!0;let r=l,o=i=>{if(e.current.isFocused=!1,r.disabled){let u=Pr(i);t==null||t(u)}e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};r.addEventListener("focusout",o,{once:!0}),e.current.observer=new MutationObserver(()=>{var i;if(e.current.isFocused&&r.disabled){(i=e.current.observer)==null||i.disconnect();let u=r===oe()?null:oe();r.dispatchEvent(new FocusEvent("blur",{relatedTarget:u})),r.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:u}))}}),e.current.observer.observe(r,{attributes:!0,attributeFilter:["disabled"]})}},[t])}let _n=!1;function Dh(t){for(;t&&!cu(t,{skipVisibilityCheck:!0});)t=t.parentElement;let e=we(t),n=e.document.activeElement;if(!n||n===t)return;_n=!0;let l=!1,r=f=>{(j(f)===n||l)&&f.stopImmediatePropagation()},o=f=>{(j(f)===n||l)&&(f.stopImmediatePropagation(),!t&&!l&&(l=!0,Ve(n),a()))},i=f=>{(j(f)===t||l)&&f.stopImmediatePropagation()},u=f=>{(j(f)===t||l)&&(f.stopImmediatePropagation(),l||(l=!0,Ve(n),a()))};e.addEventListener("blur",r,!0),e.addEventListener("focusout",o,!0),e.addEventListener("focusin",u,!0),e.addEventListener("focus",i,!0);let a=()=>{cancelAnimationFrame(c),e.removeEventListener("blur",r,!0),e.removeEventListener("focusout",o,!0),e.removeEventListener("focusin",u,!0),e.removeEventListener("focus",i,!0),_n=!1,l=!1},c=requestAnimationFrame(a);return a}let nt=null;const sn=new Set;let nn=new Map,xt=!1,Hl=!1;const kh={Tab:!0,Escape:!0};function nl(t,e){for(let n of sn)n(t,e)}function Ph(t){return!(t.metaKey||!yt()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function Hn(t){xt=!0,!tt.isOpening&&Ph(t)&&(nt="keyboard",nl("keyboard",t))}function Kt(t){nt="pointer","pointerType"in t&&t.pointerType,(t.type==="mousedown"||t.type==="pointerdown")&&(xt=!0,nl("pointer",t))}function Iu(t){!tt.isOpening&&iu(t)&&(xt=!0,nt="virtual")}function Fu(t){let e=we(j(t)),n=re(j(t));j(t)===e||j(t)===n||_n||!t.isTrusted||(!xt&&!Hl&&(nt="virtual",nl("virtual",t)),xt=!1,Hl=!1)}function Lu(){_n||(xt=!1,Hl=!0)}function Wn(t){if(typeof window>"u"||typeof document>"u")return;const e=we(t),n=re(t);if(nn.get(e))return;let l=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){xt=!0,l.apply(this,arguments)},n.addEventListener("keydown",Hn,!0),n.addEventListener("keyup",Hn,!0),n.addEventListener("click",Iu,!0),e.addEventListener("focus",Fu,!0),e.addEventListener("blur",Lu,!1),typeof PointerEvent<"u"&&(n.addEventListener("pointerdown",Kt,!0),n.addEventListener("pointermove",Kt,!0),n.addEventListener("pointerup",Kt,!0)),e.addEventListener("beforeunload",()=>{zu(t)},{once:!0}),nn.set(e,{focus:l})}const zu=(t,e)=>{const n=we(t),l=re(t);e&&l.removeEventListener("DOMContentLoaded",e),nn.has(n)&&(n.HTMLElement.prototype.focus=nn.get(n).focus,l.removeEventListener("keydown",Hn,!0),l.removeEventListener("keyup",Hn,!0),l.removeEventListener("click",Iu,!0),n.removeEventListener("focus",Fu,!0),n.removeEventListener("blur",Lu,!1),typeof PointerEvent<"u"&&(l.removeEventListener("pointerdown",Kt,!0),l.removeEventListener("pointermove",Kt,!0),l.removeEventListener("pointerup",Kt,!0)),nn.delete(n))};function Ah(t){const e=re(t);let n;return e.readyState!=="loading"?Wn(t):(n=()=>{Wn(t)},e.addEventListener("DOMContentLoaded",n)),()=>zu(t,n)}typeof document<"u"&&Ah();function Ft(){return nt!=="pointer"}function cn(){return nt}function Th(t){nt=t,nl(t,null)}function Nu(){Wn();let[t,e]=s.useState(nt);return s.useEffect(()=>{let n=()=>{e(nt)};return sn.add(n),()=>{sn.delete(n)}},[]),ct()?null:t}const Bh=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Kh(t,e,n){let l=n?j(n):void 0,r=re(l),o=we(l);const i=typeof o<"u"?o.HTMLInputElement:HTMLInputElement,u=typeof o<"u"?o.HTMLTextAreaElement:HTMLTextAreaElement,a=typeof o<"u"?o.HTMLElement:HTMLElement,c=typeof o<"u"?o.KeyboardEvent:KeyboardEvent;let f=oe(r);return t=t||f instanceof i&&!Bh.has(f.type)||f instanceof u||f instanceof a&&f.isContentEditable,!(t&&e==="keyboard"&&n instanceof c&&!kh[n.key])}function Rh(t,e,n){Wn(),s.useEffect(()=>{if((n==null?void 0:n.enabled)===!1)return;let l=(r,o)=>{Kh(!!(n!=null&&n.isTextInput),r,o)&&t(Ft())};return sn.add(l),()=>{sn.delete(l)}},e)}function ve(t){if(!t.isConnected)return;const e=re(t);if(cn()==="virtual"){let n=oe(e);ou(()=>{const l=oe(e);(l===n||l===e.body)&&t.isConnected&&Ve(t)})}else Ve(t)}function Ar(t){let{isDisabled:e,onFocus:n,onBlur:l,onFocusChange:r}=t;const o=s.useCallback(a=>{if(j(a)===a.currentTarget)return l&&l(a),r&&r(!1),!0},[l,r]),i=Mu(o),u=s.useCallback(a=>{let c=j(a);const f=re(c),d=f?oe(f):oe();c===a.currentTarget&&c===d&&(n&&n(a),r&&r(!0),i(a))},[r,n,i]);return{focusProps:{onFocus:!e&&(n||r||l)?u:void 0,onBlur:!e&&(l||r)?o:void 0}}}function zo(t){if(!t)return;let e=!0;return n=>{let l={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){e=!0},continuePropagation(){e=!1},isPropagationStopped(){return e}};t(l),e&&n.stopPropagation()}}function Tr(t){return{keyboardProps:t.isDisabled?{}:{onKeyDown:zo(t.onKeyDown),onKeyUp:zo(t.onKeyUp)}}}let Wl=g.createContext(null);function Mh(t){let e=s.useContext(Wl)||{};vr(e,t);let{ref:n,...l}=e;return l}function jt(t,e){let{focusProps:n}=Ar(t),{keyboardProps:l}=Tr(t),r=G(n,l),o=Mh(e),i=t.isDisabled?{}:o,u=s.useRef(t.autoFocus);s.useEffect(()=>{u.current&&e.current&&ve(e.current),u.current=!1},[e]);let a=t.excludeFromTabOrder?-1:0;return t.isDisabled&&(a=void 0),{focusableProps:G({...r,tabIndex:a},i)}}let Tt="default",Ul="",zn=new WeakMap;function Ou(t){if($t()){if(Tt==="default"){const e=re(t);Ul=e.documentElement.style.webkitUserSelect,e.documentElement.style.webkitUserSelect="none"}Tt="disabled"}else if(t instanceof HTMLElement||t instanceof SVGElement){let e="userSelect"in t.style?"userSelect":"webkitUserSelect";zn.set(t,t.style[e]),t.style[e]="none"}}function Gl(t){if($t()){if(Tt!=="disabled")return;Tt="restoring",setTimeout(()=>{ou(()=>{if(Tt==="restoring"){const e=re(t);e.documentElement.style.webkitUserSelect==="none"&&(e.documentElement.style.webkitUserSelect=Ul||""),Ul="",Tt="default"}})},300)}else if((t instanceof HTMLElement||t instanceof SVGElement)&&t&&zn.has(t)){let e=zn.get(t),n="userSelect"in t.style?"userSelect":"webkitUserSelect";t.style[n]==="none"&&(t.style[n]=e),t.getAttribute("style")===""&&t.removeAttribute("style"),zn.delete(t)}}const dn=g.createContext({register:()=>{}});dn.displayName="PressResponderContext";function Ih(t){let e=s.useContext(dn);if(e){let{register:n,ref:l,...r}=e;t=G(r,t),n()}return vr(e,t.ref),t}var Mt;class Bn{constructor(e,n,l,r){Eo(this,Mt);ml(this,Mt,!0);let o=(r==null?void 0:r.target)??l.currentTarget;const i=o==null?void 0:o.getBoundingClientRect();let u,a=0,c,f=null;l.clientX!=null&&l.clientY!=null&&(c=l.clientX,f=l.clientY),i&&(c!=null&&f!=null?(u=c-i.left,a=f-i.top):(u=i.width/2,a=i.height/2)),this.type=e,this.pointerType=n,this.target=l.currentTarget,this.shiftKey=l.shiftKey,this.metaKey=l.metaKey,this.ctrlKey=l.ctrlKey,this.altKey=l.altKey,this.x=u,this.y=a,this.key=l.key}continuePropagation(){ml(this,Mt,!1)}get shouldStopPropagation(){return Co(this,Mt)}}Mt=new WeakMap;const No=Symbol("linkClicked"),Oo="react-aria-pressable-style",Vo="data-react-aria-pressable";function lt(t){let{onPress:e,onPressChange:n,onPressStart:l,onPressEnd:r,onPressUp:o,onClick:i,isDisabled:u,isPressed:a,preventFocusOnPress:c,shouldCancelOnPointerExit:f,allowTextSelectionOnPress:d,ref:b,...p}=Ih(t),[h,$]=s.useState(!1),y=s.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:m,removeAllGlobalListeners:v}=hn(),E=s.useCallback((x,S)=>{let I=y.current;if(u||I.didFirePressStart)return!1;let w=!0;if(I.isTriggeringEvent=!0,l){let k=new Bn("pressstart",S,x);l(k),w=k.shouldStopPropagation}return n&&n(!0),I.isTriggeringEvent=!1,I.didFirePressStart=!0,$(!0),w},[u,l,n]),C=s.useCallback((x,S,I=!0)=>{let w=y.current;if(!w.didFirePressStart)return!1;w.didFirePressStart=!1,w.isTriggeringEvent=!0;let k=!0;if(r){let D=new Bn("pressend",S,x);r(D),k=D.shouldStopPropagation}if(n&&n(!1),$(!1),e&&I&&!u){let D=new Bn("press",S,x);e(D),k&&(k=D.shouldStopPropagation)}return w.isTriggeringEvent=!1,k},[u,r,n,e]),R=Ee(C),A=s.useCallback((x,S)=>{let I=y.current;if(u)return!1;if(o){I.isTriggeringEvent=!0;let w=new Bn("pressup",S,x);return o(w),I.isTriggeringEvent=!1,w.shouldStopPropagation}return!0},[u,o]),K=Ee(A),P=s.useCallback(x=>{let S=y.current;if(S.isPressed&&S.target){S.didFirePressStart&&S.pointerType!=null&&C(bt(S.target,x),S.pointerType,!1),S.isPressed=!1,S.isOverTarget=!1,S.activePointerId=null,S.pointerType=null,v(),d||Gl(S.target);for(let I of S.disposables)I();S.disposables=[]}},[d,v,C]),z=Ee(P);s.useEffect(()=>{u&&y.current.isPressed&&z({currentTarget:y.current.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})},[u]);let B=s.useCallback(x=>{f&&P(x)},[f,P]),N=s.useCallback(x=>{u||i==null||i(x)},[u,i]),U=s.useCallback((x,S)=>{if(!u&&i){let I=new MouseEvent("click",x);Ru(I,S),i(Pr(I))}},[u,i]),_=s.useMemo(()=>{let x=y.current,S={onKeyDown(w){var k;if(wl(w.nativeEvent,w.currentTarget)&&te(w.currentTarget,j(w))){jo(j(w),w.key)&&w.preventDefault();let D=!0;!x.isPressed&&!w.repeat&&(x.target=w.currentTarget,x.isPressed=!0,x.pointerType="keyboard",D=E(w,"keyboard"));let T=w.currentTarget,O=Z=>{wl(Z,T)&&!Z.repeat&&te(T,j(Z))&&x.target&&K(bt(x.target,Z),"keyboard")};m(re(w.currentTarget),"keyup",dt(O,I),!0),D&&w.stopPropagation(),w.metaKey&&yt()&&((k=x.metaKeyEvents)==null||k.set(w.key,w.nativeEvent))}else w.key==="Meta"&&(x.metaKeyEvents=new Map)},onClick(w){if(!(w&&!te(w.currentTarget,j(w)))&&w&&w.button===0&&!x.isTriggeringEvent&&!tt.isOpening){let k=!0;if(u&&w.preventDefault(),!x.ignoreEmulatedMouseEvents&&!x.isPressed&&(x.pointerType==="virtual"||iu(w.nativeEvent))){let D=E(w,"virtual"),T=K(w,"virtual"),O=R(w,"virtual");N(w),k=D&&T&&O}else if(x.isPressed&&x.pointerType!=="keyboard"){let D=x.pointerType||w.nativeEvent.pointerType||"virtual",T=K(bt(w.currentTarget,w),D),O=R(bt(w.currentTarget,w),D,!0);k=T&&O,x.isOverTarget=!1,N(w),z(w)}x.ignoreEmulatedMouseEvents=!1,k&&w.stopPropagation()}}},I=w=>{var k,D,T;if(x.isPressed&&x.target&&wl(w,x.target)){jo(j(w),w.key)&&w.preventDefault();let O=j(w),Z=te(x.target,O);R(bt(x.target,w),"keyboard",Z),Z&&U(w,x.target),v(),w.key!=="Enter"&&Br(x.target)&&te(x.target,O)&&!w[No]&&(w[No]=!0,tt(x.target,w,!1)),x.isPressed=!1,(k=x.metaKeyEvents)==null||k.delete(w.key)}else if(w.key==="Meta"&&((D=x.metaKeyEvents)!=null&&D.size)){let O=x.metaKeyEvents;x.metaKeyEvents=void 0;for(let Z of O.values())(T=x.target)==null||T.dispatchEvent(new KeyboardEvent("keyup",Z))}};if(typeof PointerEvent<"u"){S.onPointerDown=D=>{if(D.button!==0||!te(D.currentTarget,j(D)))return;if(qp(D.nativeEvent)){x.pointerType="virtual";return}x.pointerType=D.pointerType;let T=!0;if(!x.isPressed){x.isPressed=!0,x.isOverTarget=!0,x.activePointerId=D.pointerId,x.target=D.currentTarget,d||Ou(x.target),T=E(D,x.pointerType);let O=j(D);"releasePointerCapture"in O&&("hasPointerCapture"in O?O.hasPointerCapture(D.pointerId)&&O.releasePointerCapture(D.pointerId):O.releasePointerCapture(D.pointerId)),m(re(D.currentTarget),"pointerup",w,!1),m(re(D.currentTarget),"pointercancel",k,!1)}T&&D.stopPropagation()},S.onMouseDown=D=>{if(te(D.currentTarget,j(D))&&D.button===0){if(c){let T=Dh(D.target);T&&x.disposables.push(T)}D.stopPropagation()}},S.onPointerUp=D=>{!te(D.currentTarget,j(D))||x.pointerType==="virtual"||D.button===0&&!x.isPressed&&K(D,x.pointerType||D.pointerType)},S.onPointerEnter=D=>{D.pointerId===x.activePointerId&&x.target&&!x.isOverTarget&&x.pointerType!=null&&(x.isOverTarget=!0,E(bt(x.target,D),x.pointerType))},S.onPointerLeave=D=>{D.pointerId===x.activePointerId&&x.target&&x.isOverTarget&&x.pointerType!=null&&(x.isOverTarget=!1,R(bt(x.target,D),x.pointerType,!1),B(D))};let w=D=>{if(D.pointerId===x.activePointerId&&x.isPressed&&D.button===0&&x.target){if(te(x.target,j(D))&&x.pointerType!=null){let T=!1,O=setTimeout(()=>{x.isPressed&&x.target instanceof HTMLElement&&(T?z(D):(Ve(x.target),x.target.click()))},80);m(D.currentTarget,"click",()=>T=!0,!0),x.disposables.push(()=>clearTimeout(O))}else z(D);x.isOverTarget=!1}},k=D=>{z(D)};S.onDragStart=D=>{te(D.currentTarget,j(D))&&z(D)}}return S},[m,u,c,v,d,B,E,N,U]);return s.useEffect(()=>{if(!b)return;const x=re(b.current);if(!x||!x.head||x.getElementById(Oo))return;const S=x.createElement("style");S.id=Oo;let I=pu(x);I&&(S.nonce=I),S.textContent=` +@layer { + [${Vo}] { + touch-action: pan-x pan-y pinch-zoom; + } +} + `.trim(),x.head.prepend(S)},[b]),s.useEffect(()=>{let x=y.current;return()=>{d||Gl(x.target??void 0);for(let S of x.disposables)S();x.disposables=[]}},[d]),{isPressed:a||h,pressProps:G(p,_,{[Vo]:!0})}}function Br(t){return t.tagName==="A"&&t.hasAttribute("href")}function wl(t,e){const{key:n,code:l}=t,r=e,o=r.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||l==="Space")&&!(r instanceof we(r).HTMLInputElement&&!Vu(r,n)||r instanceof we(r).HTMLTextAreaElement||r.isContentEditable)&&!((o==="link"||!o&&Br(r))&&n!=="Enter")}function bt(t,e){let n=e.clientX,l=e.clientY;return{currentTarget:t,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,clientX:n,clientY:l,key:e.key}}function Fh(t){return t instanceof HTMLInputElement?!1:t instanceof HTMLButtonElement?t.type!=="submit"&&t.type!=="reset":!Br(t)}function jo(t,e){return t instanceof HTMLInputElement?!Vu(t,e):Fh(t)}const Lh=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Vu(t,e){return t.type==="checkbox"||t.type==="radio"?e===" ":Lh.has(t.type)}function zh(t,e){let{elementType:n="button",isDisabled:l,onPress:r,onPressStart:o,onPressEnd:i,onPressUp:u,onPressChange:a,preventFocusOnPress:c,allowFocusWhenDisabled:f,onClick:d,href:b,target:p,rel:h,type:$="button"}=t,y;n==="button"?y={type:$,disabled:l,form:t.form,formAction:t.formAction,formEncType:t.formEncType,formMethod:t.formMethod,formNoValidate:t.formNoValidate,formTarget:t.formTarget,name:t.name,value:t.value}:y={role:"button",href:n==="a"&&!l?b:void 0,target:n==="a"?p:void 0,type:n==="input"?$:void 0,disabled:n==="input"?l:void 0,"aria-disabled":!l||n==="input"?void 0:l,rel:n==="a"?h:void 0};let{pressProps:m,isPressed:v}=lt({onPressStart:o,onPressEnd:i,onPressChange:a,onPress:r,onPressUp:u,onClick:d,isDisabled:l,preventFocusOnPress:c,ref:e}),{focusableProps:E}=jt(t,e);f&&(E.tabIndex=l?-1:E.tabIndex);let C=G(E,m,ie(t,{labelable:!0}));return{isPressed:v,buttonProps:G(y,C,{"aria-haspopup":t["aria-haspopup"],"aria-expanded":t["aria-expanded"],"aria-controls":t["aria-controls"],"aria-pressed":t["aria-pressed"],"aria-current":t["aria-current"],"aria-disabled":t["aria-disabled"]})}}function ll(t){let{isDisabled:e,onBlurWithin:n,onFocusWithin:l,onFocusWithinChange:r}=t,o=s.useRef({isFocusWithin:!1}),{addGlobalListener:i,removeAllGlobalListeners:u}=hn(),a=s.useCallback(d=>{te(d.currentTarget,j(d))&&o.current.isFocusWithin&&!te(d.currentTarget,d.relatedTarget)&&(o.current.isFocusWithin=!1,u(),n&&n(d),r&&r(!1))},[n,r,o,u]),c=Mu(a),f=s.useCallback(d=>{if(!te(d.currentTarget,j(d)))return;let b=j(d);const p=re(b),h=oe(p);if(!o.current.isFocusWithin&&h===b){l&&l(d),r&&r(!0),o.current.isFocusWithin=!0,c(d);let $=d.currentTarget;i(p,"focus",y=>{let m=j(y);if(o.current.isFocusWithin&&!te($,m)){let v=new p.defaultView.FocusEvent("blur",{relatedTarget:m});Ru(v,$);let E=Pr(v);a(E)}},{capture:!0})}},[l,r,c,i,a]);return e?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:f,onBlur:a}}}function je(t={}){let{autoFocus:e=!1,isTextInput:n,within:l}=t,r=s.useRef({isFocused:!1,isFocusVisible:e||Ft()}),[o,i]=s.useState(!1),[u,a]=s.useState(()=>r.current.isFocused&&r.current.isFocusVisible),c=s.useCallback(()=>a(r.current.isFocused&&r.current.isFocusVisible),[]),f=s.useCallback(p=>{r.current.isFocused=p,r.current.isFocusVisible=Ft(),i(p),c()},[c]);Rh(p=>{r.current.isFocusVisible=p,c()},[n,o],{enabled:o,isTextInput:n});let{focusProps:d}=Ar({isDisabled:l,onFocusChange:f}),{focusWithinProps:b}=ll({isDisabled:!l,onFocusWithinChange:f});return{isFocused:o,isFocusVisible:u,focusProps:l?b:d}}let ql=!1,Kn=0;function Nh(){ql=!0,setTimeout(()=>{ql=!1},500)}function _o(t){t.pointerType==="touch"&&Nh()}function Oh(){let t=re(null);if(!(typeof t>"u"))return Kn===0&&typeof PointerEvent<"u"&&t.addEventListener("pointerup",_o),Kn++,()=>{Kn--,!(Kn>0)&&typeof PointerEvent<"u"&&t.removeEventListener("pointerup",_o)}}function He(t){let{onHoverStart:e,onHoverChange:n,onHoverEnd:l,isDisabled:r}=t,[o,i]=s.useState(!1),u=s.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;s.useEffect(Oh,[]);let{addGlobalListener:a,removeAllGlobalListeners:c}=hn(),{hoverProps:f,triggerHoverEnd:d}=s.useMemo(()=>{let b=($,y)=>{if(u.pointerType=y,r||y==="touch"||u.isHovered||!te($.currentTarget,j($)))return;u.isHovered=!0;let m=$.currentTarget;u.target=m,a(re(j($)),"pointerover",v=>{u.isHovered&&u.target&&!te(u.target,j(v))&&p(v,v.pointerType)},{capture:!0}),e&&e({type:"hoverstart",target:m,pointerType:y}),n&&n(!0),i(!0)},p=($,y)=>{let m=u.target;u.pointerType="",u.target=null,!(y==="touch"||!u.isHovered||!m)&&(u.isHovered=!1,c(),l&&l({type:"hoverend",target:m,pointerType:y}),n&&n(!1),i(!1))},h={};return typeof PointerEvent<"u"&&(h.onPointerEnter=$=>{ql&&$.pointerType==="mouse"||b($,$.pointerType)},h.onPointerLeave=$=>{!r&&te($.currentTarget,j($))&&p($,$.pointerType)}),{hoverProps:h,triggerHoverEnd:p}},[e,n,l,r,u,a,c]);return s.useEffect(()=>{r&&d({currentTarget:u.target},u.pointerType)},[r]),{hoverProps:f,isHovered:o}}const yn=s.createContext({}),Kr=gn(function(e,n){[e,n]=xe(e,n,yn);let l=e,{isPending:r}=l,{buttonProps:o,isPressed:i}=zh(e,n);o=jh(o,r);let{focusProps:u,isFocused:a,isFocusVisible:c}=je(e),{hoverProps:f,isHovered:d}=He({...e,isDisabled:e.isDisabled||r}),b={isHovered:d,isPressed:(l.isPressed||i)&&!r,isFocused:a,isFocusVisible:c,isDisabled:e.isDisabled||!1,isPending:r??!1},p=ce({...e,values:b,defaultClassName:"react-aria-Button"}),h=$e(o.id),$=$e(),y=o["aria-labelledby"];r&&(y?y=`${y} ${$}`:o["aria-label"]&&(y=`${h} ${$}`));let m=s.useRef(r);s.useEffect(()=>{let E={"aria-labelledby":y||h};(!m.current&&a&&r||m.current&&a&&!r)&>(E,"assertive"),m.current=r},[r,a,y,h]);let v=ie(e,{global:!0});return delete v.onClick,g.createElement(le.button,{...G(v,p,o,u,f),type:o.type==="submit"&&r?"button":o.type,id:h,ref:n,"aria-labelledby":y,slot:e.slot||void 0,"aria-disabled":r?"true":o["aria-disabled"],"data-disabled":e.isDisabled||void 0,"data-pressed":b.isPressed||void 0,"data-hovered":d||void 0,"data-focused":a||void 0,"data-pending":r||void 0,"data-focus-visible":c||void 0},g.createElement(wh.Provider,{value:{id:$}},p.children))}),Vh=/Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;function jh(t,e){if(e){for(const n in t)n.startsWith("on")&&!Vh.test(n)&&(t[n]=void 0);t.href=void 0,t.target=void 0}return t}const _h=typeof document<"u"?g.useInsertionEffect??g.useLayoutEffect:()=>{};function Ct(t,e,n){let[l,r]=s.useState(t||e),o=s.useRef(l),i=s.useRef(t!==void 0),u=t!==void 0;s.useEffect(()=>{i.current,i.current=u},[u]);let a=u?t:l;_h(()=>{o.current=a});let[,c]=s.useReducer(()=>({}),{}),f=s.useCallback((d,...b)=>{let p=typeof d=="function"?d(o.current):d;Object.is(o.current,p)||(o.current=p,r(p),c(),n==null||n(p,...b))},[n]);return[a,f]}const ju=s.createContext({}),Hh=s.forwardRef(function(e,n){[e,n]=xe(e,n,ju);let{children:l,level:r=3,className:o,...i}=e,u=le[`h${r}`];return g.createElement(u,{...i,ref:n,className:o??"react-aria-Heading"},l)}),_u=t=>t?"true":void 0;function me(t,e){return bh(t,(n,l)=>{const r=typeof e=="function"?e(l)??"":e??"";return It(r,n??"")??""})}const de=(t,e,n)=>typeof t=="function"?t({className:e}):e,Wh=t=>M.jsx("svg",{"aria-hidden":"true","aria-label":"Chevron down icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:M.jsx("path",{clipRule:"evenodd",d:"M2.97 5.47a.75.75 0 0 1 1.06 0L8 9.44l3.97-3.97a.75.75 0 1 1 1.06 1.06l-4.5 4.5a.75.75 0 0 1-1.06 0l-4.5-4.5a.75.75 0 0 1 0-1.06",fill:"currentColor",fillRule:"evenodd"})}),Uh=t=>M.jsx("svg",{"aria-hidden":"true","aria-label":"Chevron up icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:M.jsx("path",{clipRule:"evenodd",d:"M13.03 10.53a.75.75 0 0 1-1.06 0L8 6.56l-3.97 3.97a.75.75 0 0 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1 0 1.06",fill:"currentColor",fillRule:"evenodd"})}),Gh=({height:t=9,width:e=9,...n})=>M.jsx("svg",{"aria-hidden":"true","aria-label":"External link icon",fill:"none",height:t,role:"presentation",viewBox:"0 0 7 7",width:e,xmlns:"http://www.w3.org/2000/svg",...n,children:M.jsx("path",{d:"M1.20592 6.84333L0.379822 6.01723L4.52594 1.8672H1.37819L1.38601 0.731812H6.48742V5.83714H5.34421L5.35203 2.6933L1.20592 6.84333Z",fill:"currentColor"})}),qh=t=>M.jsx("svg",{"aria-hidden":"true","aria-label":"Close icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:M.jsx("path",{clipRule:"evenodd",d:"M3.47 3.47a.75.75 0 0 1 1.06 0L8 6.94l3.47-3.47a.75.75 0 1 1 1.06 1.06L9.06 8l3.47 3.47a.75.75 0 1 1-1.06 1.06L8 9.06l-3.47 3.47a.75.75 0 0 1-1.06-1.06L6.94 8 3.47 4.53a.75.75 0 0 1 0-1.06Z",fill:"currentColor",fillRule:"evenodd"})}),Ho=t=>M.jsx("svg",{"aria-hidden":"true","aria-label":"Info icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:M.jsx("path",{clipRule:"evenodd",d:"M8 13.5a5.5 5.5 0 1 0 0-11a5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m1-9.5a1 1 0 1 1-2 0a1 1 0 0 1 2 0m-.25 3a.75.75 0 0 0-1.5 0V11a.75.75 0 0 0 1.5 0z",fill:"currentColor",fillRule:"evenodd"})}),Zh=t=>M.jsx("svg",{"aria-hidden":"true","aria-label":"Warning icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:M.jsx("path",{clipRule:"evenodd",d:"M7.134 2.994L2.217 11.5a1 1 0 0 0 .866 1.5h9.834a1 1 0 0 0 .866-1.5L8.866 2.993a1 1 0 0 0-1.732 0m3.03-.75c-.962-1.665-3.366-1.665-4.329 0L.918 10.749c-.963 1.666.24 3.751 2.165 3.751h9.834c1.925 0 3.128-2.085 2.164-3.751zM8 5a.75.75 0 0 1 .75.75v2a.75.75 0 0 1-1.5 0v-2A.75.75 0 0 1 8 5m1 5.75a1 1 0 1 1-2 0a1 1 0 0 1 2 0",fill:"currentColor",fillRule:"evenodd"})}),Wo=t=>M.jsx("svg",{"aria-hidden":"true","aria-label":"Danger icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:M.jsx("path",{clipRule:"evenodd",d:"M8 13.5a5.5 5.5 0 1 0 0-11a5.5 5.5 0 0 0 0 11M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14m1-4.5a1 1 0 1 1-2 0a1 1 0 0 1 2 0M8.75 5a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0z",fill:"currentColor",fillRule:"evenodd"})}),Yh=t=>M.jsx("svg",{"aria-hidden":"true","aria-label":"Success icon",fill:"none",height:16,role:"presentation",viewBox:"0 0 16 16",width:16,xmlns:"http://www.w3.org/2000/svg",...t,children:M.jsx("path",{clipRule:"evenodd",d:"M13.5 8a5.5 5.5 0 1 1-11 0a5.5 5.5 0 0 1 11 0M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0m-3.9-1.55a.75.75 0 1 0-1.2-.9L7.419 8.858L6.03 7.47a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.13-.08z",fill:"currentColor",fillRule:"evenodd"})}),Hu=s.createContext({}),Xh=s.createContext({placement:"bottom"}),Jh=typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;function Uo(t){return t.dataset.liveAnnouncer==="true"||t.dataset.reactAriaTopLayer!==void 0}let Gt=new WeakMap,Ae=[];function Rr(t,e){let n=we(t==null?void 0:t[0]),l=e instanceof n.Element?{root:e}:e,r=(l==null?void 0:l.root)??document.body,o=(l==null?void 0:l.shouldUseInert)&&Jh,i=new Set(t),u=new Set,a=y=>o&&y instanceof n.HTMLElement?y.inert:y.getAttribute("aria-hidden")==="true",c=(y,m)=>{o&&y instanceof n.HTMLElement?y.inert=m:m?y.setAttribute("aria-hidden","true"):(y.removeAttribute("aria-hidden"),y instanceof n.HTMLElement&&(y.inert=!1))},f=new Set;if(Qe())for(let y of t){let m=y;for(;m&&m!==r;){let v=m.getRootNode();"shadowRoot"in v&&f.add(v.shadowRoot),m=v.parentNode}}let d=y=>{for(let C of y.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))i.add(C);let m=C=>{if(u.has(C)||i.has(C)||C.parentElement&&u.has(C.parentElement)&&C.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let R of i)if(te(C,R))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},v=lu(re(y),y,NodeFilter.SHOW_ELEMENT,{acceptNode:m}),E=m(y);if(E===NodeFilter.FILTER_ACCEPT&&b(y),E!==NodeFilter.FILTER_REJECT){let C=v.nextNode();for(;C!=null;)b(C),C=v.nextNode()}},b=y=>{let m=Gt.get(y)??0;a(y)&&m===0||(m===0&&c(y,!0),u.add(y),Gt.set(y,m+1))};Ae.length&&Ae[Ae.length-1].disconnect(),d(r);let p=new MutationObserver(y=>{for(let m of y)if(m.type==="childList"){if(m.target.isConnected&&![...i,...u].some(v=>te(v,m.target)))for(let v of m.addedNodes)(v instanceof HTMLElement||v instanceof SVGElement)&&Uo(v)?i.add(v):v instanceof Element&&d(v);if(Qe()){for(let v of f)if(!v.isConnected){p.disconnect();break}}}});p.observe(r,{childList:!0,subtree:!0});let h=new Set;if(Qe())for(let y of f){let m=new MutationObserver(v=>{for(let E of v)if(E.type==="childList"){if(E.target.isConnected&&![...i,...u].some(C=>te(C,E.target)))for(let C of E.addedNodes)(C instanceof HTMLElement||C instanceof SVGElement)&&Uo(C)?i.add(C):C instanceof Element&&d(C);if(Qe()){for(let C of f)if(!C.isConnected){p.disconnect();break}}}});m.observe(y,{childList:!0,subtree:!0}),h.add(m)}let $={visibleNodes:i,hiddenNodes:u,observe(){p.observe(r,{childList:!0,subtree:!0})},disconnect(){p.disconnect()}};return Ae.push($),()=>{if(p.disconnect(),Qe())for(let y of h)y.disconnect();for(let y of u){let m=Gt.get(y);m!=null&&(m===1?(c(y,!1),Gt.delete(y)):Gt.set(y,m-1))}$===Ae[Ae.length-1]?(Ae.pop(),Ae.length&&Ae[Ae.length-1].observe()):Ae.splice(Ae.indexOf($),1)}}function Qh(t){let e=Ae[Ae.length-1];if(e&&!e.visibleNodes.has(t))return e.visibleNodes.add(t),()=>{e.visibleNodes.delete(t)}}const Ie={top:"top",bottom:"top",left:"left",right:"left"},Un={top:"bottom",bottom:"top",left:"right",right:"left"},e4={top:"left",left:"top"},Zl={top:"height",left:"width"},Wu={width:"totalWidth",height:"totalHeight"},Rn={};let t4=()=>typeof document<"u"?window.visualViewport:null;function Go(t,e){let n=0,l=0,r=0,o=0,i=0,u=0,a={},c=((e==null?void 0:e.scale)??1)>1;if(t.tagName==="BODY"||t.tagName==="HTML"){let f=document.documentElement;r=f.clientWidth,o=f.clientHeight,n=(e==null?void 0:e.width)??r,l=(e==null?void 0:e.height)??o,a.top=f.scrollTop||t.scrollTop,a.left=f.scrollLeft||t.scrollLeft,e&&(i=e.offsetTop,u=e.offsetLeft)}else({width:n,height:l,top:i,left:u}=fn(t,!1)),a.top=t.scrollTop,a.left=t.scrollLeft,r=n,o=l;return Ji()&&(t.tagName==="BODY"||t.tagName==="HTML")&&c&&(a.top=0,a.left=0,i=(e==null?void 0:e.pageTop)??0,u=(e==null?void 0:e.pageLeft)??0),{width:n,height:l,totalWidth:r,totalHeight:o,scroll:a,top:i,left:u}}function n4(t){return{top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}}function qo(t,e,n,l,r,o,i){let u=r.scroll[t]??0,a=l[Zl[t]],c=i[t]+l.scroll[Ie[t]]+o,f=i[t]+l.scroll[Ie[t]]+a-o,d=e-u+l.scroll[Ie[t]]+i[t]-l[Ie[t]],b=e-u+n+l.scroll[Ie[t]]+i[t]-l[Ie[t]];return df?Math.max(f-b,c-d):0}function l4(t){let e=window.getComputedStyle(t);return{top:parseInt(e.marginTop,10)||0,bottom:parseInt(e.marginBottom,10)||0,left:parseInt(e.marginLeft,10)||0,right:parseInt(e.marginRight,10)||0}}function Zo(t){if(Rn[t])return Rn[t];let[e,n]=t.split(" "),l=Ie[e]||"right",r=e4[l];Ie[n]||(n="center");let o=Zl[l],i=Zl[r];return Rn[t]={placement:e,crossPlacement:n,axis:l,crossAxis:r,size:o,crossSize:i},Rn[t]}function Sl(t,e,n,l,r,o,i,u,a,c,f){let{placement:d,crossPlacement:b,axis:p,crossAxis:h,size:$,crossSize:y}=l,m={};m[h]=t[h]??0,b==="center"?m[h]+=((t[y]??0)-(n[y]??0))/2:b!==h&&(m[h]+=(t[y]??0)-(n[y]??0)),m[h]+=o;const v=t[h]-n[y]+a+c,E=t[h]+t[y]-a-c;if(m[h]=_l(m[h],v,E),d===p){let C=u?f[$]:f[Wu[$]];m[Un[p]]=Math.floor(C-t[p]+r)}else m[p]=Math.floor(t[p]+t[$]+r);return m}function r4(t,e,n,l,r,o,i,u,a,c,f){let d=(t.top!=null?t.top:a[Wu.height]-(t.bottom??0)-i)-(a.scroll.top??0),b=c?n.top:0,p={top:Math.max(e.top+b,((f==null?void 0:f.offsetTop)??e.top)+b),bottom:Math.min(e.top+e.height+b,((f==null?void 0:f.offsetTop)??0)+((f==null?void 0:f.height)??0))};return u!=="top"?Math.max(0,p.bottom-d-((r.top??0)+(r.bottom??0)+o)):Math.max(0,d+i-p.top-((r.top??0)+(r.bottom??0)+o))}function Yo(t,e,n,l,r,o,i,u){let{placement:a,axis:c,size:f}=o;return a===c?Math.max(0,n[c]-(i.scroll[c]??0)-(t[c]+(u?e[c]:0))-(l[c]??0)-l[Un[c]]-r):Math.max(0,t[f]+t[c]+(u?e[c]:0)-n[c]-n[f]+(i.scroll[c]??0)-(l[c]??0)-l[Un[c]]-r)}function o4(t,e,n,l,r,o,i,u,a,c,f,d,b,p,h,$,y,m){let v=Zo(t),{size:E,crossAxis:C,crossSize:R,placement:A,crossPlacement:K}=v,P=Sl(e,u,n,v,f,d,c,b,h,$,a),z=f,B=Yo(u,c,e,r,o+f,v,a,y);if(i&&n[E]>B){let q=Zo(`${Un[A]} ${K}`),Q=Sl(e,u,n,q,f,d,c,b,h,$,a);Yo(u,c,e,r,o+f,q,a,y)>B&&(v=q,P=Q,z=f)}let N="bottom";v.axis==="top"?v.placement==="top"?N="top":v.placement==="bottom"&&(N="bottom"):v.crossAxis==="top"&&(v.crossPlacement==="top"?N="bottom":v.crossPlacement==="bottom"&&(N="top"));let U=qo(C,P[C],n[R],u,a,o,c);P[C]+=U;let _=r4(P,u,c,b,r,o,n.height,N,a,y,m);p&&p<_&&(_=p),n.height=Math.min(n.height,_),P=Sl(e,u,n,v,z,d,c,b,h,$,a),U=qo(C,P[C],n[R],u,a,o,c),P[C]+=U;let x={},S=e[C]-P[C]-r[Ie[C]],I=S+.5*e[R];const w=h/2+$,k=Ie[C]==="left"?(r.left??0)+(r.right??0):(r.top??0)+(r.bottom??0),D=n[R]-k-h/2-$,T=e[C]+h/2-(P[C]+r[Ie[C]]),O=e[C]+e[R]-h/2-(P[C]+r[Ie[C]]),Z=_l(I,T,O);x[C]=_l(Z,w,D),{placement:A,crossPlacement:K}=v,h?S=x[C]:K==="right"?S+=e[R]:K==="center"&&(S+=e[R]/2);let F=A==="left"||A==="top"?n[E]:0,V={x:A==="top"||A==="bottom"?S:F,y:A==="left"||A==="right"?S:F};return{position:P,maxHeight:_,arrowOffsetLeft:x.left,arrowOffsetTop:x.top,placement:A,triggerAnchorPoint:V}}function i4(t){let{placement:e,targetNode:n,overlayNode:l,scrollNode:r,padding:o,shouldFlip:i,boundaryElement:u,offset:a,crossOffset:c,maxHeight:f,arrowSize:d=0,arrowBoundaryOffset:b=0}=t,p=t4(),h=l instanceof HTMLElement?u4(l):document.documentElement,$=h===document.documentElement;const y=window.getComputedStyle(h).position;let m=!!y&&y!=="static",v=$?fn(n,!1):Xo(n,h,!1);if(!$){let{marginTop:B,marginLeft:N}=window.getComputedStyle(n);v.top+=parseInt(B,10)||0,v.left+=parseInt(N,10)||0}let E=fn(l,!0),C=l4(l);E.width+=(C.left??0)+(C.right??0),E.height+=(C.top??0)+(C.bottom??0);let R=n4(r),A=Go(u,p),K=Go(h,p),P;if((u.tagName==="BODY"||u.tagName==="HTML")&&!$){let B=rl(h,!1);P={top:-(B.top-A.top),left:-(B.left-A.left),width:0,height:0}}else(u.tagName==="BODY"||u.tagName==="HTML")&&$?P={top:0,left:0,width:0,height:0}:P=Xo(u,h,!1);let z=te(u,h);return o4(e,v,E,R,C,o,i,A,K,P,a,c,m,f,d,b,z,p)}function rl(t,e){let{top:n,left:l,width:r,height:o}=t.getBoundingClientRect();return e&&t instanceof t.ownerDocument.defaultView.HTMLElement&&(r=t.offsetWidth,o=t.offsetHeight),{top:n,left:l,width:r,height:o}}function fn(t,e){let{top:n,left:l,width:r,height:o}=rl(t,e),{scrollTop:i,scrollLeft:u,clientTop:a,clientLeft:c}=document.documentElement;return{top:n+i-a,left:l+u-c,width:r,height:o}}function Xo(t,e,n){let l=window.getComputedStyle(t),r;if(l.position==="fixed")r=rl(t,n);else{r=fn(t,n);let o=fn(e,n),i=window.getComputedStyle(e);o.top+=(parseInt(i.borderTopWidth,10)||0)-e.scrollTop,o.left+=(parseInt(i.borderLeftWidth,10)||0)-e.scrollLeft,r.top-=o.top,r.left-=o.left}return r.top-=parseInt(l.marginTop,10)||0,r.left-=parseInt(l.marginLeft,10)||0,r}function u4(t){let e=t.offsetParent;if(e&&e===document.body&&window.getComputedStyle(e).position==="static"&&!Jo(e)&&(e=document.documentElement),e==null)for(e=t.parentElement;e&&!Jo(e);)e=e.parentElement;return e||document.documentElement}function Jo(t){let e=window.getComputedStyle(t);return e.transform!=="none"||/transform|perspective/.test(e.willChange)||e.filter!=="none"||e.contain==="paint"||"backdropFilter"in e&&e.backdropFilter!=="none"||"WebkitBackdropFilter"in e&&e.WebkitBackdropFilter!=="none"}const Uu=new WeakMap;function a4(t){let{triggerRef:e,isOpen:n,onClose:l}=t;s.useEffect(()=>{if(!n||l===null)return;let r=o=>{let i=j(o);if(!e.current||i instanceof Node&&!te(i,e.current)||i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement)return;let u=l||Uu.get(e.current);u&&u()};return window.addEventListener("scroll",r,!0),()=>{window.removeEventListener("scroll",r,!0)}},[n,l,e])}let pe=typeof document<"u"?window.visualViewport:null;function s4(t){let{direction:e}=Re(),{arrowSize:n,targetRef:l,overlayRef:r,arrowRef:o,scrollRef:i=r,placement:u="bottom",containerPadding:a=12,shouldFlip:c=!0,boundaryElement:f=typeof document<"u"?document.body:null,offset:d=0,crossOffset:b=0,shouldUpdatePosition:p=!0,isOpen:h=!0,onClose:$,maxHeight:y,arrowBoundaryOffset:m=0}=t,[v,E]=s.useState(null),C=[p,u,r.current,l.current,o==null?void 0:o.current,i.current,a,c,f,d,b,h,e,y,m,n],R=s.useRef(pe==null?void 0:pe.scale);s.useEffect(()=>{h&&(R.current=pe==null?void 0:pe.scale)},[h]);let A=s.useCallback(()=>{var _,x;if(p===!1||!h||!r.current||!l.current||!f||(pe==null?void 0:pe.scale)!==R.current)return;let z=null;if(i.current&&vt(i.current)){let S=(_=oe())==null?void 0:_.getBoundingClientRect(),I=i.current.getBoundingClientRect();z={type:"top",offset:((S==null?void 0:S.top)??0)-I.top},z.offset>I.height/2&&(z.type="bottom",z.offset=((S==null?void 0:S.bottom)??0)-I.bottom)}let B=r.current;!y&&r.current&&(B.style.top="0px",B.style.bottom="",B.style.maxHeight=(((x=window.visualViewport)==null?void 0:x.height)??window.innerHeight)+"px");let N=i4({placement:d4(u,e),overlayNode:r.current,targetNode:l.current,scrollNode:i.current||r.current,padding:a,shouldFlip:c,boundaryElement:f,offset:d,crossOffset:b,maxHeight:y,arrowSize:n??(o!=null&&o.current?rl(o.current,!0).width:0),arrowBoundaryOffset:m});if(!N.position)return;B.style.top="",B.style.bottom="",B.style.left="",B.style.right="",Object.keys(N.position).forEach(S=>B.style[S]=N.position[S]+"px"),B.style.maxHeight=N.maxHeight!=null?N.maxHeight+"px":"";let U=oe();if(z&&U&&i.current){let S=U.getBoundingClientRect(),I=i.current.getBoundingClientRect(),w=S[z.type]-I[z.type];i.current.scrollTop+=w-z.offset}E(N)},C);ne(A,C),c4(A),an({ref:r,onResize:A}),an({ref:l,onResize:A});let K=s.useRef(!1);ne(()=>{let z,B=()=>{K.current=!0,clearTimeout(z),z=setTimeout(()=>{K.current=!1},500),A()},N=()=>{K.current&&B()};return pe==null||pe.addEventListener("resize",B),pe==null||pe.addEventListener("scroll",N),()=>{pe==null||pe.removeEventListener("resize",B),pe==null||pe.removeEventListener("scroll",N)}},[A]);let P=s.useCallback(()=>{K.current||$==null||$()},[$,K]);return a4({triggerRef:l,isOpen:h,onClose:$&&P}),{overlayProps:{style:{position:v?"absolute":"fixed",top:v?void 0:0,left:v?void 0:0,zIndex:1e5,...v==null?void 0:v.position,maxHeight:(v==null?void 0:v.maxHeight)??"100vh"}},placement:(v==null?void 0:v.placement)??null,triggerAnchorPoint:(v==null?void 0:v.triggerAnchorPoint)??null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:v==null?void 0:v.arrowOffsetLeft,top:v==null?void 0:v.arrowOffsetTop}},updatePosition:A}}function c4(t){ne(()=>(window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}),[t])}function d4(t,e){return e==="rtl"?t.replace("start","right").replace("end","left"):t.replace("start","left").replace("end","right")}const Qo=g.createContext(null),Yl="react-aria-focus-scope-restore";let ae=null;function Mr(t){let{children:e,contain:n,restoreFocus:l,autoFocus:r}=t,o=s.useRef(null),i=s.useRef(null),u=s.useRef([]),{parentNode:a}=s.useContext(Qo)||{},c=s.useMemo(()=>new Jl({scopeRef:u}),[u]);ne(()=>{let b=a||he.root;if(he.getTreeNode(b.scopeRef)&&ae&&!Gn(ae,b.scopeRef)){let p=he.getTreeNode(ae);p&&(b=p)}b.addChild(c),he.addNode(c)},[c,a]),ne(()=>{let b=he.getTreeNode(u);b&&(b.contain=!!n)},[n]),ne(()=>{var $;let b=($=o.current)==null?void 0:$.nextSibling,p=[],h=y=>y.stopPropagation();for(;b&&b!==i.current;)p.push(b),b.addEventListener(Yl,h),b=b.nextSibling;return u.current=p,()=>{for(let y of p)y.removeEventListener(Yl,h)}},[e]),y4(u,l,n),h4(u,n),$4(u,l,n),g4(u,r),s.useEffect(()=>{const b=oe(re(u.current?u.current[0]:void 0));let p=null;if(Le(b,u.current)){for(let h of he.traverse())h.scopeRef&&Le(b,h.scopeRef.current)&&(p=h);p===he.getTreeNode(u)&&(ae=p.scopeRef)}},[u]),ne(()=>()=>{var p,h;let b=((h=(p=he.getTreeNode(u))==null?void 0:p.parent)==null?void 0:h.scopeRef)??null;(u===ae||Gn(u,ae))&&(!b||he.getTreeNode(b))&&(ae=b),he.removeTreeNode(u)},[u]);let f=s.useMemo(()=>f4(u),[]),d=s.useMemo(()=>({focusManager:f,parentNode:c}),[c,f]);return g.createElement(Qo.Provider,{value:d},g.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:o}),e,g.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:i}))}function f4(t){return{focusNext(e={}){let n=t.current,{from:l,tabbable:r,wrap:o,accept:i}=e,u=l||oe(re(n[0]??void 0)),a=n[0].previousElementSibling,c=ht(n),f=Fe(c,{tabbable:r,accept:i},n);f.currentNode=Le(u,n)?u:a;let d=f.nextNode();return!d&&o&&(f.currentNode=a,d=f.nextNode()),d&&et(d,!0),d},focusPrevious(e={}){let n=t.current,{from:l,tabbable:r,wrap:o,accept:i}=e,u=l||oe(re(n[0]??void 0)),a=n[n.length-1].nextElementSibling,c=ht(n),f=Fe(c,{tabbable:r,accept:i},n);f.currentNode=Le(u,n)?u:a;let d=f.previousNode();return!d&&o&&(f.currentNode=a,d=f.previousNode()),d&&et(d,!0),d},focusFirst(e={}){let n=t.current,{tabbable:l,accept:r}=e,o=ht(n),i=Fe(o,{tabbable:l,accept:r},n);i.currentNode=n[0].previousElementSibling;let u=i.nextNode();return u&&et(u,!0),u},focusLast(e={}){let n=t.current,{tabbable:l,accept:r}=e,o=ht(n),i=Fe(o,{tabbable:l,accept:r},n);i.currentNode=n[n.length-1].nextElementSibling;let u=i.previousNode();return u&&et(u,!0),u}}}function ht(t){return t[0].parentElement}function Qt(t){let e=he.getTreeNode(ae);for(;e&&e.scopeRef!==t;){if(e.contain)return!1;e=e.parent}return!0}function p4(t){if(!t.form)return Array.from(re(t).querySelectorAll(`input[type="radio"][name="${CSS.escape(t.name)}"]`)).filter(l=>!l.form);const e=t.form.elements.namedItem(t.name);let n=we(t);return e instanceof n.RadioNodeList?Array.from(e).filter(l=>l instanceof n.HTMLInputElement):e instanceof n.HTMLInputElement?[e]:[]}function b4(t){if(t.checked)return!0;const e=p4(t);return e.length>0&&!e.some(n=>n.checked)}function h4(t,e){let n=s.useRef(void 0),l=s.useRef(void 0);ne(()=>{let r=t.current;if(!e){l.current&&(cancelAnimationFrame(l.current),l.current=void 0);return}const o=re(r?r[0]:void 0);let i=c=>{if(c.key!=="Tab"||c.altKey||c.ctrlKey||c.metaKey||!Qt(t)||c.isComposing)return;let f=oe(o),d=t.current;if(!d||!Le(f,d))return;let b=ht(d),p=Fe(b,{tabbable:!0},d);if(!f)return;p.currentNode=f;let h=c.shiftKey?p.previousNode():p.nextNode();h||(p.currentNode=c.shiftKey?d[d.length-1].nextElementSibling:d[0].previousElementSibling,h=c.shiftKey?p.previousNode():p.nextNode()),c.preventDefault(),h&&(et(h,!0),h instanceof we(h).HTMLInputElement&&h.select())},u=c=>{(!ae||Gn(ae,t))&&Le(j(c),t.current)?(ae=t,n.current=j(c)):Qt(t)&&!at(j(c),t)?n.current?n.current.focus():ae&&ae.current&&Xl(ae.current):Qt(t)&&(n.current=j(c))},a=c=>{l.current&&cancelAnimationFrame(l.current),l.current=requestAnimationFrame(()=>{var p;let f=cn(),d=(f==="virtual"||f===null)&&rn()&&Qi(),b=oe(o);if(!d&&b&&Qt(t)&&!at(b,t)){ae=t;let h=j(c);h&&h.isConnected?(n.current=h,(p=n.current)==null||p.focus()):ae.current&&Xl(ae.current)}})};return o.addEventListener("keydown",i,!1),o.addEventListener("focusin",u,!1),r==null||r.forEach(c=>c.addEventListener("focusin",u,!1)),r==null||r.forEach(c=>c.addEventListener("focusout",a,!1)),()=>{o.removeEventListener("keydown",i,!1),o.removeEventListener("focusin",u,!1),r==null||r.forEach(c=>c.removeEventListener("focusin",u,!1)),r==null||r.forEach(c=>c.removeEventListener("focusout",a,!1))}},[t,e]),ne(()=>()=>{l.current&&cancelAnimationFrame(l.current)},[l])}function Gu(t){return at(t)}function Le(t,e){return!t||!e?!1:e.some(n=>te(n,t))}function at(t,e=null){if(t instanceof Element&&t.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of he.traverse(he.getTreeNode(e)))if(n&&Le(t,n.current))return!0;return!1}function m4(t){return at(t,ae)}function Gn(t,e){var l;let n=(l=he.getTreeNode(e))==null?void 0:l.parent;for(;n;){if(n.scopeRef===t)return!0;n=n.parent}return!1}function et(t,e=!1){if(t!=null&&!e)try{ve(t)}catch{}else if(t!=null)try{t.focus()}catch{}}function qu(t,e=!0){let n=t[0].previousElementSibling,l=ht(t),r=Fe(l,{tabbable:e},t);r.currentNode=n;let o=r.nextNode();return e&&!o&&(l=ht(t),r=Fe(l,{tabbable:!1},t),r.currentNode=n,o=r.nextNode()),o}function Xl(t,e=!0){et(qu(t,e))}function g4(t,e){const n=g.useRef(e);s.useEffect(()=>{if(n.current){ae=t;const l=re(t.current?t.current[0]:void 0);!Le(oe(l),ae.current)&&t.current&&Xl(t.current)}n.current=!1},[t])}function y4(t,e,n){ne(()=>{if(e||n)return;let l=t.current;const r=re(l?l[0]:void 0);let o=i=>{let u=j(i);Le(u,t.current)?ae=t:Gu(u)||(ae=null)};return r.addEventListener("focusin",o,!1),l==null||l.forEach(i=>i.addEventListener("focusin",o,!1)),()=>{r.removeEventListener("focusin",o,!1),l==null||l.forEach(i=>i.removeEventListener("focusin",o,!1))}},[t,e,n])}function ei(t){let e=he.getTreeNode(ae);for(;e&&e.scopeRef!==t;){if(e.nodeToRestore)return!1;e=e.parent}return(e==null?void 0:e.scopeRef)===t}function $4(t,e,n){const l=s.useRef(typeof document<"u"?oe(re(t.current?t.current[0]:void 0)):null);ne(()=>{let r=t.current;const o=re(r?r[0]:void 0);if(!e||n)return;let i=()=>{(!ae||Gn(ae,t))&&Le(oe(o),t.current)&&(ae=t)};return o.addEventListener("focusin",i,!1),r==null||r.forEach(u=>u.addEventListener("focusin",i,!1)),()=>{o.removeEventListener("focusin",i,!1),r==null||r.forEach(u=>u.removeEventListener("focusin",i,!1))}},[t,n]),ne(()=>{const r=re(t.current?t.current[0]:void 0);if(!e)return;let o=i=>{if(i.key!=="Tab"||i.altKey||i.ctrlKey||i.metaKey||!Qt(t)||i.isComposing)return;let u=r.activeElement;if(!at(u,t)||!ei(t))return;let a=he.getTreeNode(t);if(!a)return;let c=a.nodeToRestore,f=Fe(r.body,{tabbable:!0});f.currentNode=u;let d=i.shiftKey?f.previousNode():f.nextNode();if((!c||!c.isConnected||c===r.body)&&(c=void 0,a.nodeToRestore=void 0),(!d||!at(d,t))&&c){f.currentNode=c;do d=i.shiftKey?f.previousNode():f.nextNode();while(at(d,t));i.preventDefault(),i.stopPropagation(),d?et(d,!0):Gu(c)?et(c,!0):u.blur()}};return n||r.addEventListener("keydown",o,!0),()=>{n||r.removeEventListener("keydown",o,!0)}},[t,e,n]),ne(()=>{const r=re(t.current?t.current[0]:void 0);if(!e)return;let o=he.getTreeNode(t);if(o)return o.nodeToRestore=l.current??void 0,()=>{let i=he.getTreeNode(t);if(!i)return;let u=i.nodeToRestore,a=oe(r);if(e&&u&&(a&&at(a,t)||a===r.body&&ei(t))){let c=he.clone();requestAnimationFrame(()=>{if(r.activeElement===r.body){let f=c.getTreeNode(t);for(;f;){if(f.nodeToRestore&&f.nodeToRestore.isConnected){ti(f.nodeToRestore);return}f=f.parent}for(f=c.getTreeNode(t);f;){if(f.scopeRef&&f.scopeRef.current&&he.getTreeNode(f.scopeRef)){let d=qu(f.scopeRef.current,!0);ti(d);return}f=f.parent}}})}}},[t,e])}function ti(t){t.dispatchEvent(new CustomEvent(Yl,{bubbles:!0,cancelable:!0}))&&et(t)}function Fe(t,e,n){let l=e!=null&&e.tabbable?du:cu,r=(t==null?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null,o=re(r),i=lu(o,t||o,NodeFilter.SHOW_ELEMENT,{acceptNode(u){return te(e==null?void 0:e.from,u)||e!=null&&e.tabbable&&u.tagName==="INPUT"&&u.getAttribute("type")==="radio"&&(!b4(u)||i.currentNode.tagName==="INPUT"&&i.currentNode.type==="radio"&&i.currentNode.name===u.name)?NodeFilter.FILTER_REJECT:l(u)&&(!n||Le(u,n))&&(!(e!=null&&e.accept)||e.accept(u))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return e!=null&&e.from&&(i.currentNode=e.from),i}class Ir{constructor(){this.fastMap=new Map,this.root=new Jl({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,n,l){let r=this.fastMap.get(n??null);if(!r)return;let o=new Jl({scopeRef:e});r.addChild(o),o.parent=r,this.fastMap.set(e,o),l&&(o.nodeToRestore=l)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let n=this.fastMap.get(e);if(!n)return;let l=n.parent;for(let o of this.traverse())o!==n&&n.nodeToRestore&&o.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&Le(o.nodeToRestore,n.scopeRef.current)&&(o.nodeToRestore=n.nodeToRestore);let r=n.children;l&&(l.removeChild(n),r.size>0&&r.forEach(o=>l&&l.addChild(o))),this.fastMap.delete(n.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let n of e.children)yield*this.traverse(n)}clone(){var n;let e=new Ir;for(let l of this.traverse())e.addTreeNode(l.scopeRef,((n=l.parent)==null?void 0:n.scopeRef)??null,l.nodeToRestore);return e}}class Jl{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}}let he=new Ir;function v4(t){let{ref:e,onInteractOutside:n,isDisabled:l,onInteractOutsideStart:r}=t,o=s.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),i=Ee(a=>{n&&ni(a,e)&&(r&&r(a),o.current.isPointerDown=!0)}),u=Ee(a=>{n&&n(a)});s.useEffect(()=>{let a=o.current;if(l)return;const c=e.current,f=re(c);if(typeof PointerEvent<"u"){let d=b=>{a.isPointerDown&&ni(b,e)&&u(b),a.isPointerDown=!1};return f.addEventListener("pointerdown",i,!0),f.addEventListener("click",d,!0),()=>{f.removeEventListener("pointerdown",i,!0),f.removeEventListener("click",d,!0)}}},[e,l])}function ni(t,e){if(t.button>0)return!1;let n=j(t);if(n){const l=n.ownerDocument;if(!l||!te(l.documentElement,n)||n.closest("[data-react-aria-top-layer]"))return!1}return e.current?!t.composedPath().includes(e.current):!1}const Ue=[];function Zu(t,e){let{onClose:n,shouldCloseOnBlur:l,isOpen:r,isDismissable:o=!1,isKeyboardDismissDisabled:i=!1,shouldCloseOnInteractOutside:u}=t,a=s.useRef(void 0);s.useEffect(()=>{if(r&&!Ue.includes(e))return Ue.push(e),()=>{let h=Ue.indexOf(e);h>=0&&Ue.splice(h,1)}},[r,e]);let c=()=>{Ue[Ue.length-1]===e&&n&&n()},f=h=>{const $=Ue[Ue.length-1];a.current=$,(!u||u(j(h)))&&$===e&&h.stopPropagation()},d=h=>{(!u||u(j(h)))&&(Ue[Ue.length-1]===e&&h.stopPropagation(),a.current===e&&c()),a.current=void 0},b=h=>{h.key==="Escape"&&!i&&!h.nativeEvent.isComposing&&(h.stopPropagation(),h.preventDefault(),c())};v4({ref:e,onInteractOutside:o&&r?d:void 0,onInteractOutsideStart:f});let{focusWithinProps:p}=ll({isDisabled:!l,onBlurWithin:h=>{!h.relatedTarget||m4(h.relatedTarget)||(!u||u(h.relatedTarget))&&(n==null||n())}});return{overlayProps:{onKeyDown:b,...p},underlayProps:{}}}const ln=typeof document<"u"&&window.visualViewport;let Mn=0,Dl;function Yu(t={}){let{isDisabled:e}=t;ne(()=>{if(!e)return Mn++,Mn===1&&($t()?Dl=C4():Dl=x4()),()=>{Mn--,Mn===0&&Dl()}},[e])}function x4(){let t=window.innerWidth-document.documentElement.clientWidth;return dt(t>0&&("scrollbarGutter"in document.documentElement.style?Nn(document.documentElement,"scrollbarGutter","stable"):Nn(document.documentElement,"paddingRight",`${t}px`)),Nn(document.documentElement,"overflow","hidden"))}function C4(){let t=Nn(document.documentElement,"overflow","hidden"),e,n=!1,l=f=>{let d=j(f);e=st(d)?d:Xe(d,!0),n=!1;let b=d.ownerDocument.defaultView.getSelection();b&&!b.isCollapsed&&b.containsNode(d,!0)&&(n=!0),f.composedPath().some(p=>p instanceof HTMLInputElement&&p.type==="range")&&(n=!0),"selectionStart"in d&&"selectionEnd"in d&&d.selectionStart{if(!(f.touches.length===2||n)){if(!e||e===document.documentElement||e===document.body){f.preventDefault();return}e.scrollHeight===e.clientHeight&&e.scrollWidth===e.clientWidth&&f.preventDefault()}},u=f=>{var p;let d=j(f),b=f.relatedTarget;if(b&&tn(b))b.focus({preventScroll:!0}),li(b,tn(d));else if(!b){let h=(p=d.parentElement)==null?void 0:p.closest("[tabindex]");h==null||h.focus({preventScroll:!0})}},a=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(f){let d=oe(),b=d!=null&&tn(d);a.call(this,{...f,preventScroll:!0}),(!f||!f.preventScroll)&&li(this,b)};let c=dt(kl(document,"touchstart",l,{passive:!1,capture:!0}),kl(document,"touchmove",i,{passive:!1,capture:!0}),kl(document,"blur",u,!0));return()=>{t(),c(),r.remove(),HTMLElement.prototype.focus=a}}function Nn(t,e,n){let l=t.style[e];return t.style[e]=n,()=>{t.style[e]=l}}function kl(t,e,n,l){return t.addEventListener(e,n,l),()=>{t.removeEventListener(e,n,l)}}function li(t,e){e||!ln?ri(t):ln.addEventListener("resize",()=>ri(t),{once:!0})}function ri(t){let e=document.scrollingElement||document.documentElement,n=t;for(;n&&n!==e;){let l=Xe(n);if(l!==document.documentElement&&l!==document.body&&l!==n){let r=l.getBoundingClientRect(),o=n.getBoundingClientRect();if(o.topr.top+n.clientHeight){let i=r.bottom;ln&&(i=Math.min(i,ln.offsetTop+ln.height));let u=o.top-r.top-((i-r.top)/2-o.height/2);l.scrollTo({top:Math.max(0,Math.min(l.scrollHeight-l.clientHeight,l.scrollTop+u)),behavior:"smooth"})}}n=l.parentElement}}function E4(t,e){let{triggerRef:n,popoverRef:l,groupRef:r,isNonModal:o,isKeyboardDismissDisabled:i,shouldCloseOnInteractOutside:u,...a}=t,c=a.trigger==="SubmenuTrigger",{overlayProps:f,underlayProps:d}=Zu({isOpen:e.isOpen,onClose:e.close,shouldCloseOnBlur:!0,isDismissable:!o||c,isKeyboardDismissDisabled:i,shouldCloseOnInteractOutside:u},r??l),{overlayProps:b,arrowProps:p,placement:h,triggerAnchorPoint:$}=s4({...a,targetRef:n,overlayRef:l,isOpen:e.isOpen,onClose:o&&!c?e.close:null});return Yu({isDisabled:o||!e.isOpen}),s.useEffect(()=>{if(e.isOpen&&l.current)return o?Qh((r==null?void 0:r.current)??l.current):Rr([(r==null?void 0:r.current)??l.current],{shouldUseInert:!0})},[o,e.isOpen,l,r]),{popoverProps:G(f,b),arrowProps:p,underlayProps:d,placement:h,triggerAnchorPoint:$}}var Xu={};Xu={dismiss:"تجاهل"};var Ju={};Ju={dismiss:"Отхвърляне"};var Qu={};Qu={dismiss:"Odstranit"};var ea={};ea={dismiss:"Luk"};var ta={};ta={dismiss:"Schließen"};var na={};na={dismiss:"Απόρριψη"};var la={};la={dismiss:"Dismiss"};var ra={};ra={dismiss:"Descartar"};var oa={};oa={dismiss:"Lõpeta"};var ia={};ia={dismiss:"Hylkää"};var ua={};ua={dismiss:"Rejeter"};var aa={};aa={dismiss:"התעלם"};var sa={};sa={dismiss:"Odbaci"};var ca={};ca={dismiss:"Elutasítás"};var da={};da={dismiss:"Ignora"};var fa={};fa={dismiss:"閉じる"};var pa={};pa={dismiss:"무시"};var ba={};ba={dismiss:"Atmesti"};var ha={};ha={dismiss:"Nerādīt"};var ma={};ma={dismiss:"Lukk"};var ga={};ga={dismiss:"Negeren"};var ya={};ya={dismiss:"Zignoruj"};var $a={};$a={dismiss:"Descartar"};var va={};va={dismiss:"Dispensar"};var xa={};xa={dismiss:"Revocare"};var Ca={};Ca={dismiss:"Пропустить"};var Ea={};Ea={dismiss:"Zrušiť"};var wa={};wa={dismiss:"Opusti"};var Sa={};Sa={dismiss:"Odbaci"};var Da={};Da={dismiss:"Avvisa"};var ka={};ka={dismiss:"Kapat"};var Pa={};Pa={dismiss:"Скасувати"};var Aa={};Aa={dismiss:"取消"};var Ta={};Ta={dismiss:"關閉"};var Ba={};Ba={"ar-AE":Xu,"bg-BG":Ju,"cs-CZ":Qu,"da-DK":ea,"de-DE":ta,"el-GR":na,"en-US":la,"es-ES":ra,"et-EE":oa,"fi-FI":ia,"fr-FR":ua,"he-IL":aa,"hr-HR":sa,"hu-HU":ca,"it-IT":da,"ja-JP":fa,"ko-KR":pa,"lt-LT":ba,"lv-LV":ha,"nb-NO":ma,"nl-NL":ga,"pl-PL":ya,"pt-BR":$a,"pt-PT":va,"ro-RO":xa,"ru-RU":Ca,"sk-SK":Ea,"sl-SI":wa,"sr-SP":Sa,"sv-SE":Da,"tr-TR":ka,"uk-UA":Pa,"zh-CN":Aa,"zh-TW":Ta};const w4=Symbol.for("react-aria.i18n.locale"),S4=Symbol.for("react-aria.i18n.strings");let Dt;class ol{constructor(e,n="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,l])=>l)),this.defaultLocale=n}getStringForLocale(e,n){let r=this.getStringsForLocale(n)[e];if(!r)throw new Error(`Could not find intl message ${e} in ${n} locale`);return r}getStringsForLocale(e){let n=this.strings[e];return n||(n=D4(e,this.strings,this.defaultLocale),this.strings[e]=n),n}static getGlobalDictionaryForPackage(e){if(typeof window>"u")return null;let n=window[w4];if(Dt===void 0){let r=window[S4];if(!r)return null;Dt={};for(let o in r)Dt[o]=new ol({[n]:r[o]},n)}let l=Dt==null?void 0:Dt[e];if(!l)throw new Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return l}}function D4(t,e,n="en-US"){if(e[t])return e[t];let l=k4(t);if(e[l])return e[l];for(let r in e)if(r.startsWith(l+"-"))return e[r];return e[n]}function k4(t){return Intl.Locale?new Intl.Locale(t).language:t.split("-")[0]}const oi=new Map,ii=new Map;class P4{constructor(e,n){this.locale=e,this.strings=n}format(e,n){let l=this.strings.getStringForLocale(e,this.locale);return typeof l=="function"?l(n,this):l}plural(e,n,l="cardinal"){let r=n["="+e];if(r)return typeof r=="function"?r():r;let o=this.locale+":"+l,i=oi.get(o);i||(i=new Intl.PluralRules(this.locale,{type:l}),oi.set(o,i));let u=i.select(e);return r=n[u]||n.other,typeof r=="function"?r():r}number(e){let n=ii.get(this.locale);return n||(n=new Intl.NumberFormat(this.locale),ii.set(this.locale,n)),n.format(e)}select(e,n){let l=e[n]||e.other;return typeof l=="function"?l():l}}const ui=new WeakMap;function A4(t){let e=ui.get(t);return e||(e=new ol(t),ui.set(t,e)),e}function T4(t,e){return e&&ol.getGlobalDictionaryForPackage(e)||A4(t)}function Ne(t,e){let{locale:n}=Re(),l=T4(t,e);return s.useMemo(()=>new P4(n,l),[n,l])}const ai={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function $n(t={}){let{style:e,isFocusable:n}=t,[l,r]=s.useState(!1),{focusWithinProps:o}=ll({isDisabled:!n,onFocusWithinChange:u=>r(u)}),i=s.useMemo(()=>l?e:e?{...ai,...e}:ai,[l]);return{visuallyHiddenProps:{...o,style:i}}}function Ka(t){let{children:e,elementType:n="div",isFocusable:l,style:r,...o}=t,{visuallyHiddenProps:i}=$n(t);return g.createElement(n,G(o,i),e)}function B4(t){return t&&t.__esModule?t.default:t}function Ql(t){let{onDismiss:e,...n}=t,l=Ne(B4(Ba),"@react-aria/overlays"),r=un(n,l.format("dismiss")),o=()=>{e&&e()};return g.createElement(Ka,null,g.createElement("button",{...r,tabIndex:-1,onClick:o,style:{width:1,height:1}}))}const K4=g.forwardRef(({children:t,...e},n)=>{let l=s.useRef(!1),r=s.useContext(dn),o=G(r||{},{...e,register(){l.current=!0,r&&r.register()}});return o.ref=ke(n||(r==null?void 0:r.ref)),vr(r,o.ref),s.useEffect(()=>{l.current||(l.current=!0)},[]),g.createElement(dn.Provider,{value:o},t)});function R4({children:t}){let e=s.useMemo(()=>({register:()=>{}}),[]);return g.createElement(dn.Provider,{value:e},t)}const M4=s.createContext({});function I4(){return s.useContext(M4)??{}}const Ra=g.createContext(null);function er(t){let e=ct(),{portalContainer:n=e?null:document.body,isExiting:l}=t,[r,o]=s.useState(!1),i=s.useMemo(()=>({contain:r,setContain:o}),[r,o]),{getContainer:u}=I4();if(!t.portalContainer&&u&&(n=u()),!n)return null;let a=t.children;return t.disableFocusManagement||(a=g.createElement(Mr,{restoreFocus:!0,contain:(t.shouldContainFocus||r)&&!l},a)),a=g.createElement(Ra.Provider,{value:i},g.createElement(R4,null,a)),Yi.createPortal(a,n)}function Ma(){let t=s.useContext(Ra),e=t==null?void 0:t.setContain;ne(()=>{e==null||e(!0)},[e])}function il(t){let[e,n]=Ct(t.isOpen,t.defaultOpen||!1,t.onOpenChange);const l=s.useCallback(()=>{n(!0)},[n]),r=s.useCallback(()=>{n(!1)},[n]),o=s.useCallback(()=>{n(!e)},[n,e]);return{isOpen:e,setOpen:n,open:l,close:r,toggle:o}}const Fr=s.createContext(null),si=s.createContext(null),F4=s.forwardRef(function(e,n){[e,n]=xe(e,n,Fr);let l=s.useContext(Et),r=il(e),o=e.isOpen!=null||e.defaultOpen!=null||!l?r:l,i=Ll(n,o.isOpen)||e.isExiting||!1,u=gh(),{direction:a}=Re();if(u){let c=e.children;return typeof c=="function"&&(c=c({trigger:e.trigger||null,placement:"bottom",isEntering:!1,isExiting:!1,defaultChildren:null})),g.createElement(g.Fragment,null,c)}return o&&!o.isOpen&&!i?null:g.createElement(L4,{...e,triggerRef:e.triggerRef,state:o,popoverRef:n,isExiting:i,dir:a})});function L4({state:t,isExiting:e,UNSTABLE_portalContainer:n,clearContexts:l,...r}){var B,N;let o=s.useRef(null),i=s.useRef(null),u=s.useContext(si),a=u&&r.trigger==="SubmenuTrigger",{popoverProps:c,underlayProps:f,arrowProps:d,placement:b,triggerAnchorPoint:p}=E4({...r,offset:r.offset??8,arrowRef:o,groupRef:a?u:i},t),h=r.popoverRef,$=Cr(h,!!b)||r.isEntering||!1,y=ce({...r,defaultClassName:"react-aria-Popover",values:{trigger:r.trigger||null,placement:b,isEntering:$,isExiting:e}}),m=!r.isNonModal||r.trigger==="SubmenuTrigger",[v,E]=s.useState(!1);ne(()=>{h.current&&E(m&&!h.current.querySelector("[role=dialog]"))},[h,m]),s.useEffect(()=>{v&&(r.trigger!=="SubmenuTrigger"||cn()!=="pointer")&&h.current&&!vt(h.current)&&ve(h.current)},[v,h,r.trigger]);let C=s.useMemo(()=>{let U=y.children;if(l)for(let _ of l)U=g.createElement(_.Provider,{value:null},U);return U},[y.children,l]),[R,A]=s.useState(null),K=s.useCallback(()=>{r.triggerRef.current&&A(r.triggerRef.current.getBoundingClientRect().width+"px")},[r.triggerRef]);ne(K,[K]),an({ref:(B=y.style)!=null&&B["--trigger-width"]?void 0:r.triggerRef,onResize:K});let P={...c.style,"--trigger-anchor-point":p?`${p.x}px ${p.y}px`:void 0,...y.style,"--trigger-width":((N=y.style)==null?void 0:N["--trigger-width"])||R},z=g.createElement(le.div,{...G(ie(r,{global:!0}),c),...y,role:v?"dialog":void 0,tabIndex:v?-1:void 0,"aria-label":r["aria-label"],"aria-labelledby":r["aria-labelledby"],ref:h,slot:r.slot||void 0,style:P,dir:r.dir,"data-trigger":r.trigger,"data-placement":b,"data-entering":$||void 0,"data-exiting":e||void 0},!r.isNonModal&&g.createElement(Ql,{onDismiss:t.close}),g.createElement(Xh.Provider,{value:{...d,placement:b,ref:o}},C),g.createElement(Ql,{onDismiss:t.close}));return a?g.createElement(er,{...r,shouldContainFocus:v,isExiting:e,portalContainer:n??(u==null?void 0:u.current)??void 0},z):g.createElement(er,{...r,shouldContainFocus:v,isExiting:e,portalContainer:n},!r.isNonModal&&t.isOpen&&g.createElement("div",{"data-testid":"underlay",...f,style:{position:"fixed",inset:0}}),g.createElement("div",{ref:i,style:{display:"contents"}},g.createElement(si.Provider,{value:i},z)))}class Ge{constructor(e){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue="",this["aria-label"]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.colSpan=null,this.colIndex=null,this.type=this.constructor.type,this.key=e}get childNodes(){throw new Error("childNodes is not supported")}clone(){let e=new this.constructor(this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e["aria-label"]=this["aria-label"],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e.colSpan=this.colSpan,e.colIndex=this.colIndex,e}filter(e,n,l){let r=this.clone();return n.addDescendants(r,e),r}}class ul extends Ge{filter(e,n,l){let[r,o]=Fa(e,n,this.firstChildKey,l),i=this.clone();return i.firstChildKey=r,i.lastChildKey=o,i}}const lo=class lo extends Ge{};lo.type="header";let ci=lo;const ro=class ro extends Ge{};ro.type="loader";let qn=ro;const oo=class oo extends ul{filter(e,n,l){if(l(this.textValue,this)){let r=this.clone();return n.addDescendants(r,e),r}return null}};oo.type="item";let tr=oo;const io=class io extends ul{filter(e,n,l){let r=super.filter(e,n,l);if(r&&r.lastChildKey!==null){let o=e.getItem(r.lastChildKey);if(o&&o.type!=="header")return r}return null}};io.type="section";let nr=io;class Ia{get size(){return this.itemCount}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey!=null?this.keyMap.get(this.firstKey):void 0;for(;e;)yield e,e=e.nextKey!=null?this.keyMap.get(e.nextKey):void 0}getChildren(e){let n=this.keyMap;return{*[Symbol.iterator](){let l=n.get(e),r=(l==null?void 0:l.firstChildKey)!=null?n.get(l.firstChildKey):null;for(;r;)yield r,r=r.nextKey!=null?n.get(r.nextKey):void 0}}}getKeyBefore(e){let n=this.keyMap.get(e);if(!n)return null;if(n.prevKey!=null){for(n=this.keyMap.get(n.prevKey);n&&n.type!=="item"&&n.lastChildKey!=null;)n=this.keyMap.get(n.lastChildKey);return(n==null?void 0:n.key)??null}return n.parentKey}getKeyAfter(e){let n=this.keyMap.get(e);if(!n)return null;if(n.type!=="item"&&n.firstChildKey!=null)return n.firstChildKey;for(;n;){if(n.nextKey!=null)return n.nextKey;if(n.parentKey!=null)n=this.keyMap.get(n.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey!=null?this.keyMap.get(this.lastKey):null;for(;(e==null?void 0:e.lastChildKey)!=null;)e=this.keyMap.get(e.lastChildKey);return(e==null?void 0:e.key)??null}getItem(e){return this.keyMap.get(e)??null}at(){throw new Error("Not implemented")}clone(){let e=this.constructor,n=new e;return n.keyMap=new Map(this.keyMap),n.firstKey=this.firstKey,n.lastKey=this.lastKey,n.itemCount=this.itemCount,n}addNode(e){if(this.frozen)throw new Error("Cannot add a node to a frozen collection");e.type==="item"&&this.keyMap.get(e.key)==null&&this.itemCount++,this.keyMap.set(e.key,e)}addDescendants(e,n){this.addNode(e);let l=n.getChildren(e.key);for(let r of l)this.addDescendants(r,n)}removeNode(e){if(this.frozen)throw new Error("Cannot remove a node to a frozen collection");let n=this.keyMap.get(e);n!=null&&n.type==="item"&&this.itemCount--,this.keyMap.delete(e)}commit(e,n,l=!1){if(this.frozen)throw new Error("Cannot commit a frozen collection");this.firstKey=e,this.lastKey=n,this.frozen=!l}filter(e){let n=new this.constructor,[l,r]=Fa(this,n,this.firstKey,e);return n==null||n.commit(l,r),n}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1,this.itemCount=0}}function Fa(t,e,n,l){if(n==null)return[null,null];let r=null,o=null,i=t.getItem(n);for(;i!=null;){let u=i.filter(t,e,l);u!=null&&(u.nextKey=null,o&&(u.prevKey=o.key,o.nextKey=u.key),r==null&&(r=u),e.addNode(u),o=u),i=i.nextKey!=null?t.getItem(i.nextKey):null}if(o&&o.type==="separator"){let u=o.prevKey;e.removeNode(o.key),u!=null?(o=e.getItem(u),o.nextKey=null):o=null}return[(r==null?void 0:r.key)??null,(o==null?void 0:o.key)??null]}class La{constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this._minInvalidChildIndex=null,this.ownerDocument=e}*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){var e;return((e=this.parentNode)==null?void 0:e.isConnected)||!1}invalidateChildIndices(e){(this._minInvalidChildIndex==null||!this._minInvalidChildIndex.isConnected||e.indexthis.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}}function Lr(t){let{children:e,items:n,idScope:l,addIdAndValue:r,dependencies:o=[]}=t,i=s.useMemo(()=>{},[e]),u=s.useMemo(()=>new WeakMap,[...o,i]);return s.useMemo(()=>{if(n&&typeof e=="function"){let a=[];for(let c of n){let f=N4(c)?c:null,d=f?u.get(f):null;if(!d){d=e(c);let b=d.props.id??(c==null?void 0:c.key)??(c==null?void 0:c.id);l!=null&&d.props.id==null&&b!=null&&(b=l+":"+b);let p=b??a.length;d=s.cloneElement(d,r?{key:p,id:b,value:c}:{key:p}),f&&u.set(f,d)}a.push(d)}return a}else if(typeof e!="function")return e},[e,n,u,l,r])}function N4(t){switch(typeof t){case"object":return t!=null;case"function":case"symbol":return!0;default:return!1}}var Pl={exports:{}},Al={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var di;function O4(){if(di)return Al;di=1;var t=up();function e(d,b){return d===b&&(d!==0||1/d===1/b)||d!==d&&b!==b}var n=typeof Object.is=="function"?Object.is:e,l=t.useState,r=t.useEffect,o=t.useLayoutEffect,i=t.useDebugValue;function u(d,b){var p=b(),h=l({inst:{value:p,getSnapshot:b}}),$=h[0].inst,y=h[1];return o(function(){$.value=p,$.getSnapshot=b,a($)&&y({inst:$})},[d,p,b]),r(function(){return a($)&&y({inst:$}),d(function(){a($)&&y({inst:$})})},[d]),i(p),p}function a(d){var b=d.getSnapshot;d=d.value;try{var p=b();return!n(d,p)}catch{return!0}}function c(d,b){return b()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:u;return Al.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:f,Al}var fi;function V4(){return fi||(fi=1,Pl.exports=O4()),Pl.exports}var j4=V4();const za=s.createContext(!1),pn=s.createContext(null);function zr(t){if(s.useContext(pn))return t.content;let{collection:n,document:l}=U4(t.createCollection);return g.createElement(g.Fragment,null,g.createElement(mh,null,g.createElement(pn.Provider,{value:l},t.content)),g.createElement(_4,{render:t.children,collection:n}))}function _4({collection:t,render:e}){return e(t)}function H4(t,e,n){let l=ct(),r=s.useRef(l);r.current=l;let o=s.useCallback(()=>r.current?n():e(),[e,n]);return j4.useSyncExternalStore(t,o)}const W4=typeof g.useSyncExternalStore=="function"?g.useSyncExternalStore:H4;function U4(t){let[e]=s.useState(()=>new z4((t==null?void 0:t())||new Ia)),n=s.useCallback(i=>e.subscribe(i),[e]),l=s.useCallback(()=>{let i=e.getCollection();return e.isSSR&&e.resetAfterSSR(),i},[e]),r=s.useCallback(()=>(e.isSSR=!0,e.getCollection()),[e]);return{collection:W4(n,l,r),document:e}}const lr=s.createContext(null);function G4(t){var n;return n=class extends Ge{},n.type=t,n}function Na(t,e,n,l,r,o){typeof t=="string"&&(t=G4(t));let i=s.useCallback(a=>{a==null||a.setProps(e,n,t,l,o)},[e,n,l,o,t]),u=s.useContext(lr);if(u){let a=u.ownerDocument.nodesByProps.get(e);return a||(a=u.ownerDocument.createElement(t.type),a.setProps(e,n,t,l,o),u.appendChild(a),u.ownerDocument.updateCollection(),u.ownerDocument.nodesByProps.set(e,a)),r?g.createElement(lr.Provider,{value:a},r):null}return g.createElement(t.type,{ref:i},r)}function vn(t,e){let n=({node:r})=>e(r.props,r.props.ref,r),l=s.forwardRef((r,o)=>{let i=s.useContext(Wl);if(!s.useContext(za)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(r,o)}return Na(t,r,o,"children"in r?r.children:null,null,a=>g.createElement(Wl.Provider,{value:i},g.createElement(n,{node:a})))});return l.displayName=e.name,l}function al(t,e,n=Oa){let l=({node:o})=>e(o.props,o.props.ref,o),r=s.forwardRef((o,i)=>{let u=n(o);return Na(t,o,i,null,u,a=>g.createElement(l,{node:a}))??g.createElement(g.Fragment,null)});return r.displayName=e.name,r}function Oa(t){return Lr({...t,addIdAndValue:!0})}const pi=s.createContext(null);function xn(t){let e=s.useContext(pi),n=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),l=t.idScope??(e==null?void 0:e.idScope),r=Oa({...t,idScope:l,dependencies:n});return s.useContext(pn)&&(r=g.createElement(q4,null,r)),e=s.useMemo(()=>({dependencies:n,idScope:l}),[l,...n]),g.createElement(pi.Provider,{value:e},r)}function q4({children:t}){let e=s.useContext(pn),n=s.useMemo(()=>g.createElement(pn.Provider,{value:null},g.createElement(za.Provider,{value:!0},t)),[t]);return ct()?g.createElement(lr.Provider,{value:e},n):gr.createPortal(n,e)}const Z4=s.createContext(null),Nr={CollectionRoot({collection:t,renderDropIndicator:e}){return bi(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:n}){return bi(t,e,n)}};function bi(t,e,n){return Lr({items:e?t.getChildren(e.key):t,dependencies:[n],children(l){if(l.type==="content")return g.createElement(g.Fragment,null);let r=l.render(l);return!n||l.type!=="item"?r:g.createElement(g.Fragment,null,n({type:"item",key:l.key,dropPosition:"before"}),r,Y4(t,l,n))}})}function Y4(t,e,n){let l=e.key,r=t.getKeyAfter(l),o=r!=null?t.getItem(r):null;for(;o!=null&&o.type!=="item";)r=t.getKeyAfter(o.key),o=r!=null?t.getItem(r):null;let i=e.nextKey!=null?t.getItem(e.nextKey):null;for(;i!=null&&i.type!=="item";)i=i.nextKey!=null?t.getItem(i.nextKey):null;let u=[];if(i==null){let a=e;for(;(a==null?void 0:a.type)==="item"&&(!o||a.parentKey!==o.parentKey&&o.level{b.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),re(b.target).activeElement!==b.target&&Ve(b.target),r&&r({...b,type:"longpress"}),u.current=void 0},o),b.pointerType==="touch")){let p=$=>{$.preventDefault()},h=we(b.target);a(b.target,"contextmenu",p,{once:!0}),a(h,"pointerup",()=>{setTimeout(()=>{c(b.target,"contextmenu",p)},30)},{once:!0})}},onPressEnd(b){u.current&&clearTimeout(u.current),l&&(b.pointerType==="mouse"||b.pointerType==="touch")&&l({...b,type:"longpressend"})}}),d=mn(r&&!e?i:void 0);return{longPressProps:G(f,d)}}function ks(t,e,n){let{type:l}=t,{isOpen:r}=e;s.useEffect(()=>{n&&n.current&&Uu.set(n.current,e.close)});let o;l==="menu"?o=!0:l==="listbox"&&(o="listbox");let i=$e();return{triggerProps:{"aria-haspopup":o,"aria-expanded":r,"aria-controls":r?i:void 0,onPress:e.toggle},overlayProps:{id:i}}}function rm(t){return t&&t.__esModule?t.default:t}function om(t,e,n){let{type:l="menu",isDisabled:r,trigger:o="press"}=t,i=$e(),{triggerProps:u,overlayProps:a}=ks({type:l},e,n),c=p=>{if(!r&&!(o==="longPress"&&!p.altKey)&&n&&n.current)switch(p.key){case"Enter":case" ":if(o==="longPress"||p.isDefaultPrevented())return;case"ArrowDown":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("first");break;case"ArrowUp":"continuePropagation"in p||p.stopPropagation(),p.preventDefault(),e.toggle("last");break;default:"continuePropagation"in p&&p.continuePropagation()}},f=Ne(rm(Ss),"@react-aria/menu"),{longPressProps:d}=Ds({isDisabled:r||o!=="longPress",accessibilityDescription:f.format("longPressMessage"),onLongPressStart(){e.close()},onLongPress(){e.open("first")}}),b={preventFocusOnPress:!0,onPressStart(p){p.pointerType!=="touch"&&p.pointerType!=="keyboard"&&!r&&(Ve(p.target),e.open(p.pointerType==="virtual"?"first":null))},onPress(p){p.pointerType==="touch"&&!r&&(Ve(p.target),e.toggle())}};return delete u.onPress,{menuTriggerProps:{...u,...o==="press"?b:d,id:i,onKeyDown:c},menuProps:{...a,"aria-labelledby":i,autoFocus:e.focusStrategy||!0,onClose:e.close}}}function or(t){return Fn()?t.altKey:t.ctrlKey}function On(t,e){var r,o;let n=`[data-key="${CSS.escape(String(e))}"]`,l=(r=t.current)==null?void 0:r.dataset.collection;return l&&(n=`[data-collection="${CSS.escape(l)}"]${n}`),(o=t.current)==null?void 0:o.querySelector(n)}const Ps=new WeakMap;function im(t){let e=$e();return Ps.set(t,e),e}function um(t){return Ps.get(t)}const am=1e3;function sm(t){let{keyboardDelegate:e,selectionManager:n,onTypeSelect:l}=t,r=s.useRef({search:"",timeout:void 0}).current,o=i=>{let u=cm(i.key);if(!(!u||i.ctrlKey||i.metaKey||!te(i.currentTarget,j(i))||r.search.length===0&&u===" ")){if(u===" "&&r.search.trim().length>0&&(i.preventDefault(),"continuePropagation"in i||i.stopPropagation()),r.search+=u,e.getKeyForSearch!=null){let a=e.getKeyForSearch(r.search,n.focusedKey);a==null&&(a=e.getKeyForSearch(r.search)),a!=null&&(n.setFocusedKey(a),l&&l(a))}clearTimeout(r.timeout),r.timeout=setTimeout(()=>{r.search=""},am)}};return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?o:void 0}}}function cm(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}function Vr(t){let{selectionManager:e,keyboardDelegate:n,ref:l,autoFocus:r=!1,shouldFocusWrap:o=!1,disallowEmptySelection:i=!1,disallowSelectAll:u=!1,escapeKeyBehavior:a="clearSelection",selectOnFocus:c=e.selectionBehavior==="replace",disallowTypeAhead:f=!1,shouldUseVirtualFocus:d,allowsTabNavigation:b=!1,scrollRef:p=l,linkBehavior:h="action"}=t,{direction:$}=Re(),y=Nt(),m=x=>{var I,w,k,D,T,O,Z,F,V,q,Q,J,ge,Be;if(x.altKey&&x.key==="Tab"&&x.preventDefault(),!l.current||!te(l.current,j(x)))return;const S=(L,Y)=>{if(L!=null){if(e.isLink(L)&&h==="selection"&&c&&!or(x)){gr.flushSync(()=>{e.setFocusedKey(L,Y)});let ue=On(l,L),Ke=e.getItemProps(L);ue&&y.open(ue,x,Ke.href,Ke.routerOptions);return}if(e.setFocusedKey(L,Y),e.isLink(L)&&h==="override")return;x.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(L):c&&!or(x)&&e.replaceSelection(L)}};switch(x.key){case"ArrowDown":if(n.getKeyBelow){let L=e.focusedKey!=null?(I=n.getKeyBelow)==null?void 0:I.call(n,e.focusedKey):(w=n.getFirstKey)==null?void 0:w.call(n);L==null&&o&&(L=(k=n.getFirstKey)==null?void 0:k.call(n,e.focusedKey)),L!=null&&(x.preventDefault(),S(L))}break;case"ArrowUp":if(n.getKeyAbove){let L=e.focusedKey!=null?(D=n.getKeyAbove)==null?void 0:D.call(n,e.focusedKey):(T=n.getLastKey)==null?void 0:T.call(n);L==null&&o&&(L=(O=n.getLastKey)==null?void 0:O.call(n,e.focusedKey)),L!=null&&(x.preventDefault(),S(L))}break;case"ArrowLeft":if(n.getKeyLeftOf){let L=e.focusedKey!=null?(Z=n.getKeyLeftOf)==null?void 0:Z.call(n,e.focusedKey):(F=n.getFirstKey)==null?void 0:F.call(n);L==null&&o&&(L=$==="rtl"?(V=n.getFirstKey)==null?void 0:V.call(n,e.focusedKey):(q=n.getLastKey)==null?void 0:q.call(n,e.focusedKey)),L!=null&&(x.preventDefault(),S(L,$==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){let L=e.focusedKey!=null?(Q=n.getKeyRightOf)==null?void 0:Q.call(n,e.focusedKey):(J=n.getFirstKey)==null?void 0:J.call(n);L==null&&o&&(L=$==="rtl"?(ge=n.getLastKey)==null?void 0:ge.call(n,e.focusedKey):(Be=n.getFirstKey)==null?void 0:Be.call(n,e.focusedKey)),L!=null&&(x.preventDefault(),S(L,$==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(e.focusedKey===null&&x.shiftKey)return;x.preventDefault();let L=n.getFirstKey(e.focusedKey,kt(x));e.setFocusedKey(L),L!=null&&(kt(x)&&x.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(L):c&&e.replaceSelection(L))}break;case"End":if(n.getLastKey){if(e.focusedKey===null&&x.shiftKey)return;x.preventDefault();let L=n.getLastKey(e.focusedKey,kt(x));e.setFocusedKey(L),L!=null&&(kt(x)&&x.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(L):c&&e.replaceSelection(L))}break;case"PageDown":if(n.getKeyPageBelow&&e.focusedKey!=null){let L=n.getKeyPageBelow(e.focusedKey);L!=null&&(x.preventDefault(),S(L))}break;case"PageUp":if(n.getKeyPageAbove&&e.focusedKey!=null){let L=n.getKeyPageAbove(e.focusedKey);L!=null&&(x.preventDefault(),S(L))}break;case"a":kt(x)&&e.selectionMode==="multiple"&&u!==!0&&(x.preventDefault(),e.selectAll());break;case"Escape":a==="clearSelection"&&!i&&e.selectedKeys.size!==0&&(x.stopPropagation(),x.preventDefault(),e.clearSelection());break;case"Tab":if(!b){if(x.shiftKey)l.current.focus();else{let L=Fe(l.current,{tabbable:!0}),Y,ue;do ue=L.lastChild(),ue&&(Y=ue);while(ue);let Ke=oe();Y&&(!vt(Y)||Ke&&!du(Ke))&&Ve(Y)}break}}},v=s.useRef({top:0,left:0});Yt(p,"scroll",()=>{var x,S;v.current={top:((x=p.current)==null?void 0:x.scrollTop)??0,left:((S=p.current)==null?void 0:S.scrollLeft)??0}});let E=x=>{var S,I;if(e.isFocused){te(x.currentTarget,j(x))||e.setFocused(!1);return}if(te(x.currentTarget,j(x))){if(e.setFocused(!0),e.focusedKey==null){let w=D=>{D!=null&&(e.setFocusedKey(D),c&&!e.isSelected(D)&&e.replaceSelection(D))},k=x.relatedTarget;k&&x.currentTarget.compareDocumentPosition(k)&Node.DOCUMENT_POSITION_FOLLOWING?w(e.lastSelectedKey??((S=n.getLastKey)==null?void 0:S.call(n))):w(e.firstSelectedKey??((I=n.getFirstKey)==null?void 0:I.call(n)))}else p.current&&(p.current.scrollTop=v.current.top,p.current.scrollLeft=v.current.left);if(e.focusedKey!=null&&p.current){let w=On(l,e.focusedKey);w instanceof HTMLElement&&(!vt(w)&&!d&&Ve(w),cn()==="keyboard"&&it(w,{containingElement:l.current}))}}},C=x=>{te(x.currentTarget,x.relatedTarget)||e.setFocused(!1)},R=s.useRef(!1);Yt(l,sp,d?x=>{let{detail:S}=x;x.stopPropagation(),e.setFocused(!0),(S==null?void 0:S.focusStrategy)==="first"&&(R.current=!0)}:void 0),ko(()=>{var x;if(R.current){let S=((x=n.getFirstKey)==null?void 0:x.call(n))??null;if(S==null){let I=oe();Va(l.current),Or(I,null),e.collection.size>0&&(R.current=!1)}else e.setFocusedKey(S),R.current=!1}},[e.collection]),ko(()=>{e.collection.size>0&&(R.current=!1)},[e.focusedKey]),Yt(l,ap,d?x=>{var S;x.stopPropagation(),e.setFocused(!1),(S=x.detail)!=null&&S.clearFocusKey&&e.setFocusedKey(null)}:void 0);const A=s.useRef(r),K=s.useRef(!1);s.useEffect(()=>{var x,S;if(A.current){let I=null;r==="first"&&(I=((x=n.getFirstKey)==null?void 0:x.call(n))??null),r==="last"&&(I=((S=n.getLastKey)==null?void 0:S.call(n))??null);let w=e.selectedKeys;if(w.size){for(let k of w)if(e.canSelectItem(k)){I=k;break}}e.setFocused(!0),e.setFocusedKey(I),I==null&&!d&&l.current&&ve(l.current),e.collection.size>0&&(A.current=!1,K.current=!0)}});let P=s.useRef(e.focusedKey),z=s.useRef(null);s.useEffect(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==P.current||K.current)&&p.current&&l.current){let x=cn(),S=On(l,e.focusedKey);if(!(S instanceof HTMLElement))return;(x==="keyboard"||K.current)&&(z.current&&cancelAnimationFrame(z.current),z.current=requestAnimationFrame(()=>{p.current&&(Ln(p.current,S),x!=="virtual"&&it(S,{containingElement:l.current}))}))}!d&&e.isFocused&&e.focusedKey==null&&P.current!=null&&l.current&&ve(l.current),P.current=e.focusedKey,K.current=!1}),s.useEffect(()=>()=>{z.current&&cancelAnimationFrame(z.current)},[]),Yt(l,"react-aria-focus-scope-restore",x=>{x.preventDefault(),e.setFocused(!0)});let B={onKeyDown:m,onFocus:E,onBlur:C,onMouseDown(x){p.current===j(x)&&x.preventDefault()}},{typeSelectProps:N}=sm({keyboardDelegate:n,selectionManager:e});f||(B=G(N,B));let U;d||(U=e.focusedKey==null?0:-1);let _=im(e.collection);return{collectionProps:G(B,{tabIndex:U,"data-collection":_})}}class ir{constructor(e){this.ref=e}getItemRect(e){let n=this.ref.current;if(!n)return null;let l=e!=null?On(this.ref,e):null;if(!l)return null;let r=n.getBoundingClientRect(),o=l.getBoundingClientRect();return{x:o.left-r.left-n.clientLeft+n.scrollLeft,y:o.top-r.top-n.clientTop+n.scrollTop,width:o.width,height:o.height}}getContentSize(){let e=this.ref.current;return{width:(e==null?void 0:e.scrollWidth)??0,height:(e==null?void 0:e.scrollHeight)??0}}getVisibleRect(){let e=this.ref.current;return{x:(e==null?void 0:e.scrollLeft)??0,y:(e==null?void 0:e.scrollTop)??0,width:(e==null?void 0:e.clientWidth)??0,height:(e==null?void 0:e.clientHeight)??0}}}class sl{constructor(...e){if(e.length===1){let n=e[0];this.collection=n.collection,this.ref=n.ref,this.collator=n.collator,this.disabledKeys=n.disabledKeys||new Set,this.disabledBehavior=n.disabledBehavior||"all",this.orientation=n.orientation||"vertical",this.direction=n.direction,this.layout=n.layout||"stack",this.layoutDelegate=n.layoutDelegate||new ir(n.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new ir(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}isDisabled(e){var n,l;return this.disabledBehavior==="all"&&(((n=e.props)==null?void 0:n.isDisabled)||this.disabledKeys.has(e.key))&&((l=e.props)==null?void 0:l.disabledBehavior)!=="selection"}findNextNonDisabled(e,n,l=!1){let r=e;for(;r!=null;){let o=this.collection.getItem(r);if((o==null?void 0:o.type)==="item"&&(l||!this.isDisabled(o)))return r;r=n(r)}return null}getNextKey(e,n){let l=e;return l=this.collection.getKeyAfter(l),this.findNextNonDisabled(l,r=>this.collection.getKeyAfter(r),n==null?void 0:n.includeDisabled)}getPreviousKey(e,n){let l=e;return l=this.collection.getKeyBefore(l),this.findNextNonDisabled(l,r=>this.collection.getKeyBefore(r),n==null?void 0:n.includeDisabled)}findKey(e,n,l){let r=e,o=this.layoutDelegate.getItemRect(r);if(!o||r==null)return null;let i=o;do{if(r=n(r),r==null)break;o=this.layoutDelegate.getItemRect(r)}while(o&&l(i,o)&&r!=null);return r}isSameRow(e,n){return e.y===n.y||e.x!==n.x}isSameColumn(e,n){return e.x===n.x||e.y!==n.y}getKeyBelow(e,n){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,l=>this.getNextKey(l,n),this.isSameRow):this.getNextKey(e,n)}getKeyAbove(e,n){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,l=>this.getPreviousKey(l,n),this.isSameRow):this.getPreviousKey(e,n)}getNextColumn(e,n,l){return n?this.getPreviousKey(e,l):this.getNextKey(e,l)}getKeyRightOf(e,n){let l=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[l]?(e=this.layoutDelegate[l](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[l](r),n==null?void 0:n.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl",n):this.findKey(e,r=>this.getNextColumn(r,this.direction==="rtl",n),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl",n):null}getKeyLeftOf(e,n){let l=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[l]?(e=this.layoutDelegate[l](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[l](r),n==null?void 0:n.includeDisabled)):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr",n):this.findKey(e,r=>this.getNextColumn(r,this.direction==="ltr",n),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr",n):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyAfter(n))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(e){let n=this.ref.current,l=this.layoutDelegate.getItemRect(e);if(!l)return null;if(n&&!st(n))return this.getFirstKey();let r=e;if(this.orientation==="horizontal"){let o=Math.max(0,l.x+l.width-this.layoutDelegate.getVisibleRect().width);for(;l&&l.x>o&&r!=null;)r=this.getKeyAbove(r),l=r==null?null:this.layoutDelegate.getItemRect(r)}else{let o=Math.max(0,l.y+l.height-this.layoutDelegate.getVisibleRect().height);for(;l&&l.y>o&&r!=null;)r=this.getKeyAbove(r),l=r==null?null:this.layoutDelegate.getItemRect(r)}return r??this.getFirstKey()}getKeyPageBelow(e){let n=this.ref.current,l=this.layoutDelegate.getItemRect(e);if(!l)return null;if(n&&!st(n))return this.getLastKey();let r=e;if(this.orientation==="horizontal"){let o=Math.min(this.layoutDelegate.getContentSize().width,l.x-l.width+this.layoutDelegate.getVisibleRect().width);for(;l&&l.xr[0]o||new sl({collection:n,disabledKeys:l,disabledBehavior:c,ref:r,collator:a,layoutDelegate:i,orientation:u}),[o,i,n,l,r,a,c,u]),{collectionProps:d}=Vr({...t,ref:r,selectionManager:e,keyboardDelegate:f});return{listProps:d}}function jr(t){let{id:e,selectionManager:n,key:l,ref:r,shouldSelectOnPressUp:o,shouldUseVirtualFocus:i,focus:u,isDisabled:a,onAction:c,allowsDifferentPressOrigin:f,linkBehavior:d="action"}=t,b=Nt();e=$e(e);let p=T=>{if(T.pointerType==="keyboard"&&or(T))n.toggleSelection(l);else{if(n.selectionMode==="none")return;if(n.isLink(l)){if(d==="selection"&&r.current){let O=n.getItemProps(l);b.open(r.current,T,O.href,O.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(d==="override"||d==="none")return}n.selectionMode==="single"?n.isSelected(l)&&!n.disallowEmptySelection?n.toggleSelection(l):n.replaceSelection(l):T&&T.shiftKey?n.extendSelection(l):n.selectionBehavior==="toggle"||T&&(kt(T)||T.pointerType==="touch"||T.pointerType==="virtual")?n.toggleSelection(l):n.replaceSelection(l)}};s.useEffect(()=>{l===n.focusedKey&&n.isFocused&&(i?Va(r.current):u?u():oe()!==r.current&&r.current&&ve(r.current))},[r,l,n.focusedKey,n.childFocusStrategy,n.isFocused,i]),a=a||n.isDisabled(l);let h={};!i&&!a?h={tabIndex:l===n.focusedKey?0:-1,onFocus(T){j(T)===r.current&&n.setFocusedKey(l)}}:a&&(h.onMouseDown=T=>{T.preventDefault()}),s.useEffect(()=>{a&&n.focusedKey===l&&n.setFocusedKey(null)},[n,a,l]);let $=n.isLink(l)&&d==="override",y=c&&t.UNSTABLE_itemBehavior==="action",m=n.isLink(l)&&d!=="selection"&&d!=="none",v=!a&&n.canSelectItem(l)&&!$&&!y,E=(c||m)&&!a,C=E&&(n.selectionBehavior==="replace"?!v:!v||n.isEmpty),R=E&&v&&n.selectionBehavior==="replace",A=C||R,K=s.useRef(null),P=A&&v,z=s.useRef(!1),B=s.useRef(!1),N=n.getItemProps(l),U=T=>{var O;c&&(c(),(O=r.current)==null||O.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))),m&&r.current&&b.open(r.current,T,N.href,N.routerOptions)},_={ref:r};if(o?(_.onPressStart=T=>{K.current=T.pointerType,z.current=P,T.pointerType==="keyboard"&&(!A||gi(T.key))&&p(T)},f?(_.onPressUp=C?void 0:T=>{T.pointerType==="mouse"&&v&&p(T)},_.onPress=C?U:T=>{T.pointerType!=="keyboard"&&T.pointerType!=="mouse"&&v&&p(T)}):_.onPress=T=>{if(C||R&&T.pointerType!=="mouse"){if(T.pointerType==="keyboard"&&!mi(T.key))return;U(T)}else T.pointerType!=="keyboard"&&v&&p(T)}):(_.onPressStart=T=>{K.current=T.pointerType,z.current=P,B.current=C,v&&(T.pointerType==="mouse"&&!C||T.pointerType==="keyboard"&&(!E||gi(T.key)))&&p(T)},_.onPress=T=>{(T.pointerType==="touch"||T.pointerType==="pen"||T.pointerType==="virtual"||T.pointerType==="keyboard"&&A&&mi(T.key)||T.pointerType==="mouse"&&B.current)&&(A?U(T):v&&p(T))}),h["data-collection"]=um(n.collection),h["data-key"]=l,_.preventFocusOnPress=i,i&&(_=G(_,{onPressStart(T){T.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(l))},onPress(T){T.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(l))}})),N)for(let T of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])N[T]&&(_[T]=dt(_[T],N[T]));let{pressProps:x,isPressed:S}=lt(_),I=R?T=>{K.current==="mouse"&&(T.stopPropagation(),T.preventDefault(),U(T))}:void 0,{longPressProps:w}=Ds({isDisabled:!P,onLongPress(T){T.pointerType==="touch"&&(p(T),n.setSelectionBehavior("toggle"))}}),k=T=>{K.current==="touch"&&z.current&&T.preventDefault()},D=d!=="none"&&n.isLink(l)?T=>{tt.isOpening||T.preventDefault()}:void 0;return{itemProps:G(h,v||C||i&&!a?x:{},P?w:{},{onDoubleClick:I,onDragStartCapture:k,onClick:D,id:e},i?{onMouseDown:T=>T.preventDefault()}:void 0),isPressed:S,isSelected:n.isSelected(l),isFocused:n.isFocused&&n.focusedKey===l,isDisabled:a,allowsSelection:v,hasAction:A}}function mi(t){return t==="Enter"}function gi(t){return t===" "}function Ce(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function Pt(t){return en(t,0)}function en(t,e){if(e<0)return;let n=0;for(let l of t){if(n===e)return l;n++}}function In(t){let e;for(let n of t)e=n;return e}const yi=new WeakMap;function As(t){let e=yi.get(t);if(e!=null)return e;let n=0,l=r=>{for(let o of r)o.type==="section"?l(Ce(o,t)):o.type==="item"&&n++};return l(t),yi.set(t,n),n}function fm(t){let e=il(t),[n,l]=s.useState(null),[r,o]=s.useState([]),i=()=>{o([]),e.close()};return{focusStrategy:n,...e,open(c=null){l(c),e.open()},toggle(c=null){l(c),e.toggle()},close(){i()},expandedKeysStack:r,openSubmenu:(c,f)=>{o(d=>f>d.length?d:[...d.slice(0,f),c])},closeSubmenu:(c,f)=>{o(d=>d[f]===c?d.slice(0,f):d)}}}function Zn(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function _r(t){return pm(t)}function pm(t,e){for(let n of t)return n}function Ts(t){let e;for(let n of t)e=n;return e}function Bl(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let l=[...$i(t,e),e],r=[...$i(t,n),n],o=l.slice(0,r.length).findIndex((i,u)=>i!==r[u]);return o!==-1?(e=l[o],n=r[o],e.index-n.index):l.findIndex(i=>i===n)>=0?1:(r.findIndex(i=>i===e)>=0,-1)}function $i(t,e){let n=[],l=e;for(;(l==null?void 0:l.parentKey)!=null;)l=t.getItem(l.parentKey),l&&n.unshift(l);return n}class Oe extends Set{constructor(e,n,l){super(e),e instanceof Oe?(this.anchorKey=n??e.anchorKey,this.currentKey=l??e.currentKey):(this.anchorKey=n??null,this.currentKey=l??null)}}class cl{constructor(e,n,l){this.collection=e,this.state=n,this.allowsCellSelection=(l==null?void 0:l.allowsCellSelection)??!1,this._isSelectAll=null,this.layoutDelegate=(l==null?void 0:l.layoutDelegate)||null,this.fullCollection=(l==null?void 0:l.fullCollection)||null}get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,n){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let n=this.getKey(e);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=e.every(l=>n.has(l)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let n of this.state.selectedKeys){let l=this.collection.getItem(n);(!e||l&&Bl(this.collection,l,e)<0)&&(e=l)}return(e==null?void 0:e.key)??null}get lastSelectedKey(){let e=null;for(let n of this.state.selectedKeys){let l=this.collection.getItem(n);(!e||l&&Bl(this.collection,l,e)>0)&&(e=l)}return(e==null?void 0:e.key)??null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let l;if(this.state.selectedKeys==="all")l=new Oe([n],n,n);else{let r=this.state.selectedKeys,o=r.anchorKey??n;l=new Oe(r,o,n);for(let i of this.getKeyRange(o,r.currentKey??n))l.delete(i);for(let i of this.getKeyRange(n,o))this.canSelectItem(i)&&l.add(i)}this.state.setSelectedKeys(l)}getKeyRange(e,n){let l=this.collection.getItem(e),r=this.collection.getItem(n);return l&&r?Bl(this.collection,l,r)<=0?this.getKeyRangeInternal(e,n):this.getKeyRangeInternal(n,e):[]}getKeyRangeInternal(e,n){var o;if((o=this.layoutDelegate)!=null&&o.getKeyRange)return this.layoutDelegate.getKeyRange(e,n);let l=[],r=e;for(;r!=null;){let i=this.collection.getItem(r);if(i&&(i.type==="item"||i.type==="cell"&&this.allowsCellSelection)&&l.push(r),r===n)return l;r=this.collection.getKeyAfter(r)}return[]}getKey(e){let n=this.collection.getItem(e);if(!n||n.type==="cell"&&this.allowsCellSelection)return e;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let l=new Oe(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);l.has(n)?l.delete(n):this.canSelectItem(n)&&(l.add(n),l.anchorKey=n,l.currentKey=n),!(this.disallowEmptySelection&&l.size===0)&&this.state.setSelectedKeys(l)}replaceSelection(e){if(this.selectionMode==="none")return;let n=this.getKey(e);if(n==null)return;let l=this.canSelectItem(n)?new Oe([n],n,n):new Oe;this.state.setSelectedKeys(l)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new Oe;for(let l of e){let r=this.getKey(l);if(r!=null&&(n.add(r),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let e=this.fullCollection??this.collection,n=[],l=r=>{var o;for(;r!=null;){if(this.canSelectItemIn(r,e)){let i=e.getItem(r);(i==null?void 0:i.type)==="item"&&n.push(r),i!=null&&i.hasChildNodes&&(this.allowsCellSelection||i.type!=="item")&&l(((o=_r(Zn(i,e)))==null?void 0:o.key)??null)}r=e.getKeyAfter(r)}};return l(e.getFirstKey()),n}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Oe)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(e.size!==n.size)return!1;for(let l of e)if(!n.has(l))return!1;for(let l of n)if(!e.has(l))return!1;return!0}canSelectItem(e){return this.canSelectItemIn(e,this.collection)}canSelectItemIn(e,n){var r;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let l=n.getItem(e);return!(!l||(r=l==null?void 0:l.props)!=null&&r.isDisabled||l.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var l,r;let n=this.collection.getItem(e);return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!((l=n==null?void 0:n.props)!=null&&l.isDisabled))&&((r=n==null?void 0:n.props)==null?void 0:r.disabledBehavior)!=="selection"}isLink(e){var n,l;return!!((l=(n=this.collection.getItem(e))==null?void 0:n.props)!=null&&l.href)}getItemProps(e){var n;return(n=this.collection.getItem(e))==null?void 0:n.props}withCollection(e){return new cl(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0,fullCollection:this.fullCollection??this.collection})}}class bm{build(e,n){return this.context=n,vi(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:n,items:l}=e;if(g.isValidElement(n)&&n.type===g.Fragment)yield*this.iterateCollection({children:n.props.children,items:l});else if(typeof n=="function"){if(!l)throw new Error("props.children was a function but props.items is missing");let r=0;for(let o of l)yield*this.getFullNode({value:o,index:r},{renderer:n}),r++}else{let r=[];g.Children.forEach(n,i=>{i&&r.push(i)});let o=0;for(let i of r){let u=this.getFullNode({element:i,index:o},{});for(let a of u)o++,yield a}}}getKey(e,n,l,r){if(e.key!=null)return e.key;if(n.type==="cell"&&n.key!=null)return`${r}${n.key}`;let o=n.value;if(o!=null){let i=o.key??o.id;if(i==null)throw new Error("No key found for item");return i}return r?`${r}.${n.index}`:`$.${n.index}`}getChildState(e,n){return{renderer:n.renderer||e.renderer}}*getFullNode(e,n,l,r){if(g.isValidElement(e.element)&&e.element.type===g.Fragment){let a=[];g.Children.forEach(e.element.props.children,f=>{a.push(f)});let c=e.index??0;for(const f of a)yield*this.getFullNode({element:f,index:c++},n,l,r);return}let o=e.element;if(!o&&e.value&&n&&n.renderer){let a=this.cache.get(e.value);if(a&&(!a.shouldInvalidate||!a.shouldInvalidate(this.context))){a.index=e.index,a.parentKey=r?r.key:null,yield a;return}o=n.renderer(e.value)}if(g.isValidElement(o)){let a=o.type;if(typeof a!="function"&&typeof a.getCollectionNode!="function"){let b=o.type;throw new Error(`Unknown element <${b}> in collection.`)}let c=a.getCollectionNode(o.props,this.context),f=e.index??0,d=c.next();for(;!d.done&&d.value;){let b=d.value;e.index=f;let p=b.key??null;p==null&&(p=b.element?null:this.getKey(o,e,n,l));let $=[...this.getFullNode({...b,key:p,index:f,wrapper:hm(e.wrapper,b.wrapper)},this.getChildState(n,b),l?`${l}${o.key}`:o.key,r)];for(let y of $){if(y.value=b.value??e.value??null,y.value&&this.cache.set(y.value,y),e.type&&y.type!==e.type)throw new Error(`Unsupported type <${Kl(y.type)}> in <${Kl((r==null?void 0:r.type)??"unknown parent type")}>. Only <${Kl(e.type)}> is supported.`);f++,yield y}d=c.next($)}return}if(e.key==null||e.type==null)return;let i=this,u={type:e.type,props:e.props,key:e.key,parentKey:r?r.key:null,value:e.value??null,level:((r==null?void 0:r.level)??0)+((r==null?void 0:r.type)==="item"?1:0),index:e.index,rendered:e.rendered,textValue:e.textValue??"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:vi(function*(){if(!e.hasChildNodes||!e.childNodes)return;let a=0;for(let c of e.childNodes()){c.key!=null&&(c.key=`${u.key}${c.key}`);let f=i.getFullNode({...c,index:a},i.getChildState(n,c),u.key,u);for(let d of f)a++,yield d}})};yield u}constructor(){this.cache=new WeakMap}}function vi(t){let e=[],n=null;return{*[Symbol.iterator](){for(let l of e)yield l;n||(n=t());for(let l of n)e.push(l),yield l}}}function hm(t,e){if(t&&e)return n=>t(e(n));if(t)return t;if(e)return e}function Kl(t){return t[0].toUpperCase()+t.slice(1)}function Bs(t,e,n){let l=s.useMemo(()=>new bm,[]),{children:r,items:o,collection:i}=t;return s.useMemo(()=>{if(i)return i;let a=l.build({children:r,items:o},n);return e(a)},[l,r,o,i,n,e])}function mm(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function Hr(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:l,selectionBehavior:r="toggle",disabledBehavior:o="all"}=t,i=s.useRef(!1),[,u]=s.useState(!1),a=s.useRef(null),c=s.useRef(null),[,f]=s.useState(null),d=s.useMemo(()=>xi(t.selectedKeys),[t.selectedKeys]),b=s.useMemo(()=>xi(t.defaultSelectedKeys,new Oe),[t.defaultSelectedKeys]),[p,h]=Ct(d,b,t.onSelectionChange),$=s.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[y,m]=s.useState(r);r==="replace"&&y==="toggle"&&typeof p=="object"&&p.size===0&&m("replace");let v=s.useRef(r);return s.useEffect(()=>{r!==v.current&&(m(r),v.current=r)},[r]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:y,setSelectionBehavior:m,get isFocused(){return i.current},setFocused(E){i.current=E,u(E)},get focusedKey(){return a.current},get childFocusStrategy(){return c.current},setFocusedKey(E,C="first"){a.current=E,c.current=C,f(E)},selectedKeys:p,setSelectedKeys(E){(l||!mm(E,p))&&h(E)},disabledKeys:$,disabledBehavior:o}}function xi(t,e){return t?t==="all"?"all":new Oe(t):e}const gm=s.createContext(null),ao=class ao extends Ge{filter(e,n,l){let r=e.getItem(this.firstChildKey);if(r&&l(r.textValue,this)){let o=this.clone();return n.addDescendants(o,e),o}return null}};ao.type="submenutrigger";let Ci=ao;function ym(t,e){let{role:n="dialog"}=t,l=on();l=t["aria-label"]?void 0:l;let r=s.useRef(!1);return s.useEffect(()=>{if(e.current&&!vt(e.current)){ve(e.current);let o=setTimeout(()=>{(oe()===e.current||oe()===document.body)&&(r.current=!0,e.current&&(e.current.blur(),ve(e.current)),r.current=!1)},500);return()=>{clearTimeout(o)}}},[e]),Ma(),s.useRef(!1),s.useEffect(()=>{}),{dialogProps:{...ie(t,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":t["aria-labelledby"]||l,onBlur:o=>{r.current&&o.stopPropagation()}},titleProps:{id:l}}}const Ks=s.createContext(null),Et=s.createContext(null);function $m(t){let e=fm(t),n=s.useRef(null),{triggerProps:l,overlayProps:r}=ks({type:"dialog"},e,n);return l.id=$e(),r["aria-labelledby"]=l.id,g.createElement(_e,{values:[[Et,e],[gm,e],[Ks,r],[Fr,{trigger:"DialogTrigger",triggerRef:n,"aria-labelledby":r["aria-labelledby"]}]]},g.createElement(K4,{...l,ref:n,isPressed:e.isOpen},t.children))}const vm=s.forwardRef(function(e,n){let l=e["aria-labelledby"];[e,n]=xe(e,n,Ks);let{dialogProps:r,titleProps:o}=ym({...e,"aria-labelledby":l},n),i=s.useContext(Et);!r["aria-label"]&&!r["aria-labelledby"]&&e["aria-labelledby"]&&(r["aria-labelledby"]=e["aria-labelledby"]);let u=ce({defaultClassName:"react-aria-Dialog",className:e.className,style:e.style,children:e.children,values:{close:(i==null?void 0:i.close)||(()=>{})}}),a=ie(e,{global:!0});return g.createElement(le.section,{...G(a,u,r),render:e.render,ref:n,slot:e.slot||void 0},g.createElement(_e,{values:[[ju,{slots:{[mt]:{},title:{...o,level:2}}}],[yn,{slots:{[mt]:{},close:{onPress:()=>i==null?void 0:i.close()}}}]]},u.children))});function xm(t,e,n){let{overlayProps:l,underlayProps:r}=Zu({...t,isOpen:e.isOpen,onClose:e.close},n);return Yu({isDisabled:!e.isOpen}),Ma(),s.useEffect(()=>{if(e.isOpen&&n.current)return Rr([n.current],{shouldUseInert:!0})},[e.isOpen,n]),{modalProps:G(l),underlayProps:r}}const Cm=s.createContext(null),Wr=s.createContext(null),Em=s.forwardRef(function(e,n){if(s.useContext(Wr))return g.createElement(Ei,{...e,modalRef:n},e.children);let{isDismissable:r,isKeyboardDismissDisabled:o,isOpen:i,defaultOpen:u,onOpenChange:a,children:c,isEntering:f,isExiting:d,UNSTABLE_portalContainer:b,shouldCloseOnInteractOutside:p,...h}=e;return g.createElement(Rs,{isDismissable:r,isKeyboardDismissDisabled:o,isOpen:i,defaultOpen:u,onOpenChange:a,isEntering:f,isExiting:d,UNSTABLE_portalContainer:b,shouldCloseOnInteractOutside:p},g.createElement(Ei,{...h,modalRef:n},c))});function wm(t,e){[t,e]=xe(t,e,Cm);let n=s.useContext(Et),l=il(t),r=t.isOpen!=null||t.defaultOpen!=null||!n?l:n,o=ke(e),i=s.useRef(null),u=Ll(o,r.isOpen),a=Ll(i,r.isOpen),c=u||a||t.isExiting||!1,f=ct();return!r.isOpen&&!c||f?null:g.createElement(Sm,{...t,state:r,isExiting:c,overlayRef:o,modalRef:i})}const Rs=s.forwardRef(wm);function Sm({UNSTABLE_portalContainer:t,...e}){let n=e.modalRef,{state:l}=e,{modalProps:r,underlayProps:o}=xm(e,l,n),i=Cr(e.overlayRef)||e.isEntering||!1,u=ce({...e,defaultClassName:"react-aria-ModalOverlay",values:{isEntering:i,isExiting:e.isExiting,state:l}}),a=Up(),c,f;if(typeof document<"u"){let b=st(document.body)?document.body:document.scrollingElement||document.documentElement,p=b.getBoundingClientRect().width%1,h=b.getBoundingClientRect().height%1;c=b.scrollWidth-p,f=b.scrollHeight-h}let d={...u.style,"--visual-viewport-width":a.width+"px","--visual-viewport-height":a.height+"px","--page-width":c!==void 0?c+"px":void 0,"--page-height":f!==void 0?f+"px":void 0};return g.createElement(er,{isExiting:e.isExiting,portalContainer:t},g.createElement(le.div,{...G(ie(e,{global:!0}),o),...u,style:d,ref:e.overlayRef,"data-entering":i||void 0,"data-exiting":e.isExiting||void 0},g.createElement(_e,{values:[[Wr,{modalProps:r,modalRef:n,isExiting:e.isExiting,isDismissable:e.isDismissable}],[Et,l]]},u.children)))}function Ei(t){let{modalProps:e,modalRef:n,isExiting:l,isDismissable:r}=s.useContext(Wr),o=s.useContext(Et),i=s.useMemo(()=>ft(t.modalRef,n),[t.modalRef,n]),u=ke(i),a=Cr(u),c=ce({...t,defaultClassName:"react-aria-Modal",values:{isEntering:a,isExiting:l,state:o}});return g.createElement(le.div,{...G(ie(t,{global:!0}),e),...c,ref:u,"data-entering":a||void 0,"data-exiting":l||void 0},r&&g.createElement(Ql,{onDismiss:o.close}),c.children)}const Dm=g.forwardRef(({children:t,...e},n)=>{n=ke(n);let{pressProps:l}=lt({...e,ref:n}),{focusableProps:r}=jt(e,n),o=g.Children.only(t);s.useEffect(()=>{},[n,e.isDisabled]);let i=parseInt(g.version,10)<19?o.ref:o.props.ref;return g.cloneElement(o,{...G(l,r,o.props),ref:ft(i,n)})}),wi=({children:t,className:e,slot:n,style:l,variant:r,...o})=>{const i=s.useMemo(()=>nh({variant:r}),[r]);return M.jsx(Kr,{"aria-label":"Close",className:me(e,i),"data-slot":"close-button",slot:n,style:l,...o,children:u=>typeof t=="function"?t(u):t??M.jsx(qh,{"data-slot":"close-button-icon"})})},km=Object.assign(wi,{Root:wi}),ze=s.createContext({}),Si=({children:t,...e})=>{const n=s.useMemo(()=>({slots:Qn(),placement:void 0}),[]);return M.jsx(ze,{value:n,children:M.jsx($m,{"data-slot":"alert-dialog-root",...e,children:t})})},Pm=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(ze);return M.jsx(Dm,{children:M.jsx("div",{className:de(l==null?void 0:l.trigger,e),"data-slot":"alert-dialog-trigger",role:"button",...n,children:t})})},Am=({children:t,className:e,isDismissable:n=!1,isKeyboardDismissDisabled:l=!0,onClick:r,variant:o,...i})=>{const{slots:u}=s.useContext(ze),a=s.useMemo(()=>Qn({variant:o}),[o]),c=s.useMemo(()=>({slots:{...u,...a}}),[u,a]);return M.jsx(Rs,{className:me(e,a==null?void 0:a.backdrop()),"data-slot":"alert-dialog-backdrop",isDismissable:n,isKeyboardDismissDisabled:l,onClick:f=>{f.stopPropagation(),r==null||r(f)},...i,children:f=>M.jsxs(ze,{value:c,children:[typeof t=="function"?t(f):t," "]})})},Tm=({children:t,className:e,placement:n="auto",size:l,...r})=>{const{slots:o}=s.useContext(ze),i=s.useMemo(()=>Qn({size:l}),[l]),u=s.useMemo(()=>({placement:n,slots:{...o,...i}}),[n,o,i]);return M.jsx(Em,{className:me(e,i==null?void 0:i.container()),"data-placement":n,"data-slot":"alert-dialog-container",...r,children:a=>M.jsx(ze,{value:u,children:typeof t=="function"?t(a):t})})},Bm=({children:t,className:e,...n})=>{const{placement:l,slots:r}=s.useContext(ze);return M.jsx(vm,{className:de(r==null?void 0:r.dialog,e),"data-placement":l,"data-slot":"alert-dialog-dialog",role:"alertdialog",...n,children:t})},Km=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(ze);return M.jsx("div",{className:de(l==null?void 0:l.header,e),"data-slot":"alert-dialog-header",...n,children:t})},Rm=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(ze);return M.jsx(Hh,{className:de(l==null?void 0:l.heading,e),"data-slot":"alert-dialog-heading",slot:"title",...n,children:t})},Mm=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(ze);return M.jsx("div",{className:de(l==null?void 0:l.body,e),"data-slot":"alert-dialog-body",...n,children:t})},Im=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(ze);return M.jsx("div",{className:de(l==null?void 0:l.footer,e),"data-slot":"alert-dialog-footer",...n,children:t})},Fm=({children:t,className:e,status:n="danger",...l})=>{const r=s.useMemo(()=>Qn({status:n}),[n]),o=()=>{switch(n){case"default":return M.jsx(Ho,{"data-slot":"alert-dialog-default-icon"});case"accent":return M.jsx(Ho,{"data-slot":"alert-dialog-default-icon"});case"success":return M.jsx(Yh,{"data-slot":"alert-dialog-default-icon"});case"warning":return M.jsx(Zh,{"data-slot":"alert-dialog-default-icon"});case"danger":return M.jsx(Wo,{"data-slot":"alert-dialog-default-icon"});default:return M.jsx(Wo,{"data-slot":"alert-dialog-default-icon"})}};return M.jsx(Se.div,{className:r==null?void 0:r.icon({className:e}),"data-slot":"alert-dialog-icon",...l,children:t??o()})},Lm=({className:t,...e})=>{const{slots:n}=s.useContext(ze);return M.jsx(km,{className:me(t,n==null?void 0:n.closeTrigger()),"data-slot":"alert-dialog-close-trigger",slot:"close",...e})},b0=Object.assign(Si,{Root:Si,Trigger:Pm,Backdrop:Am,Container:Tm,Dialog:Bm,Header:Km,Heading:Rm,Body:Mm,Footer:Im,Icon:Fm,CloseTrigger:Lm});function zm(t){let e=En({usage:"search",...t}),n=s.useCallback((o,i)=>i.length===0?!0:(o=o.normalize("NFC"),i=i.normalize("NFC"),e.compare(o.slice(0,i.length),i)===0),[e]),l=s.useCallback((o,i)=>i.length===0?!0:(o=o.normalize("NFC"),i=i.normalize("NFC"),e.compare(o.slice(-i.length),i)===0),[e]),r=s.useCallback((o,i)=>{if(i.length===0)return!0;o=o.normalize("NFC"),i=i.normalize("NFC");let u=0,a=i.length;for(;u+a<=o.length;u++){let c=o.slice(u,u+a);if(e.compare(i,c)===0)return!0}return!1},[e]);return s.useMemo(()=>({startsWith:n,endsWith:l,contains:r}),[n,l,r])}const Ur=s.createContext({}),Ms=s.createContext(null),Is={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},Fs={...Is,customError:!0,valid:!1},qt={isInvalid:!1,validationDetails:Is,validationErrors:[]},Nm=s.createContext({}),Di="__reactAriaFormValidationState";function Om(t){if(t[Di]){let{realtimeValidation:e,displayValidation:n,updateValidation:l,resetValidation:r,commitValidation:o}=t[Di];return{realtimeValidation:e,displayValidation:n,updateValidation:l,resetValidation:r,commitValidation:o}}return Vm(t)}function Vm(t){let{isInvalid:e,validationState:n,name:l,value:r,builtinValidation:o,validate:i,validationBehavior:u="aria"}=t;n&&(e||(e=n==="invalid"));let a=e!==void 0?{isInvalid:e,validationErrors:[],validationDetails:Fs}:null,c=s.useMemo(()=>{if(!i||r==null)return null;let B=jm(i,r);return ki(B)},[i,r]);o!=null&&o.validationDetails.valid&&(o=void 0);let f=s.useContext(Nm),d=s.useMemo(()=>l?Array.isArray(l)?l.flatMap(B=>ur(f[B])):ur(f[l]):[],[f,l]),[b,p]=s.useState(f),[h,$]=s.useState(!1);f!==b&&(p(f),$(!1));let y=s.useMemo(()=>ki(h?[]:d),[h,d]),m=s.useRef(qt),[v,E]=s.useState(qt),C=s.useRef(qt),R=()=>{if(!A)return;K(!1);let B=c||o||m.current;Rl(B,C.current)||(C.current=B,E(B))},[A,K]=s.useState(!1);return s.useEffect(R),{realtimeValidation:a||y||c||o||qt,displayValidation:u==="native"?a||y||v:a||y||c||o||v,updateValidation(B){u==="aria"&&!Rl(v,B)?E(B):m.current=B},resetValidation(){let B=qt;Rl(B,C.current)||(C.current=B,E(B)),u==="native"&&K(!1),$(!0)},commitValidation(){u==="native"&&K(!0),$(!0)}}}function ur(t){return t?Array.isArray(t)?t:[t]:[]}function jm(t,e){if(typeof t=="function"){let n=t(e);if(n&&typeof n!="boolean")return ur(n)}return[]}function ki(t){return t.length?{isInvalid:!0,validationErrors:t,validationDetails:Fs}:null}function Rl(t,e){return t===e?!0:!!t&&!!e&&t.isInvalid===e.isInvalid&&t.validationErrors.length===e.validationErrors.length&&t.validationErrors.every((n,l)=>n===e.validationErrors[l])&&Object.entries(t.validationDetails).every(([n,l])=>e.validationDetails[n]===l)}const Gr=s.createContext(null);var Ls={};Ls={colorSwatchPicker:"تغييرات الألوان",dropzoneLabel:"DropZone",selectPlaceholder:"حدد عنصرًا",tableResizer:"أداة تغيير الحجم"};var zs={};zs={colorSwatchPicker:"Цветови мостри",dropzoneLabel:"DropZone",selectPlaceholder:"Изберете предмет",tableResizer:"Преоразмерител"};var Ns={};Ns={colorSwatchPicker:"Vzorky barev",dropzoneLabel:"Místo pro přetažení",selectPlaceholder:"Vyberte položku",tableResizer:"Změna velikosti"};var Os={};Os={colorSwatchPicker:"Farveprøver",dropzoneLabel:"DropZone",selectPlaceholder:"Vælg et element",tableResizer:"Størrelsesændring"};var Vs={};Vs={colorSwatchPicker:"Farbfelder",dropzoneLabel:"Ablegebereich",selectPlaceholder:"Element wählen",tableResizer:"Größenanpassung"};var js={};js={colorSwatchPicker:"Χρωματικά δείγματα",dropzoneLabel:"DropZone",selectPlaceholder:"Επιλέξτε ένα αντικείμενο",tableResizer:"Αλλαγή μεγέθους"};var _s={};_s={selectPlaceholder:"Select an item",tableResizer:"Resizer",dropzoneLabel:"DropZone",colorSwatchPicker:"Color swatches"};var Hs={};Hs={colorSwatchPicker:"Muestras de colores",dropzoneLabel:"DropZone",selectPlaceholder:"Seleccionar un artículo",tableResizer:"Cambiador de tamaño"};var Ws={};Ws={colorSwatchPicker:"Värvinäidised",dropzoneLabel:"DropZone",selectPlaceholder:"Valige üksus",tableResizer:"Suuruse muutja"};var Us={};Us={colorSwatchPicker:"Värimallit",dropzoneLabel:"DropZone",selectPlaceholder:"Valitse kohde",tableResizer:"Koon muuttaja"};var Gs={};Gs={colorSwatchPicker:"Échantillons de couleurs",dropzoneLabel:"DropZone",selectPlaceholder:"Sélectionner un élément",tableResizer:"Redimensionneur"};var qs={};qs={colorSwatchPicker:"דוגמיות צבע",dropzoneLabel:"DropZone",selectPlaceholder:"בחר פריט",tableResizer:"שינוי גודל"};var Zs={};Zs={colorSwatchPicker:"Uzorci boja",dropzoneLabel:"Zona spuštanja",selectPlaceholder:"Odaberite stavku",tableResizer:"Promjena veličine"};var Ys={};Ys={colorSwatchPicker:"Színtárak",dropzoneLabel:"DropZone",selectPlaceholder:"Válasszon ki egy elemet",tableResizer:"Átméretező"};var Xs={};Xs={colorSwatchPicker:"Campioni di colore",dropzoneLabel:"Zona di rilascio",selectPlaceholder:"Seleziona un elemento",tableResizer:"Ridimensionamento"};var Js={};Js={colorSwatchPicker:"カラースウォッチ",dropzoneLabel:"ドロップゾーン",selectPlaceholder:"項目を選択",tableResizer:"サイズ変更ツール"};var Qs={};Qs={colorSwatchPicker:"색상 견본",dropzoneLabel:"드롭 영역",selectPlaceholder:"항목 선택",tableResizer:"크기 조정기"};var ec={};ec={colorSwatchPicker:"Spalvų pavyzdžiai",dropzoneLabel:"„DropZone“",selectPlaceholder:"Pasirinkite elementą",tableResizer:"Dydžio keitiklis"};var tc={};tc={colorSwatchPicker:"Krāsu paraugi",dropzoneLabel:"DropZone",selectPlaceholder:"Izvēlēties vienumu",tableResizer:"Izmēra mainītājs"};var nc={};nc={colorSwatchPicker:"Fargekart",dropzoneLabel:"Droppsone",selectPlaceholder:"Velg et element",tableResizer:"Størrelsesendrer"};var lc={};lc={colorSwatchPicker:"kleurstalen",dropzoneLabel:"DropZone",selectPlaceholder:"Selecteer een item",tableResizer:"Resizer"};var rc={};rc={colorSwatchPicker:"Próbki kolorów",dropzoneLabel:"Strefa upuszczania",selectPlaceholder:"Wybierz element",tableResizer:"Zmiana rozmiaru"};var oc={};oc={colorSwatchPicker:"Amostras de cores",dropzoneLabel:"DropZone",selectPlaceholder:"Selecione um item",tableResizer:"Redimensionador"};var ic={};ic={colorSwatchPicker:"Amostras de cores",dropzoneLabel:"DropZone",selectPlaceholder:"Selecione um item",tableResizer:"Redimensionador"};var uc={};uc={colorSwatchPicker:"Specimene de culoare",dropzoneLabel:"Zonă de plasare",selectPlaceholder:"Selectați un element",tableResizer:"Instrument de redimensionare"};var ac={};ac={colorSwatchPicker:"Цветовые образцы",dropzoneLabel:"DropZone",selectPlaceholder:"Выберите элемент",tableResizer:"Средство изменения размера"};var sc={};sc={colorSwatchPicker:"Vzorkovníky farieb",dropzoneLabel:"DropZone",selectPlaceholder:"Vyberte položku",tableResizer:"Nástroj na zmenu veľkosti"};var cc={};cc={colorSwatchPicker:"Barvne palete",dropzoneLabel:"DropZone",selectPlaceholder:"Izberite element",tableResizer:"Spreminjanje velikosti"};var dc={};dc={colorSwatchPicker:"Uzorci boje",dropzoneLabel:"DropZone",selectPlaceholder:"Izaberite stavku",tableResizer:"Promena veličine"};var fc={};fc={colorSwatchPicker:"Färgrutor",dropzoneLabel:"DropZone",selectPlaceholder:"Välj en artikel",tableResizer:"Storleksändrare"};var pc={};pc={colorSwatchPicker:"Renk örnekleri",dropzoneLabel:"Bırakma Bölgesi",selectPlaceholder:"Bir öğe seçin",tableResizer:"Yeniden boyutlandırıcı"};var bc={};bc={colorSwatchPicker:"Зразки кольорів",dropzoneLabel:"DropZone",selectPlaceholder:"Виберіть елемент",tableResizer:"Засіб змінення розміру"};var hc={};hc={colorSwatchPicker:"颜色色板",dropzoneLabel:"放置区域",selectPlaceholder:"选择一个项目",tableResizer:"尺寸调整器"};var mc={};mc={colorSwatchPicker:"色票",dropzoneLabel:"放置區",selectPlaceholder:"選取項目",tableResizer:"大小調整器"};var gc={};gc={"ar-AE":Ls,"bg-BG":zs,"cs-CZ":Ns,"da-DK":Os,"de-DE":Vs,"el-GR":js,"en-US":_s,"es-ES":Hs,"et-EE":Ws,"fi-FI":Us,"fr-FR":Gs,"he-IL":qs,"hr-HR":Zs,"hu-HU":Ys,"it-IT":Xs,"ja-JP":Js,"ko-KR":Qs,"lt-LT":ec,"lv-LV":tc,"nb-NO":nc,"nl-NL":lc,"pl-PL":rc,"pt-BR":oc,"pt-PT":ic,"ro-RO":uc,"ru-RU":ac,"sk-SK":sc,"sl-SI":cc,"sr-SP":dc,"sv-SE":fc,"tr-TR":pc,"uk-UA":bc,"zh-CN":hc,"zh-TW":mc};const qe=s.createContext({}),qr=s.createContext(null),_m=s.forwardRef(function(e,n){let{render:l}=s.useContext(qr);return g.createElement(g.Fragment,null,l(e,n))});function Zr(t,e){var o;let n=t==null?void 0:t.renderDropIndicator,l=(o=t==null?void 0:t.isVirtualDragging)==null?void 0:o.call(t),r=s.useCallback(i=>{if(l||e!=null&&e.isDropTarget(i))return n?n(i):g.createElement(_m,{target:i})},[e==null?void 0:e.target,l,n]);return t!=null&&t.useDropIndicator?r:void 0}function yc(t,e,n){var o,i,u;let l=t.focusedKey,r=null;if((o=e==null?void 0:e.isVirtualDragging)!=null&&o.call(e)&&((i=n==null?void 0:n.target)==null?void 0:i.type)==="item"&&(r=n.target.key,n.target.dropPosition==="after")){let a=n.collection.getKeyAfter(r),c=null;if(a!=null){let f=((u=n.collection.getItem(r))==null?void 0:u.level)??0;for(;a!=null;){let d=n.collection.getItem(a);if(!d)break;if(d.type!=="item"){a=n.collection.getKeyAfter(a);continue}if((d.level??0)<=f)break;c=a,a=n.collection.getKeyAfter(a)}}r=a??c??r}return s.useMemo(()=>new Set([l,r].filter(a=>a!=null)),[l,r])}const dl=new WeakMap;function Hm(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}function $c(t,e){let n=dl.get(t);if(!n)throw new Error("Unknown list");return`${n.id}-option-${Hm(e)}`}function Wm(t,e,n){let l=ie(t,{labelable:!0}),r=t.selectionBehavior||"toggle",o=t.orientation||"vertical",i=t.linkBehavior||(r==="replace"?"action":"override");r==="toggle"&&i==="action"&&(i="override");let{listProps:u}=dm({...t,ref:n,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,linkBehavior:i}),{focusWithinProps:a}=ll({onFocusWithin:t.onFocus,onBlurWithin:t.onBlur,onFocusWithinChange:t.onFocusChange}),c=$e(t.id);dl.set(e,{id:c,shouldUseVirtualFocus:t.shouldUseVirtualFocus,shouldSelectOnPressUp:t.shouldSelectOnPressUp,shouldFocusOnHover:t.shouldFocusOnHover,isVirtualized:t.isVirtualized,onAction:t.onAction,linkBehavior:i,UNSTABLE_itemBehavior:t.UNSTABLE_itemBehavior});let{labelProps:f,fieldProps:d}=Au({...t,id:c,labelElementType:"span"});return{labelProps:f,listBoxProps:G(l,a,e.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},{role:"listbox","aria-orientation":o,...G(d,u)})}}function Um(t,e,n){var z,B;let{key:l}=t,r=dl.get(e),o=t.isDisabled??e.selectionManager.isDisabled(l),i=t.isSelected??e.selectionManager.isSelected(l),u=t.shouldSelectOnPressUp??(r==null?void 0:r.shouldSelectOnPressUp),a=t.shouldFocusOnHover??(r==null?void 0:r.shouldFocusOnHover),c=t.shouldUseVirtualFocus??(r==null?void 0:r.shouldUseVirtualFocus),f=t.isVirtualized??(r==null?void 0:r.isVirtualized),d=on(),b=on(),p={role:"option","aria-disabled":o||void 0,"aria-selected":e.selectionManager.selectionMode!=="none"?i:void 0,"aria-label":t["aria-label"],"aria-labelledby":d,"aria-describedby":b},h=e.collection.getItem(l);if(f){let N=Number(h==null?void 0:h.index);p["aria-posinset"]=Number.isNaN(N)?void 0:N+1,p["aria-setsize"]=As(e.collection)}let $=r!=null&&r.onAction?()=>{var N;return(N=r==null?void 0:r.onAction)==null?void 0:N.call(r,l)}:void 0,y=$c(e,l),{itemProps:m,isPressed:v,isFocused:E,hasAction:C,allowsSelection:R}=jr({selectionManager:e.selectionManager,key:l,ref:n,shouldSelectOnPressUp:u,allowsDifferentPressOrigin:u&&a,isVirtualized:f,shouldUseVirtualFocus:c,isDisabled:o,onAction:$||(z=h==null?void 0:h.props)!=null&&z.onAction?dt((B=h==null?void 0:h.props)==null?void 0:B.onAction,$):void 0,linkBehavior:r==null?void 0:r.linkBehavior,UNSTABLE_itemBehavior:r==null?void 0:r.UNSTABLE_itemBehavior,id:y}),{hoverProps:A}=He({isDisabled:o||!a,onHoverStart(){Ft()||(e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(l))}}),K=ie(h==null?void 0:h.props);delete K.id;let P=eu(h==null?void 0:h.props);return{optionProps:{...p,...G(K,m,A,P),id:y},labelProps:{id:d},descriptionProps:{id:b},isFocused:E,isFocusVisible:E&&e.selectionManager.isFocused&&Ft(),isSelected:i,isDisabled:o,isPressed:v,allowsSelection:R,hasAction:C}}function Gm(t){let{heading:e,"aria-label":n}=t,l=$e();return{itemProps:{role:"presentation"},headingProps:e?{id:l,role:"presentation",onMouseDown:r=>{r.preventDefault()}}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":e?l:void 0}}}class ar{constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let n=i=>{if(this.keyMap.set(i.key,i),i.childNodes&&i.type==="section")for(let u of i.childNodes)n(u)};for(let i of e)n(i);let l=null,r=0,o=0;for(let[i,u]of this.keyMap)l?(l.nextKey=i,u.prevKey=l.key):(this.firstKey=i,u.prevKey=void 0),u.type==="item"&&(u.index=r++),(u.type==="section"||u.type==="item")&&o++,l=u,l.nextKey=void 0;this._size=o,this.lastKey=(l==null?void 0:l.key)??null}*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);return n?n.prevKey??null:null}getKeyAfter(e){let n=this.keyMap.get(e);return n?n.nextKey??null:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)??null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}getChildren(e){let n=this.keyMap.get(e);return(n==null?void 0:n.childNodes)||[]}}function vc(t){let{filter:e,layoutDelegate:n}=t,l=Hr(t),r=s.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),o=s.useCallback(c=>e?new ar(e(c)):new ar(c),[e]),i=s.useMemo(()=>({suppressTextValueWarning:t.suppressTextValueWarning}),[t.suppressTextValueWarning]),u=Bs(t,o,i),a=s.useMemo(()=>new cl(u,l,{layoutDelegate:n}),[u,l,n]);return xc(u,a),{collection:u,disabledKeys:r,selectionManager:a}}function qm(t,e){let n=s.useMemo(()=>e?t.collection.filter(e):t.collection,[t.collection,e]),l=t.selectionManager.withCollection(n);return xc(n,l),{collection:n,selectionManager:l,disabledKeys:t.disabledKeys}}function xc(t,e){const n=s.useRef(null);s.useEffect(()=>{if(e.focusedKey!=null&&!t.getItem(e.focusedKey)&&n.current){let l=n.current.getKeyAfter(e.focusedKey),r=null;for(;l!=null;){let o=t.getItem(l);if(o&&o.type==="item"&&!e.isDisabled(l)){r=l;break}l=n.current.getKeyAfter(l)}if(r==null)for(l=n.current.getKeyBefore(e.focusedKey);l!=null;){let o=t.getItem(l);if(o&&o.type==="item"&&!e.isDisabled(l)){r=l;break}l=n.current.getKeyBefore(l)}e.setFocusedKey(r)}n.current=t},[t,e])}const fl=s.createContext(null),_t=s.createContext(null),Zm=s.forwardRef(function(e,n){[e,n]=xe(e,n,fl);let l=s.useContext(_t);return l?g.createElement(Cc,{state:l,props:e,listBoxRef:n}):g.createElement(zr,{content:g.createElement(xn,e)},r=>g.createElement(Ym,{props:e,listBoxRef:n,collection:r}))});function Ym({props:t,listBoxRef:e,collection:n}){t={...t,collection:n,children:null,items:null};let{layoutDelegate:l}=s.useContext(fe),r=vc({...t,layoutDelegate:l});return g.createElement(Cc,{state:r,props:t,listBoxRef:e})}function Cc({state:t,props:e,listBoxRef:n}){[e,n]=xe(e,n,rr);let{dragAndDropHooks:l,layout:r="stack",orientation:o="vertical",filter:i}=e,u=qm(t,i),{collection:a,selectionManager:c}=u,f=!!(l!=null&&l.useDraggableCollectionState),d=!!(l!=null&&l.useDroppableCollectionState),{direction:b}=Re(),{disabledBehavior:p,disabledKeys:h}=c,$=En({usage:"search",sensitivity:"base"}),{isVirtualized:y,layoutDelegate:m,dropTargetDelegate:v,CollectionRoot:E}=s.useContext(fe),C=s.useMemo(()=>e.keyboardDelegate||new sl({collection:a,collator:$,ref:n,disabledKeys:h,disabledBehavior:p,layout:r,orientation:o,direction:b,layoutDelegate:m}),[a,$,n,p,h,o,b,e.keyboardDelegate,r,m]),{listBoxProps:R}=Wm({...e,shouldSelectOnPressUp:f||e.shouldSelectOnPressUp,keyboardDelegate:C,isVirtualized:y},u,n);s.useRef(f),s.useRef(d),s.useEffect(()=>{},[f,d]);let A,K,P,z=!1,B=null,N=s.useRef(null);if(f&&l){A=l.useDraggableCollectionState({collection:a,selectionManager:c,preview:l.renderDragPreview?N:void 0}),l.useDraggableCollection({},A,n);let T=l.DragPreview;B=l.renderDragPreview?g.createElement(T,{ref:N},l.renderDragPreview):null}if(d&&l){K=l.useDroppableCollectionState({collection:a,selectionManager:c});let T=l.dropTargetDelegate||v||new l.ListDropTargetDelegate(a,n,{orientation:o,layout:r,direction:b});P=l.useDroppableCollection({keyboardDelegate:C,dropTargetDelegate:T},K,n),z=K.isDropTarget({type:"root"})}let{focusProps:U,isFocused:_,isFocusVisible:x}=je(),S=u.collection.size===0,I={isDropTarget:z,isEmpty:S,isFocused:_,isFocusVisible:x,layout:e.layout||"stack",orientation:o,state:u},w=ce({...e,children:void 0,defaultClassName:"react-aria-ListBox",values:I}),k=null;S&&e.renderEmptyState&&(k=g.createElement("div",{role:"option",style:{display:"contents"}},e.renderEmptyState(I)));let D=ie(e,{global:!0});return g.createElement(Mr,null,g.createElement(le.div,{...G(D,w,R,U,P==null?void 0:P.collectionProps),ref:n,slot:e.slot||void 0,onScroll:e.onScroll,"data-drop-target":z||void 0,"data-empty":S||void 0,"data-focused":_||void 0,"data-focus-visible":x||void 0,"data-layout":e.layout||"stack","data-orientation":o},g.createElement(_e,{values:[[fl,e],[_t,u],[qe,{dragAndDropHooks:l,dragState:A,dropState:K}],[tm,{elementType:"div"}],[qr,{render:Qm}],[Z4,{name:"ListBoxSection",render:Ec}]]},g.createElement(_a,null,g.createElement(E,{collection:a,scrollRef:n,persistedKeys:yc(c,l,K),renderDropIndicator:Zr(l,K)}))),k,B))}function Ec(t,e,n,l="react-aria-ListBoxSection"){let r=s.useContext(_t),{dragAndDropHooks:o,dropState:i}=s.useContext(qe),{CollectionBranch:u}=s.useContext(fe),[a,c]=Dr(),{headingProps:f,groupProps:d}=Gm({heading:c,"aria-label":t["aria-label"]??void 0}),b=ce({...t,id:void 0,children:void 0,defaultClassName:l,values:void 0}),p=ie(t,{global:!0});return delete p.id,g.createElement(le.section,{...G(p,b,d),ref:e},g.createElement(Q4.Provider,{value:{...f,ref:a}},g.createElement(u,{collection:r.collection,parent:n,renderDropIndicator:Zr(o,i)})))}const Xm=al(nr,Ec),Jm=vn(tr,function(e,n,l){let r=ke(n),o=s.useContext(_t),{dragAndDropHooks:i,dragState:u,dropState:a}=s.useContext(qe),c=u&&!(u.isDisabled||u.selectionManager.isDisabled(l.key)),{optionProps:f,labelProps:d,descriptionProps:b,...p}=Um({key:l.key,"aria-label":e==null?void 0:e["aria-label"]},o,r),{hoverProps:h,isHovered:$}=He({isDisabled:!p.allowsSelection&&!p.hasAction&&!c,onHoverStart:l.props.onHoverStart,onHoverChange:l.props.onHoverChange,onHoverEnd:l.props.onHoverEnd}),{keyboardProps:y}=Tr(e),{focusProps:m}=Ar(e),v=null;u&&i&&(v=i.useDraggableItem({key:l.key,hasAction:p.hasAction},u));let E=null;a&&i&&(E=i.useDroppableItem({target:{type:"item",key:l.key,dropPosition:"on"}},a,r));let C=u&&u.isDragging(l.key),R=ce({...e,id:void 0,children:e.children,defaultClassName:"react-aria-ListBoxItem",values:{...p,isHovered:$,selectionMode:o.selectionManager.selectionMode,selectionBehavior:o.selectionManager.selectionBehavior,allowsDragging:!!u,isDragging:C,isDropTarget:E==null?void 0:E.isDropTarget}});s.useEffect(()=>{l.textValue},[l.textValue]);let A=e.href?le.a:le.div,K=ie(e,{global:!0});return delete K.id,delete K.onClick,e.href&&f.tabIndex==null&&(f.tabIndex=-1),g.createElement(A,{...G(K,R,f,h,y,m,v==null?void 0:v.dragProps,E==null?void 0:E.dropProps),ref:r,"data-allows-dragging":!!u||void 0,"data-selected":p.isSelected||void 0,"data-disabled":p.isDisabled||void 0,"data-hovered":$||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":p.isFocusVisible||void 0,"data-pressed":p.isPressed||void 0,"data-dragging":C||void 0,"data-drop-target":(E==null?void 0:E.isDropTarget)||void 0,"data-selection-mode":o.selectionManager.selectionMode==="none"?void 0:o.selectionManager.selectionMode},g.createElement(_e,{values:[[Cn,{slots:{[mt]:d,label:d,description:b}}],[Ha,{isSelected:p.isSelected}]]},R.children))});function Qm(t,e){e=ke(e);let{dragAndDropHooks:n,dropState:l}=s.useContext(qe),{dropIndicatorProps:r,isHidden:o,isDropTarget:i}=n.useDropIndicator(t,l,e);return o?null:g.createElement(t3,{...t,dropIndicatorProps:r,isDropTarget:i,ref:e})}function e3(t,e){let{dropIndicatorProps:n,isDropTarget:l,...r}=t,o=ce({...r,defaultClassName:"react-aria-DropIndicator",values:{isDropTarget:l}});return g.createElement(g.Fragment,null,g.createElement(le.div,{...n,...o,role:"option",ref:e,"data-drop-target":l||void 0}))}const t3=s.forwardRef(e3);vn(qn,function(e,n,l){let r=s.useContext(_t),{isLoading:o,onLoadMore:i,scrollOffset:u,...a}=e,c=s.useRef(null),f=s.useMemo(()=>({onLoadMore:i,collection:r==null?void 0:r.collection,sentinelRef:c,scrollOffset:u}),[i,u,r==null?void 0:r.collection]);uu(f,c);let d=ce({...a,id:void 0,children:l.rendered,defaultClassName:"react-aria-ListBoxLoadingIndicator",values:void 0}),b={tabIndex:-1};return g.createElement(g.Fragment,null,g.createElement("div",{style:{position:"relative",width:0,height:0},inert:au(!0)},g.createElement("div",{"data-testid":"loadMoreSentinel",ref:c,style:{position:"absolute",height:1,width:1}})),o&&d.children&&g.createElement(g.Fragment,null,g.createElement(le.div,{...G(ie(e,{global:!0}),b),...d,role:"option",ref:n},d.children)))});function n3(t){let{description:e,errorMessage:n,isInvalid:l,validationState:r}=t,{labelProps:o,fieldProps:i}=Au(t),u=on([!!e,!!n,l,r]),a=on([!!e,!!n,l,r]);return i=G(i,{"aria-describedby":[u,a,t["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:o,fieldProps:i,descriptionProps:{id:u},errorMessageProps:{id:a}}}function wc(t,e,n){let{validationBehavior:l,focus:r}=t;ne(()=>{if(l==="native"&&(n!=null&&n.current)&&!n.current.disabled){let c=e.realtimeValidation.isInvalid?e.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(c),n.current.hasAttribute("title")||(n.current.title=""),e.realtimeValidation.isInvalid||e.updateValidation(r3(n.current))}});let o=s.useRef(!1),i=Ee(()=>{o.current||e.resetValidation()}),u=Ee(c=>{var d,b;e.displayValidation.isInvalid||e.commitValidation();let f=(d=n==null?void 0:n.current)==null?void 0:d.form;!c.defaultPrevented&&n&&f&&o3(f)===n.current&&(r?r():(b=n.current)==null||b.focus(),Th("keyboard")),c.preventDefault()}),a=Ee(()=>{e.commitValidation()});s.useEffect(()=>{let c=n==null?void 0:n.current;if(!c)return;let f=c.form,d=f==null?void 0:f.reset;return f&&(f.reset=()=>{o.current=!window.event||window.event.type==="message"&&j(window.event)instanceof MessagePort,d==null||d.call(f),o.current=!1}),c.addEventListener("invalid",u),c.addEventListener("change",a),f==null||f.addEventListener("reset",i),()=>{c.removeEventListener("invalid",u),c.removeEventListener("change",a),f==null||f.removeEventListener("reset",i),f&&(f.reset=d)}},[n,l])}function l3(t){let e=t.validity;return{badInput:e.badInput,customError:e.customError,patternMismatch:e.patternMismatch,rangeOverflow:e.rangeOverflow,rangeUnderflow:e.rangeUnderflow,stepMismatch:e.stepMismatch,tooLong:e.tooLong,tooShort:e.tooShort,typeMismatch:e.typeMismatch,valueMissing:e.valueMissing,valid:e.valid}}function r3(t){return{isInvalid:!t.validity.valid,validationDetails:l3(t),validationErrors:t.validationMessage?[t.validationMessage]:[]}}function o3(t){var e;for(let n=0;n{var v;(v=d.onClick)==null||v.call(d,m),vp(m,$,t.href,t.routerOptions)}})}}const u3=s.createContext(null),a3=s.forwardRef(function(e,n){[e,n]=xe(e,n,u3);let l=e.href&&!e.isDisabled?"a":"span",{linkProps:r,isPressed:o}=i3({...e,elementType:l},n),i=le[l],{hoverProps:u,isHovered:a}=He(e),{focusProps:c,isFocused:f,isFocusVisible:d}=je(),b=ce({...e,defaultClassName:"react-aria-Link",values:{isCurrent:!!e["aria-current"],isDisabled:e.isDisabled||!1,isPressed:o,isHovered:a,isFocused:f,isFocusVisible:d}}),p=ie(e,{global:!0});return delete p.onClick,g.createElement(i,{ref:n,slot:e.slot||void 0,...G(p,b,r,u,c),"data-focused":f||void 0,"data-hovered":a||void 0,"data-pressed":o||void 0,"data-focus-visible":d||void 0,"data-current":!!e["aria-current"]||void 0,"data-disabled":e.isDisabled||void 0},b.children)}),Sc=s.createContext({}),Pi=({children:t,className:e,...n})=>{const l=g.useMemo(()=>uh(),[]);return M.jsx(Sc,{value:{slots:l},children:M.jsx(a3,{...n,className:me(e,l==null?void 0:l.base()),children:r=>M.jsx(M.Fragment,{children:typeof t=="function"?t(r):t})})})},s3=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(Sc);return M.jsx(Se.span,{className:de(l==null?void 0:l.icon,e),"data-default-icon":_u(!t),"data-slot":"link-icon",...n,children:t??M.jsx(Gh,{"data-slot":"link-default-icon"})})},h0=Object.assign(Pi,{Root:Pi,Icon:s3});function c3(t={}){let{isReadOnly:e}=t,[n,l]=Ct(t.isSelected,t.defaultSelected||!1,t.onChange),[r]=s.useState(n);function o(u){e||l(u)}function i(){e||l(!n)}return{isSelected:n,defaultSelected:t.defaultSelected??r,setSelected:o,toggle:i}}const d3=s.createContext({}),f3="__button_group_child",Ai=({children:t,className:e,fullWidth:n,isDisabled:l,isIconOnly:r,size:o,slot:i,style:u,variant:a,[f3]:c,...f})=>{const d=s.useContext(d3),b=c===!0,p=o??(b?d==null?void 0:d.size:void 0),h=a??(b?d==null?void 0:d.variant:void 0),$=l??(b?d==null?void 0:d.isDisabled:void 0),y=n??(b?d==null?void 0:d.fullWidth:void 0),m=Qb({fullWidth:y,isIconOnly:r,size:p,variant:h});return M.jsx(Kr,{className:me(e,m),"data-slot":"button",isDisabled:$,slot:i,style:u,...f,children:v=>typeof t=="function"?t(v):t})},m0=Object.assign(Ai,{Root:Ai}),Ht=s.createContext({}),Ti=({children:t,className:e,variant:n="default",...l})=>{const r=g.useMemo(()=>eh({variant:n}),[n]),o=M.jsx(Se.div,{className:r.base({className:e}),"data-slot":"card",...l,children:t});return M.jsx(Ht,{value:{slots:r},children:n==="transparent"?o:M.jsx(Hu,{value:{variant:n},children:o})})},p3=({className:t,...e})=>{const{slots:n}=s.useContext(Ht);return M.jsx(Se.div,{className:de(n==null?void 0:n.header,t),"data-slot":"card-header",...e})},b3=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(Ht);return M.jsx(Se.h3,{className:de(l==null?void 0:l.title,e),"data-slot":"card-title",...n,children:t})},h3=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(Ht);return M.jsx(Se.p,{className:de(l==null?void 0:l.description,e),"data-slot":"card-description",...n,children:t})},m3=({className:t,...e})=>{const{slots:n}=s.useContext(Ht);return M.jsx(Se.div,{className:de(n==null?void 0:n.content,t),"data-slot":"card-content",...e})},g3=({className:t,...e})=>{const{slots:n}=s.useContext(Ht);return M.jsx(Se.div,{className:de(n==null?void 0:n.footer,t),"data-slot":"card-footer",...e})},g0=Object.assign(Ti,{Root:Ti,Header:p3,Title:b3,Description:h3,Content:m3,Footer:g3}),y3=new WeakMap;function $3(t=!0){let[e,n]=s.useState(t),l=s.useRef(!1),r=s.useCallback(o=>{l.current=!0,n(!!o)},[]);return ne(()=>{l.current||n(!1)},[]),[r,e]}function Bi(t=!0){let e=$e(),[n,l]=$3(t);return{id:l?e:void 0,ref:n}}const Dc={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},kc={...Dc,customError:!0,valid:!1},At={isInvalid:!1,validationDetails:Dc,validationErrors:[]},v3=s.createContext({}),bn="__reactAriaFormValidationState";function Yr(t){if(t[bn]){let{realtimeValidation:e,displayValidation:n,updateValidation:l,resetValidation:r,commitValidation:o}=t[bn];return{realtimeValidation:e,displayValidation:n,updateValidation:l,resetValidation:r,commitValidation:o}}return x3(t)}function x3(t){let{isInvalid:e,validationState:n,name:l,value:r,builtinValidation:o,validate:i,validationBehavior:u="aria"}=t;n&&(e||(e=n==="invalid"));let a=e!==void 0?{isInvalid:e,validationErrors:[],validationDetails:kc}:null,c=s.useMemo(()=>{if(!i||r==null)return null;let B=C3(i,r);return Ki(B)},[i,r]);o!=null&&o.validationDetails.valid&&(o=void 0);let f=s.useContext(v3),d=s.useMemo(()=>l?Array.isArray(l)?l.flatMap(B=>sr(f[B])):sr(f[l]):[],[f,l]),[b,p]=s.useState(f),[h,$]=s.useState(!1);f!==b&&(p(f),$(!1));let y=s.useMemo(()=>Ki(h?[]:d),[h,d]),m=s.useRef(At),[v,E]=s.useState(At),C=s.useRef(At),R=()=>{if(!A)return;K(!1);let B=c||o||m.current;Ml(B,C.current)||(C.current=B,E(B))},[A,K]=s.useState(!1);return s.useEffect(R),{realtimeValidation:a||y||c||o||At,displayValidation:u==="native"?a||y||v:a||y||c||o||v,updateValidation(B){u==="aria"&&!Ml(v,B)?E(B):m.current=B},resetValidation(){let B=At;Ml(B,C.current)||(C.current=B,E(B)),u==="native"&&K(!1),$(!0)},commitValidation(){u==="native"&&K(!0),$(!0)}}}function sr(t){return t?Array.isArray(t)?t:[t]:[]}function C3(t,e){if(typeof t=="function"){let n=t(e);if(n&&typeof n!="boolean")return sr(n)}return[]}function Ki(t){return t.length?{isInvalid:!0,validationErrors:t,validationDetails:kc}:null}function Ml(t,e){return t===e?!0:!!t&&!!e&&t.isInvalid===e.isInvalid&&t.validationErrors.length===e.validationErrors.length&&t.validationErrors.every((n,l)=>n===e.validationErrors[l])&&Object.entries(t.validationDetails).every(([n,l])=>e.validationDetails[n]===l)}function E3(t,e,n){let{isDisabled:l=!1,isReadOnly:r=!1,value:o,name:i,form:u,children:a,isRequired:c,validationBehavior:f="aria","aria-label":d,"aria-labelledby":b,"aria-describedby":p,onPressStart:h,onPressEnd:$,onPressChange:y,onPress:m,onPressUp:v,onClick:E}=t,C=Yr({...t,value:e.isSelected}),{isInvalid:R,validationErrors:A,validationDetails:K}=C.displayValidation;wc(t,C,n);let P=D=>{D.stopPropagation(),e.setSelected(j(D).checked)},{pressProps:z,isPressed:B}=lt({onPressStart:h,onPressEnd:$,onPressChange:y,onPress:m,onPressUp:v,onClick:E,isDisabled:l}),[N,U]=s.useState(!1),{pressProps:_}=lt({onPressStart(D){if(D.pointerType==="keyboard"||D.pointerType==="virtual"){D.continuePropagation();return}h==null||h(D),y==null||y(!0),U(!0)},onPressEnd(D){if(D.pointerType==="keyboard"||D.pointerType==="virtual"){D.continuePropagation();return}$==null||$(D),y==null||y(!1),U(!1)},onPressUp(D){if(D.pointerType==="keyboard"||D.pointerType==="virtual"){D.continuePropagation();return}v==null||v(D)},onClick:E,onPress(D){var Z;if(D.pointerType==="keyboard"||D.pointerType==="virtual"){D.continuePropagation();return}m==null||m(D),e.toggle(),(Z=n.current)==null||Z.focus();let{[bn]:T}=t,{commitValidation:O}=T||C;O()},isDisabled:l||r}),{focusableProps:x}=jt(t,n),S=G(z,x),I=ie(t,{labelable:!0});xr(n,e.defaultSelected,e.setSelected);let w=Bi(),k=Bi();return{labelProps:G(_,{onClick:D=>D.preventDefault()}),inputProps:G(I,{checked:e.isSelected,"aria-required":c&&f==="aria"||void 0,required:c&&f==="native","aria-invalid":R||t.validationState==="invalid"||void 0,"aria-errormessage":t["aria-errormessage"],"aria-controls":t["aria-controls"],"aria-readonly":r||void 0,"aria-describedby":[w.id,k.id,p].filter(Boolean).join(" ")||void 0,onChange:P,disabled:l,...o==null?{}:{value:o},name:i,form:u,type:"checkbox",...S}),descriptionProps:w,errorMessageProps:k,isSelected:e.isSelected,isPressed:B||N,isDisabled:l,isReadOnly:r,isInvalid:R||t.validationState==="invalid",validationErrors:A,validationDetails:K}}function Pc(t,e,n){let{labelProps:l,inputProps:r,descriptionProps:o,errorMessageProps:i,isSelected:u,isPressed:a,isDisabled:c,isReadOnly:f,isInvalid:d,validationErrors:b,validationDetails:p}=E3(t,e,n),{isIndeterminate:h}=t;return s.useEffect(()=>{n.current&&(n.current.indeterminate=!!h)}),{labelProps:G(l,s.useMemo(()=>({onMouseDown:$=>$.preventDefault()}),[])),inputProps:r,descriptionProps:o,errorMessageProps:i,isSelected:u,isPressed:a,isDisabled:c,isReadOnly:f,isInvalid:d,validationErrors:b,validationDetails:p}}const w3=typeof document<"u"?g.useInsertionEffect??g.useLayoutEffect:()=>{};function Ac(t,e,n){let[l,r]=s.useState(t||e),o=s.useRef(l),i=s.useRef(t!==void 0),u=t!==void 0;s.useEffect(()=>{i.current,i.current=u},[u]);let a=u?t:l;w3(()=>{o.current=a});let[,c]=s.useReducer(()=>({}),{}),f=s.useCallback((d,...b)=>{let p=typeof d=="function"?d(o.current):d;Object.is(o.current,p)||(o.current=p,r(p),c(),n==null||n(p,...b))},[n]);return[a,f]}function S3(t={}){let{isReadOnly:e}=t,[n,l]=Ac(t.isSelected,t.defaultSelected||!1,t.onChange),[r]=s.useState(n);function o(u){e||l(u)}function i(){e||l(!n)}return{isSelected:n,defaultSelected:t.defaultSelected??r,setSelected:o,toggle:i}}function D3(t,e,n){const l=S3({isReadOnly:t.isReadOnly||e.isReadOnly,isSelected:e.isSelected(t.value),defaultSelected:e.defaultValue.includes(t.value),onChange($){$?e.addValue(t.value):e.removeValue(t.value),t.onChange&&t.onChange($)}});let{name:r,form:o,descriptionId:i,errorMessageId:u,validationBehavior:a}=y3.get(e);a=t.validationBehavior??a;let{realtimeValidation:c}=Yr({...t,value:l.isSelected,name:void 0,validationBehavior:"aria"}),f=s.useRef(At),d=()=>{e.setInvalid(t.value,c.isInvalid?c:f.current)};s.useEffect(d);let b=e.realtimeValidation.isInvalid?e.realtimeValidation:c,p=a==="native"?e.displayValidation:b,h=Pc({...t,isReadOnly:t.isReadOnly||e.isReadOnly,isDisabled:t.isDisabled||e.isDisabled,name:t.name||r,form:t.form||o,isRequired:t.isRequired??e.isRequired,validationBehavior:a,[bn]:{realtimeValidation:b,displayValidation:p,resetValidation:e.resetValidation,commitValidation:e.commitValidation,updateValidation($){f.current=$,d()}}},l,n);return{...h,inputProps:{...h.inputProps,"aria-describedby":[h.inputProps["aria-describedby"],e.isInvalid?u:null,i].filter(Boolean).join(" ")||void 0}}}const Xr=s.createContext(null),Tc=s.createContext(null),k3=s.createContext(null),Bc=s.createContext(null);function P3(t,e){let{validationBehavior:n}=el(Gr)||{},l=t.validationBehavior??n??"native",r=s.useContext(k3),o=ke(s.useMemo(()=>ft(e,t.inputRef!==void 0?t.inputRef:null),[e,t.inputRef])),i={...kr(t),children:typeof t.children=="function"?!0:t.children,value:t.value,validationBehavior:l};return[r?D3(i,r,o):Pc(i,c3(t),o),o]}const y0=s.forwardRef(function(e,n){let{inputRef:l=null,...r}=e;[e,n]=xe(r,n,Xr);let[o,i]=P3(e,l);return g.createElement(Bc.Provider,{value:{...o,inputRef:i,defaultClassName:"react-aria-Checkbox",isIndeterminate:e.isIndeterminate,isRequired:e.isRequired}},g.createElement(A3,{...e,ref:n}))}),A3=s.forwardRef(function(e,n){let{labelProps:l,inputProps:r,isSelected:o,isDisabled:i,isReadOnly:u,isPressed:a,isInvalid:c,inputRef:f,defaultClassName:d,isIndeterminate:b,isRequired:p}=s.useContext(Bc),{isFocused:h,isFocusVisible:$,focusProps:y}=je(),m=i||u,{hoverProps:v,isHovered:E}=He({...e,isDisabled:m}),C=ce({...e,defaultClassName:d,values:{isSelected:o,isIndeterminate:b||!1,isPressed:a,isHovered:E,isFocused:h,isFocusVisible:$,isDisabled:i,isReadOnly:u,isInvalid:c,isRequired:p||!1}}),R=ie(e,{global:!0});return delete R.id,delete R.onClick,g.createElement(le.label,{...G(R,l,v,C),ref:n,slot:e.slot||void 0,"data-selected":o||void 0,"data-indeterminate":b||void 0,"data-pressed":a||void 0,"data-hovered":E||void 0,"data-focused":h||void 0,"data-focus-visible":$||void 0,"data-disabled":i||void 0,"data-readonly":u||void 0,"data-invalid":c||void 0,"data-required":p||void 0},g.createElement(Ka,{elementType:"span"},g.createElement("input",{...G(r,y),ref:f})),C.children)}),Kc=s.createContext({}),Ri=({children:t,className:e,color:n,size:l,variant:r,...o})=>{const i=g.useMemo(()=>th({color:n,size:l,variant:r}),[n,l,r]),u=g.useMemo(()=>typeof t=="string"||typeof t=="number"?M.jsx(Rc,{children:t}):t,[t]);return M.jsx(Kc,{value:{slots:i},children:M.jsx(Se.span,{...o,className:de(i.base,e),"data-slot":"chip",children:u})})},Rc=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(Kc);return M.jsx(Se.span,{className:de(l==null?void 0:l.label,e),"data-slot":"chip-label",...n,children:t})},$0=Object.assign(Ri,{Root:Ri,Label:Rc});function T3(t){let{onMoveStart:e,onMove:n,onMoveEnd:l}=t,r=s.useRef({didMove:!1,lastPosition:null,id:null}),{addGlobalListener:o,removeGlobalListener:i}=hn(),u=s.useCallback((b,p,h,$)=>{h===0&&$===0||(r.current.didMove||(r.current.didMove=!0,e==null||e({type:"movestart",pointerType:p,shiftKey:b.shiftKey,metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey})),n==null||n({type:"move",pointerType:p,deltaX:h,deltaY:$,shiftKey:b.shiftKey,metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey}))},[e,n,r]),a=Ee(u),c=s.useCallback((b,p)=>{Gl(),r.current.didMove&&(l==null||l({type:"moveend",pointerType:p,shiftKey:b.shiftKey,metaKey:b.metaKey,ctrlKey:b.ctrlKey,altKey:b.altKey}))},[l,r]),f=Ee(c);return{moveProps:s.useMemo(()=>{let b={},p=()=>{Ou(),r.current.didMove=!1};{let $=m=>{var v,E;if(m.pointerId===r.current.id){let C=m.pointerType||"mouse";a(m,C,m.pageX-(((v=r.current.lastPosition)==null?void 0:v.pageX)??0),m.pageY-(((E=r.current.lastPosition)==null?void 0:E.pageY)??0)),r.current.lastPosition={pageX:m.pageX,pageY:m.pageY}}},y=m=>{if(m.pointerId===r.current.id){let v=m.pointerType||"mouse";f(m,v),r.current.id=null;let E=we(j(m));i(E,"pointermove",$,!1),i(E,"pointerup",y,!1),i(E,"pointercancel",y,!1)}};b.onPointerDown=m=>{if(m.button===0&&r.current.id==null){p(),m.stopPropagation(),m.preventDefault(),r.current.lastPosition={pageX:m.pageX,pageY:m.pageY},r.current.id=m.pointerId;let v=we(j(m));o(v,"pointermove",$,!1),o(v,"pointerup",y,!1),o(v,"pointercancel",y,!1)}}}let h=($,y,m)=>{p(),a($,"keyboard",y,m),f($,"keyboard")};return b.onKeyDown=$=>{switch($.key){case"Left":case"ArrowLeft":$.preventDefault(),$.stopPropagation(),h($,-1,0);break;case"Right":case"ArrowRight":$.preventDefault(),$.stopPropagation(),h($,1,0);break;case"Up":case"ArrowUp":$.preventDefault(),$.stopPropagation(),h($,0,-1);break;case"Down":case"ArrowDown":$.preventDefault(),$.stopPropagation(),h($,0,1);break}},b},[o,i,r])}}const pl=s.createContext({});let B3=t=>{let{onHoverStart:e,onHoverChange:n,onHoverEnd:l,...r}=t;return r};const K3=gn(function(e,n){[e,n]=xe(e,n,pl);let{hoverProps:l,isHovered:r}=He({...e,isDisabled:e.disabled}),{isFocused:o,isFocusVisible:i,focusProps:u}=je({isTextInput:!0,autoFocus:e.autoFocus}),a=!!e["aria-invalid"]&&e["aria-invalid"]!=="false",c=ce({...e,values:{isHovered:r,isFocused:o,isFocusVisible:i,isDisabled:e.disabled||!1,isInvalid:a},defaultClassName:"react-aria-Input"});return g.createElement(le.input,{...G(B3(e),u,l),...c,ref:n,"data-focused":o||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":i||void 0,"data-invalid":a||void 0})});function Mc(t,e){let{inputElementType:n="input",isDisabled:l=!1,isRequired:r=!1,isReadOnly:o=!1,type:i="text",validationBehavior:u="aria"}=t,[a,c]=Ac(t.value,t.defaultValue||"",t.onChange),{focusableProps:f}=jt(t,e),d=Yr({...t,value:a}),{isInvalid:b,validationErrors:p,validationDetails:h}=d.displayValidation,{labelProps:$,fieldProps:y,descriptionProps:m,errorMessageProps:v}=n3({...t,isInvalid:b,errorMessage:t.errorMessage||p}),E=ie(t,{labelable:!0});const C={type:i,pattern:t.pattern};let[R]=s.useState(a);return xr(e,t.defaultValue??R,c),wc(t,d,e),{labelProps:$,inputProps:G(E,n==="input"?C:void 0,{disabled:l,readOnly:o,required:r&&u==="native","aria-required":r&&u==="aria"||void 0,"aria-invalid":b||void 0,"aria-errormessage":t["aria-errormessage"],"aria-activedescendant":t["aria-activedescendant"],"aria-autocomplete":t["aria-autocomplete"],"aria-haspopup":t["aria-haspopup"],"aria-controls":t["aria-controls"],value:a,onChange:A=>c(j(A).value),autoComplete:t.autoComplete,autoCapitalize:t.autoCapitalize,maxLength:t.maxLength,minLength:t.minLength,name:t.name,form:t.form,placeholder:t.placeholder,inputMode:t.inputMode,autoCorrect:t.autoCorrect,spellCheck:t.spellCheck,[parseInt(g.version,10)>=17?"enterKeyHint":"enterkeyhint"]:t.enterKeyHint,onCopy:t.onCopy,onCut:t.onCut,onPaste:t.onPaste,onCompositionEnd:t.onCompositionEnd,onCompositionStart:t.onCompositionStart,onCompositionUpdate:t.onCompositionUpdate,onSelect:t.onSelect,onBeforeInput:t.onBeforeInput,onInput:t.onInput,...f,...y}),descriptionProps:m,errorMessageProps:v,isInvalid:b,validationErrors:p,validationDetails:h}}var Ic={};Ic={buttonLabel:"عرض المقترحات",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} خيار`,other:()=>`${e.number(t.optionCount)} خيارات`})} متاحة.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`المجموعة المدخلة ${t.groupTitle}, مع ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} خيار`,other:()=>`${e.number(t.groupCount)} خيارات`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", محدد",other:""},t.isSelected)}`,listboxLabel:"مقترحات",selectedAnnouncement:t=>`${t.optionText}، محدد`};var Fc={};Fc={buttonLabel:"Покажи предложения",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} опция`,other:()=>`${e.number(t.optionCount)} опции`})} на разположение.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Въведена група ${t.groupTitle}, с ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} опция`,other:()=>`${e.number(t.groupCount)} опции`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", избрани",other:""},t.isSelected)}`,listboxLabel:"Предложения",selectedAnnouncement:t=>`${t.optionText}, избрани`};var Lc={};Lc={buttonLabel:"Zobrazit doporučení",countAnnouncement:(t,e)=>`K dispozici ${e.plural(t.optionCount,{one:()=>`je ${e.number(t.optionCount)} možnost`,other:()=>`jsou/je ${e.number(t.optionCount)} možnosti/-í`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Zadaná skupina „${t.groupTitle}“ ${e.plural(t.groupCount,{one:()=>`s ${e.number(t.groupCount)} možností`,other:()=>`se ${e.number(t.groupCount)} možnostmi`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:" (vybráno)",other:""},t.isSelected)}`,listboxLabel:"Návrhy",selectedAnnouncement:t=>`${t.optionText}, vybráno`};var zc={};zc={buttonLabel:"Vis forslag",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} mulighed tilgængelig`,other:()=>`${e.number(t.optionCount)} muligheder tilgængelige`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Angivet gruppe ${t.groupTitle}, med ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} mulighed`,other:()=>`${e.number(t.groupCount)} muligheder`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valgt",other:""},t.isSelected)}`,listboxLabel:"Forslag",selectedAnnouncement:t=>`${t.optionText}, valgt`};var Nc={};Nc={buttonLabel:"Empfehlungen anzeigen",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} Option`,other:()=>`${e.number(t.optionCount)} Optionen`})} verfügbar.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Eingetretene Gruppe ${t.groupTitle}, mit ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} Option`,other:()=>`${e.number(t.groupCount)} Optionen`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", ausgewählt",other:""},t.isSelected)}`,listboxLabel:"Empfehlungen",selectedAnnouncement:t=>`${t.optionText}, ausgewählt`};var Oc={};Oc={buttonLabel:"Προβολή προτάσεων",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} επιλογή`,other:()=>`${e.number(t.optionCount)} επιλογές `})} διαθέσιμες.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Εισαγμένη ομάδα ${t.groupTitle}, με ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} επιλογή`,other:()=>`${e.number(t.groupCount)} επιλογές`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", επιλεγμένο",other:""},t.isSelected)}`,listboxLabel:"Προτάσεις",selectedAnnouncement:t=>`${t.optionText}, επιλέχθηκε`};var Vc={};Vc={focusAnnouncement:(t,e)=>`${e.select({true:()=>`Entered group ${t.groupTitle}, with ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} option`,other:()=>`${e.number(t.groupCount)} options`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selected",other:""},t.isSelected)}`,countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} option`,other:()=>`${e.number(t.optionCount)} options`})} available.`,selectedAnnouncement:t=>`${t.optionText}, selected`,buttonLabel:"Show suggestions",listboxLabel:"Suggestions"};var jc={};jc={buttonLabel:"Mostrar sugerencias",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opción`,other:()=>`${e.number(t.optionCount)} opciones`})} disponible(s).`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Se ha unido al grupo ${t.groupTitle}, con ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opción`,other:()=>`${e.number(t.groupCount)} opciones`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", seleccionado",other:""},t.isSelected)}`,listboxLabel:"Sugerencias",selectedAnnouncement:t=>`${t.optionText}, seleccionado`};var _c={};_c={buttonLabel:"Kuva soovitused",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} valik`,other:()=>`${e.number(t.optionCount)} valikud`})} saadaval.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Sisestatud rühm ${t.groupTitle}, valikuga ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} valik`,other:()=>`${e.number(t.groupCount)} valikud`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valitud",other:""},t.isSelected)}`,listboxLabel:"Soovitused",selectedAnnouncement:t=>`${t.optionText}, valitud`};var Hc={};Hc={buttonLabel:"Näytä ehdotukset",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} vaihtoehto`,other:()=>`${e.number(t.optionCount)} vaihtoehdot`})} saatavilla.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Mentiin ryhmään ${t.groupTitle}, ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} vaihtoehdon`,other:()=>`${e.number(t.groupCount)} vaihtoehdon`})} kanssa.`,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valittu",other:""},t.isSelected)}`,listboxLabel:"Ehdotukset",selectedAnnouncement:t=>`${t.optionText}, valittu`};var Wc={};Wc={buttonLabel:"Afficher les suggestions",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} option`,other:()=>`${e.number(t.optionCount)} options`})} disponible(s).`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Groupe ${t.groupTitle} rejoint, avec ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} option`,other:()=>`${e.number(t.groupCount)} options`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", sélectionné(s)",other:""},t.isSelected)}`,listboxLabel:"Suggestions",selectedAnnouncement:t=>`${t.optionText}, sélectionné`};var Uc={};Uc={buttonLabel:"הצג הצעות",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`אפשרות ${e.number(t.optionCount)}`,other:()=>`${e.number(t.optionCount)} אפשרויות`})} במצב זמין.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`נכנס לקבוצה ${t.groupTitle}, עם ${e.plural(t.groupCount,{one:()=>`אפשרות ${e.number(t.groupCount)}`,other:()=>`${e.number(t.groupCount)} אפשרויות`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", נבחר",other:""},t.isSelected)}`,listboxLabel:"הצעות",selectedAnnouncement:t=>`${t.optionText}, נבחר`};var Gc={};Gc={buttonLabel:"Prikaži prijedloge",countAnnouncement:(t,e)=>`Dostupno još: ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcija`,other:()=>`${e.number(t.optionCount)} opcije/a`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Unesena skupina ${t.groupTitle}, s ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opcijom`,other:()=>`${e.number(t.groupCount)} opcije/a`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", odabranih",other:""},t.isSelected)}`,listboxLabel:"Prijedlozi",selectedAnnouncement:t=>`${t.optionText}, odabrano`};var qc={};qc={buttonLabel:"Javaslatok megjelenítése",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} lehetőség`,other:()=>`${e.number(t.optionCount)} lehetőség`})} áll rendelkezésre.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Belépett a(z) ${t.groupTitle} csoportba, amely ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} lehetőséget`,other:()=>`${e.number(t.groupCount)} lehetőséget`})} tartalmaz. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", kijelölve",other:""},t.isSelected)}`,listboxLabel:"Javaslatok",selectedAnnouncement:t=>`${t.optionText}, kijelölve`};var Zc={};Zc={buttonLabel:"Mostra suggerimenti",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opzione disponibile`,other:()=>`${e.number(t.optionCount)} opzioni disponibili`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Ingresso nel gruppo ${t.groupTitle}, con ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opzione`,other:()=>`${e.number(t.groupCount)} opzioni`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selezionato",other:""},t.isSelected)}`,listboxLabel:"Suggerimenti",selectedAnnouncement:t=>`${t.optionText}, selezionato`};var Yc={};Yc={buttonLabel:"候補を表示",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} 個のオプション`,other:()=>`${e.number(t.optionCount)} 個のオプション`})}を利用できます。`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`入力されたグループ ${t.groupTitle}、${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} 個のオプション`,other:()=>`${e.number(t.groupCount)} 個のオプション`})}を含む。`,other:""},t.isGroupChange)}${t.optionText}${e.select({true:"、選択済み",other:""},t.isSelected)}`,listboxLabel:"候補",selectedAnnouncement:t=>`${t.optionText}、選択済み`};var Xc={};Xc={buttonLabel:"제안 사항 표시",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)}개 옵션`,other:()=>`${e.number(t.optionCount)}개 옵션`})}을 사용할 수 있습니다.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`입력한 그룹 ${t.groupTitle}, ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)}개 옵션`,other:()=>`${e.number(t.groupCount)}개 옵션`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", 선택됨",other:""},t.isSelected)}`,listboxLabel:"제안",selectedAnnouncement:t=>`${t.optionText}, 선택됨`};var Jc={};Jc={buttonLabel:"Rodyti pasiūlymus",countAnnouncement:(t,e)=>`Yra ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} parinktis`,other:()=>`${e.number(t.optionCount)} parinktys (-ių)`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Įvesta grupė ${t.groupTitle}, su ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} parinktimi`,other:()=>`${e.number(t.groupCount)} parinktimis (-ių)`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", pasirinkta",other:""},t.isSelected)}`,listboxLabel:"Pasiūlymai",selectedAnnouncement:t=>`${t.optionText}, pasirinkta`};var Qc={};Qc={buttonLabel:"Rādīt ieteikumus",countAnnouncement:(t,e)=>`Pieejamo opciju skaits: ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcija`,other:()=>`${e.number(t.optionCount)} opcijas`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Ievadīta grupa ${t.groupTitle}, ar ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opciju`,other:()=>`${e.number(t.groupCount)} opcijām`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", atlasīta",other:""},t.isSelected)}`,listboxLabel:"Ieteikumi",selectedAnnouncement:t=>`${t.optionText}, atlasīta`};var ed={};ed={buttonLabel:"Vis forslag",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} alternativ`,other:()=>`${e.number(t.optionCount)} alternativer`})} finnes.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Angitt gruppe ${t.groupTitle}, med ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} alternativ`,other:()=>`${e.number(t.groupCount)} alternativer`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valgt",other:""},t.isSelected)}`,listboxLabel:"Forslag",selectedAnnouncement:t=>`${t.optionText}, valgt`};var td={};td={buttonLabel:"Suggesties weergeven",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} optie`,other:()=>`${e.number(t.optionCount)} opties`})} beschikbaar.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Groep ${t.groupTitle} ingevoerd met ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} optie`,other:()=>`${e.number(t.groupCount)} opties`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", geselecteerd",other:""},t.isSelected)}`,listboxLabel:"Suggesties",selectedAnnouncement:t=>`${t.optionText}, geselecteerd`};var nd={};nd={buttonLabel:"Wyświetlaj sugestie",countAnnouncement:(t,e)=>`dostępna/dostępne(-nych) ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcja`,other:()=>`${e.number(t.optionCount)} opcje(-i)`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Dołączono do grupy ${t.groupTitle}, z ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opcją`,other:()=>`${e.number(t.groupCount)} opcjami`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", wybrano",other:""},t.isSelected)}`,listboxLabel:"Sugestie",selectedAnnouncement:t=>`${t.optionText}, wybrano`};var ld={};ld={buttonLabel:"Mostrar sugestões",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opção`,other:()=>`${e.number(t.optionCount)} opções`})} disponível.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Grupo inserido ${t.groupTitle}, com ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opção`,other:()=>`${e.number(t.groupCount)} opções`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selecionado",other:""},t.isSelected)}`,listboxLabel:"Sugestões",selectedAnnouncement:t=>`${t.optionText}, selecionado`};var rd={};rd={buttonLabel:"Apresentar sugestões",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opção`,other:()=>`${e.number(t.optionCount)} opções`})} disponível.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Grupo introduzido ${t.groupTitle}, com ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opção`,other:()=>`${e.number(t.groupCount)} opções`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selecionado",other:""},t.isSelected)}`,listboxLabel:"Sugestões",selectedAnnouncement:t=>`${t.optionText}, selecionado`};var od={};od={buttonLabel:"Afișare sugestii",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opțiune`,other:()=>`${e.number(t.optionCount)} opțiuni`})} disponibile.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Grup ${t.groupTitle} introdus, cu ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opțiune`,other:()=>`${e.number(t.groupCount)} opțiuni`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", selectat",other:""},t.isSelected)}`,listboxLabel:"Sugestii",selectedAnnouncement:t=>`${t.optionText}, selectat`};var id={};id={buttonLabel:"Показать предложения",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} параметр`,other:()=>`${e.number(t.optionCount)} параметров`})} доступно.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Введенная группа ${t.groupTitle}, с ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} параметром`,other:()=>`${e.number(t.groupCount)} параметрами`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", выбранными",other:""},t.isSelected)}`,listboxLabel:"Предложения",selectedAnnouncement:t=>`${t.optionText}, выбрано`};var ud={};ud={buttonLabel:"Zobraziť návrhy",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} možnosť`,other:()=>`${e.number(t.optionCount)} možnosti/-í`})} k dispozícii.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Zadaná skupina ${t.groupTitle}, s ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} možnosťou`,other:()=>`${e.number(t.groupCount)} možnosťami`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", vybraté",other:""},t.isSelected)}`,listboxLabel:"Návrhy",selectedAnnouncement:t=>`${t.optionText}, vybraté`};var ad={};ad={buttonLabel:"Prikaži predloge",countAnnouncement:(t,e)=>`Na voljo je ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcija`,other:()=>`${e.number(t.optionCount)} opcije`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Vnesena skupina ${t.groupTitle}, z ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opcija`,other:()=>`${e.number(t.groupCount)} opcije`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", izbrano",other:""},t.isSelected)}`,listboxLabel:"Predlogi",selectedAnnouncement:t=>`${t.optionText}, izbrano`};var sd={};sd={buttonLabel:"Prikaži predloge",countAnnouncement:(t,e)=>`Dostupno još: ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} opcija`,other:()=>`${e.number(t.optionCount)} opcije/a`})}.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Unesena grupa ${t.groupTitle}, s ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} opcijom`,other:()=>`${e.number(t.groupCount)} optione/a`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", izabranih",other:""},t.isSelected)}`,listboxLabel:"Predlozi",selectedAnnouncement:t=>`${t.optionText}, izabrano`};var cd={};cd={buttonLabel:"Visa förslag",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} alternativ`,other:()=>`${e.number(t.optionCount)} alternativ`})} tillgängliga.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Ingick i gruppen ${t.groupTitle} med ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} alternativ`,other:()=>`${e.number(t.groupCount)} alternativ`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", valda",other:""},t.isSelected)}`,listboxLabel:"Förslag",selectedAnnouncement:t=>`${t.optionText}, valda`};var dd={};dd={buttonLabel:"Önerileri göster",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} seçenek`,other:()=>`${e.number(t.optionCount)} seçenekler`})} kullanılabilir.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Girilen grup ${t.groupTitle}, ile ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} seçenek`,other:()=>`${e.number(t.groupCount)} seçenekler`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", seçildi",other:""},t.isSelected)}`,listboxLabel:"Öneriler",selectedAnnouncement:t=>`${t.optionText}, seçildi`};var fd={};fd={buttonLabel:"Показати пропозиції",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} параметр`,other:()=>`${e.number(t.optionCount)} параметри(-ів)`})} доступно.`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`Введена група ${t.groupTitle}, з ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} параметр`,other:()=>`${e.number(t.groupCount)} параметри(-ів)`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", вибрано",other:""},t.isSelected)}`,listboxLabel:"Пропозиції",selectedAnnouncement:t=>`${t.optionText}, вибрано`};var pd={};pd={buttonLabel:"显示建议",countAnnouncement:(t,e)=>`有 ${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} 个选项`,other:()=>`${e.number(t.optionCount)} 个选项`})}可用。`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`进入了 ${t.groupTitle} 组,其中有 ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} 个选项`,other:()=>`${e.number(t.groupCount)} 个选项`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", 已选择",other:""},t.isSelected)}`,listboxLabel:"建议",selectedAnnouncement:t=>`${t.optionText}, 已选择`};var bd={};bd={buttonLabel:"顯示建議",countAnnouncement:(t,e)=>`${e.plural(t.optionCount,{one:()=>`${e.number(t.optionCount)} 選項`,other:()=>`${e.number(t.optionCount)} 選項`})} 可用。`,focusAnnouncement:(t,e)=>`${e.select({true:()=>`輸入的群組 ${t.groupTitle}, 有 ${e.plural(t.groupCount,{one:()=>`${e.number(t.groupCount)} 選項`,other:()=>`${e.number(t.groupCount)} 選項`})}. `,other:""},t.isGroupChange)}${t.optionText}${e.select({true:", 已選取",other:""},t.isSelected)}`,listboxLabel:"建議",selectedAnnouncement:t=>`${t.optionText}, 已選取`};var hd={};hd={"ar-AE":Ic,"bg-BG":Fc,"cs-CZ":Lc,"da-DK":zc,"de-DE":Nc,"el-GR":Oc,"en-US":Vc,"es-ES":jc,"et-EE":_c,"fi-FI":Hc,"fr-FR":Wc,"he-IL":Uc,"hr-HR":Gc,"hu-HU":qc,"it-IT":Zc,"ja-JP":Yc,"ko-KR":Xc,"lt-LT":Jc,"lv-LV":Qc,"nb-NO":ed,"nl-NL":td,"pl-PL":nd,"pt-BR":ld,"pt-PT":rd,"ro-RO":od,"ru-RU":id,"sk-SK":ud,"sl-SI":ad,"sr-SP":sd,"sv-SE":cd,"tr-TR":dd,"uk-UA":fd,"zh-CN":pd,"zh-TW":bd};function R3(t){return t&&t.__esModule?t.default:t}function M3(t,e){let{buttonRef:n,popoverRef:l,inputRef:r,listBoxRef:o,keyboardDelegate:i,layoutDelegate:u,shouldFocusWrap:a,isReadOnly:c,isDisabled:f}=t,d=s.useRef(null);n=n??d;let b=Ne(R3(hd),"@react-aria/combobox"),{menuTriggerProps:p,menuProps:h}=om({type:"listbox",isDisabled:f||c},e,n);dl.set(e,{id:h.id});let{collection:$}=e,{disabledKeys:y}=e.selectionManager,m=s.useMemo(()=>i||new sl({collection:$,disabledKeys:y,ref:o,layoutDelegate:u}),[i,u,$,y,o]),{collectionProps:v}=Vr({selectionManager:e.selectionManager,keyboardDelegate:m,disallowTypeAhead:!0,disallowEmptySelection:!0,shouldFocusWrap:a,ref:r,isVirtualized:!0}),E=Nt(),C=L=>{if(!L.nativeEvent.isComposing)switch(L.key){case"Enter":case"Tab":if(e.isOpen&&L.key==="Enter"&&L.preventDefault(),e.isOpen&&o.current&&e.selectionManager.focusedKey!=null){let Y=e.collection.getItem(e.selectionManager.focusedKey);if(Y!=null&&Y.props.href){let ue=o.current.querySelector(`[data-key="${CSS.escape(e.selectionManager.focusedKey.toString())}"]`);L.key==="Enter"&&ue instanceof HTMLAnchorElement&&E.open(ue,L,Y.props.href,Y.props.routerOptions),e.close();break}else if(Y!=null&&Y.props.onAction){Y.props.onAction(),e.close();break}}(L.key==="Enter"||e.isOpen)&&e.commit();break;case"Escape":(!e.selectionManager.isEmpty||e.inputValue===""||t.allowsCustomValue)&&L.continuePropagation(),e.revert();break;case"ArrowDown":e.open("first","manual");break;case"ArrowUp":e.open("last","manual");break;case"ArrowLeft":case"ArrowRight":e.selectionManager.setFocusedKey(null);break}},R=L=>{let Y=(n==null?void 0:n.current)&&n.current===L.relatedTarget,ue=te(l.current,L.relatedTarget);Y||ue||(t.onBlur&&t.onBlur(L),e.setFocused(!1))},A=L=>{e.isFocused||(t.onFocus&&t.onFocus(L),e.setFocused(!0))},K=I3([e.selectionManager.selectedKeys,e.selectionManager.selectionMode]),{isInvalid:P,validationErrors:z,validationDetails:B}=e.displayValidation,{labelProps:N,inputProps:U,descriptionProps:_,errorMessageProps:x}=Mc({...t,isRequired:t.selectionMode==="multiple"?t.isRequired&&e.selectionManager.isEmpty:t.isRequired,onChange:e.setInputValue,onKeyDown:c?t.onKeyDown:dt(e.isOpen&&v.onKeyDown,C,t.onKeyDown),onBlur:R,value:e.inputValue,defaultValue:e.defaultInputValue,onFocus:A,autoComplete:"off",validate:void 0,[bn]:e,"aria-describedby":[K,t["aria-describedby"]].filter(Boolean).join(" ")||void 0},r);xr(r,e.defaultValue,e.setValue);let S=L=>{var Y;L.pointerType==="touch"&&((Y=r.current)==null||Y.focus(),e.toggle(null,"manual"))},I=L=>{var Y;L.pointerType!=="touch"&&((Y=r.current)==null||Y.focus(),e.toggle(L.pointerType==="keyboard"||L.pointerType==="virtual"?"first":null,"manual"))},w=un({id:p.id,"aria-label":b.format("buttonLabel"),"aria-labelledby":t["aria-labelledby"]||N.id}),k=un({id:h.id,"aria-label":b.format("listboxLabel"),"aria-labelledby":t["aria-labelledby"]||N.id}),D=s.useRef(0),T=L=>{var wt,Sn;if(f||c)return;if(L.timeStamp-D.current<500){L.preventDefault(),(wt=r.current)==null||wt.focus();return}let Y=j(L).getBoundingClientRect(),ue=L.changedTouches[0],Ke=Math.ceil(Y.left+.5*Y.width),hl=Math.ceil(Y.top+.5*Y.height);ue.clientX===Ke&&ue.clientY===hl&&(L.preventDefault(),(Sn=r.current)==null||Sn.focus(),e.toggle(null,"manual"),D.current=L.timeStamp)},O=e.selectionManager.focusedKey!=null&&e.isOpen?e.collection.getItem(e.selectionManager.focusedKey):void 0,Z=(O==null?void 0:O.parentKey)??null,F=e.selectionManager.focusedKey??null,V=s.useRef(Z),q=s.useRef(F);s.useEffect(()=>{if(Fn()&&O!=null&&F!=null&&F!==q.current){let L=e.selectionManager.isSelected(F),Y=Z!=null?e.collection.getItem(Z):null,ue=(Y==null?void 0:Y["aria-label"])||(typeof(Y==null?void 0:Y.rendered)=="string"?Y.rendered:"")||"",Ke=b.format("focusAnnouncement",{isGroupChange:(Y&&Z!==V.current)??!1,groupTitle:ue,groupCount:Y?[...Ce(Y,e.collection)].length:0,optionText:O["aria-label"]||O.textValue||"",isSelected:L});gt(Ke)}V.current=Z,q.current=F});let Q=As(e.collection),J=s.useRef(Q),ge=s.useRef(e.isOpen);s.useEffect(()=>{let L=e.isOpen!==ge.current&&(e.selectionManager.focusedKey==null||Fn());if(e.isOpen&&(L||Q!==J.current)){let Y=b.format("countAnnouncement",{optionCount:Q});gt(Y)}J.current=Q,ge.current=e.isOpen});let Be=s.useRef(e.selectedKey);return s.useEffect(()=>{if(Fn()&&e.isFocused&&e.selectedItem&&e.selectedKey!==Be.current){let L=e.selectedItem["aria-label"]||e.selectedItem.textValue||"",Y=b.format("selectedAnnouncement",{optionText:L});gt(Y)}Be.current=e.selectedKey}),s.useEffect(()=>{if(e.isOpen)return Rr([r.current,l.current].filter(L=>L!=null))},[e.isOpen,r,l]),$r(()=>{!O&&r.current&&oe(re(r.current))===r.current&&Or(r.current,null)},[O]),Yt(o,"react-aria-item-action",e.isOpen?()=>{e.close()}:void 0),{labelProps:N,buttonProps:{...p,...w,excludeFromTabOrder:!0,preventFocusOnPress:!0,onPress:S,onPressStart:I,isDisabled:f||c},inputProps:G(U,{role:"combobox","aria-expanded":p["aria-expanded"],"aria-controls":e.isOpen?h.id:void 0,"aria-autocomplete":"list","aria-activedescendant":O?$c(e,O.key):void 0,onTouchEnd:T,autoCorrect:"off",spellCheck:"false"}),listBoxProps:G(h,k,{autoFocus:e.focusStrategy||!0,shouldUseVirtualFocus:!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,linkBehavior:"selection",UNSTABLE_itemBehavior:"action"}),valueProps:{id:K},descriptionProps:_,errorMessageProps:x,isInvalid:P,validationErrors:z,validationDetails:B}}function I3(t=[]){let e=$e(),[n,l]=s.useState(!0),[r,o]=s.useState(t);return r.some((i,u)=>!Object.is(i,t[u]))&&(l(!0),o(t)),s.useEffect(()=>{n&&!document.getElementById(e)&&l(!1)},[e,n,r]),n?e:void 0}function F3(t){var go;let{defaultFilter:e,menuTrigger:n="input",allowsEmptyCollection:l=!1,allowsCustomValue:r,shouldCloseOnBlur:o=!0,selectionMode:i="single"}=t,[u,a]=s.useState(!1),[c,f]=s.useState(!1),[d,b]=s.useState(null),p=s.useMemo(()=>t.defaultValue!==void 0?t.defaultValue:i==="single"?t.defaultSelectedKey??null:[],[t.defaultValue,t.defaultSelectedKey,i]),h=s.useMemo(()=>t.value!==void 0?t.value:i==="single"?t.selectedKey:void 0,[t.value,t.selectedKey,i]),[$,y]=Ct(h,p,t.onChange),m=i==="single"&&Array.isArray($)?$[0]:$,v=X=>{var se;if(i==="single"){let be=Array.isArray(X)?X[0]??null:X;y(be),be!==m&&((se=t.onSelectionChange)==null||se.call(t,be))}else{let be=[];Array.isArray(X)?be=X:X!=null&&(be=[X]),y(be)}},{collection:E,selectionManager:C,disabledKeys:R}=vc({...t,items:t.items??t.defaultItems,selectionMode:i,disallowEmptySelection:i==="single",allowDuplicateSelectionEvents:!0,selectedKeys:s.useMemo(()=>z3(m),[m]),onSelectionChange:X=>{var se;if(X!=="all")if(i==="single"){let be=X.values().next().value??null;be===m?((se=t.onSelectionChange)==null||se.call(t,be),Q(),F()):v(be)}else v([...X])}}),A=i==="single"?C.firstSelectedKey:null,K=s.useMemo(()=>[...C.selectedKeys].map(X=>E.getItem(X)).filter(X=>X!=null),[C.selectedKeys,E]),[P,z]=Ct(t.inputValue,Mi(t.defaultInputValue,A,E)||"",t.onInputChange),[B]=s.useState(m),[N]=s.useState(P),U=E,_=s.useMemo(()=>t.items!=null||!e?E:L3(E,P,e),[E,P,e,t.items]),[x,S]=s.useState(_),I=s.useRef("focus"),k=il({...t,onOpenChange:X=>{t.onOpenChange&&t.onOpenChange(X,X?I.current:void 0),C.setFocused(X),X||C.setFocusedKey(null)},isOpen:void 0,defaultOpen:void 0}),D=(X=null,se)=>{let be=se==="manual"||se==="focus"&&n==="focus";(l||_.size>0||be&&U.size>0||t.items)&&(be&&!k.isOpen&&t.items===void 0&&a(!0),I.current=se,b(X),k.open())},T=(X=null,se)=>{let be=se==="manual"||se==="focus"&&n==="focus";!(l||_.size>0||be&&U.size>0||t.items)&&!k.isOpen||(be&&!k.isOpen&&t.items===void 0&&a(!0),k.isOpen||(I.current=se),Z(X))},O=s.useCallback(()=>{S(u?U:_)},[u,U,_]),Z=s.useCallback((X=null)=>{k.isOpen&&O(),b(X),k.toggle()},[k,O]),F=s.useCallback(()=>{k.isOpen&&(O(),k.close())},[k,O]),[V,q]=s.useState(P),Q=()=>{var se;let X=A!=null?((se=E.getItem(A))==null?void 0:se.textValue)??"":"";q(X),z(X)},J=s.useRef(m),ge=s.useRef(A!=null?((go=E.getItem(A))==null?void 0:go.textValue)??"":"");s.useEffect(()=>{var se;c&&(_.size>0||l)&&!k.isOpen&&P!==V&&n!=="manual"&&D(null,"input"),!u&&!l&&k.isOpen&&_.size===0&&F(),m!=null&&m!==J.current&&i==="single"&&F(),P!==V&&(C.setFocusedKey(null),a(!1),i==="single"&&P===""&&(t.inputValue===void 0||h===void 0)&&v(null)),m!==J.current&&(t.inputValue===void 0||h===void 0)?Q():V!==P&&q(P);let X=A!=null?((se=E.getItem(A))==null?void 0:se.textValue)??"":"";!c&&A!=null&&t.inputValue===void 0&&A===J.current&&ge.current!==X&&(q(X),z(X)),J.current=m,ge.current=X});let Be=Om({...t,value:s.useMemo(()=>Array.isArray(m)&&m.length===0?null:{inputValue:P,value:m,selectedKey:A},[P,A,m])}),L=()=>{r&&A==null?Y():ue()},Y=()=>{if(i==="multiple"){q(P),F();return}let X=null;J.current=X,v(X),F()},ue=(X=!1)=>{var se,be,yo;if(h!==void 0&&t.inputValue!==void 0){let $o=A!=null?((se=E.getItem(A))==null?void 0:se.textValue)??"":"";(X||i==="multiple"||P!==$o)&&((be=t.onSelectionChange)==null||be.call(t,A),(yo=t.onChange)==null||yo.call(t,m)),q($o),F()}else Q(),F()};const Ke=()=>{var X;if(r){const se=A!=null?((X=E.getItem(A))==null?void 0:X.textValue)??"":"";P===se?ue():Y()}else ue()};let hl=()=>{k.isOpen&&C.focusedKey!=null?C.isSelected(C.focusedKey)&&i==="single"?ue(!0):C.select(C.focusedKey):Ke()},wt=s.useRef([P,m]),Sn=X=>{X?(wt.current=[P,m],n==="focus"&&!t.isReadOnly&&D(null,"focus")):(o&&Ke(),(P!==wt.current[0]||m!==wt.current[1])&&Be.commitValidation()),f(X)},ip=s.useMemo(()=>k.isOpen?u?U:_:x,[k.isOpen,U,_,u,x]),mo=t.defaultSelectedKey??(i==="single"?B:null);return{...Be,...k,focusStrategy:d,toggle:T,open:D,close:Ke,selectionManager:C,value:m,defaultValue:p??B,setValue:v,selectedKey:A,selectedItems:K,defaultSelectedKey:mo,setSelectedKey:v,disabledKeys:R,isFocused:c,setFocused:Sn,selectedItem:K[0]??null,collection:ip,inputValue:P,defaultInputValue:Mi(t.defaultInputValue,mo,E)??N,setInputValue:z,commit:hl,revert:L}}function L3(t,e,n){return new ar(md(t,t,e,n))}function md(t,e,n,l){let r=[];for(let o of e)if(o.type==="section"&&o.hasChildNodes){let i=md(t,Zn(o,t),n,l);[...i].some(u=>u.type==="item")&&r.push({...o,childNodes:i})}else o.type==="item"&&l(o.textValue,n)?r.push({...o}):o.type!=="item"&&r.push({...o});return r}function Mi(t,e,n){var l;return t==null&&e!=null?((l=n.getItem(e))==null?void 0:l.textValue)??"":t}function z3(t){if(t!==void 0)return t===null?[]:Array.isArray(t)?t:[t]}const N3=s.createContext(null),gd=s.createContext(null),O3=gn(function(e,n){[e,n]=xe(e,n,N3);let{children:l,isDisabled:r=!1,isInvalid:o=!1,isRequired:i=!1,isReadOnly:u=!1}=e,a=s.useMemo(()=>g.createElement(fl.Provider,{value:{items:e.items??e.defaultItems}},typeof l=="function"?l({isOpen:!1,isDisabled:r,isInvalid:o,isRequired:i,defaultChildren:null,isReadOnly:u}):l),[l,r,o,i,u,e.items,e.defaultItems]);return g.createElement(zr,{content:a},c=>g.createElement(j3,{props:e,collection:c,comboBoxRef:n}))}),V3=[tl,yn,pl,Ur,Cn];function j3({props:t,collection:e,comboBoxRef:n}){let{name:l,formValue:r="key",allowsCustomValue:o}=t;o&&(r="text");let{validationBehavior:i}=el(Gr)||{},u=t.validationBehavior??i??"native",{contains:a}=zm({sensitivity:"base"}),c=F3({...t,defaultFilter:t.defaultFilter||a,items:t.items,children:void 0,collection:e,validationBehavior:u}),f=s.useRef(null),d=s.useRef(null),b=s.useRef(null),p=s.useRef(null),h=s.useRef(null),[$,y]=Dr(!t["aria-label"]&&!t["aria-labelledby"]),{buttonProps:m,inputProps:v,listBoxProps:E,labelProps:C,descriptionProps:R,errorMessageProps:A,valueProps:K,...P}=M3({...kr(t),label:y,inputRef:d,buttonRef:f,listBoxRef:p,popoverRef:h,name:r==="text"?l:void 0,validationBehavior:u},c),[z,B]=s.useState(null),N=s.useCallback(()=>{var w;if(d.current&&!b.current){let k=(w=f.current)==null?void 0:w.getBoundingClientRect(),D=d.current.getBoundingClientRect(),T=k?Math.min(k.left,D.left):D.left,O=k?Math.max(k.right,D.right):D.right;B(O-T+"px")}},[f,d,B]);an({ref:d,onResize:N});let U=s.useMemo(()=>({get current(){return b.current||d.current}}),[b,d]),_=s.useMemo(()=>({isOpen:c.isOpen,isDisabled:t.isDisabled||!1,isInvalid:P.isInvalid||!1,isRequired:t.isRequired||!1,isReadOnly:t.isReadOnly||!1}),[c.isOpen,t.isDisabled,P.isInvalid,t.isRequired,t.isReadOnly]),x=ce({...t,values:_,defaultClassName:"react-aria-ComboBox"}),S=ie(t,{global:!0});delete S.id;let I=[];if(l&&r==="key"){let w=Array.isArray(c.value)?c.value:[c.value];w.length===0&&(w=[null]),I=w.map((k,D)=>g.createElement("input",{key:D,type:"hidden",name:l,form:t.form,value:k??""}))}return g.createElement(_e,{values:[[gd,c],[tl,{...C,ref:$}],[yn,{...m,ref:f,isPressed:c.isOpen}],[pl,{...v,ref:d}],[Et,c],[Fr,{ref:h,triggerRef:U,scrollRef:p,placement:"bottom start",isNonModal:!0,trigger:"ComboBox",style:{"--trigger-width":z},clearContexts:V3}],[fl,{...E,ref:p}],[_t,c],[Cn,{slots:{description:R,errorMessage:A}}],[Ur,{ref:b,isInvalid:P.isInvalid,isDisabled:t.isDisabled||!1}],[Ms,P],[_3,K]]},g.createElement(le.div,{...S,...x,ref:n,slot:t.slot||void 0,"data-focused":c.isFocused||void 0,"data-open":c.isOpen||void 0,"data-disabled":t.isDisabled||void 0,"data-readonly":t.isReadOnly||void 0,"data-invalid":P.isInvalid||void 0,"data-required":t.isRequired||void 0},x.children,I))}const _3=s.createContext(null),wn=s.createContext({}),Ii=({children:t,className:e,fullWidth:n,menuTrigger:l="focus",variant:r,...o})=>{const i=g.useMemo(()=>lh({fullWidth:n}),[n]);return M.jsx(wn,{value:{slots:i,variant:r},children:M.jsx(O3,{"data-slot":"combo-box",menuTrigger:l,...o,className:me(e,i==null?void 0:i.base()),children:u=>M.jsx(M.Fragment,{children:typeof t=="function"?t(u):t})})})},H3=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(wn),r=de(l==null?void 0:l.inputGroup,e);return M.jsx("div",{className:r,"data-slot":"combo-box-input-group",...n,children:t})},W3=({children:t,className:e,...n})=>{const{slots:l}=s.useContext(wn),r=s.useContext(gd);return M.jsx(Kr,{className:me(e,l==null?void 0:l.trigger()),"data-open":_u(r==null?void 0:r.isOpen),"data-slot":"combo-box-trigger",...n,children:t??M.jsx(Wh,{"data-slot":"combo-box-trigger-default-icon"})})},U3=({children:t,className:e,placement:n="bottom",...l})=>{const{slots:r}=s.useContext(wn);return M.jsx(Hu,{value:{variant:"default"},children:M.jsx(F4,{...l,className:me(e,r==null?void 0:r.popover()),"data-slot":"combo-box-popover",placement:n,children:t})})},v0=Object.assign(Ii,{Root:Ii,InputGroup:H3,Trigger:W3,Popover:U3}),G3=({...t})=>{const e=s.useId();return M.jsxs("svg",{"data-slot":"spinner-icon",viewBox:"0 0 24 24",...t,children:[M.jsxs("defs",{children:[M.jsxs("linearGradient",{id:`«data-slot-icon-def-1»-${e}`,x1:"50%",x2:"50%",y1:"5.271%",y2:"91.793%",children:[M.jsx("stop",{offset:"0%",stopColor:"currentColor"}),M.jsx("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:.55})]}),M.jsxs("linearGradient",{id:`«data-slot-icon-def-2»-${e}`,x1:"50%",x2:"50%",y1:"15.24%",y2:"87.15%",children:[M.jsx("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:0}),M.jsx("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:.55})]})]}),M.jsxs("g",{fill:"none",children:[M.jsx("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),M.jsx("path",{d:"M8.749.021a1.5 1.5 0 0 1 .497 2.958A7.5 7.5 0 0 0 3 10.375a7.5 7.5 0 0 0 7.5 7.5v3c-5.799 0-10.5-4.7-10.5-10.5C0 5.23 3.726.865 8.749.021",fill:`url(#«data-slot-icon-def-1»-${e})`,transform:"translate(1.5 1.625)"}),M.jsx("path",{d:"M15.392 2.673a1.5 1.5 0 0 1 2.119-.115A10.48 10.48 0 0 1 21 10.375c0 5.8-4.701 10.5-10.5 10.5v-3a7.5 7.5 0 0 0 5.007-13.084a1.5 1.5 0 0 1-.115-2.118",fill:`url(#«data-slot-icon-def-2»-${e})`,transform:"translate(1.5 1.625)"})]})]})},Fi=({className:t,color:e,size:n,...l})=>M.jsx(Se.span,{"data-slot":"spinner",...l,className:dh({className:t,color:e,size:n}),children:M.jsx(G3,{"aria-hidden":!0,"aria-label":"Loading",role:"presentation"})}),x0=Object.assign(Fi,{Root:Fi});function q3(t,e){let n=e==null?void 0:e.isDisabled,[l,r]=s.useState(!1);return ne(()=>{if(t!=null&&t.current&&!n){let o=()=>{if(t.current){let u=Fe(t.current,{tabbable:!0});r(!!u.nextNode())}};o();let i=new MutationObserver(o);return i.observe(t.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{i.disconnect()}}}),n?!1:l}var yd={};yd={deselectedItem:t=>`${t.item} غير المحدد`,longPressToSelect:"اضغط مطولًا للدخول إلى وضع التحديد.",select:"تحديد",selectedAll:"جميع العناصر المحددة.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"لم يتم تحديد عناصر",one:()=>`${e.number(t.count)} عنصر محدد`,other:()=>`${e.number(t.count)} عنصر محدد`})}.`,selectedItem:t=>`${t.item} المحدد`};var $d={};$d={deselectedItem:t=>`${t.item} не е избран.`,longPressToSelect:"Натиснете и задръжте за да влезете в избирателен режим.",select:"Изберете",selectedAll:"Всички елементи са избрани.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Няма избрани елементи",one:()=>`${e.number(t.count)} избран елемент`,other:()=>`${e.number(t.count)} избрани елементи`})}.`,selectedItem:t=>`${t.item} избран.`};var vd={};vd={deselectedItem:t=>`Položka ${t.item} není vybrána.`,longPressToSelect:"Dlouhým stisknutím přejdete do režimu výběru.",select:"Vybrat",selectedAll:"Vybrány všechny položky.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nevybrány žádné položky",one:()=>`Vybrána ${e.number(t.count)} položka`,other:()=>`Vybráno ${e.number(t.count)} položek`})}.`,selectedItem:t=>`Vybrána položka ${t.item}.`};var xd={};xd={deselectedItem:t=>`${t.item} ikke valgt.`,longPressToSelect:"Lav et langt tryk for at aktivere valgtilstand.",select:"Vælg",selectedAll:"Alle elementer valgt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ingen elementer valgt",one:()=>`${e.number(t.count)} element valgt`,other:()=>`${e.number(t.count)} elementer valgt`})}.`,selectedItem:t=>`${t.item} valgt.`};var Cd={};Cd={deselectedItem:t=>`${t.item} nicht ausgewählt.`,longPressToSelect:"Gedrückt halten, um Auswahlmodus zu öffnen.",select:"Auswählen",selectedAll:"Alle Elemente ausgewählt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Keine Elemente ausgewählt",one:()=>`${e.number(t.count)} Element ausgewählt`,other:()=>`${e.number(t.count)} Elemente ausgewählt`})}.`,selectedItem:t=>`${t.item} ausgewählt.`};var Ed={};Ed={deselectedItem:t=>`Δεν επιλέχθηκε το στοιχείο ${t.item}.`,longPressToSelect:"Πατήστε παρατεταμένα για να μπείτε σε λειτουργία επιλογής.",select:"Επιλογή",selectedAll:"Επιλέχθηκαν όλα τα στοιχεία.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Δεν επιλέχθηκαν στοιχεία",one:()=>`Επιλέχθηκε ${e.number(t.count)} στοιχείο`,other:()=>`Επιλέχθηκαν ${e.number(t.count)} στοιχεία`})}.`,selectedItem:t=>`Επιλέχθηκε το στοιχείο ${t.item}.`};var wd={};wd={deselectedItem:t=>`${t.item} not selected.`,select:"Select",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"No items selected",one:()=>`${e.number(t.count)} item selected`,other:()=>`${e.number(t.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:t=>`${t.item} selected.`,longPressToSelect:"Long press to enter selection mode."};var Sd={};Sd={deselectedItem:t=>`${t.item} no seleccionado.`,longPressToSelect:"Mantenga pulsado para abrir el modo de selección.",select:"Seleccionar",selectedAll:"Todos los elementos seleccionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ningún elemento seleccionado",one:()=>`${e.number(t.count)} elemento seleccionado`,other:()=>`${e.number(t.count)} elementos seleccionados`})}.`,selectedItem:t=>`${t.item} seleccionado.`};var Dd={};Dd={deselectedItem:t=>`${t.item} pole valitud.`,longPressToSelect:"Valikurežiimi sisenemiseks vajutage pikalt.",select:"Vali",selectedAll:"Kõik üksused valitud.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Üksusi pole valitud",one:()=>`${e.number(t.count)} üksus valitud`,other:()=>`${e.number(t.count)} üksust valitud`})}.`,selectedItem:t=>`${t.item} valitud.`};var kd={};kd={deselectedItem:t=>`Kohdetta ${t.item} ei valittu.`,longPressToSelect:"Siirry valintatilaan painamalla pitkään.",select:"Valitse",selectedAll:"Kaikki kohteet valittu.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ei yhtään kohdetta valittu",one:()=>`${e.number(t.count)} kohde valittu`,other:()=>`${e.number(t.count)} kohdetta valittu`})}.`,selectedItem:t=>`${t.item} valittu.`};var Pd={};Pd={deselectedItem:t=>`${t.item} non sélectionné.`,longPressToSelect:"Appuyez de manière prolongée pour passer en mode de sélection.",select:"Sélectionner",selectedAll:"Tous les éléments sélectionnés.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Aucun élément sélectionné",one:()=>`${e.number(t.count)} élément sélectionné`,other:()=>`${e.number(t.count)} éléments sélectionnés`})}.`,selectedItem:t=>`${t.item} sélectionné.`};var Ad={};Ad={deselectedItem:t=>`${t.item} לא נבחר.`,longPressToSelect:"הקשה ארוכה לכניסה למצב בחירה.",select:"בחר",selectedAll:"כל הפריטים נבחרו.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"לא נבחרו פריטים",one:()=>`פריט ${e.number(t.count)} נבחר`,other:()=>`${e.number(t.count)} פריטים נבחרו`})}.`,selectedItem:t=>`${t.item} נבחר.`};var Td={};Td={deselectedItem:t=>`Stavka ${t.item} nije odabrana.`,longPressToSelect:"Dugo pritisnite za ulazak u način odabira.",select:"Odaberite",selectedAll:"Odabrane su sve stavke.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nije odabrana nijedna stavka",one:()=>`Odabrana je ${e.number(t.count)} stavka`,other:()=>`Odabrano je ${e.number(t.count)} stavki`})}.`,selectedItem:t=>`Stavka ${t.item} je odabrana.`};var Bd={};Bd={deselectedItem:t=>`${t.item} nincs kijelölve.`,longPressToSelect:"Nyomja hosszan a kijelöléshez.",select:"Kijelölés",selectedAll:"Az összes elem kijelölve.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Egy elem sincs kijelölve",one:()=>`${e.number(t.count)} elem kijelölve`,other:()=>`${e.number(t.count)} elem kijelölve`})}.`,selectedItem:t=>`${t.item} kijelölve.`};var Kd={};Kd={deselectedItem:t=>`${t.item} non selezionato.`,longPressToSelect:"Premi a lungo per passare alla modalità di selezione.",select:"Seleziona",selectedAll:"Tutti gli elementi selezionati.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nessun elemento selezionato",one:()=>`${e.number(t.count)} elemento selezionato`,other:()=>`${e.number(t.count)} elementi selezionati`})}.`,selectedItem:t=>`${t.item} selezionato.`};var Rd={};Rd={deselectedItem:t=>`${t.item} が選択されていません。`,longPressToSelect:"長押しして選択モードを開きます。",select:"選択",selectedAll:"すべての項目を選択しました。",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"項目が選択されていません",one:()=>`${e.number(t.count)} 項目を選択しました`,other:()=>`${e.number(t.count)} 項目を選択しました`})}。`,selectedItem:t=>`${t.item} を選択しました。`};var Md={};Md={deselectedItem:t=>`${t.item}이(가) 선택되지 않았습니다.`,longPressToSelect:"선택 모드로 들어가려면 길게 누르십시오.",select:"선택",selectedAll:"모든 항목이 선택되었습니다.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"선택된 항목이 없습니다",one:()=>`${e.number(t.count)}개 항목이 선택되었습니다`,other:()=>`${e.number(t.count)}개 항목이 선택되었습니다`})}.`,selectedItem:t=>`${t.item}이(가) 선택되었습니다.`};var Id={};Id={deselectedItem:t=>`${t.item} nepasirinkta.`,longPressToSelect:"Norėdami įjungti pasirinkimo režimą, paspauskite ir palaikykite.",select:"Pasirinkti",selectedAll:"Pasirinkti visi elementai.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nepasirinktas nė vienas elementas",one:()=>`Pasirinktas ${e.number(t.count)} elementas`,other:()=>`Pasirinkta elementų: ${e.number(t.count)}`})}.`,selectedItem:t=>`Pasirinkta: ${t.item}.`};var Fd={};Fd={deselectedItem:t=>`Vienums ${t.item} nav atlasīts.`,longPressToSelect:"Ilgi turiet nospiestu. lai ieslēgtu atlases režīmu.",select:"Atlasīt",selectedAll:"Atlasīti visi vienumi.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nav atlasīts neviens vienums",one:()=>`Atlasīto vienumu skaits: ${e.number(t.count)}`,other:()=>`Atlasīto vienumu skaits: ${e.number(t.count)}`})}.`,selectedItem:t=>`Atlasīts vienums ${t.item}.`};var Ld={};Ld={deselectedItem:t=>`${t.item} er ikke valgt.`,longPressToSelect:"Bruk et langt trykk for å gå inn i valgmodus.",select:"Velg",selectedAll:"Alle elementer er valgt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Ingen elementer er valgt",one:()=>`${e.number(t.count)} element er valgt`,other:()=>`${e.number(t.count)} elementer er valgt`})}.`,selectedItem:t=>`${t.item} er valgt.`};var zd={};zd={deselectedItem:t=>`${t.item} niet geselecteerd.`,longPressToSelect:"Druk lang om de selectiemodus te openen.",select:"Selecteren",selectedAll:"Alle items geselecteerd.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Geen items geselecteerd",one:()=>`${e.number(t.count)} item geselecteerd`,other:()=>`${e.number(t.count)} items geselecteerd`})}.`,selectedItem:t=>`${t.item} geselecteerd.`};var Nd={};Nd={deselectedItem:t=>`Nie zaznaczono ${t.item}.`,longPressToSelect:"Naciśnij i przytrzymaj, aby wejść do trybu wyboru.",select:"Zaznacz",selectedAll:"Wszystkie zaznaczone elementy.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nie zaznaczono żadnych elementów",one:()=>`${e.number(t.count)} zaznaczony element`,other:()=>`${e.number(t.count)} zaznaczonych elementów`})}.`,selectedItem:t=>`Zaznaczono ${t.item}.`};var Od={};Od={deselectedItem:t=>`${t.item} não selecionado.`,longPressToSelect:"Mantenha pressionado para entrar no modo de seleção.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(t.count)} item selecionado`,other:()=>`${e.number(t.count)} itens selecionados`})}.`,selectedItem:t=>`${t.item} selecionado.`};var Vd={};Vd={deselectedItem:t=>`${t.item} não selecionado.`,longPressToSelect:"Prima continuamente para entrar no modo de seleção.",select:"Selecionar",selectedAll:"Todos os itens selecionados.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nenhum item selecionado",one:()=>`${e.number(t.count)} item selecionado`,other:()=>`${e.number(t.count)} itens selecionados`})}.`,selectedItem:t=>`${t.item} selecionado.`};var jd={};jd={deselectedItem:t=>`${t.item} neselectat.`,longPressToSelect:"Apăsați lung pentru a intra în modul de selectare.",select:"Selectare",selectedAll:"Toate elementele selectate.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Niciun element selectat",one:()=>`${e.number(t.count)} element selectat`,other:()=>`${e.number(t.count)} elemente selectate`})}.`,selectedItem:t=>`${t.item} selectat.`};var _d={};_d={deselectedItem:t=>`${t.item} не выбрано.`,longPressToSelect:"Нажмите и удерживайте для входа в режим выбора.",select:"Выбрать",selectedAll:"Выбраны все элементы.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Нет выбранных элементов",one:()=>`${e.number(t.count)} элемент выбран`,other:()=>`${e.number(t.count)} элементов выбрано`})}.`,selectedItem:t=>`${t.item} выбрано.`};var Hd={};Hd={deselectedItem:t=>`Nevybraté položky: ${t.item}.`,longPressToSelect:"Dlhším stlačením prejdite do režimu výberu.",select:"Vybrať",selectedAll:"Všetky vybraté položky.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Žiadne vybraté položky",one:()=>`${e.number(t.count)} vybratá položka`,other:()=>`Počet vybratých položiek:${e.number(t.count)}`})}.`,selectedItem:t=>`Vybraté položky: ${t.item}.`};var Wd={};Wd={deselectedItem:t=>`Element ${t.item} ni izbran.`,longPressToSelect:"Za izbirni način pritisnite in dlje časa držite.",select:"Izberite",selectedAll:"Vsi elementi so izbrani.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Noben element ni izbran",one:()=>`${e.number(t.count)} element je izbran`,other:()=>`${e.number(t.count)} elementov je izbranih`})}.`,selectedItem:t=>`Element ${t.item} je izbran.`};var Ud={};Ud={deselectedItem:t=>`${t.item} nije izabrano.`,longPressToSelect:"Dugo pritisnite za ulazak u režim biranja.",select:"Izaberite",selectedAll:"Izabrane su sve stavke.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Nije izabrana nijedna stavka",one:()=>`Izabrana je ${e.number(t.count)} stavka`,other:()=>`Izabrano je ${e.number(t.count)} stavki`})}.`,selectedItem:t=>`${t.item} je izabrano.`};var Gd={};Gd={deselectedItem:t=>`${t.item} ej markerat.`,longPressToSelect:"Tryck länge när du vill öppna väljarläge.",select:"Markera",selectedAll:"Alla markerade objekt.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Inga markerade objekt",one:()=>`${e.number(t.count)} markerat objekt`,other:()=>`${e.number(t.count)} markerade objekt`})}.`,selectedItem:t=>`${t.item} markerat.`};var qd={};qd={deselectedItem:t=>`${t.item} seçilmedi.`,longPressToSelect:"Seçim moduna girmek için uzun basın.",select:"Seç",selectedAll:"Tüm ögeler seçildi.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Hiçbir öge seçilmedi",one:()=>`${e.number(t.count)} öge seçildi`,other:()=>`${e.number(t.count)} öge seçildi`})}.`,selectedItem:t=>`${t.item} seçildi.`};var Zd={};Zd={deselectedItem:t=>`${t.item} не вибрано.`,longPressToSelect:"Виконайте довге натиснення, щоб перейти в режим вибору.",select:"Вибрати",selectedAll:"Усі елементи вибрано.",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"Жодних елементів не вибрано",one:()=>`${e.number(t.count)} елемент вибрано`,other:()=>`Вибрано елементів: ${e.number(t.count)}`})}.`,selectedItem:t=>`${t.item} вибрано.`};var Yd={};Yd={deselectedItem:t=>`未选择 ${t.item}。`,longPressToSelect:"长按以进入选择模式。",select:"选择",selectedAll:"已选择所有项目。",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"未选择项目",one:()=>`已选择 ${e.number(t.count)} 个项目`,other:()=>`已选择 ${e.number(t.count)} 个项目`})}。`,selectedItem:t=>`已选择 ${t.item}。`};var Xd={};Xd={deselectedItem:t=>`未選取「${t.item}」。`,longPressToSelect:"長按以進入選擇模式。",select:"選取",selectedAll:"已選取所有項目。",selectedCount:(t,e)=>`${e.plural(t.count,{"=0":"未選取任何項目",one:()=>`已選取 ${e.number(t.count)} 個項目`,other:()=>`已選取 ${e.number(t.count)} 個項目`})}。`,selectedItem:t=>`已選取「${t.item}」。`};var bl={};bl={"ar-AE":yd,"bg-BG":$d,"cs-CZ":vd,"da-DK":xd,"de-DE":Cd,"el-GR":Ed,"en-US":wd,"es-ES":Sd,"et-EE":Dd,"fi-FI":kd,"fr-FR":Pd,"he-IL":Ad,"hr-HR":Td,"hu-HU":Bd,"it-IT":Kd,"ja-JP":Rd,"ko-KR":Md,"lt-LT":Id,"lv-LV":Fd,"nb-NO":Ld,"nl-NL":zd,"pl-PL":Nd,"pt-BR":Od,"pt-PT":Vd,"ro-RO":jd,"ru-RU":_d,"sk-SK":Hd,"sl-SI":Wd,"sr-SP":Ud,"sv-SE":Gd,"tr-TR":qd,"uk-UA":Zd,"zh-CN":Yd,"zh-TW":Xd};function Z3(t){return t&&t.__esModule?t.default:t}function Y3(t,e){let{getRowText:n=u=>{var a,c,f;return((c=(a=e.collection).getTextValue)==null?void 0:c.call(a,u))??((f=e.collection.getItem(u))==null?void 0:f.textValue)}}=t,l=Ne(Z3(bl),"@react-aria/grid"),r=e.selectionManager.rawSelection,o=s.useRef(r),i=s.useCallback(()=>{var d;if(!e.selectionManager.isFocused||r===o.current){o.current=r;return}let u=Li(r,o.current),a=Li(o.current,r),c=e.selectionManager.selectionBehavior==="replace",f=[];if(e.selectionManager.selectedKeys.size===1&&c){let b=e.selectionManager.selectedKeys.keys().next().value;if(b!=null&&e.collection.getItem(b)){let p=n(b);p&&f.push(l.format("selectedItem",{item:p}))}}else if(u.size===1&&a.size===0){let b=u.keys().next().value;if(b!=null){let p=n(b);p&&f.push(l.format("selectedItem",{item:p}))}}else if(a.size===1&&u.size===0){let b=a.keys().next().value;if(b!=null&&e.collection.getItem(b)){let p=n(b);p&&f.push(l.format("deselectedItem",{item:p}))}}e.selectionManager.selectionMode==="multiple"&&(f.length===0||r==="all"||r.size>1||o.current==="all"||((d=o.current)==null?void 0:d.size)>1)&&f.push(r==="all"?l.format("selectedAll"):l.format("selectedCount",{count:r.size})),f.length>0&>(f.join(" ")),o.current=r},[r,e.selectionManager.selectedKeys,e.selectionManager.isFocused,e.selectionManager.selectionBehavior,e.selectionManager.selectionMode,e.collection,n,l]);$r(()=>{if(e.selectionManager.isFocused)i();else{let u=requestAnimationFrame(i);return()=>cancelAnimationFrame(u)}},[r,e.selectionManager.isFocused])}function Li(t,e){let n=new Set;if(t==="all"||e==="all")return n;for(let l of t.keys())e.has(l)||n.add(l);return n}function X3(t){return t&&t.__esModule?t.default:t}function J3(t){let e=Ne(X3(bl),"@react-aria/grid"),n=Nu(),l=(n==="pointer"||n==="virtual"||n==null)&&typeof window<"u"&&"ontouchstart"in window,r=s.useMemo(()=>{let i=t.selectionManager.selectionMode,u=t.selectionManager.selectionBehavior,a;return l&&(a=e.format("longPressToSelect")),u==="replace"&&i!=="none"&&t.hasItemActions?a:void 0},[t.selectionManager.selectionMode,t.selectionManager.selectionBehavior,t.hasItemActions,e,l]);return mn(r)}const Q3=s.createContext({}),eg=s.createContext(null),tg=gn(function(e,n){[e,n]=xe(e,n,eg);let{validationBehavior:l}=el(Gr)||{},r=e.validationBehavior??l??"native",o=s.useRef(null);[e,o]=xe(e,o,ja);let[i,u]=Dr(!e["aria-label"]&&!e["aria-labelledby"]),[a,c]=s.useState("input"),{labelProps:f,inputProps:d,descriptionProps:b,errorMessageProps:p,...h}=Mc({...kr(e),inputElementType:a,label:u,validationBehavior:r},o),$=s.useCallback(v=>{o.current=v,v&&c(v instanceof HTMLTextAreaElement?"textarea":"input")},[o]),y=ce({...e,values:{isDisabled:e.isDisabled||!1,isInvalid:h.isInvalid,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1},defaultClassName:"react-aria-TextField"}),m=ie(e,{global:!0});return delete m.id,g.createElement(le.div,{...m,...y,ref:n,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":h.isInvalid||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0},g.createElement(_e,{values:[[tl,{...f,ref:i}],[pl,{...d,ref:$}],[Q3,{...d,ref:$}],[Ur,{role:"presentation",isInvalid:h.isInvalid,isDisabled:e.isDisabled||!1}],[Cn,{slots:{description:b,errorMessage:p}}],[Ms,h]]},y.children))}),Jd=s.createContext({}),zi=({children:t,className:e,fullWidth:n,variant:l,...r})=>{const o=g.useMemo(()=>ph({fullWidth:n}),[n]);return M.jsx(tg,{"data-slot":"textfield",...r,className:me(e,o),children:i=>M.jsx(Jd,{value:{variant:l},children:M.jsx(M.Fragment,{children:typeof t=="function"?t(i):t})})})},Ni=({className:t,fullWidth:e,variant:n,...l})=>{const r=s.useContext(Jd),o=s.useContext(wn),i=n??r.variant??o.variant;return M.jsx(K3,{className:me(t,oh({fullWidth:e,variant:i})),"data-slot":"input",...l})},C0=Object.assign(Ni,{Root:Ni}),E0=Object.assign(zi,{Root:zi}),Oi=({children:t,className:e,isDisabled:n,isInvalid:l,isRequired:r,...o})=>M.jsx(yh,{className:ih({isRequired:r,isDisabled:n,isInvalid:l,className:e}),"data-slot":"label",...o,children:t}),w0=Object.assign(Oi,{Root:Oi}),Vi=({children:t,className:e,...n})=>M.jsx(nm,{className:rh({className:e}),"data-slot":"description",slot:"description",...n,children:t}),S0=Object.assign(Vi,{Root:Vi});function ng(t){return t&&t.__esModule?t.default:t}function lg(t,e){let{key:n}=t,l=e.selectionManager,r=$e(),o=!e.selectionManager.canSelectItem(n),i=e.selectionManager.isSelected(n),u=()=>l.toggleSelection(n);const a=Ne(ng(bl),"@react-aria/grid");return{checkboxProps:{id:r,"aria-label":a.format("select"),isSelected:i,isDisabled:o,onChange:u}}}const ji=10,_i=5;class rg{setup(e,n,l){this.delegate=e,this.state=n,this.direction=l}getDropTargetFromPoint(e,n,l){let r=this.delegate.getDropTargetFromPoint(e,n,l);return!r||r.type==="root"?r:this.resolveDropTarget(r,e,n,l)}resolveDropTarget(e,n,l,r){let o=this.pointerTracking,i=l-o.lastY,u=n-o.lastX,a=o.yDirection,c=o.xDirection;if(Math.abs(i)>_i&&(a=i>0?"down":"up",o.yDirection=a,o.lastY=l),Math.abs(u)>ji&&(c=u>0?"right":"left",o.xDirection=c,o.lastX=n),e.dropPosition==="before"){let b=this.state.collection.getKeyBefore(e.key);for(;b!=null;){let p=this.state.collection.getItem(b);if((p==null?void 0:p.type)==="item")break;b=(p==null?void 0:p.parentKey)??null}if(b!=null){let p={type:"item",key:b,dropPosition:"after"};r(p)&&(e=p)}}let f=this.getPotentialTargets(e,r);if(f.length===0)return{type:"root"};let d;return f.length>1?d=this.selectTarget(f,e,n,l,a,c):(d=f[0],o.boundaryContext=null),d}getPotentialTargets(e,n){if(e.dropPosition==="on")return[e];let l=e,r=this.state.collection,o=r.getItem(l.key);for(;o&&(o==null?void 0:o.type)!=="item"&&o.nextKey!=null;)l.key=o.nextKey,o=r.getItem(o.nextKey);let i=[l];if(o&&o.hasChildNodes&&this.state.expandedKeys.has(o.key)&&r.getChildren&&l.dropPosition==="after"){let c=o.firstChildKey!=null?r.getItem(o.firstChildKey):null;for(;c&&c.type!=="item";)c=c.nextKey!=null?r.getItem(c.nextKey):null;if((c==null?void 0:c.type)==="item"){const f={type:"item",key:c.key,dropPosition:"before"};return n(f)?[f]:[]}}if((o==null?void 0:o.nextKey)!=null)return[e];let u=o==null?void 0:o.parentKey,a=[];for(;u!=null;){let c=r.getItem(u),f=(c==null?void 0:c.nextKey)!=null?r.getItem(c.nextKey):null;if(!f||f.parentKey!==u){let b={type:"item",key:u,dropPosition:"after"};if(n(b)&&a.push(b),f)break}u=c==null?void 0:c.parentKey}if(a.length>0&&i.push(...a),i.length===1){let c=r.getKeyAfter(l.key),f=c!=null?r.getItem(c):null;if(c!=null&&f&&o&&f.level!=null&&o.level!=null&&f.level>o.level){let d={type:"item",key:c,dropPosition:"before"};if(n(d))return[d]}}return i.filter(n)}selectTarget(e,n,l,r,o,i){if(e.length<2)return e[0];let u=this.pointerTracking,a=this.state.collection.getItem(n.key),c=a==null?void 0:a.parentKey;if(c==null)return e[0];if(!u.boundaryContext||u.boundaryContext.parentKey!==c){let h=u.yDirection==="up"?e.length-1:0;u.boundaryContext={parentKey:c,preferredTargetIndex:h,lastSwitchY:r,lastSwitchX:l}}let f=u.boundaryContext,d=Math.abs(l-f.lastSwitchX);if(Math.abs(r-f.lastSwitchY)>_i&&o){let h=f.preferredTargetIndex||0;o==="down"&&h===0?f.preferredTargetIndex=e.length-1:o==="up"&&h===e.length-1&&(f.preferredTargetIndex=0),u.xDirection=null}if(d>ji&&i){let h=f.preferredTargetIndex||0;i==="left"?this.direction==="ltr"?h0&&(f.preferredTargetIndex=h-1,f.lastSwitchX=l):i==="right"&&(this.direction==="ltr"?h>0&&(f.preferredTargetIndex=h-1,f.lastSwitchX=l):h{var f,d,b;let i=this.keyMap.get(o.key);e.visitNode&&(o=e.visitNode(o)),this.keyMap.set(o.key,o);let u=new Set,a=null,c=!1;if(o.type==="item"){for(let p of o.childNodes)if(((f=p.props)==null?void 0:f.colSpan)!==void 0){c=!0;break}}for(let p of o.childNodes)p.type==="cell"&&c&&(p.colspan=(d=p.props)==null?void 0:d.colSpan,p.colSpan=(b=p.props)==null?void 0:b.colSpan,p.colIndex=a?(a.colIndex??a.index)+(a.colSpan??1):p.index),p.type==="cell"&&p.parentKey==null&&(p.parentKey=o.key),u.add(p.key),a?(a.nextKey=p.key,p.prevKey=a.key):p.prevKey=null,n(p),a=p;if(a&&(a.nextKey=null),i)for(let p of i.childNodes)u.has(p.key)||l(p)},l=o=>{this.keyMap.delete(o.key);for(let i of o.childNodes)this.keyMap.get(i.key)===i&&l(i)},r=null;for(let[o,i]of e.items.entries()){let u={...i,level:i.level??0,key:i.key??"row-"+o,type:i.type??"row",value:i.value??null,hasChildNodes:!0,childNodes:[...i.childNodes],rendered:i.rendered,textValue:i.textValue??"",index:i.index??o};r?(r.nextKey=u.key,u.prevKey=r.key):u.prevKey=null,this.rows.push(u),n(u),r=u}r&&(r.nextKey=null)}*[Symbol.iterator](){yield*[...this.rows]}get size(){return[...this.rows].length}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);return n?n.prevKey??null:null}getKeyAfter(e){let n=this.keyMap.get(e);return n?n.nextKey??null:null}getFirstKey(){var e;return(e=[...this.rows][0])==null?void 0:e.key}getLastKey(){var n;let e=[...this.rows];return(n=e[e.length-1])==null?void 0:n.key}getItem(e){return this.keyMap.get(e)??null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}getChildren(e){let n=this.keyMap.get(e);return(n==null?void 0:n.childNodes)||[]}}const Qd="row-header-column-"+Math.random().toString(36).slice(2);let cr="row-header-column-"+Math.random().toString(36).slice(2);for(;Qd===cr;)cr="row-header-column-"+Math.random().toString(36).slice(2);function ef(t,e){if(e.length===0)return[];let n=[],l=new Map;for(let a of e){let c=a.parentKey,f=[a];for(;c!=null;){let d=t.get(c);if(!d)break;if(l.has(d)){d.colSpan??(d.colSpan=0),d.colSpan++,d.colspan=d.colSpan;let{column:b,index:p}=l.get(d);if(p>f.length)break;for(let h=p;ha.length)),o=Array(r).fill(0).map(()=>[]),i=0;for(let a of n){let c=r-1;for(let f of a){if(f){let d=o[c],b=d.reduce((p,h)=>p+(h.colSpan??1),0);if(b0&&(d[d.length-1].nextKey=p.key,p.prevKey=d[d.length-1].key),d.push(p)}d.length>0&&(d[d.length-1].nextKey=f.key,f.prevKey=d[d.length-1].key),f.level=c,f.colIndex=i,d.push(f)}c--}i++}let u=0;for(let a of o){let c=a.reduce((f,d)=>f+(d.colSpan??1),0);if(c({type:"headerrow",key:"headerrow-"+c,index:c,value:null,rendered:null,level:0,hasChildNodes:!0,childNodes:a,textValue:""}))}class ig extends og{constructor(e,n,l){let r=new Set,o=null,i=[];if(l!=null&&l.showSelectionCheckboxes){let d={type:"column",key:Qd,value:null,textValue:"",level:0,index:l!=null&&l.showDragButtons?1:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isSelectionCell:!0}};i.unshift(d)}if(l!=null&&l.showDragButtons){let d={type:"column",key:cr,value:null,textValue:"",level:0,index:0,hasChildNodes:!1,rendered:null,childNodes:[],props:{isDragButtonCell:!0}};i.unshift(d)}let u=[],a=new Map,c=d=>{switch(d.type){case"body":o=d;break;case"column":a.set(d.key,d),d.hasChildNodes||(i.push(d),d.props.isRowHeader&&r.add(d.key));break;case"item":u.push(d);return}for(let b of d.childNodes)c(b)};for(let d of e)c(d);let f=ef(a,i);if(f.forEach((d,b)=>u.splice(b,0,d)),super({columnCount:i.length,items:u,visitNode:d=>(d.column=i[d.index],d)}),this._size=0,this.columns=i,this.rowHeaderColumnKeys=r,this.body=o,this.headerRows=f,this._size=[...o.childNodes].length,this.rowHeaderColumnKeys.size===0){let d=this.columns.find(b=>{var p,h;return!((p=b.props)!=null&&p.isDragButtonCell)&&!((h=b.props)!=null&&h.isSelectionCell)});d&&this.rowHeaderColumnKeys.add(d.key)}}*[Symbol.iterator](){yield*this.body.childNodes}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);return(n==null?void 0:n.prevKey)??null}getKeyAfter(e){let n=this.keyMap.get(e);return(n==null?void 0:n.nextKey)??null}getFirstKey(){var e;return((e=_r(this.body.childNodes))==null?void 0:e.key)??null}getLastKey(){var e;return((e=Ts(this.body.childNodes))==null?void 0:e.key)??null}getItem(e){return e===this.body.key?this.body:this.keyMap.get(e)??null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}getChildren(e){if(e===this.body.key)return this.body.childNodes;let n=this.getItem(e);return(n==null?void 0:n.type)==="item"?[...n.childNodes].filter(l=>l.type==="cell"):super.getChildren(e)}getTextValue(e){let n=this.getItem(e);if(!n)return"";if(n.textValue)return n.textValue;let l=this.rowHeaderColumnKeys;if(l){let r=[];for(let o of n.childNodes){let i=this.columns[o.index];if(l.has(i.key)&&o.textValue&&r.push(o.textValue),r.length===l.size)break}return r.join(" ")}return""}}function ug(t){return t!=null&&(!isNaN(t)||String(t).match(/^(\d+)(?=%$)/)!==null)}function ag(t){if(!t||typeof t=="number")return 1;let e=t.match(/^(.+)(?=fr$)/);return e?parseFloat(e[0]):1}function Jr(t,e){if(typeof t=="string"){let n=t.match(/^(\d+)(?=%$)/);if(!n)throw new Error("Only percentages or numbers are supported for static column widths");return e*(parseFloat(n[0])/100)}return t}function tf(t,e){return t!=null?Jr(t,e):Number.MAX_SAFE_INTEGER}function nf(t,e){return t!=null?Jr(t,e):0}function sg(t,e,n,l,r){let o=!1,i=e.map((u,a)=>{let c=n.get(u.key)!=null?n.get(u.key)??"1fr":u.width??u.defaultWidth??(l==null?void 0:l(a))??"1fr",f=!1,d=0,b=0,p=0;ug(c)?(d=Jr(c,t),f=!0):(b=ag(c),b<=0&&(f=!0));let h=nf(u.minWidth??(r==null?void 0:r(a))??0,t),$=tf(u.maxWidth,t),y=Math.max(h,Math.min(d,$));return f?p=y:d>y&&(f=!0,p=y),f||(o=!0),{frozen:f,baseSize:d,hypotheticalMainSize:y,min:h,max:$,flex:b,targetMainSize:p,violation:0}});for(;o;){let u=0,a=0;i.forEach(d=>{d.frozen?u+=d.targetMainSize:(u+=d.baseSize,a+=d.flex)});let c=t-u;c>0&&i.forEach(d=>{if(!d.frozen){let b=d.flex/a;d.targetMainSize=d.baseSize+b*c}});let f=0;i.forEach(d=>{if(d.violation=0,!d.frozen){let{min:b,max:p,targetMainSize:h}=d;d.targetMainSize=Math.max(b,Math.min(h,p)),d.violation=d.targetMainSize-h,f+=d.violation}}),o=!1,i.forEach(d=>{f===0||Math.sign(f)===Math.sign(d.violation)?d.frozen=!0:d.frozen||(o=!0)})}return cg(i)}function cg(t){let e=0,n=0,l=[];return t.forEach(function(r){let o=r.targetMainSize,i=Math.round(o+e)-n;e+=o,n+=i,l.push(i)}),l}class dg{constructor(e){this.columnWidths=new Map,this.columnMinWidths=new Map,this.columnMaxWidths=new Map,this.getDefaultWidth=(e==null?void 0:e.getDefaultWidth)??(()=>"1fr"),this.getDefaultMinWidth=(e==null?void 0:e.getDefaultMinWidth)??(()=>75)}splitColumnsIntoControlledAndUncontrolled(e){return e.reduce((n,l)=>(l.props.width!=null?n[0].set(l.key,l):n[1].set(l.key,l),n),[new Map,new Map])}recombineColumns(e,n,l,r){return new Map(e.map(o=>l.has(o.key)?[o.key,n.get(o.key)]:[o.key,r.get(o.key).props.width]))}getInitialUncontrolledWidths(e){return new Map(Array.from(e).map(([n,l])=>{var r;return[n,l.props.defaultWidth??((r=this.getDefaultWidth)==null?void 0:r.call(this,l))??"1fr"]}))}getColumnWidth(e){return this.columnWidths.get(e)??0}getColumnMinWidth(e){return this.columnMinWidths.get(e)??0}getColumnMaxWidth(e){return this.columnMaxWidths.get(e)??0}resizeColumnWidth(e,n,l,r){let o=this.columnWidths,i=!0,u=new Map;return r=Math.max(this.getColumnMinWidth(l),Math.min(this.getColumnMaxWidth(l),Math.floor(r))),e.columns.forEach(a=>{a.key===l?(u.set(a.key,r),i=!1):i?u.set(a.key,o.get(a.key)??0):u.set(a.key,a.props.width??n.get(a.key))}),u}buildColumnWidths(e,n,l){return this.columnWidths=new Map,this.columnMinWidths=new Map,this.columnMaxWidths=new Map,sg(e,n.columns.map(o=>({...o.props,key:o.key})),l,o=>this.getDefaultWidth(n.columns[o]),o=>this.getDefaultMinWidth(n.columns[o])).forEach((o,i)=>{let u=n.columns[i].key,a=n.columns[i];this.columnWidths.set(u,o),this.columnMinWidths.set(u,nf(a.props.minWidth??this.getDefaultMinWidth(a),e)),this.columnMaxWidths.set(u,tf(a.props.maxWidth,e))}),this.columnWidths}}function fg(t,e){let{getDefaultWidth:n,getDefaultMinWidth:l,tableWidth:r=0}=t,[o,i]=s.useState(null),u=s.useMemo(()=>new dg({getDefaultWidth:n,getDefaultMinWidth:l}),[n,l]),[a,c]=s.useMemo(()=>u.splitColumnsIntoControlledAndUncontrolled(e.collection.columns),[e.collection.columns,u]),[f,d]=s.useState(()=>u.getInitialUncontrolledWidths(c)),[b,p]=s.useState(e.collection.columns);if(e.collection.columns!==b){if(e.collection.columns.length!==b.length||e.collection.columns.some((E,C)=>E.key!==b[C].key)){let E=u.getInitialUncontrolledWidths(c);d(E)}p(e.collection.columns)}let h=s.useMemo(()=>u.recombineColumns(e.collection.columns,f,c,a),[e.collection.columns,f,c,a,u]),$=s.useCallback(E=>{i(E)},[i]),y=s.useCallback((E,C)=>{let R=u.resizeColumnWidth(e.collection,f,E,C),A=new Map(Array.from(c).map(([K])=>[K,R.get(K)]));return A.set(E,C),d(A),R},[c,d,u,e.collection,f]),m=s.useCallback(()=>{i(null)},[i]),v=s.useMemo(()=>u.buildColumnWidths(r,e.collection,h),[r,e.collection,h,u]);return s.useMemo(()=>({resizingColumn:o,updateResizedColumns:y,startResize:$,endResize:m,getColumnWidth:E=>u.getColumnWidth(E),getColumnMinWidth:E=>u.getColumnMinWidth(E),getColumnMaxWidth:E=>u.getColumnMaxWidth(E),tableState:e,columnWidths:v}),[u,v,o,y,$,m,e])}function pg(t){let{collection:e,focusMode:n}=t,l=t.UNSAFE_selectionState||Hr(t),r=s.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),o=l.setFocusedKey;l.setFocusedKey=(a,c)=>{var f,d;if(n==="cell"&&a!=null){let b=e.getItem(a);if((b==null?void 0:b.type)==="item"){let p=Zn(b,e);c==="last"?a=((f=Ts(p))==null?void 0:f.key)??null:a=((d=_r(p))==null?void 0:d.key)??null}}o(a,c)};let i=s.useMemo(()=>new cl(e,l),[e,l]);const u=s.useRef(null);return s.useEffect(()=>{if(l.focusedKey!=null&&u.current&&!e.getItem(l.focusedKey)){const a=u.current.getItem(l.focusedKey),c=(a==null?void 0:a.parentKey)!=null&&(a.type==="cell"||a.type==="rowheader"||a.type==="column")?u.current.getItem(a.parentKey):a;if(!c){l.setFocusedKey(null);return}const f=u.current.rows,d=e.rows,b=f.length-d.length;let p=Math.min(b>1?Math.max(c.index-b+1,0):c.index,d.length-1),h=null;for(;p>=0;){if(!i.isDisabled(d[p].key)&&d[p].type!=="headerrow"){h=d[p];break}pc.index&&(p=c.index),p--)}if(h){const $=h.hasChildNodes?[...Zn(h,e)]:[],y=h.hasChildNodes&&c!==a&&a&&a.index<$.length?$[a.index].key:h.key;l.setFocusedKey(y)}else l.setFocusedKey(null)}u.current=e},[e,i,l,l.focusedKey]),{collection:e,disabledKeys:r,isKeyboardNavigationDisabled:!1,selectionManager:i}}const bg={ascending:"descending",descending:"ascending"};function hg(t){let[e,n]=s.useState(!1),{selectionMode:l="none",showSelectionCheckboxes:r,showDragButtons:o,treeColumn:i=null}=t,u=s.useMemo(()=>({showSelectionCheckboxes:r&&l!=="none",showDragButtons:o,selectionMode:l,columns:[]}),[t.children,r,l,o]),a=Bs(t,s.useCallback(p=>new ig(p,null,u),[u]),u),{disabledKeys:c,selectionManager:f}=pg({...t,collection:a,disabledBehavior:t.disabledBehavior||"selection"}),[d,b]=Ct(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,t.onExpandedChange);return{collection:a,disabledKeys:c,selectionManager:f,showSelectionCheckboxes:t.showSelectionCheckboxes||!1,sortDescriptor:t.sortDescriptor??null,isKeyboardNavigationDisabled:a.size===0||e,setKeyboardNavigationDisabled:n,sort(p,h){var $,y;(y=t.onSortChange)==null||y.call(t,{column:p,direction:h??((($=t.sortDescriptor)==null?void 0:$.column)===p?bg[t.sortDescriptor.direction]:"ascending")})},expandedKeys:d,toggleKey(p){b(h=>{let $=new Set(h);return $.has(p)?$.delete(p):$.add(p),$})},treeColumn:i}}function mg(t,e){let n=s.useMemo(()=>e?t.collection.filter(e):t.collection,[t.collection,e]),l=t.selectionManager.withCollection(n);return{...t,collection:n,selectionManager:l}}class lf{constructor(e){if(this.collection=e.collection,this.disabledKeys=e.disabledKeys,this.disabledBehavior=e.disabledBehavior||"all",this.direction=e.direction,this.collator=e.collator,!e.layout&&!e.ref)throw new Error("Either a layout or a ref must be specified.");this.layoutDelegate=e.layoutDelegate||(e.layout?new gg(e.layout):new ir(e.ref)),this.focusMode=e.focusMode??"row"}isCell(e){return e.type==="cell"}isRow(e){return e.type==="row"||e.type==="item"}isDisabled(e){var n,l;return this.disabledBehavior==="all"&&(((n=e.props)==null?void 0:n.isDisabled)||this.disabledKeys.has(e.key))&&((l=e.props)==null?void 0:l.disabledBehavior)!=="selection"}findPreviousKey(e,n,l=!1){let r=e!=null?this.collection.getKeyBefore(e):this.collection.getLastKey();for(;r!=null;){let o=this.collection.getItem(r);if(!o)return null;if((l||!this.isDisabled(o))&&(!n||n(o)))return r;r=this.collection.getKeyBefore(r)}return null}findNextKey(e,n,l=!1){let r=e!=null?this.collection.getKeyAfter(e):this.collection.getFirstKey();for(;r!=null;){let o=this.collection.getItem(r);if(!o)return null;if((l||!this.isDisabled(o))&&(!n||n(o)))return r;if(r=this.collection.getKeyAfter(r),r==null)return null}return null}getKeyForItemInRowByIndex(e,n=0){if(n<0)return null;let l=this.collection.getItem(e);if(!l)return null;let r=0;for(let o of Ce(l,this.collection)){if(o.colSpan&&o.colSpan+r>n||(o.colSpan&&(r=r+o.colSpan-1),r===n))return o.key??null;r++}return null}getKeyBelow(e,n){let l=e,r=this.collection.getItem(l);if(!r||(this.isCell(r)&&(l=r.parentKey??null),l==null))return null;if(l=this.findNextKey(l,o=>o.type==="item",n==null?void 0:n.includeDisabled),l!=null){if(this.isCell(r)){let o=r.colIndex?r.colIndex:r.index;return this.getKeyForItemInRowByIndex(l,o)}if(this.focusMode==="row")return l}return null}getKeyAbove(e,n){let l=e,r=this.collection.getItem(l);if(!r||(this.isCell(r)&&(l=r.parentKey??null),l==null))return null;if(l=this.findPreviousKey(l,o=>o.type==="item",n==null?void 0:n.includeDisabled),l!=null){if(this.isCell(r)){let o=r.colIndex?r.colIndex:r.index;return this.getKeyForItemInRowByIndex(l,o)}if(this.focusMode==="row")return l}return null}getKeyRightOf(e){var l,r;let n=this.collection.getItem(e);if(!n)return null;if(this.isRow(n)){let o=Ce(n,this.collection);return(this.direction==="rtl"?(l=In(o))==null?void 0:l.key:(r=Pt(o))==null?void 0:r.key)??null}if(this.isCell(n)&&n.parentKey!=null){let o=this.collection.getItem(n.parentKey);if(!o)return null;let i=Ce(o,this.collection),u=(this.direction==="rtl"?en(i,n.index-1):en(i,n.index+1))??null;return u?u.key??null:this.focusMode==="row"?n.parentKey??null:(this.direction==="rtl"?this.getFirstKey(e):this.getLastKey(e))??null}return null}getKeyLeftOf(e){var l,r;let n=this.collection.getItem(e);if(!n)return null;if(this.isRow(n)){let o=Ce(n,this.collection);return(this.direction==="rtl"?(l=Pt(o))==null?void 0:l.key:(r=In(o))==null?void 0:r.key)??null}if(this.isCell(n)&&n.parentKey!=null){let o=this.collection.getItem(n.parentKey);if(!o)return null;let i=Ce(o,this.collection),u=(this.direction==="rtl"?en(i,n.index+1):en(i,n.index-1))??null;return u?u.key??null:this.focusMode==="row"?n.parentKey??null:(this.direction==="rtl"?this.getLastKey(e):this.getFirstKey(e))??null}return null}getFirstKey(e,n){var o,i;let l=e??null,r;if(l!=null){if(r=this.collection.getItem(l),!r)return null;if(this.isCell(r)&&!n&&r.parentKey!=null){let u=this.collection.getItem(r.parentKey);return u?((o=Pt(Ce(u,this.collection)))==null?void 0:o.key)??null:null}}if(l=this.findNextKey(void 0,u=>u.type==="item"),l!=null&&(r&&this.isCell(r)&&n||this.focusMode==="cell")){let u=this.collection.getItem(l);if(!u)return null;l=((i=Pt(Ce(u,this.collection)))==null?void 0:i.key)??null}return l}getLastKey(e,n){var o,i;let l=e??null,r;if(l!=null){if(r=this.collection.getItem(l),!r)return null;if(this.isCell(r)&&!n&&r.parentKey!=null){let u=this.collection.getItem(r.parentKey);if(!u)return null;let a=Ce(u,this.collection);return((o=In(a))==null?void 0:o.key)??null}}if(l=this.findPreviousKey(void 0,u=>u.type==="item"),l!=null&&(r&&this.isCell(r)&&n||this.focusMode==="cell")){let u=this.collection.getItem(l);if(!u)return null;let a=Ce(u,this.collection);l=((i=In(a))==null?void 0:i.key)??null}return l}getKeyPageAbove(e){let n=e,l=this.layoutDelegate.getItemRect(n);if(!l)return null;let r=Math.max(0,l.y+l.height-this.layoutDelegate.getVisibleRect().height);for(;l&&l.y>r&&n!=null&&(n=this.getKeyAbove(n)??null,n!=null);)l=this.layoutDelegate.getItemRect(n);return n}getKeyPageBelow(e){let n=e,l=this.layoutDelegate.getItemRect(n);if(!l)return null;let r=this.layoutDelegate.getVisibleRect().height,o=Math.min(this.layoutDelegate.getContentSize().height,l.y+r);for(;l&&l.y+l.heightc.type==="item"),l==null&&!i&&(l=this.getFirstKey(),i=!0)}return null}}class gg{constructor(e){this.layout=e}getContentSize(){return this.layout.getContentSize()}getItemRect(e){var n;return((n=this.layout.getLayoutInfo(e))==null?void 0:n.rect)||null}getVisibleRect(){return this.layout.virtualizer.visibleRect}}const Qr=new WeakMap;function yg(t,e,n){let{isVirtualized:l,disallowTypeAhead:r,keyboardDelegate:o,focusMode:i,scrollRef:u,getRowText:a,onRowAction:c,onCellAction:f,escapeKeyBehavior:d="clearSelection",shouldSelectOnPressUp:b}=t,{selectionManager:p}=e;!t["aria-label"]&&!t["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let h=En({usage:"search",sensitivity:"base"}),{direction:$}=Re(),y=e.selectionManager.disabledBehavior,m=s.useMemo(()=>o||new lf({collection:e.collection,disabledKeys:e.disabledKeys,disabledBehavior:y,ref:n,direction:$,collator:h,focusMode:i}),[o,e.collection,e.disabledKeys,y,n,$,h,i]),{collectionProps:v}=Vr({ref:n,selectionManager:p,keyboardDelegate:m,isVirtualized:l,scrollRef:u,disallowTypeAhead:r,escapeKeyBehavior:d}),E=$e(t.id);Qr.set(e,{keyboardDelegate:m,actions:{onRowAction:c,onCellAction:f},shouldSelectOnPressUp:b});let C=J3({selectionManager:p,hasItemActions:!!(c||f)}),R=ie(t,{labelable:!0}),A=s.useCallback(B=>{if(p.isFocused){te(B.currentTarget,j(B))||p.setFocused(!1);return}te(B.currentTarget,j(B))&&p.setFocused(!0)},[p]),K=s.useMemo(()=>({onBlur:v.onBlur,onFocus:A}),[A,v.onBlur]),P=q3(n,{isDisabled:e.collection.size!==0}),z=G(R,{role:"grid",id:E,"aria-multiselectable":p.selectionMode==="multiple"?"true":void 0},e.isKeyboardNavigationDisabled?K:v,e.collection.size===0&&{tabIndex:P?-1:0}||void 0,C);return l&&(z["aria-rowcount"]=e.collection.size,z["aria-colcount"]=e.collection.columnCount),Y3({getRowText:a},e),{gridProps:z}}const eo=new WeakMap;function dr(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}function rf(t,e){let n=eo.get(t);if(!n)throw new Error("Unknown grid");return`${n}-${dr(e)}`}function of(t,e,n){let l=eo.get(t);if(!l)throw new Error("Unknown grid");return`${l}-${dr(e)}-${dr(n)}`}function fr(t,e){return[...t.collection.rowHeaderColumnKeys].map(n=>of(t,e,n)).join(" ")}var uf={};uf={ascending:"تصاعدي",ascendingSort:t=>`ترتيب حسب العمود ${t.columnName} بترتيب تصاعدي`,columnSize:t=>`${t.value} بالبكسل`,descending:"تنازلي",descendingSort:t=>`ترتيب حسب العمود ${t.columnName} بترتيب تنازلي`,resizerDescription:"اضغط على مفتاح Enter لبدء تغيير الحجم",select:"تحديد",selectAll:"تحديد الكل",sortable:"عمود قابل للترتيب",collapse:"طي",expand:"تمديد"};var af={};af={ascending:"възходящ",ascendingSort:t=>`сортирано по колона ${t.columnName} във възходящ ред`,columnSize:t=>`${t.value} пиксела`,descending:"низходящ",descendingSort:t=>`сортирано по колона ${t.columnName} в низходящ ред`,resizerDescription:"Натиснете „Enter“, за да започнете да преоразмерявате",select:"Изберете",selectAll:"Изберете всичко",sortable:"сортираща колона",collapse:"Свиване",expand:"Разширяване"};var sf={};sf={ascending:"vzestupně",ascendingSort:t=>`řazeno vzestupně podle sloupce ${t.columnName}`,columnSize:t=>`${t.value} pixelů`,descending:"sestupně",descendingSort:t=>`řazeno sestupně podle sloupce ${t.columnName}`,resizerDescription:"Stisknutím klávesy Enter začnete měnit velikost",select:"Vybrat",selectAll:"Vybrat vše",sortable:"sloupec s možností řazení",collapse:"Sbalit",expand:"Roztáhnout"};var cf={};cf={ascending:"stigende",ascendingSort:t=>`sorteret efter kolonne ${t.columnName} i stigende rækkefølge`,columnSize:t=>`${t.value} pixels`,descending:"faldende",descendingSort:t=>`sorteret efter kolonne ${t.columnName} i faldende rækkefølge`,resizerDescription:"Tryk på Enter for at ændre størrelse",select:"Vælg",selectAll:"Vælg alle",sortable:"sorterbar kolonne",collapse:"Skjul",expand:"Udvid"};var df={};df={ascending:"aufsteigend",ascendingSort:t=>`sortiert nach Spalte ${t.columnName} in aufsteigender Reihenfolge`,columnSize:t=>`${t.value} Pixel`,descending:"absteigend",descendingSort:t=>`sortiert nach Spalte ${t.columnName} in absteigender Reihenfolge`,resizerDescription:"Eingabetaste zum Starten der Größenänderung drücken",select:"Auswählen",selectAll:"Alles auswählen",sortable:"sortierbare Spalte",collapse:"Reduzieren",expand:"Erweitern"};var ff={};ff={ascending:"αύξουσα",ascendingSort:t=>`διαλογή ανά στήλη ${t.columnName} σε αύξουσα σειρά`,columnSize:t=>`${t.value} pixel`,descending:"φθίνουσα",descendingSort:t=>`διαλογή ανά στήλη ${t.columnName} σε φθίνουσα σειρά`,resizerDescription:"Πατήστε Enter για έναρξη της αλλαγής μεγέθους",select:"Επιλογή",selectAll:"Επιλογή όλων",sortable:"Στήλη διαλογής",collapse:"Σύμπτυξη",expand:"Ανάπτυξη"};var pf={};pf={select:"Select",selectAll:"Select All",sortable:"sortable column",ascending:"ascending",descending:"descending",ascendingSort:t=>`sorted by column ${t.columnName} in ascending order`,descendingSort:t=>`sorted by column ${t.columnName} in descending order`,columnSize:t=>`${t.value} pixels`,resizerDescription:"Press Enter to start resizing",expand:"Expand",collapse:"Collapse"};var bf={};bf={ascending:"ascendente",ascendingSort:t=>`ordenado por columna ${t.columnName} en sentido ascendente`,columnSize:t=>`${t.value} píxeles`,descending:"descendente",descendingSort:t=>`ordenado por columna ${t.columnName} en orden descendente`,resizerDescription:"Pulse Intro para empezar a redimensionar",select:"Seleccionar",selectAll:"Seleccionar todos",sortable:"columna ordenable",collapse:"Contraer",expand:"Ampliar"};var hf={};hf={ascending:"tõusev järjestus",ascendingSort:t=>`sorditud veeru järgi ${t.columnName} tõusvas järjestuses`,columnSize:t=>`${t.value} pikslit`,descending:"laskuv järjestus",descendingSort:t=>`sorditud veeru järgi ${t.columnName} laskuvas järjestuses`,resizerDescription:"Suuruse muutmise alustamiseks vajutage klahvi Enter",select:"Vali",selectAll:"Vali kõik",sortable:"sorditav veerg",collapse:"Ahenda",expand:"Laienda"};var mf={};mf={ascending:"nouseva",ascendingSort:t=>`lajiteltu sarakkeen ${t.columnName} mukaan nousevassa järjestyksessä`,columnSize:t=>`${t.value} pikseliä`,descending:"laskeva",descendingSort:t=>`lajiteltu sarakkeen ${t.columnName} mukaan laskevassa järjestyksessä`,resizerDescription:"Aloita koon muutos painamalla Enter-näppäintä",select:"Valitse",selectAll:"Valitse kaikki",sortable:"lajiteltava sarake",collapse:"Pienennä",expand:"Laajenna"};var gf={};gf={ascending:"croissant",ascendingSort:t=>`trié en fonction de la colonne ${t.columnName} par ordre croissant`,columnSize:t=>`${t.value} pixels`,descending:"décroissant",descendingSort:t=>`trié en fonction de la colonne ${t.columnName} par ordre décroissant`,resizerDescription:"Appuyez sur Entrée pour commencer le redimensionnement.",select:"Sélectionner",selectAll:"Sélectionner tout",sortable:"colonne triable",collapse:"Réduire",expand:"Développer"};var yf={};yf={ascending:"עולה",ascendingSort:t=>`מוין לפי עמודה ${t.columnName} בסדר עולה`,columnSize:t=>`${t.value} פיקסלים`,descending:"יורד",descendingSort:t=>`מוין לפי עמודה ${t.columnName} בסדר יורד`,resizerDescription:"הקש Enter כדי לשנות את הגודל",select:"בחר",selectAll:"בחר הכול",sortable:"עמודה שניתן למיין",collapse:"כווץ",expand:"הרחב"};var $f={};$f={ascending:"rastući",ascendingSort:t=>`razvrstano po stupcima ${t.columnName} rastućem redoslijedom`,columnSize:t=>`${t.value} piksela`,descending:"padajući",descendingSort:t=>`razvrstano po stupcima ${t.columnName} padajućim redoslijedom`,resizerDescription:"Pritisnite Enter da biste započeli promenu veličine",select:"Odaberite",selectAll:"Odaberite sve",sortable:"stupac koji se može razvrstati",collapse:"Sažmi",expand:"Proširi"};var vf={};vf={ascending:"növekvő",ascendingSort:t=>`rendezve a(z) ${t.columnName} oszlop szerint, növekvő sorrendben`,columnSize:t=>`${t.value} képpont`,descending:"csökkenő",descendingSort:t=>`rendezve a(z) ${t.columnName} oszlop szerint, csökkenő sorrendben`,resizerDescription:"Nyomja le az Enter billentyűt az átméretezés megkezdéséhez",select:"Kijelölés",selectAll:"Összes kijelölése",sortable:"rendezendő oszlop",collapse:"Összecsukás",expand:"Kibontás"};var xf={};xf={ascending:"crescente",ascendingSort:t=>`in ordine crescente in base alla colonna ${t.columnName}`,columnSize:t=>`${t.value} pixel`,descending:"decrescente",descendingSort:t=>`in ordine decrescente in base alla colonna ${t.columnName}`,resizerDescription:"Premi Invio per iniziare a ridimensionare",select:"Seleziona",selectAll:"Seleziona tutto",sortable:"colonna ordinabile",collapse:"Comprimi",expand:"Espandi"};var Cf={};Cf={ascending:"昇順",ascendingSort:t=>`列 ${t.columnName} を昇順で並べ替え`,columnSize:t=>`${t.value} ピクセル`,descending:"降順",descendingSort:t=>`列 ${t.columnName} を降順で並べ替え`,resizerDescription:"Enter キーを押してサイズ変更を開始",select:"選択",selectAll:"すべて選択",sortable:"並べ替え可能な列",collapse:"折りたたむ",expand:"展開"};var Ef={};Ef={ascending:"오름차순",ascendingSort:t=>`${t.columnName} 열을 기준으로 오름차순으로 정렬됨`,columnSize:t=>`${t.value} 픽셀`,descending:"내림차순",descendingSort:t=>`${t.columnName} 열을 기준으로 내림차순으로 정렬됨`,resizerDescription:"크기 조정을 시작하려면 Enter를 누르세요.",select:"선택",selectAll:"모두 선택",sortable:"정렬 가능한 열",collapse:"접기",expand:"펼치기"};var wf={};wf={ascending:"didėjančia tvarka",ascendingSort:t=>`surikiuota pagal stulpelį ${t.columnName} didėjančia tvarka`,columnSize:t=>`${t.value} piks.`,descending:"mažėjančia tvarka",descendingSort:t=>`surikiuota pagal stulpelį ${t.columnName} mažėjančia tvarka`,resizerDescription:"Paspauskite „Enter“, kad pradėtumėte keisti dydį",select:"Pasirinkti",selectAll:"Pasirinkti viską",sortable:"rikiuojamas stulpelis",collapse:"Sutraukti",expand:"Išskleisti"};var Sf={};Sf={ascending:"augošā secībā",ascendingSort:t=>`kārtots pēc kolonnas ${t.columnName} augošā secībā`,columnSize:t=>`${t.value} pikseļi`,descending:"dilstošā secībā",descendingSort:t=>`kārtots pēc kolonnas ${t.columnName} dilstošā secībā`,resizerDescription:"Nospiediet Enter, lai sāktu izmēru mainīšanu",select:"Atlasīt",selectAll:"Atlasīt visu",sortable:"kārtojamā kolonna",collapse:"Sakļaut",expand:"Izvērst"};var Df={};Df={ascending:"stigende",ascendingSort:t=>`sortert etter kolonne ${t.columnName} i stigende rekkefølge`,columnSize:t=>`${t.value} piksler`,descending:"synkende",descendingSort:t=>`sortert etter kolonne ${t.columnName} i synkende rekkefølge`,resizerDescription:"Trykk på Enter for å starte størrelsesendring",select:"Velg",selectAll:"Velg alle",sortable:"kolonne som kan sorteres",collapse:"Skjul",expand:"Utvid"};var kf={};kf={ascending:"oplopend",ascendingSort:t=>`gesorteerd in oplopende volgorde in kolom ${t.columnName}`,columnSize:t=>`${t.value} pixels`,descending:"aflopend",descendingSort:t=>`gesorteerd in aflopende volgorde in kolom ${t.columnName}`,resizerDescription:"Druk op Enter om het formaat te wijzigen",select:"Selecteren",selectAll:"Alles selecteren",sortable:"sorteerbare kolom",collapse:"Samenvouwen",expand:"Uitvouwen"};var Pf={};Pf={ascending:"rosnąco",ascendingSort:t=>`posortowano według kolumny ${t.columnName} w porządku rosnącym`,columnSize:t=>`Liczba pikseli: ${t.value}`,descending:"malejąco",descendingSort:t=>`posortowano według kolumny ${t.columnName} w porządku malejącym`,resizerDescription:"Naciśnij Enter, aby rozpocząć zmienianie rozmiaru",select:"Zaznacz",selectAll:"Zaznacz wszystko",sortable:"kolumna z możliwością sortowania",collapse:"Zwiń",expand:"Rozwiń"};var Af={};Af={ascending:"crescente",ascendingSort:t=>`classificado pela coluna ${t.columnName} em ordem crescente`,columnSize:t=>`${t.value} pixels`,descending:"decrescente",descendingSort:t=>`classificado pela coluna ${t.columnName} em ordem decrescente`,resizerDescription:"Pressione Enter para começar a redimensionar",select:"Selecionar",selectAll:"Selecionar tudo",sortable:"coluna classificável",collapse:"Recolher",expand:"Expandir"};var Tf={};Tf={ascending:"ascendente",ascendingSort:t=>`Ordenar por coluna ${t.columnName} em ordem ascendente`,columnSize:t=>`${t.value} pixels`,descending:"descendente",descendingSort:t=>`Ordenar por coluna ${t.columnName} em ordem descendente`,resizerDescription:"Prima Enter para iniciar o redimensionamento",select:"Selecionar",selectAll:"Selecionar tudo",sortable:"Coluna ordenável",collapse:"Colapsar",expand:"Expandir"};var Bf={};Bf={ascending:"crescătoare",ascendingSort:t=>`sortate după coloana ${t.columnName} în ordine crescătoare`,columnSize:t=>`${t.value} pixeli`,descending:"descrescătoare",descendingSort:t=>`sortate după coloana ${t.columnName} în ordine descrescătoare`,resizerDescription:"Apăsați pe Enter pentru a începe redimensionarea",select:"Selectare",selectAll:"Selectare totală",sortable:"coloană sortabilă",collapse:"Restrângeți",expand:"Extindeți"};var Kf={};Kf={ascending:"возрастание",ascendingSort:t=>`сортировать столбец ${t.columnName} в порядке возрастания`,columnSize:t=>`${t.value} пикс.`,descending:"убывание",descendingSort:t=>`сортировать столбец ${t.columnName} в порядке убывания`,resizerDescription:"Нажмите клавишу Enter для начала изменения размеров",select:"Выбрать",selectAll:"Выбрать все",sortable:"сортируемый столбец",collapse:"Свернуть",expand:"Развернуть"};var Rf={};Rf={ascending:"vzostupne",ascendingSort:t=>`zoradené zostupne podľa stĺpca ${t.columnName}`,columnSize:t=>`Počet pixelov: ${t.value}`,descending:"zostupne",descendingSort:t=>`zoradené zostupne podľa stĺpca ${t.columnName}`,resizerDescription:"Stlačením klávesu Enter začnete zmenu veľkosti",select:"Vybrať",selectAll:"Vybrať všetko",sortable:"zoraditeľný stĺpec",collapse:"Zbaliť",expand:"Rozbaliť"};var Mf={};Mf={ascending:"naraščajoče",ascendingSort:t=>`razvrščeno po stolpcu ${t.columnName} v naraščajočem vrstnem redu`,columnSize:t=>`${t.value} slikovnih pik`,descending:"padajoče",descendingSort:t=>`razvrščeno po stolpcu ${t.columnName} v padajočem vrstnem redu`,resizerDescription:"Pritisnite tipko Enter da začnete spreminjati velikost",select:"Izberite",selectAll:"Izberite vse",sortable:"razvrstljivi stolpec",collapse:"Strni",expand:"Razširi"};var If={};If={ascending:"rastući",ascendingSort:t=>`sortirano po kolonama ${t.columnName} rastućim redosledom`,columnSize:t=>`${t.value} piksela`,descending:"padajući",descendingSort:t=>`sortirano po kolonama ${t.columnName} padajućim redosledom`,resizerDescription:"Pritisnite Enter da biste započeli promenu veličine",select:"Izaberite",selectAll:"Izaberite sve",sortable:"kolona koja se može sortirati",collapse:" Skupi",expand:"Proširi"};var Ff={};Ff={ascending:"stigande",ascendingSort:t=>`sorterat på kolumn ${t.columnName} i stigande ordning`,columnSize:t=>`${t.value} pixlar`,descending:"fallande",descendingSort:t=>`sorterat på kolumn ${t.columnName} i fallande ordning`,resizerDescription:"Tryck på Retur för att börja ändra storlek",select:"Markera",selectAll:"Markera allt",sortable:"sorterbar kolumn",collapse:"Dölj",expand:"Expandera"};var Lf={};Lf={ascending:"artan sırada",ascendingSort:t=>`${t.columnName} sütuna göre artan düzende sırala`,columnSize:t=>`${t.value} piksel`,descending:"azalan sırada",descendingSort:t=>`${t.columnName} sütuna göre azalan düzende sırala`,resizerDescription:"Yeniden boyutlandırmak için Enter'a basın",select:"Seç",selectAll:"Tümünü Seç",sortable:"Sıralanabilir sütun",collapse:"Daralt",expand:"Genişlet"};var zf={};zf={ascending:"висхідний",ascendingSort:t=>`відсортовано за стовпцем ${t.columnName} у висхідному порядку`,columnSize:t=>`${t.value} пікс.`,descending:"низхідний",descendingSort:t=>`відсортовано за стовпцем ${t.columnName} у низхідному порядку`,resizerDescription:"Натисніть Enter, щоб почати зміну розміру",select:"Вибрати",selectAll:"Вибрати все",sortable:"сортувальний стовпець",collapse:"Згорнути",expand:"Розгорнути"};var Nf={};Nf={ascending:"升序",ascendingSort:t=>`按列 ${t.columnName} 升序排序`,columnSize:t=>`${t.value} 像素`,descending:"降序",descendingSort:t=>`按列 ${t.columnName} 降序排序`,resizerDescription:"按“输入”键开始调整大小。",select:"选择",selectAll:"全选",sortable:"可排序的列",collapse:"折叠",expand:"扩展"};var Of={};Of={ascending:"遞增",ascendingSort:t=>`已依據「${t.columnName}」欄遞增排序`,columnSize:t=>`${t.value} 像素`,descending:"遞減",descendingSort:t=>`已依據「${t.columnName}」欄遞減排序`,resizerDescription:"按 Enter 鍵以開始調整大小",select:"選取",selectAll:"全選",sortable:"可排序的欄",collapse:"收合",expand:"展開"};var Wt={};Wt={"ar-AE":uf,"bg-BG":af,"cs-CZ":sf,"da-DK":cf,"de-DE":df,"el-GR":ff,"en-US":pf,"es-ES":bf,"et-EE":hf,"fi-FI":mf,"fr-FR":gf,"he-IL":yf,"hr-HR":$f,"hu-HU":vf,"it-IT":xf,"ja-JP":Cf,"ko-KR":Ef,"lt-LT":wf,"lv-LV":Sf,"nb-NO":Df,"nl-NL":kf,"pl-PL":Pf,"pt-BR":Af,"pt-PT":Tf,"ro-RO":Bf,"ru-RU":Kf,"sk-SK":Rf,"sl-SI":Mf,"sr-SP":If,"sv-SE":Ff,"tr-TR":Lf,"uk-UA":zf,"zh-CN":Nf,"zh-TW":Of};class $g extends lf{isCell(e){return e.type==="cell"||e.type==="rowheader"||e.type==="column"}getKeyBelow(e,n){let l=this.collection.getItem(e);if(!l)return null;if(l.type==="column"){let r=Pt(Ce(l,this.collection));if(r)return r.key;let o=this.getFirstKey();return o==null||!this.collection.getItem(o)?null:super.getKeyForItemInRowByIndex(o,l.index)}return super.getKeyBelow(e,n)}getKeyAbove(e,n){let l=this.collection.getItem(e);if(!l)return null;if(l.type==="column"){let i=l.parentKey!=null?this.collection.getItem(l.parentKey):null;return i&&i.type==="column"?i.key:null}let r=super.getKeyAbove(e,n),o=r!=null?this.collection.getItem(r):null;return o&&o.type!=="headerrow"?r:this.isCell(l)?this.collection.columns[l.index].key:this.collection.columns[0].key}findNextColumnKey(e){let n=this.findNextKey(e.key,r=>r.type==="column");if(n!=null)return n;let l=this.collection.headerRows[e.level];for(let r of Ce(l,this.collection))if(r.type==="column")return r.key;return null}findPreviousColumnKey(e){let n=this.findPreviousKey(e.key,o=>o.type==="column");if(n!=null)return n;let l=this.collection.headerRows[e.level],r=[...Ce(l,this.collection)];for(let o=r.length-1;o>=0;o--){let i=r[o];if(i.type==="column")return i.key}return null}getKeyRightOf(e){let n=this.collection.getItem(e);return n?n.type==="column"?this.direction==="rtl"?this.findPreviousColumnKey(n):this.findNextColumnKey(n):super.getKeyRightOf(e):null}getKeyLeftOf(e){let n=this.collection.getItem(e);return n?n.type==="column"?this.direction==="rtl"?this.findNextColumnKey(n):this.findPreviousColumnKey(n):super.getKeyLeftOf(e):null}getKeyForSearch(e,n){if(!this.collator)return null;let l=this.collection,r=n??this.getFirstKey();if(r==null)return null;let o=l.getItem(r);(o==null?void 0:o.type)==="cell"&&(r=o.parentKey??null);let i=!1;for(;r!=null;){let u=l.getItem(r);if(!u)return null;if(u.textValue){let a=u.textValue.slice(0,e.length);if(this.collator.compare(a,e)===0)return u.key}for(let a of Ce(u,this.collection)){let c=l.columns[a.index];if(l.rowHeaderColumnKeys.has(c.key)&&a.textValue){let f=a.textValue.slice(0,e.length);if(this.collator.compare(f,e)===0){let d=n!=null?l.getItem(n):o;return(d==null?void 0:d.type)==="cell"?a.key:u.key}}}r=this.getKeyBelow(r),r==null&&!i&&(r=this.getFirstKey(),i=!0)}return null}}function vg(t){return t&&t.__esModule?t.default:t}function xg(t,e,n){let{keyboardDelegate:l,isVirtualized:r,layoutDelegate:o,layout:i}=t,u=En({usage:"search",sensitivity:"base"}),{direction:a}=Re(),c=e.selectionManager.disabledBehavior,f=s.useMemo(()=>l||new $g({collection:e.collection,disabledKeys:e.disabledKeys,disabledBehavior:c,ref:n,direction:a,collator:u,layoutDelegate:o,layout:i}),[l,e.collection,e.disabledKeys,c,n,a,u,o,i]),d=$e(t.id);eo.set(e,d);let{gridProps:b}=yg({...t,id:d,keyboardDelegate:f},e,n);r&&(b["aria-rowcount"]=e.collection.size+e.collection.headerRows.length),e.treeColumn!=null&&(b.role="treegrid");let{column:p,direction:h}=e.sortDescriptor||{},$=Ne(vg(Wt),"@react-aria/table"),y=s.useMemo(()=>{var E;let v=((E=e.collection.columns.find(C=>C.key===p))==null?void 0:E.textValue)??"";return h&&p?$.format(`${h}Sort`,{columnName:v}):void 0},[h,p,e.collection.columns]),m=mn(y);return $r(()=>{y&>(y,"assertive",500)},[y]),{gridProps:G(b,m,{"aria-describedby":[m["aria-describedby"],b["aria-describedby"]].filter(Boolean).join(" ")})}}function Vf(t,e,n){let{node:l,isVirtualized:r,focusMode:o="child",shouldSelectOnPressUp:i,onAction:u}=t,{direction:a}=Re(),{keyboardDelegate:c,actions:{onCellAction:f}}=Qr.get(e),d=s.useRef(null),b=()=>{if(n.current){let v=Fe(n.current);if(o==="child"){if(vt(n.current)&&n.current!==oe())return;let E=e.selectionManager.childFocusStrategy==="last"?Il(v):v.firstChild();if(E){ve(E);return}}(d.current!=null&&l.key!==d.current||!vt(n.current))&&ve(n.current)}},{itemProps:p,isPressed:h}=jr({selectionManager:e.selectionManager,key:l.key,ref:n,isVirtualized:r,focus:b,shouldSelectOnPressUp:i,onAction:f?()=>f(l.key):u,isDisabled:e.collection.size===0}),$=v=>{var R,A,K,P,z;let E=oe();if(!te(v.currentTarget,j(v))||e.isKeyboardNavigationDisabled||!n.current||!E)return;let C=Fe(n.current);switch(C.currentNode=E,v.key){case"ArrowLeft":{let B=a==="rtl"?C.nextNode():C.previousNode();if(o==="child"&&B===n.current&&(B=null),v.preventDefault(),v.stopPropagation(),B)ve(B),it(B,{containingElement:Xe(n.current)});else{if(((R=c.getKeyLeftOf)==null?void 0:R.call(c,l.key))!==l.key){(A=n.current.parentElement)==null||A.dispatchEvent(new KeyboardEvent(v.nativeEvent.type,v.nativeEvent));break}o==="cell"&&a==="rtl"?(ve(n.current),it(n.current,{containingElement:Xe(n.current)})):(C.currentNode=n.current,B=a==="rtl"?C.firstChild():Il(C),B&&(ve(B),it(B,{containingElement:Xe(n.current)})))}break}case"ArrowRight":{let B=a==="rtl"?C.previousNode():C.nextNode();if(o==="child"&&B===n.current&&(B=null),v.preventDefault(),v.stopPropagation(),B)ve(B),it(B,{containingElement:Xe(n.current)});else{if(((K=c.getKeyRightOf)==null?void 0:K.call(c,l.key))!==l.key){(P=n.current.parentElement)==null||P.dispatchEvent(new KeyboardEvent(v.nativeEvent.type,v.nativeEvent));break}o==="cell"&&a==="ltr"?(ve(n.current),it(n.current,{containingElement:Xe(n.current)})):(C.currentNode=n.current,B=a==="rtl"?Il(C):C.firstChild(),B&&(ve(B),it(B,{containingElement:Xe(n.current)})))}break}case"ArrowUp":case"ArrowDown":!v.altKey&&te(n.current,j(v))&&(v.stopPropagation(),v.preventDefault(),(z=n.current.parentElement)==null||z.dispatchEvent(new KeyboardEvent(v.nativeEvent.type,v.nativeEvent)));break}},y=v=>{if(d.current=l.key,j(v)!==n.current){Ft()||e.selectionManager.setFocusedKey(l.key);return}requestAnimationFrame(()=>{o==="child"&&oe()===n.current&&b()})},m=G(p,{role:"gridcell",onKeyDownCapture:$,"aria-colspan":l.colSpan,"aria-colindex":l.colIndex!=null?l.colIndex+1:void 0,colSpan:r?void 0:l.colSpan,onFocus:y});return r&&(m["aria-colindex"]=(l.colIndex??l.index)+1),i&&m.tabIndex!=null&&m.onPointerDown==null&&(m.onPointerDown=v=>{let E=v.currentTarget,C=E.getAttribute("tabindex");E.removeAttribute("tabindex"),requestAnimationFrame(()=>{C!=null&&E.setAttribute("tabindex",C)})}),{gridCellProps:m,isPressed:h}}function Il(t){let e=null,n=null;do n=t.lastChild(),n&&(e=n);while(n);return e}function Cg(t){return t&&t.__esModule?t.default:t}function Eg(t,e,n){var m,v;let{node:l}=t,r=l.props.allowsSorting,{gridCellProps:o}=Vf({...t,focusMode:"child"},e,n),i=l.props.isSelectionCell&&e.selectionManager.selectionMode==="single",{pressProps:u,isPressed:a}=lt({isDisabled:!r||i,onPress(){e.sort(l.key)},ref:n}),{focusableProps:c}=jt({},n),f,d=((m=e.sortDescriptor)==null?void 0:m.column)===l.key,b=(v=e.sortDescriptor)==null?void 0:v.direction;l.props.allowsSorting&&!rn()&&(f=d?b:"none");let p=Ne(Cg(Wt),"@react-aria/table"),h;r&&(h=`${p.format("sortable")}`,d&&b&&rn()&&(h=`${h}, ${p.format(b)}`));let $=mn(h),y=e.collection.size===0;return s.useEffect(()=>{y&&e.selectionManager.focusedKey===l.key&&e.selectionManager.setFocusedKey(null)},[y,e.selectionManager,l.key]),{columnHeaderProps:{...G(c,o,u,$,y?{tabIndex:-1}:null),role:"columnheader",id:rf(e,l.key),"aria-colspan":l.colSpan&&l.colSpan>1?l.colSpan:void 0,"aria-sort":f},isPressed:a}}function wg(t,e,n){var h,$;let{node:l,isVirtualized:r,shouldSelectOnPressUp:o,onAction:i}=t,{actions:u,shouldSelectOnPressUp:a}=Qr.get(e),c=u.onRowAction?()=>{var y;return(y=u.onRowAction)==null?void 0:y.call(u,l.key)}:i,{itemProps:f,...d}=jr({selectionManager:e.selectionManager,key:l.key,ref:n,isVirtualized:r,shouldSelectOnPressUp:a||o,onAction:c||(h=l==null?void 0:l.props)!=null&&h.onAction?dt(($=l==null?void 0:l.props)==null?void 0:$.onAction,c):void 0,isDisabled:e.collection.size===0}),b=e.selectionManager.isSelected(l.key),p={role:"row","aria-selected":e.selectionManager.selectionMode!=="none"?b:void 0,"aria-disabled":d.isDisabled||void 0,...f};return r&&(p["aria-rowindex"]=l.index+1),{rowProps:p,...d}}function Sg(t){return t&&t.__esModule?t.default:t}const Hi={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function Dg(t,e,n){var $,y;let{node:l,isVirtualized:r}=t,{rowProps:o,...i}=wg(t,e,n),{direction:u}=Re();r&&e.treeColumn==null?o["aria-rowindex"]=l.index+1+e.collection.headerRows.length:delete o["aria-rowindex"];let a=e.treeColumn!=null&&(e.expandedKeys==="all"||e.expandedKeys.has(l.key)),c=Ne(Sg(Wt),"@react-aria/table"),f=un({"aria-label":a?c.format("collapse"):c.format("expand"),"aria-labelledby":fr(e,l.key)}),d={},b={};if(e.treeColumn!=null){let m=e.collection.getItem(l.key);if(m!=null){let v=Wi(e.collection,l),E=(($=m.props)==null?void 0:$.hasChildRows)||((y=m.props)==null?void 0:y.UNSTABLE_childItems)||(v==null?void 0:v.type)!=="cell",C=e.collection.getItem(l.parentKey),R=C.type==="tablebody"||C.type==="body",A=Wi(e.collection,C);for(;A&&A.type!=="item"&&A.prevKey!=null;)A=e.collection.getItem(A.prevKey);d={onKeyDown:K=>{K.key===Hi.expand[u]&&e.selectionManager.focusedKey===m.key&&E&&e.expandedKeys!=="all"&&!e.expandedKeys.has(m.key)?(e.toggleKey(m.key),K.stopPropagation()):K.key===Hi.collapse[u]&&e.selectionManager.focusedKey===m.key&&(e.expandedKeys!=="all"?E&&e.expandedKeys.has(m.key)?(e.toggleKey(m.key),K.stopPropagation()):!e.expandedKeys.has(m.key)&&m.parentKey!=null&&m.level>0&&(e.selectionManager.setFocusedKey(m.parentKey),K.stopPropagation()):e.expandedKeys==="all"&&(e.toggleKey(m.key),K.stopPropagation()))},"aria-expanded":E?e.expandedKeys==="all"||e.expandedKeys.has(l.key):void 0,"aria-level":m.level+1,"aria-posinset":m.index-(R?0:e.collection.columnCount)+1,"aria-setsize":A.index-(R?0:e.collection.columnCount)+1},b={isDisabled:i.isDisabled,onPress:()=>{i.isDisabled||(e.toggleKey(l.key),e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(l.key))},excludeFromTabOrder:!0,preventFocusOnPress:!0,"data-react-aria-prevent-focus":!0,...f}}}let p=$p(l.props),h=i.hasAction?p:{};return{rowProps:{...G(o,d,h),"aria-labelledby":fr(e,l.key)},expandButtonProps:b,...i}}function Wi(t,e){return"lastChildKey"in e?e.lastChildKey!=null?t.getItem(e.lastChildKey):null:Array.from(e.childNodes).findLast(n=>n.parentKey===e.key)}function kg(t,e,n){let{node:l,isVirtualized:r}=t,o={role:"row"};return r&&e.treeColumn==null&&(o["aria-rowindex"]=l.index+1),{rowProps:o}}function Pg(t,e,n){var i;let{gridCellProps:l,isPressed:r}=Vf(t,e,n),o=(i=t.node.column)==null?void 0:i.key;return o!=null&&e.collection.rowHeaderColumnKeys.has(o)&&(l.role="rowheader",l.id=of(e,t.node.parentKey,o)),{gridCellProps:l,isPressed:r}}function Ag(t){return t&&t.__esModule?t.default:t}function Tg(t,e){let{key:n}=t;const{checkboxProps:l}=lg(t,e);return{checkboxProps:{...l,"aria-labelledby":`${l.id} ${fr(e,n)}`}}}function Bg(t){let{isEmpty:e,isSelectAll:n,selectionMode:l}=t.selectionManager;return{checkboxProps:{"aria-label":Ne(Ag(Wt),"@react-aria/table").format(l==="single"?"select":"selectAll"),isSelected:n,isDisabled:l!=="multiple"||t.collection.size===0||t.collection.rows.length===1&&t.collection.rows[0].type==="loader",isIndeterminate:!e&&!n,onChange:()=>t.selectionManager.toggleSelectAll()}}}function Kg(t){return t&&t.__esModule?t.default:t}function Rg(t,e,n){let{column:l,triggerRef:r,isDisabled:o,onResizeStart:i,onResize:u,onResizeEnd:a,"aria-label":c}=t;const f=Ne(Kg(Wt),"@react-aria/table");let d=$e(),b=e.resizingColumn===l.key,p=s.useRef(b),h=s.useRef(null),$=s.useRef(!1),y=e.tableState.isKeyboardNavigationDisabled,{direction:m}=Re(),v=s.useCallback(F=>{p.current||(h.current=e.updateResizedColumns(F.key,e.getColumnWidth(F.key)),e.startResize(F.key),e.tableState.setKeyboardNavigationDisabled(!0),i==null||i(h.current)),p.current=!0},[e,i]),E=s.useCallback((F,V)=>{let q=e.updateResizedColumns(F.key,V);u==null||u(q),h.current=q},[e,u]),C=s.useCallback(F=>{p.current&&(h.current==null&&(h.current=e.updateResizedColumns(F.key,e.getColumnWidth(F.key))),e.endResize(),e.tableState.setKeyboardNavigationDisabled(!1),a==null||a(h.current),p.current=!1,r!=null&&r.current&&!$.current&&ve(r.current)),h.current=null},[e,r,a]),{keyboardProps:R}=Tr({onKeyDown:F=>{y?(F.key==="Escape"||F.key==="Enter"||F.key===" "||F.key==="Tab")&&(F.preventDefault(),C(l)):(F.continuePropagation(),F.key==="Enter"&&v(l))}});const A=s.useRef(0),{moveProps:K}=T3({onMoveStart(){A.current=e.getColumnWidth(l.key),v(l)},onMove(F){let{deltaX:V,deltaY:q,pointerType:Q}=F;m==="rtl"&&(V*=-1),Q==="keyboard"&&(q!==0&&V===0&&(V=q*-1),V*=10),V!==0&&(A.current+=V,E(l,A.current))},onMoveEnd(F){let{pointerType:V}=F;A.current=0,(V==="mouse"||V==="touch"&&$.current)&&C(l)}});let P=s.useCallback(F=>{var V;y&&((V=K.onKeyDown)==null||V.call(K,F))},[y,K]),z=Math.floor(e.getColumnMinWidth(l.key)),B=Math.floor(e.getColumnMaxWidth(l.key));B===1/0&&(B=Number.MAX_SAFE_INTEGER);let N=Math.floor(e.getColumnWidth(l.key)),U=Nu();U==="virtual"&&typeof window<"u"&&"ontouchstart"in window&&(U="touch");let _=(r==null?void 0:r.current)==null&&(U==="keyboard"||U==="virtual")&&!b?f.format("resizerDescription"):void 0,x=mn(_),S={"aria-label":c,"aria-orientation":"horizontal","aria-labelledby":`${d} ${rf(e.tableState,l.key)}`,"aria-valuetext":f.format("columnSize",{value:N}),type:"range",min:z,max:B,value:N,...x};const I=s.useCallback(()=>{n.current&&ve(n.current)},[n]);let w=e.resizingColumn,k=s.useRef(null),D=Ee(v);s.useEffect(()=>{if(k.current!==w&&w!=null&&w===l.key){$.current=oe()===n.current,D(l);let F=setTimeout(()=>I(),0),V=setTimeout(I,400);return()=>{clearTimeout(F),clearTimeout(V)}}k.current=w},[w,l,I,n]);let T=F=>{let V=e.getColumnWidth(l.key),q=parseFloat(j(F).value);q>V?q=V+10:q=V-10,E(l,q)},{pressProps:O}=lt({preventFocusOnPress:!0,onPressStart:F=>{if(!(F.ctrlKey||F.altKey||F.metaKey||F.shiftKey||F.pointerType==="keyboard")){if(F.pointerType==="virtual"&&e.resizingColumn!=null){C(l);return}I(),F.pointerType!=="virtual"&&v(l)}},onPress:F=>{(F.pointerType==="touch"&&$.current||F.pointerType==="mouse")&&e.resizingColumn!=null&&C(l)}}),{visuallyHiddenProps:Z}=$n();return{resizerProps:G(R,{...K,onKeyDown:P},O,{style:{touchAction:"none"}}),inputProps:G(Z,{id:d,onBlur:()=>{C(l)},onChange:T,disabled:o},S),isResizing:b}}function Mg(){return{rowGroupProps:{role:"rowgroup"}}}function jf(){return Mg()}function Ig(t){return t&&t.__esModule?t.default:t}class Fg extends Ia{withExpandedKeys(e){let n=this.clone();return n.expandedKeys=e,n.frozen=this.frozen,n.rows=Array.from(n.getRows()),n}addNode(e){super.addNode(e),this.columnsDirty||(this.columnsDirty=e.type==="column"),e.type==="tableheader"&&(this.head=e)}getRows(){let e=[];for(let n of this)(n.type==="tablebody"||n.type==="tablefooter")&&e.push(...this.getChildren(n.key));return e}get body(){for(let e of this)if(e.type==="tablebody")return e;return new Xn(-2)}commit(e,n,l=!1){this.updateColumns(l),this.firstKey=e,this.lastKey=n,this.rows=[];for(let r of this.getRows()){let o=r.lastChildKey;if(o!=null){let i=this.getItem(o);for(;i&&i.type!=="cell";)i=i.prevKey!=null?this.getItem(i.prevKey):null;if(i){let u=(i.colIndex??i.index)+(i.colSpan??1);if(u!==this.columns.length&&!l)throw new Error(`Cell count must match column count. Found ${u} cells and ${this.columns.length} columns.`)}}this.rows.push(r)}super.commit(e,n,l)}updateColumns(e){if(!this.columnsDirty)return;this.rowHeaderColumnKeys=new Set,this.columns=[];let n=new Map,l=r=>{switch(r.type){case"column":n.set(r.key,r),r.hasChildNodes||(r.index=this.columns.length,this.columns.push(r),r.props.isRowHeader&&this.rowHeaderColumnKeys.add(r.key));break}for(let o of this.getChildren(r.key))l(o)};for(let r of this.getChildren(this.head.key))l(r);if(this.headerRows=ef(n,this.columns),this.columnsDirty=!1,this.rowHeaderColumnKeys.size===0&&this.columns.length>0&&!e)throw new Error("A table must have at least one Column with the isRowHeader prop set to true")}get columnCount(){return this.columns.length}*[Symbol.iterator](){let e=this.firstKey;for(;e!=null;){let n=this.getItem(e);n&&(yield n),e=(n==null?void 0:n.nextKey)??null}}getFirstKey(){for(let e of this)if(e.type==="tablebody")return e.firstChildKey??null;return null}getLastKey(){let e=this.lastKey;if(e==null)return null;let n=this.getItem(e);for(;(n==null?void 0:n.lastChildKey)!=null&&(n.type!=="item"||this.expandedKeys.has(n.key));)n=this.getItem(n.lastChildKey);return n==null?void 0:n.key}getKeyAfter(e){let n=this.getItem(e);if((n==null?void 0:n.type)==="column")return n.nextKey??null;if(!n)return null;if(n.type==="item"&&n.firstChildKey!=null&&this.expandedKeys.has(n.key)){let l=this.getItem(n.firstChildKey);for(;l;){if(l.type==="item")return l.key;l=l.nextKey!=null?this.getItem(l.nextKey):null}}return super.getKeyAfter(e)}getKeyBefore(e){var r;let n=this.getItem(e);if((n==null?void 0:n.type)==="column")return n.prevKey??null;if(!n)return null;let l=null;if(n.prevKey!=null){for(n=this.getItem(n.prevKey);n&&(n.type!=="item"||this.expandedKeys.has(n.key))&&n.lastChildKey!=null;)n=this.getItem(n.lastChildKey);l=(n==null?void 0:n.key)??null}return l==null&&(l=n.parentKey),l!=null&&((r=this.getItem(l))==null?void 0:r.type)==="tableheader"?null:l}getChildren(e){let n=this.getItem(e);if(!n){for(let r of this.headerRows)if(r.key===e)return r.childNodes}let l=this;return(n==null?void 0:n.type)==="tablebody"||(n==null?void 0:n.type)==="tablefooter"?{*[Symbol.iterator](){let r=n.firstChildKey,o=r!=null?l.getItem(r):null;for(;o;){yield o;let i=l.getKeyAfter(o.key);if(o=i!=null?l.getItem(i):null,o&&o.parentKey===n.parentKey)break}}}:{*[Symbol.iterator](){let r=l.getItem(e),o=(r==null?void 0:r.firstChildKey)!=null?l.getItem(r.firstChildKey):null;for(;o&&(yield o,o=o.nextKey!=null?l.getItem(o.nextKey):null,!((r==null?void 0:r.type)==="item"&&(o==null?void 0:o.type)!=="cell")););}}}clone(){let e=super.clone();return e.headerRows=this.headerRows,e.columns=this.columns,e.rows=this.rows,e.rowHeaderColumnKeys=this.rowHeaderColumnKeys,e.head=this.head,e}getTextValue(e){let n=this.getItem(e);if(!n)return"";if(n.textValue)return n.textValue;let l=this.rowHeaderColumnKeys,r=[];for(let o of this.getChildren(e)){let i=this.columns[o.index];if(l.has(i.key)&&o.textValue&&r.push(o.textValue),r.length===l.size)break}return r.join(" ")}constructor(...e){super(...e),this.headerRows=[],this.columns=[],this.rows=[],this.rowHeaderColumnKeys=new Set,this.head=new Yn(-1),this.columnsDirty=!0,this.expandedKeys=new Set}}const to=s.createContext(null),Lg=s.forwardRef(function(e,n){let l=ke(n),r=s.useRef(null),o=s.useRef(null),[i,u]=s.useState(0);ne(()=>{let c=r.current;for(;c&&c!==l.current&&!st(c);)c=c.parentElement;o.current=c},[l]),an({ref:o,box:"border-box",onResize(){var c;u(((c=o.current)==null?void 0:c.clientWidth)??0)}}),ne(()=>{var c;u(((c=o.current)==null?void 0:c.clientWidth)??0)},[]);let a=s.useMemo(()=>({tableRef:r,scrollRef:o,tableWidth:i,useTableColumnResizeState:fg,onResizeStart:e.onResizeStart,onResize:e.onResize,onResizeEnd:e.onResizeEnd}),[r,i,e.onResizeStart,e.onResize,e.onResizeEnd]);return g.createElement(le.div,{render:e.render,...ie(e,{global:!0}),ref:l,className:e.className||"react-aria-ResizableTableContainer",style:e.style,onScroll:e.onScroll},g.createElement(to.Provider,{value:a},e.children))}),zg=s.createContext(null),Ze=s.createContext(null),no=s.createContext(null),Ng=s.forwardRef(function(e,n){var f;[e,n]=xe(e,n,zg);let l=Hr(e),{selectionBehavior:r,selectionMode:o,disallowEmptySelection:i}=l,u=!!((f=e.dragAndDropHooks)!=null&&f.useDraggableCollectionState),a=s.useMemo(()=>({selectionBehavior:o==="none"?null:r,selectionMode:o,disallowEmptySelection:i,allowsDragging:u}),[r,o,i,u]),c=g.createElement(jg.Provider,{value:a},g.createElement(xn,e));return g.createElement(zr,{content:c,createCollection:()=>new Fg},d=>g.createElement(Vg,{props:e,forwardedRef:n,selectionState:l,collection:d}))});let Og=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(fe);return l?g.createElement(le.div,{...e,ref:n}):g.createElement(le.table,{...e,ref:n})});const Ui={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function Vg({props:t,forwardedRef:e,selectionState:n,collection:l}){[t,e]=xe(t,e,rr);let{shouldUseVirtualFocus:r,disallowTypeAhead:o,filter:i,...u}=t,a=s.useContext(to);e=ke(s.useMemo(()=>ft(e,a==null?void 0:a.tableRef),[e,a==null?void 0:a.tableRef]));let[c,f]=Ct(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,t.onExpandedChange);l=s.useMemo(()=>l.withExpandedKeys(c),[l,c]);let d=hg({...u,collection:l,children:void 0,UNSAFE_selectionState:n,expandedKeys:c,onExpandedChange:f}),b=mg(d,i),{isVirtualized:p,layoutDelegate:h,dropTargetDelegate:$,CollectionRoot:y}=s.useContext(fe),{dragAndDropHooks:m}=t,{gridProps:v}=xg({...u,layoutDelegate:h,isVirtualized:p},b,e),E=b.selectionManager,C=!!(m!=null&&m.useDraggableCollectionState),R=!!(m!=null&&m.useDroppableCollectionState);s.useRef(C),s.useRef(R),s.useEffect(()=>{},[C,R]);let A,K,P,z=!1,B=null,N=s.useRef(null),{direction:U}=Re(),[_]=s.useState(()=>new rg);if(C&&m){A=m.useDraggableCollectionState({collection:b.collection,selectionManager:E,preview:m.renderDragPreview?N:void 0}),m.useDraggableCollection({},A,e);let Z=m.DragPreview;B=m.renderDragPreview?g.createElement(Z,{ref:N},m.renderDragPreview):null}if(R&&m){K=m.useDroppableCollectionState({collection:b.collection,selectionManager:E});let Z=new sl({collection:b.collection,disabledKeys:E.disabledKeys,disabledBehavior:E.disabledBehavior,ref:e,layoutDelegate:h}),F=m.dropTargetDelegate||$||new m.ListDropTargetDelegate(l.rows,e);_.setup(F,d,U),P=m.useDroppableCollection({keyboardDelegate:Z,dropTargetDelegate:_,onDropActivate:V=>{var q;if(V.target.type==="item"){let Q=V.target.key,J=d.collection.getItem(Q),ge=c.has(Q);J&&J.hasChildNodes&&(!ge||(q=m==null?void 0:m.isVirtualDragging)!=null&&q.call(m))&&d.toggleKey(Q)}},onKeyDown:V=>{let q=K==null?void 0:K.target;if(q&&q.type==="item"&&q.dropPosition==="on"){let Q=d.collection.getItem(q.key);(V.key===Ui.expand[U]&&(Q!=null&&Q.hasChildNodes)&&!d.expandedKeys.has(q.key)||V.key===Ui.collapse[U]&&(Q!=null&&Q.hasChildNodes)&&d.expandedKeys.has(q.key))&&d.toggleKey(q.key)}}},K,e),z=K.isDropTarget({type:"root"})}let{focusProps:x,isFocused:S,isFocusVisible:I}=je(),w=ce({...t,children:void 0,defaultClassName:"react-aria-Table",values:{isDropTarget:z,isFocused:S,isFocusVisible:I,state:b}}),k=!!(C&&!(A!=null&&A.isDisabled)),D=w.style,T=null;a&&(T=a.useTableColumnResizeState({tableWidth:a.tableWidth},b),p||(D={...D,tableLayout:"fixed",width:"min-content"}));let O=ie(t,{global:!0});return g.createElement(_e,{values:[[Ze,b],[no,T],[qe,{dragAndDropHooks:m,dragState:A,dropState:K}],[qr,{render:e0}],[rr,null],[ja,null]]},g.createElement(Mr,null,g.createElement(Og,{...G(O,w,v,x,P==null?void 0:P.collectionProps),style:D,ref:e,slot:t.slot||void 0,onScroll:t.onScroll,"data-allows-dragging":k||void 0,"data-drop-target":z||void 0,"data-focused":S||void 0,"data-focus-visible":I||void 0},g.createElement(_a,null,g.createElement(y,{collection:b.collection,scrollRef:(a==null?void 0:a.scrollRef)??e,persistedKeys:yc(E,m,K)})))),B)}const jg=s.createContext(null),so=class so extends Ge{};so.type="tableheader";let Yn=so,_g=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(fe);return l?g.createElement(le.div,{...e,ref:n}):g.createElement(le.thead,{...e,ref:n})});const Hg=al(Yn,(t,e)=>{let n=s.useContext(Ze).collection,l=Lr({items:n.headerRows,children:s.useCallback(a=>{switch(a.type){case"headerrow":return g.createElement(Ug,{item:a});default:throw new Error("Unsupported node type in TableHeader: "+a.type)}},[])}),{rowGroupProps:r}=jf(),{hoverProps:o,isHovered:i}=He({onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),u=ce({...t,children:void 0,defaultClassName:"react-aria-TableHeader",values:{isHovered:i}});return g.createElement(_g,{...G(ie(t,{global:!0}),r,o),...u,ref:e,"data-hovered":i||void 0},l)},t=>g.createElement(xn,{dependencies:t.dependencies,items:t.columns},t.children));let Wg=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(fe);return l?g.createElement("div",{...e,ref:n}):g.createElement("tr",{...e,ref:n})});function Ug({item:t}){let e=s.useRef(null),n=s.useContext(Ze),{isVirtualized:l,CollectionBranch:r}=s.useContext(fe),{rowProps:o}=kg({node:t,isVirtualized:l},n,e),{checkboxProps:i}=Bg(n);return g.createElement(Wg,{...o,ref:e},g.createElement(_e,{values:[[Xr,{slots:{selection:i}}],[Tc,{slots:{selection:i}}]]},g.createElement(r,{collection:n.collection,parent:t})))}const co=class co extends Ge{};co.type="column";let pr=co,Gg=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(fe);return l?g.createElement(le.div,{...e,ref:n}):g.createElement(le.th,{...e,ref:n})});const qg=vn(pr,(t,e,n)=>{var v,E;let l=ke(e),r=s.useContext(Ze),{isVirtualized:o}=s.useContext(fe),{columnHeaderProps:i,isPressed:u}=Eg({node:n,isVirtualized:o},r,l),{isFocused:a,isFocusVisible:c,focusProps:f}=je(),d=s.useContext(no),b=!1;d&&(b=d.resizingColumn===n.key);let{hoverProps:p,isHovered:h}=He({isDisabled:!t.allowsSorting}),$=ce({...t,id:void 0,children:n.rendered,defaultClassName:"react-aria-Column",values:{isHovered:h,isPressed:u,isFocused:a,isFocusVisible:c,allowsSorting:n.props.allowsSorting,sortDirection:((v=r.sortDescriptor)==null?void 0:v.column)===n.key?r.sortDescriptor.direction:void 0,isResizing:b,startResize:()=>{if(d)d.startResize(n.key),r.setKeyboardNavigationDisabled(!0);else throw new Error("Wrap your
in a to enable column resizing")},sort:C=>{r.sort(n.key,C)}}}),y=$.style;d&&(y={...y,width:d.getColumnWidth(n.key)});let m=ie(t,{global:!0});return delete m.id,g.createElement(Gg,{...G(m,i,f,p),...$,style:y,ref:l,"data-hovered":h||void 0,"data-pressed":u||void 0,"data-focused":a||void 0,"data-focus-visible":c||void 0,"data-resizing":b||void 0,"data-allows-sorting":n.props.allowsSorting||void 0,"data-sort-direction":((E=r.sortDescriptor)==null?void 0:E.column)===n.key?r.sortDescriptor.direction:void 0},g.createElement(_e,{values:[[_f,{column:n,triggerRef:l}],[fe,Nr]]},$.children))}),_f=s.createContext(null),Zg=s.forwardRef(function(e,n){let l=s.useContext(no);if(!l)throw new Error("Wrap your
in a to enable column resizing");let r=Ne(Ig(gc),"react-aria-components"),{onResizeStart:o,onResize:i,onResizeEnd:u}=s.useContext(to),{column:a,triggerRef:c}=s.useContext(_f),f=s.useRef(null),{resizerProps:d,inputProps:b,isResizing:p}=Rg({column:a,"aria-label":e["aria-label"]||r.format("tableResizer"),onResizeStart:o,onResize:i,onResizeEnd:u,triggerRef:c},l,f),{focusProps:h,isFocused:$,isFocusVisible:y}=je(),{hoverProps:m,isHovered:v}=He(e),E=l.getColumnMinWidth(a.key)>=l.getColumnWidth(a.key),C=l.getColumnMaxWidth(a.key)<=l.getColumnWidth(a.key),{direction:R}=Re(),A="both";E?A=R==="rtl"?"right":"left":C?A=R==="rtl"?"left":"right":A="both";let K=ke(n),[P,z]=s.useState("");s.useEffect(()=>{if(!K.current)return;let S=window.getComputedStyle(K.current);z(S.cursor)},[K,A]);let B=ce({...e,defaultClassName:"react-aria-ColumnResizer",values:{isFocused:$,isFocusVisible:y,isResizing:p,isHovered:v,resizableDirection:A}}),[N,U]=s.useState(!1),_=S=>{S.pointerType==="mouse"&&U(!0)};!p&&N&&U(!1);let x=ie(e,{global:!0});return g.createElement(le.div,{ref:K,role:"presentation",...G(x,B,d,{onPointerDown:_},m),"data-hovered":v||void 0,"data-focused":$||void 0,"data-focus-visible":y||void 0,"data-resizing":p||void 0,"data-resizable-direction":A},B.children,g.createElement("input",{ref:f,...G(b,h)}),p&&N&&Yi.createPortal(g.createElement("div",{style:{position:"fixed",top:0,left:0,bottom:0,right:0,cursor:P}}),document.body))}),fo=class fo extends ul{};fo.type="tablebody";let Xn=fo,Yg=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(fe);return l?g.createElement(le.div,{...e,ref:n}):g.createElement(le.tbody,{...e,ref:n})});const Xg=al(Xn,(t,e,n)=>{let l=s.useContext(Ze),{isVirtualized:r}=s.useContext(fe),o=l.collection,{CollectionBranch:i}=s.useContext(fe),{dragAndDropHooks:u,dropState:a}=s.useContext(qe),c=!!(u!=null&&u.useDroppableCollectionState)&&!(a!=null&&a.isDisabled),f=c&&!!a&&(a.isDropTarget({type:"root"})??!1),d=o.size===0,b={isDropTarget:f,isEmpty:d},p=ce({...t,id:void 0,children:void 0,defaultClassName:"react-aria-TableBody",values:b}),h,$=o.columnCount;if(d&&t.renderEmptyState&&l){let v={},E={},C={};r?(E["aria-colspan"]=$,C={display:"contents"}):E.colSpan=$,h=g.createElement(Lt,{role:"row",...v,style:C},g.createElement(zt,{role:"rowheader",...E,style:C},t.renderEmptyState(b)))}let{rowGroupProps:y}=jf(),m=ie(t,{global:!0});return g.createElement(Yg,{...G(m,p,y),ref:e,"data-empty":d||void 0},c&&g.createElement(o0,null),g.createElement(i,{collection:o,parent:n,renderDropIndicator:Zr(u,a)}),h)}),po=class po extends ul{};po.type="tablefooter";let Gi=po;const Hf=s.createContext({isFocusVisibleWithinRow:!1}),bo=class bo extends Ge{filter(e,n,l){let r=e.getChildren(this.key);for(let o of r)if(l(o.textValue,o)){let i=this.clone();return n.addDescendants(i,e),i}return null}};bo.type="item";let br=bo,Lt=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(fe);return l?g.createElement(le.div,{...e,ref:n}):g.createElement(le.tr,{...e,ref:n})});const Jg=al(br,(t,e,n)=>{var k;let l=ke(e),r=s.useContext(Ze),{dragAndDropHooks:o,dragState:i,dropState:u}=s.useContext(qe),{isVirtualized:a,CollectionBranch:c}=s.useContext(fe),f=i&&!(i.isDisabled||i.selectionManager.isDisabled(n.key)),{rowProps:d,expandButtonProps:b,...p}=Dg({node:n,shouldSelectOnPressUp:!!i,isVirtualized:a},r,l),{isFocused:h,isFocusVisible:$,focusProps:y}=je(),{isFocusVisible:m,focusProps:v}=je({within:!0}),{hoverProps:E,isHovered:C}=He({isDisabled:!p.allowsSelection&&!p.hasAction&&!f,onHoverStart:t.onHoverStart,onHoverChange:t.onHoverChange,onHoverEnd:t.onHoverEnd}),{checkboxProps:R}=Tg({key:n.key},r),A;i&&o&&(A=o.useDraggableItem({key:n.key,hasDragButton:!0},i));let K,P=s.useRef(null),{visuallyHiddenProps:z}=$n();u&&o&&(K=o.useDropIndicator({target:{type:"item",key:n.key,dropPosition:"on"}},u,P));let B=s.useRef(null);s.useEffect(()=>{i&&B.current},[]);let N=i&&i.isDragging(n.key),{children:U,..._}=t,x=t.hasChildItems||((k=r.collection.getItem(n.lastChildKey))==null?void 0:k.type)!=="cell",S=x&&r.expandedKeys.has(n.key),I=ce({..._,id:void 0,defaultClassName:"react-aria-Row",defaultStyle:{"--table-row-level":n.level+1},values:{...p,state:r,isHovered:C,isFocused:h,isFocusVisible:$,selectionMode:r.selectionManager.selectionMode,selectionBehavior:r.selectionManager.selectionBehavior,isDragging:N,isDropTarget:K==null?void 0:K.isDropTarget,isFocusVisibleWithin:m,id:n.key,hasChildItems:x,isExpanded:S,level:n.level+1}}),w=ie(t,{global:!0});return delete w.id,delete w.onClick,g.createElement(g.Fragment,null,K&&!K.isHidden&&g.createElement(Lt,{role:"row",style:{height:0}},g.createElement(zt,{role:"gridcell",colSpan:r.collection.columnCount,style:{padding:0}},g.createElement("div",{role:"button",...z,...K.dropIndicatorProps,ref:P}))),g.createElement(Lt,{...G(w,I,d,y,E,A==null?void 0:A.dragProps,v),ref:l,"data-disabled":p.isDisabled||void 0,"data-selected":p.isSelected||void 0,"data-hovered":C||void 0,"data-focused":p.isFocused||void 0,"data-focus-visible":$||void 0,"data-pressed":p.isPressed||void 0,"data-dragging":N||void 0,"data-drop-target":(K==null?void 0:K.isDropTarget)||void 0,"data-selection-mode":r.selectionManager.selectionMode==="none"?void 0:r.selectionManager.selectionMode,"data-focus-visible-within":m||void 0,"data-expanded":S||void 0,"data-has-child-items":x||void 0,"data-level":n.level+1},g.createElement(_e,{values:[[Xr,{slots:{[mt]:{},selection:R}}],[Tc,{slots:{[mt]:{},selection:R}}],[yn,{slots:{[mt]:{},chevron:b,drag:{...A==null?void 0:A.dragButtonProps,ref:B,style:{pointerEvents:"none"}}}}],[Ha,{isSelected:p.isSelected}],[Hf,{isFocusVisibleWithinRow:m}]]},g.createElement(c,{collection:r.collection,parent:n}))))},t=>{if(t.id==null&&typeof t.children=="function")throw new Error("No id detected for the Row element. The Row element requires a id to be provided to it when the cells are rendered dynamically.");let e=[t.value].concat(t.dependencies);return g.createElement(xn,{dependencies:e,items:t.columns,idScope:t.id},t.children)}),ho=class ho extends Ge{};ho.type="cell";let hr=ho,zt=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(fe);return l?g.createElement(le.div,{...e,ref:n}):g.createElement(le.td,{...e,ref:n})});const Qg=vn(hr,(t,e,n)=>{var K;let l=ke(e),r=s.useContext(Ze),{dragState:o}=s.useContext(qe),{isVirtualized:i}=s.useContext(fe);n.column=r.collection.columns[n.index];let{gridCellProps:u,isPressed:a}=Pg({node:n,shouldSelectOnPressUp:!!o,isVirtualized:i},r,l),{isFocused:c,isFocusVisible:f,focusProps:d}=je(),{hoverProps:b,isHovered:p}=He({}),{isFocusVisibleWithinRow:h}=s.useContext(Hf),$=n.parentKey!=null?r.selectionManager.isSelected(n.parentKey):!1,y=n.colIndex||n.index,m=r.collection.getItem(n.parentKey),v=m.props.hasChildItems||((K=r.collection.getItem(m.lastChildKey))==null?void 0:K.type)!=="cell",E=v&&r.expandedKeys.has(n.parentKey),C=r.selectionManager.isDisabled(n.parentKey),R=ce({...t,id:void 0,defaultClassName:"react-aria-Cell",values:{isFocused:c,isFocusVisible:f,isFocusVisibleWithinRow:h,isPressed:a,isHovered:p,isSelected:$,id:n.key,columnIndex:y,hasChildItems:v,isExpanded:E,isDisabled:C,level:m.level+1,isTreeColumn:n.column.key===r.treeColumn}}),A=ie(t,{global:!0});return delete A.id,g.createElement(zt,{...G(A,R,u,d,b),ref:l,"data-focused":c||void 0,"data-focus-visible":f||void 0,"data-focus-visible-within-row":h||void 0,"data-pressed":a||void 0,"data-selected":$||void 0,"data-column-index":y,"data-expanded":E||void 0,"data-has-child-items":v||void 0,"data-level":m.level+1,"data-tree-column":n.column.key===r.treeColumn||void 0,"data-disabled":C||void 0},g.createElement(fe.Provider,{value:Nr},R.children))});function e0(t,e){var c;e=ke(e);let{dragAndDropHooks:n,dropState:l}=s.useContext(qe),r=s.useRef(null),{dropIndicatorProps:o,isHidden:i,isDropTarget:u}=n.useDropIndicator(t,l,r);if(i)return null;let a=l&&t.target.type==="item"?(((c=l.collection.getItem(t.target.key))==null?void 0:c.level)||0)+1:1;return g.createElement(r0,{...t,dropIndicatorProps:o,isDropTarget:u,buttonRef:r,level:a,ref:e})}let t0=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(fe);return l?g.createElement(le.div,{...e,ref:n}):g.createElement(le.tr,{...e,ref:n})}),n0=s.forwardRef(function(e,n){let{isVirtualized:l}=s.useContext(fe);return l?g.createElement(le.div,{...e,ref:n}):g.createElement(le.td,{...e,ref:n})});function l0(t,e){let{dropIndicatorProps:n,isDropTarget:l,buttonRef:r,level:o,...i}=t,u=s.useContext(Ze),{visuallyHiddenProps:a}=$n(),c=ce({...i,defaultClassName:"react-aria-DropIndicator",defaultStyle:{"--table-row-level":o+1},values:{isDropTarget:l}});return g.createElement(t0,{...ie(t,{global:!0}),...c,role:"row",ref:e,"data-drop-target":l||void 0,"aria-level":o},g.createElement(n0,{role:"gridcell",colSpan:u.collection.columnCount,style:{padding:0}},g.createElement("div",{...a,role:"button",...n,ref:r}),c.children))}const r0=s.forwardRef(l0);function o0(){let t=s.useContext(Ze),{dragAndDropHooks:e,dropState:n}=s.useContext(qe),l=s.useRef(null),{dropIndicatorProps:r}=e.useDropIndicator({target:{type:"root"}},n,l),o=n.isDropTarget({type:"root"}),{visuallyHiddenProps:i}=$n();return!o&&r["aria-hidden"]?null:g.createElement(Lt,{role:"row","aria-hidden":r["aria-hidden"],style:{height:0}},g.createElement(zt,{role:"gridcell",colSpan:t.collection.columnCount,style:{padding:0}},g.createElement("div",{role:"button",...i,...r,ref:l})))}const i0=vn(qn,function(e,n,l){let r=s.useContext(Ze),{isVirtualized:o}=s.useContext(fe),{isLoading:i,onLoadMore:u,scrollOffset:a,...c}=e,f=r.collection.columns.length,d=s.useRef(null),b=s.useMemo(()=>({onLoadMore:u,collection:r==null?void 0:r.collection,sentinelRef:d,scrollOffset:a}),[u,a,r==null?void 0:r.collection]);uu(b,d);let p=ce({...c,id:void 0,children:l.rendered,defaultClassName:"react-aria-TableLoadingIndicator",defaultStyle:{"--table-row-level":l.level+1},values:void 0}),h={},$={},y={};return o?($["aria-colspan"]=f,y={display:"contents"}):$.colSpan=f,g.createElement(g.Fragment,null,g.createElement(Lt,{style:{height:0},inert:au(!0)},g.createElement(zt,{style:{padding:0,border:0}},g.createElement("div",{"data-testid":"loadMoreSentinel",ref:d,style:{position:"relative",height:1,width:1}}))),i&&p.children&&g.createElement(Lt,{...G(ie(e,{global:!0}),h),...p,role:"row",ref:n,"aria-level":l.level+1,"data-level":l.level+1},g.createElement(zt,{role:"rowheader",...$,style:y},p.children)))}),Wf=s.createContext({}),qi=({children:t,className:e,variant:n,...l})=>{const r=g.useMemo(()=>sh({variant:n}),[n]);return M.jsx(Jm,{className:me(e,r.item()),"data-slot":"list-box-item",...l,children:o=>M.jsx(Wf,{value:{slots:r,state:o},children:typeof t=="function"?t(o):t})})},Uf=({children:t,className:e,...n})=>{const{slots:l,state:r}=s.useContext(Wf),o=r==null?void 0:r.isSelected,i=typeof t=="function"?t(r??{}):t||M.jsx("svg",{"aria-hidden":"true","data-slot":"list-box-item-indicator--checkmark",fill:"none",role:"presentation",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:o?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 17 18",children:M.jsx("polyline",{points:"1 9 7 14 15 4"})});return M.jsx(Se.span,{"aria-hidden":"true",className:de(l==null?void 0:l.indicator,e),"data-slot":"list-box-item-indicator","data-visible":o||void 0,...n,children:i})},u0=Object.assign(qi,{Root:qi,Indicator:Uf}),a0=({children:t,className:e,...n})=>{const l=g.useMemo(()=>ch({class:typeof e=="string"?e:void 0}),[e]);return M.jsx(Xm,{className:l,...n,children:t})},s0=a0;function Zi({className:t,variant:e,...n}){const l=g.useMemo(()=>ah({variant:e}),[e]);return M.jsx(Zm,{className:me(t,l),"data-slot":"list-box",...n})}const D0=Object.assign(Zi,{Root:Zi,Item:u0,ItemIndicator:Uf,Section:s0}),Me=s.createContext({}),mr=({children:t,className:e,variant:n,...l})=>{const r=g.useMemo(()=>fh({variant:n}),[n]);return M.jsx(Me,{value:{slots:r},children:M.jsx(Se.div,{className:r.base({className:e}),"data-slot":"table",...l,children:t})})};mr.displayName="HeroUI.Table";const Gf=({className:t,...e})=>{const{slots:n}=s.useContext(Me);return M.jsx(Se.div,{className:de(n==null?void 0:n.scrollContainer,t),"data-slot":"table-scroll-container",...e})};Gf.displayName="HeroUI.Table.ScrollContainer";function qf({className:t,...e}){const{slots:n}=s.useContext(Me);return M.jsx(Ng,{className:me(t,n==null?void 0:n.content()),"data-slot":"table-content",...e})}qf.displayName="HeroUI.Table.Content";function Zf({className:t,...e}){const{slots:n}=s.useContext(Me);return M.jsx(Hg,{className:me(t,n==null?void 0:n.header()),"data-slot":"table-header",...e})}Zf.displayName="HeroUI.Table.Header";const Yf=g.forwardRef(({className:t,...e},n)=>{const{slots:l}=s.useContext(Me);return M.jsx(qg,{ref:n,className:me(t,l==null?void 0:l.column()),"data-slot":"table-column",...e})});Yf.displayName="HeroUI.Table.Column";function Xf({className:t,...e}){const{slots:n}=s.useContext(Me);return M.jsx(Xg,{className:me(t,n==null?void 0:n.body()),"data-slot":"table-body",...e})}Xf.displayName="HeroUI.Table.Body";function Jf({className:t,...e}){const{slots:n}=s.useContext(Me);return M.jsx(Jg,{className:me(t,n==null?void 0:n.row()),"data-slot":"table-row",...e})}Jf.displayName="HeroUI.Table.Row";const Qf=g.forwardRef(({className:t,...e},n)=>{const{slots:l}=s.useContext(Me);return M.jsx(Qg,{ref:n,className:me(t,l==null?void 0:l.cell()),"data-slot":"table-cell",...e})});Qf.displayName="HeroUI.Table.Cell";const ep=({className:t,...e})=>{const{slots:n}=s.useContext(Me);return M.jsx(Se.div,{className:de(n==null?void 0:n.footer,t),"data-slot":"table-footer",...e})};ep.displayName="HeroUI.Table.Footer";const tp=g.forwardRef(({className:t,...e},n)=>M.jsx(Lg,{ref:n,className:It("table__resizable-container",t),"data-slot":"table-resizable-container",...e}));tp.displayName="HeroUI.Table.ResizableContainer";const np=g.forwardRef(({className:t,...e},n)=>{const{slots:l}=s.useContext(Me);return M.jsx(Zg,{ref:n,className:me(t,l==null?void 0:l.columnResizer()),"data-slot":"table-column-resizer",...e})});np.displayName="HeroUI.Table.ColumnResizer";const lp=g.forwardRef(({className:t,...e},n)=>{const{slots:l}=s.useContext(Me);return M.jsx(i0,{ref:n,className:de(l==null?void 0:l.loadMore,t),"data-slot":"table-load-more",...e})});lp.displayName="HeroUI.Table.LoadMore";const rp=({className:t,...e})=>{const{slots:n}=s.useContext(Me);return M.jsx(Se.div,{className:de(n==null?void 0:n.loadMoreContent,t),"data-slot":"table-load-more-content",...e})};rp.displayName="HeroUI.Table.LoadMoreContent";const op=g.forwardRef(({children:t,className:e,indicator:n,showIndicator:l=!0,sortDirection:r,...o},i)=>{const{slots:u}=s.useContext(Me),a=l&&!!r;let c=null;if(a)if(n===void 0)c=M.jsx(Uh,{className:u==null?void 0:u.sortableColumnIndicator(),"data-direction":r,"data-slot":"table-sortable-column-indicator"});else if(g.isValidElement(n)){const f=n;c=g.cloneElement(f,{className:de(u==null?void 0:u.sortableColumnIndicator,f.props.className),"data-direction":r,"data-slot":"table-sortable-column-indicator"})}else c=n;return M.jsxs("span",{ref:i,className:de(u==null?void 0:u.sortableColumnHeader,e),"data-direction":r,"data-slot":"table-sortable-column-header",...o,children:[t,c]})});op.displayName="HeroUI.Table.SortableColumnHeader";const c0=xn,k0=Object.assign(mr,{Body:Xf,Cell:Qf,Collection:c0,Column:Yf,ColumnResizer:np,Content:qf,Footer:ep,Header:Zf,LoadMore:lp,LoadMoreContent:rp,ResizableContainer:tp,Root:mr,Row:Jf,ScrollContainer:Gf,SortableColumnHeader:op});export{y0 as $,b0 as A,m0 as B,v0 as C,S0 as D,C0 as I,w0 as L,x0 as S,E0 as T,D0 as a,u0 as b,Fp as c,g0 as d,h0 as e,$0 as f,Qb as g,k0 as h,V4 as r}; diff --git a/src/gateway/static/dashboard/assets/index-Bu_MKbvb.css b/src/gateway/static/dashboard/assets/index-BTjXME2B.css similarity index 92% rename from src/gateway/static/dashboard/assets/index-Bu_MKbvb.css rename to src/gateway/static/dashboard/assets/index-BTjXME2B.css index e8a027c3d..ef9a181ad 100644 --- a/src/gateway/static/dashboard/assets/index-Bu_MKbvb.css +++ b/src/gateway/static/dashboard/assets/index-BTjXME2B.css @@ -1 +1 @@ -/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--tw-content:"";--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-space-y-reverse:0;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-700:oklch(50.5% .213 27.518);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-500:oklch(72.3% .219 149.579);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-xl:calc(var(--radius) * 1.5);--radius-2xl:calc(var(--radius) * 2);--radius-3xl:calc(var(--radius) * 3);--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow-surface:var(--surface-shadow);--shadow-overlay:var(--overlay-shadow);--border-width-field:var(--field-border-width,var(--border-width));--ease-smooth:ease;--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-fluid:cubic-bezier(.32, .72, 0, 1);--ease-linear:linear}@layer theme.base{:root,.light,.default,[data-theme=light],[data-theme=default]{color-scheme:light;--white:oklch(100% 0 0);--black:oklch(0% 0 0);--snow:oklch(99.11% 0 0);--eclipse:oklch(21.03% .0059 285.89);--spacing:.25rem;--border-width:1px;--field-border-width:0px;--disabled-opacity:.5;--ring-offset-width:2px;--cursor-interactive:pointer;--cursor-disabled:not-allowed;--radius:.5rem;--field-radius:calc(var(--radius) * 1.5);--background:oklch(97.02% 0 0);--foreground:var(--eclipse);--surface:var(--white);--surface-foreground:var(--foreground);--surface-secondary:oklch(95.24% .0013 286.37);--surface-secondary-foreground:var(--foreground);--surface-tertiary:oklch(93.73% .0013 286.37);--surface-tertiary-foreground:var(--foreground);--overlay:var(--white);--overlay-foreground:var(--foreground);--muted:oklch(55.17% .0138 285.94);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(94% .001 286.375);--default-foreground:var(--eclipse);--accent:oklch(62.04% .195 253.83);--accent-foreground:var(--snow);--field-background:var(--white);--field-foreground:oklch(21.03% .0059 285.89);--field-placeholder:var(--muted);--field-border:transparent;--success:oklch(73.29% .1935 150.81);--success-foreground:var(--eclipse);--warning:oklch(78.19% .1585 72.33);--warning-foreground:var(--eclipse);--danger:oklch(65.32% .2328 25.74);--danger-foreground:var(--snow);--segment:var(--white);--segment-foreground:var(--eclipse);--border:oklch(90% .004 286.32);--separator:oklch(92% .004 286.32);--focus:var(--accent);--link:var(--foreground);--backdrop:#00000080;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:color-mix(in oklab, var(--accent) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 70%, var(--foreground) 30%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:color-mix(in oklab, var(--accent) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 70%, var(--foreground) 40%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:color-mix(in oklab, var(--warning) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 70%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:color-mix(in oklab, var(--warning) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:color-mix(in oklab, var(--success) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 60%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:color-mix(in oklab, var(--success) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--overlay-shadow:0 2px 8px 0 #0000000f, 0 -6px 12px 0 #00000008, 0 14px 28px 0 #00000014;--field-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--skeleton-animation:shimmer;--tooltip-delay:1.5s;--tooltip-close-delay:.5s}.dark,[data-theme=dark]{color-scheme:dark;--background:oklch(12% .005 285.823);--foreground:var(--snow);--surface:oklch(21.03% .0059 285.89);--surface-foreground:var(--foreground);--surface-secondary:oklch(25.7% .0037 286.14);--surface-tertiary:oklch(27.21% .0024 247.91);--overlay:oklch(21.03% .0059 285.89);--overlay-foreground:var(--foreground);--muted:oklch(70.5% .015 286.067);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}.dark,[data-theme=dark]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(27.4% .006 286.033);--default-foreground:var(--snow);--field-background:oklch(21.03% .0059 285.89);--field-foreground:var(--foreground);--warning:oklch(82.03% .1388 76.34);--warning-foreground:var(--eclipse);--danger:oklch(59.4% .1967 24.63);--danger-foreground:var(--snow);--segment:oklch(39.64% .01 285.93);--segment-foreground:var(--foreground);--border:oklch(28% .006 286.033);--separator:oklch(25% .006 286.033);--focus:var(--accent);--link:var(--foreground);--backdrop:#0009;--surface-shadow:0 0 0 0 transparent inset;--overlay-shadow:0 0 1px 0 #ffffff4d inset;--field-shadow:0 0 0 0 transparent inset;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}.dark,[data-theme=dark]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}.dark,[data-theme=dark]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}.dark,[data-theme=dark]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}.dark,[data-theme=dark]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}.dark,[data-theme=dark]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}.dark,[data-theme=dark]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}.dark,[data-theme=dark]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}.dark,[data-theme=dark]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}.dark,[data-theme=dark]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}.dark,[data-theme=dark]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}.dark,[data-theme=dark]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}.dark,[data-theme=dark]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}.dark,[data-theme=dark]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft:color-mix(in oklab, var(--accent) 12%, transparent)}}.dark,[data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-hover:color-mix(in oklab, var(--accent) 16%, transparent)}}.dark,[data-theme=dark]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}.dark,[data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}.dark,[data-theme=dark]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft:color-mix(in oklab, var(--warning) 12%, transparent)}}.dark,[data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-hover:color-mix(in oklab, var(--warning) 16%, transparent)}}.dark,[data-theme=dark]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft:color-mix(in oklab, var(--success) 12%, transparent)}}.dark,[data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-hover:color-mix(in oklab, var(--success) 16%, transparent)}}.dark,[data-theme=dark]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}.dark,[data-theme=dark]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}.dark,[data-theme=dark]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}.dark,[data-theme=dark]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}}@layer components;}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--border,currentColor)}::file-selector-button{border-color:var(--border,currentColor)}:root{view-transition-name:none}::view-transition{pointer-events:none}[data-scrollbar=thin]{--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--scrollbar-gutter:auto}[data-scrollbar=default]{--scrollbar-width:auto;--scrollbar-color:auto;--scrollbar-gutter:auto}[data-scrollbar=none]{--scrollbar-width:none;--scrollbar-color:auto;--scrollbar-gutter:auto}}@layer components{.close-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),color .15s var(--ease-out),background-color .1s var(--ease-out),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.close-button:focus-visible:not(:focus),.close-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.close-button:disabled,.close-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.close-button[data-pending=true]{pointer-events:none}.close-button svg{pointer-events:none;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);flex-shrink:0;align-self:center}.close-button--default{background-color:var(--default);color:var(--muted)}@media(hover:hover){.close-button--default:hover,.close-button--default[data-hovered=true]{background-color:var(--default-hover)}}.close-button--default:active,.close-button--default[data-pressed=true]{transform:scale(.93)}.description{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted)}.error-message{height:auto;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *),.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.field-error{height:0;padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);opacity:0}.field-error[data-visible]{opacity:1;height:auto}.field-error{transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *),.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox>.field-error,.checkbox>[data-slot=field-error],.switch>.field-error,.switch>[data-slot=field-error],.radio>.field-error,.radio>[data-slot=field-error]{height:auto;min-height:0;color:var(--muted);opacity:1;margin:0;padding:0;transition:none}.label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}:is(.label--required,[data-required=true]:not([role=group]):not([role=radiogroup]):not([role=checkboxgroup])>.label,[data-required=true]:not([data-slot=radio]):not([data-slot=checkbox])>.label):after{margin-left:calc(var(--spacing) * .5);color:var(--danger);--tw-content:"*";content:var(--tw-content)}.label--disabled,[data-disabled=true] .label{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.label--invalid,[data-invalid=true] .label,[aria-invalid=true] .label{color:var(--danger)}.accordion{contain:layout style;width:100%}.accordion__body{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.accordion__body-inner{padding-inline:calc(var(--spacing) * 4);padding-top:0;padding-bottom:calc(var(--spacing) * 4);color:var(--muted)}.accordion__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__indicator[data-expanded=true]{rotate:-180deg}.accordion__item{--tw-border-style:none;border-style:none;position:relative}.accordion__item:after{content:"";border-radius:calc(var(--radius) * .25);background-color:var(--separator);width:100%;height:1px;position:absolute;bottom:0;left:0}.accordion__item:last-child:after{content:none}.accordion__item[data-hide-separator=true]:after{display:none}.accordion__trigger{cursor:var(--cursor-interactive);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 4);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-tap-highlight-color:transparent;transition:opacity .15s var(--ease-out),box-shadow .15s var(--ease-out);flex:1;justify-content:space-between;align-items:center;display:flex}.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:color-mix(in oklab,var(--foreground) 3%,transparent 90%)}}}.accordion__trigger:focus-visible:not(:focus),.accordion__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.accordion__trigger:disabled,.accordion__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.accordion__panel{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__panel[data-expanded=true]{will-change:height,opacity;opacity:1}.accordion--surface{background-color:var(--surface);border-radius:min(32px,var(--radius-3xl))}@media(hover:hover){.accordion--surface .accordion__trigger:hover:not([aria-expanded=true]),.accordion--surface .accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--default)}}.accordion--surface .accordion__item:after{background-color:var(--surface-foreground)}@supports (color:color-mix(in lab,red,red)){.accordion--surface .accordion__item:after{background-color:color-mix(in oklab,var(--surface-foreground) 6%,transparent)}}.accordion--surface .accordion__item:after{width:94%;left:3%}.accordion--surface .accordion__item:first-child [data-slot=accordion-trigger]{border-top-left-radius:min(32px,var(--radius-3xl));border-top-right-radius:min(32px,var(--radius-3xl))}.accordion--surface .accordion__item:last-child:not(:has([data-slot=accordion-trigger][aria-expanded=true])) [data-slot=accordion-trigger]{border-bottom-left-radius:min(32px,var(--radius-3xl));border-bottom-right-radius:min(32px,var(--radius-3xl))}.breadcrumbs{align-items:center;display:flex}.breadcrumbs .breadcrumbs__link{padding-inline:calc(var(--spacing) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);opacity:1;text-decoration-line:none;position:relative}.breadcrumbs .breadcrumbs__link:hover,.breadcrumbs .breadcrumbs__link[data-hovered=true]{text-decoration-line:underline}.breadcrumbs .breadcrumbs__link[data-current=true]{color:var(--link);opacity:1}.breadcrumbs .breadcrumbs__item{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);padding-inline:calc(var(--spacing) * .5);flex-shrink:0;display:flex}.breadcrumbs .breadcrumbs__separator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:var(--muted)}.breadcrumbs .breadcrumbs__separator:where(:dir(rtl),[dir=rtl],[dir=rtl] *){rotate:180deg}.disclosure-group{contain:layout style;width:100%}.disclosure{position:relative}.accordion__heading{display:flex}.disclosure__trigger{cursor:var(--cursor-interactive);-webkit-tap-highlight-color:transparent;display:inline-block}.disclosure__trigger:focus-visible:not(:focus),.disclosure__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.disclosure__trigger:disabled,.disclosure__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.disclosure__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:inherit;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__indicator[data-expanded=true]{rotate:-180deg}.disclosure__content{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__content[data-expanded=true]{will-change:height,opacity;opacity:1}.disclosure__body{padding:calc(var(--spacing) * 2)}.link{border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);width:fit-content;height:fit-content;font-weight:var(--font-weight-medium);color:var(--link);text-decoration-line:none;-webkit-text-decoration-color:var(--separator-tertiary);text-decoration-color:var(--separator-tertiary);text-underline-offset:4px;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .1s var(--ease-out);align-items:center;text-decoration-thickness:1.5px;display:inline-flex;position:relative}.link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link{cursor:var(--cursor-interactive)}@media(hover:hover){.link:hover,.link[data-hovered=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.link:hover,.link[data-hovered=true]{-webkit-text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent);text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent)}}:is(.link:hover,.link[data-hovered=true]) .link__icon{opacity:1}}.link:active,.link[data-pressed=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}:is(.link:active,.link[data-pressed=true]) .link__icon{opacity:1}.link:focus-visible:not(:focus),.link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}:is(.link:focus-visible:not(:focus),.link[data-focus-visible=true]) .link__icon{opacity:1}.link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.link .link__icon{pointer-events:none;color:currentColor;opacity:.6;width:.75em;height:.75em;transition:opacity .15s var(--ease-out);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link .link__icon svg{transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.link .link__icon[data-default-icon=true]{margin-left:var(--spacing);padding-bottom:calc(var(--spacing) * 1.5)}.link.button{gap:0;text-decoration-line:none}.pagination{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);flex-direction:column;width:100%;display:flex}@media(min-width:40rem){.pagination{flex-direction:row}}.pagination__summary{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__summary{align-self:center}}.pagination__content{align-items:center;gap:var(--spacing);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__content{align-self:center}}.pagination__item{display:inline-flex}.pagination__link{isolation:isolate;width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);transform-origin:50%;border-radius:calc(var(--radius) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}@media(min-width:48rem){.pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.pagination__link{--pagination-link-bg:transparent;--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover);--pagination-link-fg:var(--default-foreground);background-color:var(--pagination-link-bg);color:var(--pagination-link-fg)}.pagination__link:focus-visible,.pagination__link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.pagination__link:disabled,.pagination__link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.pagination__link:hover,.pagination__link[data-hovered=true]{background-color:var(--pagination-link-bg-hover)}}.pagination__link:active,.pagination__link[data-pressed=true]{background-color:var(--pagination-link-bg-pressed);transform:scale(.97)}.pagination__link[data-active=true]{--pagination-link-bg:var(--default);--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover)}.pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:inline-flex}@media(min-width:48rem){.pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link--nav{gap:calc(var(--spacing) * 1.5);width:auto;padding-inline:calc(var(--spacing) * 2.5)}.pagination--sm .pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__link{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__link:active,.pagination--sm .pagination__link[data-pressed=true]{transform:scale(.98)}.pagination--sm .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 2)}.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.pagination--lg .pagination__link{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__link{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__link:active,.pagination--lg .pagination__link[data-pressed=true]{transform:scale(.96)}.pagination--lg .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 3)}.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__summary{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.tabs{gap:calc(var(--spacing) * 2);display:flex}.tabs[data-orientation=horizontal]{flex-direction:column}.tabs[data-orientation=vertical]{flex-direction:row}.tabs__list-container{position:relative}.tabs__list{background-color:var(--default);padding:var(--spacing);border-radius:calc(var(--radius) * 2.5);display:inline-flex}.tabs__list[data-orientation=horizontal]{flex-direction:row;width:100%}.tabs__list[data-orientation=vertical]{gap:var(--spacing);flex-direction:column}.tabs__list[data-orientation=vertical] .tabs__tab{min-width:calc(var(--spacing) * 20)}.tabs__tab{z-index:1;cursor:var(--cursor-interactive);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);width:100%;padding-inline:calc(var(--spacing) * 4);text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .15s var(--ease-smooth);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__tab[data-selected=true]{color:var(--segment-foreground)}.tabs__tab[data-selected=true] .tabs__separator,.tabs__tab[data-selected=true]+.tabs__tab .tabs__separator{opacity:0}.tabs__tab:disabled,.tabs__tab[data-disabled=true],.tabs__tab[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.tabs__tab:not([data-selected=true]):not([data-disabled=true]):hover,.tabs__tab[data-hovered=true]:not([data-selected=true]):not([data-disabled=true]){opacity:.7}}.tabs__tab:focus-visible:not(:focus),.tabs__tab[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tabs__separator{border-radius:calc(var(--radius) * .5);background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.tabs__separator{background-color:color-mix(in oklab,var(--muted) 25%,transparent)}}.tabs__separator{pointer-events:none;transition:opacity .15s var(--ease-smooth);position:absolute}.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__list[data-orientation=horizontal] .tabs__separator{width:1px;height:50%;top:25%;left:0}.tabs__list[data-orientation=vertical] .tabs__separator{width:90%;height:1px;top:0;left:5%}.tabs__panel{width:100%;padding:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none}.tabs__panel[data-exiting=true]{width:100%;position:absolute;top:0;left:0}.tabs__panel[data-orientation=horizontal]{margin-top:calc(var(--spacing) * 4)}.tabs__panel[data-orientation=vertical]{margin-left:calc(var(--spacing) * 4)}.tabs__indicator{box-shadow:var(--shadow-surface);z-index:-1;border-radius:var(--radius-3xl);background-color:var(--segment);width:100%;height:100%;transition-property:translate,width,height;transition-duration:.25s;transition-timing-function:var(--ease-out-fluid);position:absolute;top:0;left:0}.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs--secondary>.tabs__list-container>.tabs__list{background-color:#0000;border-radius:0;padding:0}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=horizontal]{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border);max-width:100%;overflow:auto clip}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=vertical]{border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--border)}.tabs--secondary>.tabs__list-container .tabs__tab{border-radius:0}.tabs--secondary>.tabs__list-container .tabs__tab[data-selected=true]{color:var(--foreground)}.tabs--secondary>.tabs__list-container .tabs__separator{display:none}.tabs--secondary>.tabs__list-container .tabs__indicator{background-color:var(--accent);box-shadow:none;border-radius:0}.tabs--secondary[data-orientation=horizontal]>.tabs__list-container .tabs__indicator{height:2px;top:auto;bottom:0}.tabs--secondary[data-orientation=vertical]>.tabs__list-container .tabs__indicator{width:2px;height:100%;top:0;left:0}.button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.button{height:calc(var(--spacing) * 9)}}.button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button{cursor:var(--cursor-interactive);--button-bg:transparent;--button-bg-hover:var(--button-bg);--button-bg-pressed:var(--button-bg-hover);--button-fg:currentColor;background-color:var(--button-bg);color:var(--button-fg)}.button:focus-visible:not(:focus),.button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.button:disabled,.button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.button[data-pending=true]{pointer-events:none}.button:active,.button[data-pressed=true]{background-color:var(--button-bg-pressed);transform:scale(.97)}@media(hover:hover){.button:hover,.button[data-hovered=true]{background-color:var(--button-bg-hover)}}.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.button--sm{height:calc(var(--spacing) * 8)}}.button--sm svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.button--sm:active,.button--sm[data-pressed=true]{transform:scale(.98)}.button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.button--lg{height:calc(var(--spacing) * 10)}}.button--lg:active,.button--lg[data-pressed=true]{transform:scale(.96)}.button--primary{--button-bg:var(--accent);--button-bg-hover:var(--accent-hover);--button-bg-pressed:var(--accent-hover);--button-fg:var(--accent-foreground)}.button--secondary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover);--button-fg:var(--accent-soft-foreground)}.button--tertiary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover)}.button--ghost,.button--outline{--button-bg:transparent;--button-bg-hover:var(--default);--button-bg-pressed:var(--default);--button-fg:var(--default-foreground)}.button--outline{border-style:var(--tw-border-style);border-width:1px;border-color:var(--border);--button-bg-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.button--outline{--button-bg-hover:color-mix(in srgb, var(--default) 60%, transparent)}}.button--danger{--button-bg:var(--danger);--button-bg-hover:var(--danger-hover);--button-bg-pressed:var(--danger-hover);--button-fg:var(--danger-foreground)}.button--danger-soft{--button-bg:var(--danger-soft);--button-bg-hover:var(--danger-soft-hover);--button-bg-pressed:var(--danger-soft-hover);--button-fg:var(--danger-soft-foreground)}.button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.button--icon-only{width:calc(var(--spacing) * 9)}}.button--icon-only.button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.button--icon-only.button--sm{width:calc(var(--spacing) * 8)}}.button--icon-only.button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.button--icon-only.button--lg{width:calc(var(--spacing) * 10)}}.button--full-width{width:100%}.button-group{justify-content:center;align-items:center;gap:0;height:auto;display:inline-flex}.button-group--horizontal{flex-direction:row}.button-group--vertical{flex-direction:column}.button-group .button{border-radius:0}.button-group--horizontal .button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.button-group--vertical .button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group .button:active,.button-group .button[data-pressed=true]{transform:none}.button-group .button:focus-visible:not(:focus),.button-group .button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button-group--horizontal .button-group__separator{width:1px;height:50%;top:25%;left:-1px}.button-group--vertical .button-group__separator{width:50%;height:1px;top:-1px;left:25%}.button-group--horizontal .button--outline:first-child{border-inline-end-style:var(--tw-border-style);border-inline-end-width:0}.button-group--horizontal .button--outline:last-child{border-inline-start-style:var(--tw-border-style);border-inline-start-width:0}.button-group--horizontal .button--outline:not(:first-child):not(:last-child){border-inline-style:var(--tw-border-style);border-inline-width:0}.button-group--vertical .button--outline:first-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.button-group--vertical .button--outline:last-child{border-top-style:var(--tw-border-style);border-top-width:0}.button-group--vertical .button--outline:not(:first-child):not(:last-child){border-block-style:var(--tw-border-style);border-block-width:0}.button-group--full-width{width:100%}.toggle-button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.toggle-button{height:calc(var(--spacing) * 9)}}.toggle-button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button{cursor:var(--cursor-interactive);--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover);--toggle-button-fg:currentColor;--toggle-button-bg-selected:var(--accent-soft);--toggle-button-bg-selected-hover:var(--accent-soft-hover);--toggle-button-bg-selected-pressed:var(--accent-soft-hover);--toggle-button-fg-selected:var(--accent-soft-foreground);background-color:var(--toggle-button-bg);color:var(--toggle-button-fg)}.toggle-button:focus-visible:not(:focus),.toggle-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.toggle-button:disabled,.toggle-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.toggle-button:hover,.toggle-button[data-hovered=true]{background-color:var(--toggle-button-bg-hover)}}.toggle-button:active,.toggle-button[data-pressed=true]{background-color:var(--toggle-button-bg-pressed);transform:scale(.97)}.toggle-button[data-selected=true]{background-color:var(--toggle-button-bg-selected);color:var(--toggle-button-fg-selected)}@media(hover:hover){.toggle-button[data-selected=true]:hover,.toggle-button[data-selected=true][data-hovered=true]{background-color:var(--toggle-button-bg-selected-hover)}}.toggle-button[data-selected=true]:active,.toggle-button[data-selected=true][data-pressed=true]{background-color:var(--toggle-button-bg-selected-pressed)}.toggle-button svg{pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.toggle-button svg{margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.toggle-button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.toggle-button--sm{height:calc(var(--spacing) * 8)}}.toggle-button--sm svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toggle-button--sm:active,.toggle-button--sm[data-pressed=true]{transform:scale(.98)}.toggle-button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.toggle-button--lg{height:calc(var(--spacing) * 10)}}.toggle-button--lg:active,.toggle-button--lg[data-pressed=true]{transform:scale(.96)}.toggle-button--default{--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover)}.toggle-button--ghost{--toggle-button-bg:transparent;--toggle-button-bg-hover:var(--default);--toggle-button-bg-pressed:var(--default);--toggle-button-fg:var(--default-foreground)}.toggle-button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.toggle-button--icon-only{width:calc(var(--spacing) * 9)}}.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 8)}}.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 10)}}.toggle-button-group{justify-content:center;align-items:center;gap:0;width:fit-content;height:auto;display:inline-flex}.toggle-button-group--horizontal{flex-direction:row}.toggle-button-group--vertical{flex-direction:column}.toggle-button-group--full-width{width:100%}.toggle-button-group .toggle-button{border-radius:0}.toggle-button-group--horizontal .toggle-button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group .toggle-button:active,.toggle-button-group .toggle-button[data-pressed=true]{transform:none}.toggle-button-group .toggle-button:focus-visible:not(:focus),.toggle-button-group .toggle-button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.toggle-button-group--full-width .toggle-button{flex:1}.toggle-button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button-group--horizontal .toggle-button-group__separator{width:1px;height:50%;top:25%;left:-1px}.toggle-button-group--vertical .toggle-button-group__separator{width:50%;height:1px;top:-1px;left:25%}.toggle-button-group--detached{gap:var(--spacing)}.toggle-button-group--detached .toggle-button{border-radius:calc(var(--radius) * 3)}.toggle-button-group--detached .toggle-button-group__separator{display:none}.toolbar{align-items:center;gap:calc(var(--spacing) * 2);grid-auto-flow:column;width:fit-content;display:grid}.toolbar .separator--vertical{align-self:center;height:50%}.toolbar .separator--horizontal{justify-content:center;justify-self:center;width:50%}.toolbar--vertical{grid-auto-flow:row;justify-content:flex-start;align-items:flex-start}.toolbar--vertical .button-group{justify-content:flex-start}.toolbar--attached{border-radius:calc(var(--radius) * 3);background-color:var(--surface);padding:var(--spacing);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dropdown{gap:var(--spacing);flex-direction:column;display:flex}.dropdown__trigger{--tw-outline-style:none;transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;display:inline-block}.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.dropdown__trigger{cursor:var(--cursor-interactive)}.dropdown__trigger:focus-visible:not(:focus),.dropdown__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.dropdown__trigger:disabled,.dropdown__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.dropdown__trigger[data-pending=true]{pointer-events:none}.dropdown__trigger:active,.dropdown__trigger[data-pressed=true]{transform:scale(.97)}.dropdown__popover{max-width:48svw;transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));padding:0;overflow-y:auto}@media(min-width:48rem){.dropdown__popover{min-width:calc(var(--spacing) * 55)}}.dropdown__popover{border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay)}.dropdown__popover:focus-visible:not(:focus),.dropdown__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.dropdown__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.dropdown__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.dropdown__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.dropdown__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.dropdown__popover[data-exiting=true],.dropdown__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.dropdown__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.dropdown__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.dropdown__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.dropdown__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.dropdown__popover [data-slot=dropdown-menu]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.dropdown__popover [data-slot=menu-item]{padding-inline:calc(var(--spacing) * 2.5)}.dropdown__menu{gap:calc(var(--spacing) * .5);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.dropdown__menu [data-slot=separator]{width:94%;margin-left:3%}.list-box-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item{cursor:var(--cursor-interactive)}.list-box-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.list-box-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.list-box-item:has(.list-box-item__indicator){padding-inline-end:calc(var(--spacing) * 7)}.list-box-item:focus-visible:not(:focus),.list-box-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.list-box-item:active,.list-box-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.list-box-item:hover,.list-box-item[data-hovered=true]{background-color:var(--default)}}.list-box-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.list-box-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--default-foreground);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-end:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]{transition:stroke-dashoffset .25s linear}:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item--danger .list-box-item__indicator,.list-box-item--danger [data-slot=label]{color:var(--danger)}.list-box-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.list-box{width:100%;padding:var(--spacing);position:relative;overflow:clip}.list-box>*+*{margin-top:var(--spacing)}.list-box [data-slot=separator][data-orientation=horizontal]{width:94%;margin-left:3%}.menu-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item{cursor:var(--cursor-interactive)}.menu-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.menu-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.menu-item [data-slot=submenu-indicator] svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.menu-item:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 7)}.menu-item[data-has-submenu=true]:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 7)}.menu-item:focus-visible:not(:focus),.menu-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.menu-item:active,.menu-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.menu-item:hover,.menu-item[data-hovered=true]{background-color:var(--default)}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]{transition:stroke-dashoffset .1s linear}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--dot]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.menu-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.menu-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-start:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item[data-has-submenu=true] .menu-item__indicator{inset-inline-start:auto;inset-inline-end:calc(var(--spacing) * 2)}.menu-item__indicator [data-slot=menu-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:0}.menu-item__indicator--submenu{color:var(--muted)}.menu-item__indicator--submenu svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.menu-item--danger .menu-item__indicator,.menu-item--danger [data-slot=label]{color:var(--danger)}.menu-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.menu{gap:var(--spacing);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.menu [data-slot=separator]{width:94%;margin-left:3%}.tag-group{gap:var(--spacing);flex-direction:column;display:flex;position:relative}.tag-group__list{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex;position:relative}.tag-group [slot=description],.tag-group [data-slot=description],.tag-group [slot=errorMessage],.tag-group [data-slot=error-message]{padding:var(--spacing)}.tag{--optical-offset:.031em;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:inline-flex;position:relative}.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tag{cursor:var(--cursor-interactive)}.tag svg{pointer-events:none;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:currentColor;flex-shrink:0;align-self:center}.tag:is([data-disabled=true],[aria-disabled=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tag:is(:focus-visible,[data-focus-visible]){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tag:is([data-selected=true],[aria-selected=true]){background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.tag:is([data-selected=true],[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-soft-hover)}}.tag--sm{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--md{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--lg{border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.tag--default{background-color:var(--default);color:var(--default-foreground)}@media(hover:hover){.tag--default:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--default-hover)}}.tag--surface{background-color:var(--surface);color:var(--surface-foreground)}@media(hover:hover){.tag--surface:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--surface-hover)}}.tag__remove-button{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:inherit}.tag__remove-button svg{width:inherit;height:inherit;color:currentColor;flex-shrink:0;align-self:center}.color-area{width:100%;max-width:calc(var(--spacing) * 56);border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;aspect-ratio:1;background:var(--color-area-background);flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-area[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-area--show-dots:after{content:"";pointer-events:none;border-radius:inherit;background-image:radial-gradient(circle,#fff3 1px,#0000 1px);background-size:8px 8px;position:absolute;top:0;right:0;bottom:0;left:0}.color-area__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);will-change:width,height;background-color:var(--color-area-thumb-color);transition:width .15s var(--ease-out),height .15s var(--ease-out);border:3px solid #fff;box-shadow:0 0 0 1px #0000001a,inset 0 0 0 1px #0000001a}.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-area__thumb[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-area__thumb[data-dragging=true]{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.color-area__thumb[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker{display:inline-flex}.color-picker__trigger{align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-flex}.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-picker__trigger [data-slot=label]{cursor:var(--cursor-interactive)}.color-picker__trigger:focus-visible:not(:focus),.color-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-picker__trigger:disabled,.color-picker__trigger[data-disabled=true],.color-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker__popover{min-width:calc(var(--spacing) * 62);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 3);box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5));gap:calc(var(--spacing) * 3);flex-direction:column;display:flex;overflow:hidden auto}.color-picker__popover:focus-visible:not(:focus),.color-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.color-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.color-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.color-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.color-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.color-picker__popover[data-exiting=true],.color-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.color-slider{gap:var(--spacing);grid-template:"label output""track track"/1fr auto;width:100%;display:grid}.color-slider:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template:"track"/1fr;gap:0}.color-slider:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-columns:1fr;grid-template-areas:"label""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output){grid-template-columns:1fr;grid-template-areas:"output""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output) .color-slider__output{justify-self:end}.color-slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.color-slider .color-slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.color-slider .color-slider__track{border-radius:calc(var(--radius) * 2);grid-area:track;position:relative}.color-slider .color-slider__track:before,.color-slider .color-slider__track:after{content:"";z-index:0;pointer-events:none;position:absolute}.color-slider .color-slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;border-style:var(--tw-border-style);border-width:3px;border-color:var(--color-white);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);z-index:1;transition:transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-slider .color-slider__thumb[data-dragging=true]{cursor:grabbing}.color-slider .color-slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-slider .color-slider__thumb[data-disabled=true]{cursor:default;background-color:var(--default)}.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]) [data-slot=label]{opacity:1}.color-slider[data-orientation=horizontal]{flex-direction:column}.color-slider[data-orientation=horizontal] .color-slider__track{height:calc(var(--spacing) * 5);border-radius:0;justify-self:center;width:calc(100% - 1.25rem);box-shadow:inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:before,.color-slider[data-orientation=horizontal] .color-slider__track:after{width:.625rem;height:100%;top:0}.color-slider[data-orientation=horizontal] .color-slider__track:before{border-top-left-radius:calc(var(--radius) * 2);border-bottom-left-radius:calc(var(--radius) * 2);background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;left:-.625rem;box-shadow:inset 1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:after{border-top-right-radius:calc(var(--radius) * 2);border-bottom-right-radius:calc(var(--radius) * 2);background-color:var(--track-end-color,transparent);right:-.625rem;box-shadow:inset -1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);top:50%}.color-slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;place-items:center;height:100%}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template-rows:1fr;grid-template-areas:"track";gap:0}.color-slider[data-orientation=vertical]:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-rows:1fr auto;grid-template-areas:"track""label"}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):has(.color-slider__output){grid-template-rows:auto 1fr;grid-template-areas:"output""track"}.color-slider[data-orientation=vertical] .color-slider__output,.color-slider[data-orientation=vertical] [data-slot=label]{text-align:center}.color-slider[data-orientation=vertical] .color-slider__track{width:calc(var(--spacing) * 5);border-radius:0;justify-self:center;height:calc(100% - 1.25rem);box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:before,.color-slider[data-orientation=vertical] .color-slider__track:after{width:100%;height:.625rem;left:0}.color-slider[data-orientation=vertical] .color-slider__track:before{background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;border-bottom-right-radius:999px;border-bottom-left-radius:999px;bottom:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:after{background-color:var(--track-end-color,transparent);border-top-left-radius:999px;border-top-right-radius:999px;top:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);left:50%}.color-swatch{box-sizing:border-box;width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);background:linear-gradient(var(--color-swatch-current),var(--color-swatch-current)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-swatch--circle{border-radius:calc(var(--radius) * 2)}.color-swatch--square{border-radius:calc(var(--radius) * .75)}.color-swatch--xs{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.color-swatch--xs.color-swatch--circle{border-radius:calc(var(--radius) * 1)}.color-swatch--sm{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.color-swatch--sm.color-swatch--circle{border-radius:calc(var(--radius) * 1.5)}.color-swatch--lg{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.color-swatch--lg.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.color-swatch--xl.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch-picker{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.color-swatch-picker__item{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);border-style:var(--tw-border-style);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:border-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);border-width:2px;border-color:#0000;outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__item:focus-visible,.color-swatch-picker__item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-swatch-picker__item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-swatch-picker__item[data-selected=true]{border-color:var(--color-swatch-current);box-shadow:var(--field-shadow)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{transform:scale(.77)}.color-swatch-picker__swatch{border-radius:inherit;width:100%;height:100%;transition:transform .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:block}.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-swatch-picker__swatch:hover{transform:scale(1.1)}}.color-swatch-picker__indicator{pointer-events:none;z-index:10;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.color-swatch-picker__indicator>*{width:33.3333%;height:33.3333%;color:var(--color-white);transition:transform .15s var(--ease-out);transform:scale(0)translateZ(0)}.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__indicator[data-light-color=true] .color-swatch-picker__indicator>*{color:var(--color-black)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__indicator>*{transform:scale(1)translateZ(0)}.color-swatch-picker--stack{flex-direction:column}.color-swatch-picker--xs .color-swatch-picker__item{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px}.color-swatch-picker--sm .color-swatch-picker__item{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);border-style:var(--tw-border-style);border-width:2px}.color-swatch-picker--lg .color-swatch-picker__item{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--xl .color-swatch-picker__item{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--square .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-input-group:hover:not(:focus-within),.color-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.color-input-group[data-focus-within=true],.color-input-group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.color-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group[data-invalid=true]:focus,.color-input-group[data-invalid=true]:focus-visible,.color-input-group[data-invalid=true][data-focused=true],.color-input-group[data-invalid=true][data-focus-visible=true],.color-input-group[data-invalid=true]:focus-within,.color-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.color-input-group[data-disabled=true],.color-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-input-group__input{cursor:text;border-style:var(--tw-border-style);height:100%;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;display:flex}@media(min-width:40rem){.color-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.color-input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}.color-input-group:has([data-slot=color-input-group-prefix]) .color-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.color-input-group:has([data-slot=color-input-group-suffix]) .color-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.color-input-group__input:focus,.color-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.color-input-group__prefix{color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group__suffix{color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--color-input-group-bg);--color-input-group-bg:var(--default);--color-input-group-bg-hover:var(--default-hover);--color-input-group-bg-focus:var(--default)}@media(hover:hover){.color-input-group--secondary:hover:not(:focus-within),.color-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--color-input-group-bg-hover)}}.color-input-group--secondary:focus-within,.color-input-group--secondary[data-focus-within=true]{background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group--secondary[data-invalid=true]:focus,.color-input-group--secondary[data-invalid=true]:focus-visible,.color-input-group--secondary[data-invalid=true][data-focused=true],.color-input-group--secondary[data-invalid=true][data-focus-visible=true],.color-input-group--secondary[data-invalid=true]:focus-within,.color-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary [data-slot=color-input-group-input]{background-color:#0000}.color-input-group--full-width{width:100%}.color-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.color-field[data-invalid=true],.color-field[aria-invalid=true]) [data-slot=description]{display:none}.color-field [data-slot=label]{width:fit-content}.color-field--full-width{width:100%}.slider{gap:var(--spacing);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.slider .slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.slider .slider__track{border-radius:calc(var(--radius) * 1.5);background-color:var(--default);grid-area:track;position:relative}.slider .slider__fill{pointer-events:none;background-color:var(--accent);position:absolute}.slider .slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 1.5);background-color:var(--accent);-webkit-tap-highlight-color:transparent;transition:background-color .25s var(--ease-smooth),transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.slider .slider__thumb:after{z-index:10;border-radius:calc(var(--radius) * 1);background-color:var(--accent-foreground);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);content:"";transform-origin:50%;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));position:relative}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:after:not(:is()){transition-property:none}}.slider .slider__thumb[data-dragging=true]{cursor:grabbing}.slider .slider__thumb[data-dragging=true]:after{scale:.9}@media(prefers-reduced-motion:reduce){.slider .slider__thumb[data-dragging=true]:after:not(:is()){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.slider .slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.slider .slider__thumb[data-disabled=true]{cursor:default}.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]) [data-slot=label]{opacity:1}.slider[data-orientation=horizontal]{flex-direction:column}.slider[data-orientation=horizontal] .slider__track{height:calc(var(--spacing) * 5);border-inline-style:var(--tw-border-style);border-inline-width:.75rem;border-inline-color:#0000;width:100%}.slider[data-orientation=horizontal] .slider__track[data-fill-start=true]{border-inline-start-color:var(--accent)}.slider[data-orientation=horizontal] .slider__track[data-fill-end=true]{border-inline-end-color:var(--accent)}.slider[data-orientation=horizontal] .slider__fill,.slider[data-orientation=horizontal] .slider__thumb{height:100%}.slider[data-orientation=horizontal] .slider__thumb{width:1.75rem;top:50%}.slider[data-orientation=horizontal] .slider__thumb:after{width:1.5rem;height:1rem}.slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;height:100%}.slider[data-orientation=vertical] .slider__output,.slider[data-orientation=vertical] [data-slot=label]{text-align:center}.slider[data-orientation=vertical] .slider__track{height:100%;width:calc(var(--spacing) * 5);border-block-style:var(--tw-border-style);border-block-width:.75rem;border-block-color:#0000;justify-self:center}.slider[data-orientation=vertical] .slider__track[data-fill-start=true]{border-bottom-color:var(--accent)}.slider[data-orientation=vertical] .slider__track[data-fill-end=true]{border-top-color:var(--accent)}.slider[data-orientation=vertical] .slider__fill,.slider[data-orientation=vertical] .slider__thumb{width:100%}.slider[data-orientation=vertical] .slider__thumb{height:1.75rem;left:50%}.slider[data-orientation=vertical] .slider__thumb:after{width:1rem;height:1.5rem}.switch{align-items:flex-start;gap:var(--spacing);-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);--switch-control-bg:var(--default);--switch-control-bg-hover:var(--switch-control-bg);flex-direction:column;display:flex}@supports (color:color-mix(in lab,red,red)){.switch{--switch-control-bg-hover:color-mix(in oklab, var(--switch-control-bg), transparent 20%)}}.switch{--switch-control-bg-pressed:var(--switch-control-bg-hover);--switch-control-bg-checked:var(--accent);--switch-control-bg-checked-hover:var(--accent-hover)}.switch[data-disabled=true],.switch[data-disabled=true] [data-slot=description],.switch[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.switch[data-disabled=true] .switch__thumb{background-color:var(--default-foreground)}@supports (color:color-mix(in lab,red,red)){.switch[data-disabled=true] .switch__thumb{background-color:color-mix(in oklab,var(--default-foreground) 20%,transparent)}}.switch>[data-slot=description]{width:100%;min-width:0;padding-inline-start:3.25rem}.switch>[data-slot=field-error]{width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--muted);padding-inline-start:3.25rem}.switch.switch--sm>[data-slot=description],.switch.switch--sm>[data-slot=field-error]{padding-inline-start:2.75rem}.switch.switch--lg>[data-slot=description],.switch.switch--lg>[data-slot=field-error]{padding-inline-start:3.75rem}:is(.switch:disabled[aria-checked=true],.switch:disabled[data-selected=true],.switch[data-disabled=true][aria-checked=true],.switch[data-disabled=true][data-selected=true],.switch[aria-disabled=true][aria-checked=true],.switch[aria-disabled=true][data-selected=true]) .switch__thumb{opacity:.4}.switch__control{border-radius:calc(var(--radius) * 1.5);background-color:var(--switch-control-bg);width:2.5rem;height:1.25rem;transition:background-color .25s var(--ease-smooth),box-shadow .15s var(--ease-out);flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch:focus-visible .switch__control,.switch:has([data-slot=switch-content][data-focus-visible=true]) .switch__control,.switch [data-slot=switch-content][data-focus-visible=true] .switch__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.switch:hover .switch__control,.switch:has([data-slot=switch-content][data-hovered=true]) .switch__control,.switch [data-slot=switch-content][data-hovered=true] .switch__control{background-color:var(--switch-control-bg-hover)}.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control{background-color:var(--switch-control-bg-pressed)}:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transform:none}@media(prefers-reduced-motion:reduce){:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transform:none}}.switch[aria-checked=true] .switch__control,.switch[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked)}.switch[aria-checked=true]:hover .switch__control,.switch[data-selected=true]:hover .switch__control,.switch[aria-checked=true][data-hovered=true] .switch__control,.switch[data-selected=true][data-hovered=true] .switch__control,.switch:has([data-slot=switch-content][data-hovered=true])[data-selected=true] .switch__control,.switch[aria-checked=true]:active .switch__control,.switch[data-selected=true]:active .switch__control,.switch[aria-checked=true][data-pressed=true] .switch__control,.switch[data-selected=true][data-pressed=true] .switch__control,.switch:has([data-slot=switch-content][data-pressed=true])[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked-hover)}.switch__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.switch--sm .switch__control{border-radius:calc(var(--radius) * 1);width:2rem;height:1rem}.switch--lg .switch__control{width:3rem;height:1.5rem}.switch__thumb{transform-origin:50%;border-radius:calc(var(--radius) * 1);background-color:var(--color-white);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);width:1.375rem;height:1rem;transition:margin .3s var(--ease-out-fluid),background-color .2s var(--ease-out);margin-inline-start:calc(var(--spacing) * .5);display:flex}.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch[aria-checked=true] .switch__thumb,.switch[data-selected=true] .switch__thumb{background-color:var(--accent-foreground);color:var(--accent);margin-inline-start:calc(100% - 1.5rem);box-shadow:0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d}.switch--sm .switch__thumb{border-radius:calc(var(--radius) * .75);width:1.03125rem;height:.75rem}.switch[aria-checked=true] :is(.switch--sm .switch__thumb),.switch[data-selected=true] :is(.switch--sm .switch__thumb){margin-inline-start:calc(100% - 1.15625rem)}.switch--lg .switch__thumb{border-radius:calc(var(--radius) * 1.5);width:1.71875rem;height:1.25rem}.switch[aria-checked=true] :is(.switch--lg .switch__thumb),.switch[data-selected=true] :is(.switch--lg .switch__thumb){margin-inline-start:calc(100% - 1.84375rem)}.switch__thumb>*{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.switch__label{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.switch [data-slot=label]{-webkit-user-select:none;user-select:none}.switch__content [data-slot=label]{cursor:var(--cursor-interactive)}.switch [data-slot=description]{cursor:default;-webkit-user-select:none;user-select:none}.switch-group{gap:calc(var(--spacing) * 6);flex-direction:column;display:flex}.switch-group__items{gap:calc(var(--spacing) * 4);display:flex}.switch-group--horizontal .switch-group__items{flex-direction:row}.switch-group--vertical .switch-group__items{flex-direction:column}.badge{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);min-height:calc(var(--spacing) * 7);min-width:calc(var(--spacing) * 7);border-radius:calc(var(--radius) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:1.34;--badge-bg:var(--default);--badge-fg:var(--default-foreground);--badge-border:var(--background);background-color:var(--badge-bg);color:var(--badge-fg);border:1px solid var(--badge-border);flex-shrink:0;line-height:1.34;display:inline-flex}.badge__label{padding-inline:calc(var(--spacing) * .5)}.badge-anchor{flex-shrink:0;display:inline-flex;position:relative}.badge--lg{min-height:calc(var(--spacing) * 8);min-width:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;line-height:1.43}.badge--sm{min-height:calc(var(--spacing) * 4);min-width:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);--tw-leading:1.34;font-size:10px;line-height:1.34}.badge--accent{--badge-fg:var(--accent-soft-foreground)}.badge--default{--badge-fg:var(--default-foreground)}.badge--success{--badge-fg:var(--success-soft-foreground)}.badge--warning{--badge-fg:var(--warning-soft-foreground)}.badge--danger{--badge-fg:var(--danger-soft-foreground)}.badge--top-right{position:absolute;top:0;right:0;transform:translate(25%,-25%)}.badge--top-left{position:absolute;top:0;left:0;transform:translate(-25%,-25%)}.badge--bottom-right{position:absolute;bottom:0;right:0;transform:translate(25%,25%)}.badge--bottom-left{position:absolute;bottom:0;left:0;transform:translate(-25%,25%)}.badge--primary.badge--accent{--badge-bg:var(--accent);--badge-fg:var(--accent-foreground)}.badge--primary.badge--default{--badge-bg:var(--default);--badge-fg:var(--default-foreground)}.badge--primary.badge--success{--badge-bg:var(--success);--badge-fg:var(--success-foreground)}.badge--primary.badge--warning{--badge-bg:var(--warning);--badge-fg:var(--warning-foreground)}.badge--primary.badge--danger{--badge-bg:var(--danger);--badge-fg:var(--danger-foreground)}.badge--soft.badge--accent{--badge-bg:var(--accent-soft);--badge-fg:var(--accent-soft-foreground)}.badge--soft.badge--default{--badge-bg:var(--default-soft);--badge-fg:var(--default-soft-foreground)}.badge--soft.badge--success{--badge-bg:var(--success-soft);--badge-fg:var(--success-soft-foreground)}.badge--soft.badge--warning{--badge-bg:var(--warning-soft);--badge-fg:var(--warning-soft-foreground)}.badge--soft.badge--danger{--badge-bg:var(--danger-soft);--badge-fg:var(--danger-soft-foreground)}.chip{align-items:center;gap:calc(var(--spacing) * .5);border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--chip-bg:var(--default);--chip-fg:currentColor;background-color:var(--chip-bg);color:var(--chip-fg);flex-shrink:0;display:inline-flex}.chip__label{padding-inline:calc(var(--spacing) * .5)}.chip--accent{--chip-fg:var(--accent-soft-foreground)}.chip--danger{--chip-fg:var(--danger-soft-foreground)}.chip--default{--chip-fg:var(--default-foreground)}.chip--success{--chip-fg:var(--success-soft-foreground)}.chip--warning{--chip-fg:var(--warning-soft-foreground)}.chip--tertiary{--chip-bg:transparent}.chip--sm{padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));padding-block:0}.chip--md{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.chip--lg{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.chip--primary.chip--accent{--chip-bg:var(--accent);--chip-fg:var(--accent-foreground)}.chip--primary.chip--success{--chip-bg:var(--success);--chip-fg:var(--success-foreground)}.chip--primary.chip--warning{--chip-bg:var(--warning);--chip-fg:var(--warning-foreground)}.chip--primary.chip--danger{--chip-bg:var(--danger);--chip-fg:var(--danger-foreground)}.chip--accent.chip--soft{--chip-bg:var(--accent-soft);--chip-fg:var(--accent-soft-foreground)}.chip--success.chip--soft{--chip-bg:var(--success-soft);--chip-fg:var(--success-soft-foreground)}.chip--warning.chip--soft{--chip-bg:var(--warning-soft);--chip-fg:var(--warning-soft-foreground)}.chip--danger.chip--soft{--chip-bg:var(--danger-soft);--chip-fg:var(--danger-soft-foreground)}.chip--default.chip--soft{--chip-bg:var(--default-soft);--chip-fg:var(--default-soft-foreground)}.table-root{grid-template-columns:minmax(0,1fr);width:100%;display:grid;position:relative;overflow:clip}.table__scroll-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;overflow-x:auto}.table-root--primary{background-color:var(--surface-secondary);padding-inline:var(--spacing);padding-bottom:var(--spacing);border-radius:min(32px,calc(var(--radius) * 2.5))}.table-root--secondary .table__header{border-bottom-style:var(--tw-border-style);background-color:#0000;border-bottom-width:0}.table-root--secondary .table__column{background-color:var(--surface-secondary)}.table-root--secondary :is(th.table__column:first-child,[role=row]>[role=presentation]:first-of-type>.table__column){border-start-start-radius:min(32px,var(--radius-2xl));border-end-start-radius:min(32px,var(--radius-2xl))}.table-root--secondary :is(th.table__column:last-child,[role=row]>[role=presentation]:last-of-type>.table__column){border-start-end-radius:min(32px,var(--radius-2xl));border-end-end-radius:min(32px,var(--radius-2xl))}.table-root--secondary .table__body{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table-root--secondary .table__body tr:first-child td:first-child,.table-root--secondary .table__body tr:first-child td:last-child,.table-root--secondary .table__body tr:last-child td:first-child,.table-root--secondary .table__body tr:last-child td:last-child{border-radius:0}.table-root--secondary .table__body:not(tbody){border-radius:0;overflow:visible}.table-root--secondary .table__row .table__cell{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row .table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table-root--secondary .table__row .table__cell{background-color:#0000}@media(hover:hover){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--default) 50%,transparent)}}}.table__content{border-collapse:separate;--tw-border-spacing-x:0;--tw-border-spacing-y:0;width:100%;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.table-root--primary .table__content{overflow:clip}.table__header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator)}@supports (color:color-mix(in lab,red,red)){.table__header{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__header{background-color:var(--surface-secondary)}.table__column{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);position:relative}.table__column:after{content:"";pointer-events:none;height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .5);background-color:var(--separator);inset-inline-end:calc(var(--spacing) * 0);position:absolute;top:50%}.table__column:last-child:not(:only-child):after{content:none}.table__column[data-allows-sorting=true]{cursor:var(--cursor-interactive)}@media(hover:hover){.table__column[data-allows-sorting=true]:hover,.table__column[data-allows-sorting=true][data-hovered=true]{color:var(--foreground)}}.table__column:focus-visible,.table__column[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}[role=row]>[role=presentation]:last-of-type:not(:only-of-type)>.table__column:after{content:none}.table__sortable-column-header{justify-content:space-between;align-items:center;display:flex}.table__sortable-column-indicator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out)}.table__sortable-column-indicator[data-direction=descending]{rotate:180deg}.table__body tr:first-child td:first-child{border-start-start-radius:min(32px,var(--radius-2xl))}.table__body tr:first-child td:last-child{border-start-end-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:first-child{border-end-start-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:last-child{border-end-end-radius:min(32px,var(--radius-2xl))}.table__body:not(tbody){border-radius:min(32px,var(--radius-2xl));height:100%;position:relative;overflow:clip}.table__row{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator);height:100%;position:relative}@supports (color:color-mix(in lab,red,red)){.table__row{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__row:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 40%,transparent)}}}.table__row[data-selected=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row[data-selected=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 10%,transparent)}}.table__row[aria-disabled=true],.table__row[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.table__row:focus-visible,.table__row[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.table__row[data-dragging=true]{opacity:.5}.table__row[data-drop-target=true] .table__cell{background-color:var(--accent-soft)}.table__cell{background-color:var(--surface);height:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);vertical-align:middle;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table__cell:focus-visible,.table__cell[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true]) :is(.table__cell,.table__column){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):only-child,.table__row:is(:focus-visible,[data-focus-visible=true])>:only-child :is(.table__cell,.table__column){border-radius:calc(var(--radius) * 1);--tw-shadow:inset 0 0 0 2px var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):first-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:first-child:not(:only-child) :is(.table__cell,.table__column){border-top-left-radius:calc(var(--radius) * 1);border-bottom-left-radius:calc(var(--radius) * 1);--tw-shadow:inset 2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):last-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:last-child:not(:only-child) :is(.table__cell,.table__column){border-top-right-radius:calc(var(--radius) * 1);border-bottom-right-radius:calc(var(--radius) * 1);--tw-shadow:inset -2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):not(:first-child):not(:last-child):not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:not(:first-child):not(:last-child):not(:only-child) :is(.table__cell,.table__column){--tw-shadow:inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__cell[data-tree-column]{padding-inline-start:calc(1rem * var(--table-row-level,1))}.table__footer{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);align-items:center;display:flex}.table__resizable-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;position:relative;overflow:auto}.table__column-resizer{height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;border-radius:calc(var(--radius) * .5);background-color:var(--separator);box-sizing:content-box;--tw-translate-x: 50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:col-resize;touch-action:none;padding-inline:calc(var(--spacing) * 2);--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-clip:content-box;border-style:none;outline-style:none;position:absolute;top:50%}.table__column-resizer[data-hovered=true],.table__column-resizer:hover,.table__column-resizer[data-resizing=true]{height:100%;width:calc(var(--spacing) * .5);background-color:var(--accent)}.table__column-resizer[data-focus-visible=true],.table__column-resizer:focus-visible{height:100%;width:calc(var(--spacing) * .5);background-color:var(--focus)}.table__column:has(.table__column-resizer):after{content:none}.table__load-more td,.table__load-more [role=rowheader]{padding-block:calc(var(--spacing) * 3);text-align:center}:is(.table__load-more td,.table__load-more [role=rowheader])>*{margin-inline:auto}.table__load-more-content{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 2);display:flex}.alert{justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 4);background-color:var(--surface);width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex}.alert__content{flex-direction:column;flex-grow:1;align-items:flex-start;height:100%;display:flex}.alert__indicator{padding:var(--spacing);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:flex}.alert__indicator [data-slot=alert-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.alert__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.alert__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.alert--default .alert__indicator,.alert--default .alert__title{color:var(--foreground)}.alert--accent .alert__indicator,.alert--accent .alert__title{color:var(--accent-soft-foreground)}.alert--success .alert__indicator,.alert--success .alert__title{color:var(--success-soft-foreground)}.alert--warning .alert__indicator,.alert--warning .alert__title{color:var(--warning-soft-foreground)}.alert--danger .alert__indicator,.alert--danger .alert__title{color:var(--danger-soft-foreground)}.empty-state{padding:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.skeleton{pointer-events:none;border-radius:calc(var(--radius) * .5);background-color:var(--surface-tertiary);position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.skeleton{background-color:color-mix(in oklab,var(--surface-tertiary) 70%,transparent)}}.skeleton--shimmer:after{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-gradient-position:to right;animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}@supports (background-image:linear-gradient(in lab,red,red)){.skeleton--shimmer:after{--tw-gradient-position:to right in oklab}}.skeleton--shimmer:after{background-image:linear-gradient(var(--tw-gradient-stops));--tw-gradient-from:transparent;--tw-gradient-via:var(--surface-tertiary);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));--tw-gradient-to:transparent;--tw-content:"";content:var(--tw-content)}.skeleton--shimmer:has(.skeleton):after{content:none}.skeleton--shimmer:has(.skeleton):before{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-content:"";content:var(--tw-content);z-index:10;pointer-events:none;mix-blend-mode:overlay;background:linear-gradient(90deg,#0000,#ffffff80,#0000);animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}.skeleton--shimmer:has(.skeleton) .skeleton:after{content:none}.skeleton--pulse{animation:var(--animate-pulse)}.meter{gap:var(--spacing);--meter-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.meter [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.meter .meter__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.meter .meter__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.meter .meter__fill{border-radius:calc(var(--radius) * .5);background-color:var(--meter-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]) [data-slot=label]{opacity:1}.meter--sm .meter__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.meter--sm .meter__fill{border-radius:calc(var(--radius) * .25)}.meter--lg .meter__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.meter--lg .meter__fill{border-radius:calc(var(--radius) * .75)}.meter--default{--meter-fill:var(--default-foreground)}.meter--accent{--meter-fill:var(--accent)}.meter--success{--meter-fill:var(--success)}.meter--warning{--meter-fill:var(--warning)}.meter--danger{--meter-fill:var(--danger)}.progress-bar{gap:var(--spacing);--progress-bar-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.progress-bar [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.progress-bar .progress-bar__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.progress-bar .progress-bar__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.progress-bar .progress-bar__fill{border-radius:calc(var(--radius) * .5);background-color:var(--progress-bar-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-bar:not([aria-valuenow]) .progress-bar__fill{width:40%;animation:1.5s cubic-bezier(.65,0,.35,1) infinite progress-bar-indeterminate}.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]) [data-slot=label]{opacity:1}@keyframes progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(350%)}}.progress-bar--sm .progress-bar__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.progress-bar--sm .progress-bar__fill{border-radius:calc(var(--radius) * .25)}.progress-bar--lg .progress-bar__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.progress-bar--lg .progress-bar__fill{border-radius:calc(var(--radius) * .75)}.progress-bar--default{--progress-bar-fill:var(--default-foreground)}.progress-bar--accent{--progress-bar-fill:var(--accent)}.progress-bar--success{--progress-bar-fill:var(--success)}.progress-bar--warning{--progress-bar-fill:var(--warning)}.progress-bar--danger{--progress-bar-fill:var(--danger)}.progress-circle{--progress-circle-stroke:var(--accent);--progress-circle-track-stroke:var(--default);justify-content:center;align-items:center;display:inline-flex}.progress-circle .progress-circle__track{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.progress-circle .progress-circle__track-circle{stroke:var(--progress-circle-track-stroke)}.progress-circle .progress-circle__fill-circle{stroke:var(--progress-circle-stroke);transition:stroke-dashoffset .3s var(--ease-out)}.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-circle:not([aria-valuenow]) .progress-circle__track{animation:1s linear infinite progress-circle-spin}.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-circle:disabled,.progress-circle[data-disabled=true],.progress-circle[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@keyframes progress-circle-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.progress-circle--sm .progress-circle__track{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.progress-circle--lg .progress-circle__track{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.progress-circle--default{--progress-circle-stroke:var(--default-foreground)}.progress-circle--accent{--progress-circle-stroke:var(--accent)}.progress-circle--success{--progress-circle-stroke:var(--success)}.progress-circle--warning{--progress-circle-stroke:var(--warning)}.progress-circle--danger{--progress-circle-stroke:var(--danger)}.spinner{pointer-events:none;width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);flex-shrink:0;animation:.75s linear infinite spin;display:inline-flex}.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *),.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.spinner--sm{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.spinner--lg{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.spinner--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.spinner--current{color:inherit}.spinner--accent{color:var(--accent)}.spinner--danger{color:var(--danger)}.spinner--success{color:var(--success)}.spinner--warning{color:var(--warning)}.toast-region{pointer-events:none;z-index:50;--tw-outline-style:none;outline-style:none;width:calc(100vw - 2rem);position:fixed}@media(min-width:40rem){.toast-region{width:auto;min-width:var(--toast-width)}}.toast-region{display:block}.toast-region--bottom{bottom:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--bottom-start{bottom:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--bottom-end{right:calc(var(--spacing) * 4);bottom:calc(var(--spacing) * 4)}.toast-region--top{top:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--top-start{top:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--top-end{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4)}.toast-region:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast{pointer-events:auto;justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 1.5);background-color:var(--surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex;position:absolute;left:0;right:0}.toast--bottom,.toast--bottom-start,.toast--bottom-end{bottom:0}.toast--top,.toast--top-start,.toast--top-end{top:0}.toast:not([data-frontmost=true]){pointer-events:none;height:var(--front-height);overflow:hidden}.toast:not([data-frontmost=true]) .toast__close-button{pointer-events:none;opacity:0;outline:none}.toast[data-hidden=true]{pointer-events:none;opacity:0;display:flex}.toast:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast--bottom,.toast--bottom-start,.toast--bottom-end{view-transition-class:toast-bottom}.toast--top,.toast--top-start,.toast--top-end{view-transition-class:toast-top}.toast__content{flex-direction:column;flex-grow:1;align-self:center;align-items:flex-start;height:100%;display:flex}.toast__indicator{padding:var(--spacing);color:var(--overlay-foreground);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.toast__indicator [data-slot=toast-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__indicator [data-slot=spinner],.toast__indicator [data-slot=spinner-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--overlay-foreground)}.toast__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.toast__close-button{pointer-events:none;top:calc(var(--spacing) * -1);right:calc(var(--spacing) * -1);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);border-color:var(--border);background-color:var(--default);opacity:0;position:absolute}@media(min-width:40rem){.toast__close-button{border-style:var(--tw-border-style);background-color:var(--overlay);border-width:1px}}.toast__close-button{transition:opacity .15s var(--ease-smooth)}.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(min-width:40rem){.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}}@media(hover:hover){.toast__close-button:hover,.toast__close-button[data-hovered=true]{background-color:var(--default)}}.toast[data-frontmost=true]:hover .toast__close-button{pointer-events:auto;opacity:1}.toast__action{margin-top:calc(var(--spacing) * 2)}@media(min-width:40rem){.toast__action{margin-top:0}}.toast--accent .toast__title{color:var(--accent-soft-foreground)}.toast--success .toast__title,.toast--success .toast__indicator{color:var(--success-soft-foreground)}.toast--warning .toast__title,.toast--warning .toast__indicator{color:var(--warning-soft-foreground)}.toast--danger .toast__title,.toast--danger .toast__indicator{color:var(--danger-soft-foreground)}::view-transition-old(*){will-change:translate,opacity}::view-transition-new(*){will-change:translate,opacity}::view-transition-new(.toast-bottom):only-child{animation:.35s toast-slide-bottom-in}::view-transition-old(.toast-bottom):only-child{animation:.35s forwards toast-slide-bottom-out}::view-transition-new(.toast-top):only-child{animation:.35s toast-slide-top-in}::view-transition-old(.toast-top):only-child{animation:.35s forwards toast-slide-top-out}@keyframes toast-slide-bottom-in{0%{opacity:0;translate:0 100%}}@keyframes toast-slide-bottom-out{to{opacity:0;translate:0 100%}}@keyframes toast-slide-top-in{0%{opacity:0;translate:0 -100%}}@keyframes toast-slide-top-out{to{opacity:0;translate:0 -100%}}.checkbox-group{flex-direction:column;display:flex}.checkbox-group [data-slot=checkbox]{margin-top:calc(var(--spacing) * 4)}.checkbox{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.checkbox>[data-slot=description],.checkbox>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.checkbox [data-slot=label]{-webkit-user-select:none;user-select:none}.checkbox .checkbox__content [data-slot=label]{cursor:var(--cursor-interactive)}.checkbox[data-disabled=true],.checkbox[data-disabled=true] [data-slot=description],.checkbox[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.checkbox[data-selected=true],.checkbox[data-indeterminate=true]) .checkbox__indicator{border-color:var(--accent-foreground)}.checkbox [data-slot=checkbox-default-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);stroke-width:2.5px;color:var(--accent-foreground);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.2s;transition-duration:.2s}.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox[data-selected=true] [data-slot=checkbox-default-indicator--checkmark]{transition:stroke-dashoffset .15s linear 15ms}.checkbox[data-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[data-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark]{color:var(--danger-foreground)}.checkbox[data-indeterminate=true] [data-slot=checkbox-default-indicator--indeterminate]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.checkbox[data-indeterminate=true][data-invalid=true] [data-slot=checkbox-default-indicator--indeterminate],.checkbox[data-indeterminate=true][aria-invalid=true] [data-slot=checkbox-default-indicator--indeterminate]{color:var(--danger-foreground)}.checkbox__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .75);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative;overflow:hidden}.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox__control{cursor:var(--cursor-interactive)}.checkbox__control:before{pointer-events:none;z-index:0;transform-origin:50%;--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);border-radius:calc(var(--radius) * .75);background-color:var(--accent);opacity:0;--tw-content:"";content:var(--tw-content);transition:scale .1s var(--ease-linear),opacity .2s var(--ease-linear),background-color .2s var(--ease-out);position:absolute;top:0;right:0;bottom:0;left:0}@media(prefers-reduced-motion:reduce){.checkbox__control:before:not(:is()){transition-property:none}}.checkbox:focus-visible .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-focus-visible=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-focus-visible=true] .checkbox__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control{border-color:var(--field-border-hover)}:is(.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control):before{background-color:var(--accent-hover)}.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control{color:var(--accent-foreground);border-color:#0000}:is(.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.checkbox[data-indeterminate=true] .checkbox__control{background-color:var(--accent);color:var(--accent-foreground)}.checkbox:active[data-indeterminate=true] .checkbox__control,.checkbox[data-pressed=true][data-indeterminate=true] .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-pressed=true])[data-indeterminate=true] .checkbox__control{background-color:var(--accent-hover)}.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-visible,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focused=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-visible=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-within,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground);border-color:#0000}:is(.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);background-color:var(--danger);opacity:1}.checkbox[data-indeterminate=true][aria-invalid=true] .checkbox__control,.checkbox[data-indeterminate=true][data-invalid=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground)}.checkbox__indicator{z-index:10;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);justify-content:center;align-items:center;display:flex;position:relative}.checkbox__indicator svg{width:100%;height:100%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.checkbox--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.checkbox--secondary .checkbox__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--checkbox-control-bg);--checkbox-control-bg:var(--default)}.checkbox:hover :is(.checkbox--secondary .checkbox__control),.checkbox:has([data-slot=checkbox-content][data-hovered=true]) :is(.checkbox--secondary .checkbox__control),.checkbox [data-slot=checkbox-content][data-hovered=true] :is(.checkbox--secondary .checkbox__control){border-color:var(--field-border-hover)}.checkbox__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.checkbox--secondary:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{background-color:var(--checkbox-control-bg)}:is(.checkbox--secondary[aria-checked=true] .checkbox__control,.checkbox--secondary[data-selected=true] .checkbox__control):before,.checkbox--secondary[data-indeterminate=true] .checkbox__control,.checkbox--secondary[data-indeterminate=true] .checkbox__control:before{background-color:var(--accent)}.fieldset{gap:calc(var(--spacing) * 6);flex-direction:column;flex:1 1 0;display:flex}.fieldset__legend{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.fieldset__field_group{width:100%}:where(.fieldset__field_group>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.fieldset__actions{align-items:center;gap:calc(var(--spacing) * 2);padding-top:var(--spacing);display:flex}.input-otp{align-items:center;gap:calc(var(--spacing) * 2);display:flex;position:relative}.input-otp[data-disabled=true]{cursor:not-allowed;opacity:.5}.input-otp__group{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.input-otp__slot{height:calc(var(--spacing) * 10);width:calc(var(--spacing) * 9.5);border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:var(--field-radius,calc(var(--radius) * 1.5));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;flex:1;justify-content:center;align-items:center;display:flex;position:relative}.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-otp__slot:hover,.input-otp__slot[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-otp__slot[data-active=true]{z-index:10;background-color:var(--field-focus);--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.input-otp__slot[data-filled=true]{background-color:var(--field-focus)}.input-otp__slot[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input-otp__slot[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-otp__slot[data-invalid=true]:focus,.input-otp__slot[data-invalid=true]:focus-visible,.input-otp__slot[data-invalid=true][data-focused=true],.input-otp__slot[data-invalid=true][data-focus-visible=true],.input-otp__slot[data-invalid=true]:focus-within,.input-otp__slot[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-otp__slot[data-invalid=true]{background-color:var(--field-focus)}.input-otp__slot-value{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-tracking:-.27px;letter-spacing:-.27px;animation:slot-value-in .25s var(--ease-smooth) both;transform-origin:bottom}.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.input-otp__caret{height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .5);background-color:var(--field-placeholder,var(--muted));width:2px;animation:1.2s ease-out infinite caret-blink;position:absolute}.input-otp__separator{border-radius:calc(var(--radius) * .5);background-color:var(--separator);flex-shrink:0;width:6px;height:2px}.input-otp--secondary .input-otp__slot{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-otp-slot-bg);--input-otp-slot-bg:var(--default);--input-otp-slot-bg-hover:var(--default-hover);--input-otp-slot-bg-focus:var(--default)}@media(hover:hover){.input-otp--secondary .input-otp__slot:hover,.input-otp--secondary .input-otp__slot[data-hovered=true]{background-color:var(--input-otp-slot-bg-hover)}}.input-otp--secondary .input-otp__slot[data-active=true],.input-otp--secondary .input-otp__slot[data-filled=true]{background-color:var(--input-otp-slot-bg-focus)}@keyframes slot-value-in{0%{opacity:0;transform:translateY(8px)scale(.8)}to{opacity:1;transform:translateY(0)scale(1)}}.input{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input{border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input:hover:not(:focus):not(:focus-visible),.input[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input:focus,.input[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input[data-invalid=true]:focus,.input[data-invalid=true]:focus-visible,.input[data-invalid=true][data-focused=true],.input[data-invalid=true][data-focus-visible=true],.input[data-invalid=true]:focus-within,.input[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input[data-invalid=true]{background-color:var(--field-focus)}.input:disabled,.input[data-disabled=true],.input[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-bg);--input-bg:var(--default);--input-bg-hover:var(--default-hover);--input-bg-focus:var(--default)}@media(hover:hover){.input--secondary:hover:not(:focus):not(:focus-visible),.input--secondary[data-hovered=true]:not([data-focus-visible=true]):not([data-focused=true]){background-color:var(--input-bg-hover)}}.input--secondary:focus,.input--secondary[data-focused=true]{background-color:var(--input-bg-focus)}.input--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input--secondary[data-invalid=true]:focus,.input--secondary[data-invalid=true]:focus-visible,.input--secondary[data-invalid=true][data-focused=true],.input--secondary[data-invalid=true][data-focus-visible=true],.input--secondary[data-invalid=true]:focus-within,.input--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input--secondary[data-invalid=true]{background-color:var(--input-bg-focus)}.input--full-width{width:100%}.input-group{min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);outline-style:none;align-items:center;display:inline-flex}.input-group:has([data-slot=input-group-textarea]){align-items:flex-start;height:auto}.input-group{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-group:hover:not(:focus-within),.input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-group:has([data-slot=input-group-input]:focus),.input-group:has([data-slot=input-group-textarea]:focus){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group[data-invalid=true]:focus,.input-group[data-invalid=true]:focus-visible,.input-group[data-invalid=true][data-focused=true],.input-group[data-invalid=true][data-focus-visible=true],.input-group[data-invalid=true]:focus-within,.input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.input-group[data-disabled=true],.input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.input-group:has([data-slot=input-group-input]:-webkit-autofill),.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.input-group__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}.input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input-group:has([data-slot=input-group-prefix]) .input-group__input{border-top-left-radius:0;border-bottom-left-radius:0;padding-left:0}.input-group:has([data-slot=input-group-suffix]) .input-group__input{border-top-right-radius:0;border-bottom-right-radius:0;padding-right:0}.input-group__input:focus,.input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.input-group__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input[data-slot=input-group-textarea]{resize:vertical;min-height:38px}.input-group__prefix{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-right-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-left:none;border-top-right-radius:0;border-bottom-right-radius:0;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__prefix{align-items:flex-start;padding-top:.5rem}.input-group__prefix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group__suffix{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-left-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-right:none;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__suffix{align-items:flex-start;padding-top:.5rem}.input-group__suffix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-group-bg);--input-group-bg:var(--default);--input-group-bg-hover:var(--default-hover);--input-group-bg-focus:var(--default)}@media(hover:hover){.input-group--secondary:hover:not(:focus-within),.input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--input-group-bg-hover)}}.input-group--secondary:has([data-slot=input-group-input]:focus),.input-group--secondary:has([data-slot=input-group-textarea]:focus){background-color:var(--input-group-bg-focus)}.input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group--secondary[data-invalid=true]:focus,.input-group--secondary[data-invalid=true]:focus-visible,.input-group--secondary[data-invalid=true][data-focused=true],.input-group--secondary[data-invalid=true][data-focus-visible=true],.input-group--secondary[data-invalid=true]:focus-within,.input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--input-group-bg-focus)}.input-group--secondary [data-slot=input-group-input],.input-group--secondary [data-slot=input-group-textarea]{background-color:#0000}.input-group--full-width{width:100%}.number-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.number-field[data-invalid=true],.number-field[aria-invalid=true]) [data-slot=description]{display:none}.number-field [data-slot=label]{width:fit-content}.number-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;grid-template-columns:40px 1fr 40px;align-items:center;display:grid;overflow:hidden}.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.number-field__group:hover:not(:focus-within),.number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.number-field__group[data-focus-within=true],.number-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field__group[data-invalid=true]:focus,.number-field__group[data-invalid=true]:focus-visible,.number-field__group[data-invalid=true][data-focused=true],.number-field__group[data-invalid=true][data-focus-visible=true],.number-field__group[data-invalid=true]:focus-within,.number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.number-field__group[data-disabled=true],.number-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.number-field__group:has([data-slot=number-field-input]:-webkit-autofill),.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.number-field__input{border-style:var(--tw-border-style);min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none}@media(min-width:40rem){.number-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.number-field__group:has([slot=decrement]) .number-field__input{border-top-left-radius:0;border-bottom-left-radius:0}.number-field__group:has([slot=increment]) .number-field__input{border-top-right-radius:0;border-bottom-right-radius:0}.number-field__input:focus,.number-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.number-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__increment-button,.number-field__decrement-button{height:100%;width:calc(var(--spacing) * 10);color:var(--field-foreground,var(--foreground));--tw-outline-style:none;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth);background-color:#0000;border-style:solid;border-radius:0;outline-style:none;justify-content:center;align-items:center;display:flex}:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.number-field__increment-button,.number-field__decrement-button{cursor:var(--cursor-interactive)}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:var(--field-foreground,var(--foreground))}@supports (color:color-mix(in lab,red,red)){:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:color-mix(in oklab,var(--field-foreground,var(--foreground)) 10%,transparent)}}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{transform:scale(.97)}:is(.number-field__increment-button,.number-field__decrement-button):disabled,:is(.number-field__increment-button,.number-field__decrement-button)[data-disabled=true],:is(.number-field__increment-button,.number-field__decrement-button)[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-increment-button-icon],:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-decrement-button-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.number-field__increment-button{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--field-placeholder,var(--muted))}@supports (color:color-mix(in lab,red,red)){.number-field__increment-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field__decrement-button{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--field-placeholder,var(--muted));border-top-right-radius:0;border-bottom-right-radius:0}@supports (color:color-mix(in lab,red,red)){.number-field__decrement-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field--secondary .number-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--number-field-group-bg);--number-field-group-bg:var(--default);--number-field-group-bg-hover:var(--default-hover);--number-field-group-bg-focus:var(--default)}@media(hover:hover){.number-field--secondary .number-field__group:hover:not(:focus-within),.number-field--secondary .number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--number-field-group-bg-hover)}}.number-field--secondary .number-field__group:focus-within,.number-field--secondary .number-field__group[data-focus-within=true]{background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field--secondary .number-field__group[data-invalid=true]:focus,.number-field--secondary .number-field__group[data-invalid=true]:focus-visible,.number-field--secondary .number-field__group[data-invalid=true][data-focused=true],.number-field--secondary .number-field__group[data-invalid=true][data-focus-visible=true],.number-field--secondary .number-field__group[data-invalid=true]:focus-within,.number-field--secondary .number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field--secondary .number-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group [data-slot=number-field-input]{background-color:#0000}.number-field--full-width,.number-field__group--full-width{width:100%}.radio-group{flex-direction:column;display:flex}.radio-group[data-orientation=vertical] [data-slot=radio]{margin-top:calc(var(--spacing) * 4)}.radio-group[data-orientation=horizontal]{gap:calc(var(--spacing) * 4);flex-flow:wrap}.radio-group--secondary .radio__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--radio-control-bg);--radio-control-bg:var(--default);--radio-control-bg-hover:var(--default-hover)}.radio:has([data-slot=radio-content][data-hovered=true]) :is(.radio-group--secondary .radio__control),.radio [data-slot=radio-content][data-hovered=true] :is(.radio-group--secondary .radio__control){border-color:var(--field-border-hover)}.radio:not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg-hover)}.radio{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.radio [data-slot=label]{-webkit-user-select:none;user-select:none}.radio .radio__content [data-slot=label]{cursor:var(--cursor-interactive)}.radio>[data-slot=description],.radio>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=description],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.radio__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.radio__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.radio__control{cursor:var(--cursor-interactive)}.radio:has([data-slot=radio-content][data-focus-visible=true]) .radio__control,.radio [data-slot=radio-content][data-focus-visible=true] .radio__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.radio:has([data-slot=radio-content][data-hovered=true]) .radio__control,.radio [data-slot=radio-content][data-hovered=true] .radio__control{border-color:var(--field-border-hover)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) .radio__control .radio__indicator:empty:before{background-color:var(--field-hover)}.radio:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio [data-slot=radio-content][data-pressed=true] .radio__control{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.radio[data-selected] .radio__control,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__control,.radio:has(input:checked) .radio__control{background-color:var(--accent);border-color:#0000}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__control,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__control{background-color:var(--accent-hover)}.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-visible,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focused=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-within,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-visible,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focused=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-within,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio__indicator{pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.radio__indicator:empty:before{content:"";border-radius:calc(var(--radius) * 1);background-color:var(--field-background,var(--default));width:100%;height:100%;transition:scale .2s var(--ease-out),background-color .2s var(--ease-out);scale:1}@media(prefers-reduced-motion:reduce){.radio__indicator:empty:before:not(:is()){transition-property:none}}.radio[data-selected] .radio__indicator:empty:before,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked) .radio__indicator:empty:before{background-color:var(--accent-foreground);scale:.4286}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before{scale:.5714}.radio--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textfield{gap:var(--spacing);flex-direction:column;display:flex}:is(.textfield[data-invalid=true],.textfield[aria-invalid=true]) [data-slot=description]{display:none}.textfield--full-width,.textfield--full-width [data-slot=input],.textfield--full-width [data-slot=textarea]{width:100%}.search-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.search-field[data-invalid=true],.search-field[aria-invalid=true]) [data-slot=description]{display:none}.search-field [data-slot=label]{width:fit-content}.search-field[data-empty=true] [data-slot=search-field-clear-button]{pointer-events:none;opacity:0}.search-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;position:relative;overflow:hidden}.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.search-field__group:hover:not(:focus-within),.search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.search-field__group[data-focus-within=true],.search-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field__group[data-invalid=true]:focus,.search-field__group[data-invalid=true]:focus-visible,.search-field__group[data-invalid=true][data-focused=true],.search-field__group[data-invalid=true][data-focus-visible=true],.search-field__group[data-invalid=true]:focus-within,.search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.search-field__group[data-disabled=true],.search-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.search-field__group:has([data-slot=search-field-input]:-webkit-autofill),.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.search-field__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}@media(min-width:40rem){.search-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.search-field__input::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__input::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__group:has([data-slot=search-field-search-icon]) .search-field__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.search-field__group:has([slot=clear]) .search-field__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.search-field__input:focus,.search-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.search-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__search-icon{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);flex-shrink:0}.search-field__clear-button{margin-right:calc(var(--spacing) * 2);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0}.search-field__clear-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.search-field--secondary .search-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--search-field-group-bg);--search-field-group-bg:var(--default);--search-field-group-bg-hover:var(--default-hover);--search-field-group-bg-focus:var(--default)}@media(hover:hover){.search-field--secondary .search-field__group:hover:not(:focus-within),.search-field--secondary .search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--search-field-group-bg-hover)}}.search-field--secondary .search-field__group:focus-within,.search-field--secondary .search-field__group[data-focus-within=true]{background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field--secondary .search-field__group[data-invalid=true]:focus,.search-field--secondary .search-field__group[data-invalid=true]:focus-visible,.search-field--secondary .search-field__group[data-invalid=true][data-focused=true],.search-field--secondary .search-field__group[data-invalid=true][data-focus-visible=true],.search-field--secondary .search-field__group[data-invalid=true]:focus-within,.search-field--secondary .search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field--secondary .search-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group [data-slot=search-field-input]{background-color:#0000}.search-field--full-width,.search-field__group--full-width{width:100%}.textarea{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.textarea::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.textarea{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.textarea{border-width:var(--border-width-field);border-color:var(--field-border);min-height:38px;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *),.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.textarea:hover:not(:focus):not(:focus-visible),.textarea[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.textarea:focus,.textarea[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.textarea[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea[data-invalid=true]:focus,.textarea[data-invalid=true]:focus-visible,.textarea[data-invalid=true][data-focused=true],.textarea[data-invalid=true][data-focus-visible=true],.textarea[data-invalid=true]:focus-within,.textarea[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea[data-invalid=true]{background-color:var(--field-focus)}.textarea:disabled,.textarea[data-disabled=true],.textarea[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textarea--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--textarea-bg);--textarea-bg:var(--default);--textarea-bg-hover:var(--default-hover);--textarea-bg-focus:var(--default)}@media(hover:hover){.textarea--secondary:hover:not(:focus):not(:focus-visible),.textarea--secondary[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--textarea-bg-hover)}}.textarea--secondary:focus,.textarea--secondary[data-focused=true]{background-color:var(--textarea-bg-focus)}.textarea--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea--secondary[data-invalid=true]:focus,.textarea--secondary[data-invalid=true]:focus-visible,.textarea--secondary[data-invalid=true][data-focused=true],.textarea--secondary[data-invalid=true][data-focus-visible=true],.textarea--secondary[data-invalid=true]:focus-within,.textarea--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea--secondary[data-invalid=true]{background-color:var(--textarea-bg-focus)}.textarea--full-width{width:100%}.calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.calendar--week-view .calendar__cell,.calendar--day-view .calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.calendar--day-view .calendar__grid{flex-direction:column;display:flex}.calendar--day-view .calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-header>tr{display:contents}.calendar--day-view .calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-body>tr{display:contents}.calendar--day-view .calendar__grid-body>tr:first-child>td{margin-top:0}.calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .calendar__nav-button{pointer-events:none;opacity:0}.calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 2);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.calendar__nav-button:hover,.calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.calendar__nav-button:active,.calendar__nav-button[data-pressed=true]{transform:scale(.95)}.calendar__nav-button:focus-visible,.calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__nav-button:disabled,.calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar__grid[aria-readonly=true] .calendar__cell{pointer-events:none}.calendar__grid-header,.calendar__grid-header>tr,.calendar__grid-body,.calendar__grid-body>tr{display:contents}.calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.calendar__grid-row{display:contents}.calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.calendar__cell{aspect-ratio:1;border-radius:calc(var(--radius) * 3);text-align:center;width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;will-change:scale;transition:transform .25s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__cell{cursor:var(--cursor-interactive)}.calendar__cell:focus-visible:not(:focus),.calendar__cell[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__cell[data-today=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.calendar__cell[data-today=true]:hover:not([data-selected=true]),.calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true]){background-color:var(--accent-soft-hover)}}.calendar__cell[data-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}.calendar__cell:active,.calendar__cell[data-pressed=true]{background-color:var(--default);transform:scale(.95)}:is(.calendar__cell:active,.calendar__cell[data-pressed=true])[data-selected=true]{background-color:var(--accent-hover)}@media(hover:hover){.calendar__cell:hover:not([data-selected=true]),.calendar__cell[data-hovered=true]:not([data-selected=true]){background-color:var(--default)}}.calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.calendar__cell[data-selected=true][data-outside-month=true]{background-color:var(--default)}.calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__cell:disabled:not([data-outside-month=true]),.calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.calendar__cell-indicator{background-color:var(--accent-foreground)}.range-calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.range-calendar--week-view .range-calendar__cell,.range-calendar--day-view .range-calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.range-calendar--day-view .range-calendar__grid{flex-direction:column;display:flex}.range-calendar--day-view .range-calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-header>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-body>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body>tr:first-child>td{margin-top:0}.range-calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.range-calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .range-calendar__nav-button{pointer-events:none;opacity:0}.range-calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.range-calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.range-calendar__nav-button:hover,.range-calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.range-calendar__nav-button:active,.range-calendar__nav-button[data-pressed=true]{transform:scale(.95)}.range-calendar__nav-button:focus-visible,.range-calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__nav-button:disabled,.range-calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.range-calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar__grid[aria-readonly=true] .range-calendar__cell{pointer-events:none}.range-calendar__grid-header,.range-calendar__grid-header>tr,.range-calendar__grid-body,.range-calendar__grid-body>tr{display:contents}.range-calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.range-calendar__grid-row{display:contents}.range-calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.range-calendar__cell{z-index:1;border-radius:calc(var(--radius) * 3);--tw-outline-style:none;cursor:var(--cursor-interactive);will-change:background-color,border-color;transition:box-shadow .1s var(--ease-out),border-color .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;margin-block:2px;margin-inline:0;padding:0;position:relative}.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell .range-calendar__cell-button{aspect-ratio:1;border-radius:calc(var(--radius) * 3);width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);-webkit-tap-highlight-color:transparent;will-change:scale;transition:scale .2s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]{z-index:2}:is(.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]) .range-calendar__cell-button{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__cell[data-today=true] .range-calendar__cell-button{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){:is(.range-calendar__cell[data-today=true]:hover:not([data-selected=true]),.range-calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--accent-soft-hover)}}.range-calendar__cell[data-selected=true]:not([data-outside-month=true]){background-color:var(--accent-soft);border-radius:0}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*){border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*)[data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*){border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*)[data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){z-index:2}:is(.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true])) .range-calendar__cell-button{background-color:var(--accent);color:var(--accent-foreground)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]){border-top-left-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){border-top-right-radius:calc(var(--radius) * 3);border-bottom-right-radius:calc(var(--radius) * 3)}:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true]) .range-calendar__cell-button{scale:.9}:is(:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-start=true],:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-end=true]) .range-calendar__cell-button{background-color:var(--accent-hover)}@media(hover:hover){:is(.range-calendar__cell:hover:not([data-selected=true]),.range-calendar__cell[data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--default)}}.range-calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:color-mix(in oklab,var(--default) 20%,transparent)}}.range-calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__cell:disabled:not([data-outside-month=true]),.range-calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true]{border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true]{border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.range-calendar__cell-indicator{background-color:var(--accent-foreground)}.calendar:has(.calendar-year-picker__year-grid),.range-calendar:has(.calendar-year-picker__year-grid){position:relative}.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]{will-change:opacity;transition:opacity .15s var(--ease-out),visibility 0s linear}:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]{pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s var(--ease-out),visibility 0s linear .15s}:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger{justify-content:flex-start;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1);--tw-outline-style:none;cursor:var(--cursor-interactive);touch-action:manipulation;outline-style:none;flex:1;display:flex}.calendar-year-picker__trigger:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar-year-picker__trigger-heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition:color .15s var(--ease-out)}.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger-indicator{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--accent-soft-foreground);transition:transform .15s var(--ease-out)}.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-indicator{transform:rotate(90deg)}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-heading{color:var(--accent-soft-foreground)}.calendar-year-picker__year-grid{pointer-events:none;scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);align-content:flex-start;gap:var(--spacing);padding:var(--spacing);opacity:0;will-change:opacity;grid-template-columns:repeat(3,1fr);display:grid;position:absolute;left:0;right:0;overflow-y:auto}.calendar-year-picker__year-grid[data-open=true]{pointer-events:auto;opacity:1;transition:opacity .2s var(--ease-out) 50ms}.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);padding-inline:calc(var(--spacing) * 2.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{cursor:var(--cursor-interactive)}@media(hover:hover)and (pointer:fine){.calendar-year-picker__year-cell:is(:hover,[data-hovered=true]):not([data-selected=true]){background-color:var(--default);color:var(--default-foreground)}}.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}@media(hover:hover)and (pointer:fine){:is(.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-hover)}}.calendar-year-picker__year-cell:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.date-field[data-invalid=true],.date-field[aria-invalid=true]) [data-slot=description]{display:none}.date-field [data-slot=label]{width:fit-content}.date-field--full-width{width:100%}.time-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.time-field[data-invalid=true],.time-field[aria-invalid=true]) [data-slot=description]{display:none}.time-field [data-slot=label]{width:fit-content}.time-field--full-width{width:100%}.date-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.date-input-group:hover:not(:focus-within),.date-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.date-input-group[data-focus-within=true]:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])),.date-input-group:focus-within:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.date-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group[data-invalid=true]:focus,.date-input-group[data-invalid=true]:focus-visible,.date-input-group[data-invalid=true][data-focused=true],.date-input-group[data-invalid=true][data-focus-visible=true],.date-input-group[data-invalid=true]:focus-within,.date-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.date-input-group[data-disabled=true],.date-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-input-group__input{cursor:text;border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;gap:1px;display:flex}@media(min-width:40rem){.date-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.date-input-group:has([data-slot=date-input-group-prefix]) .date-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.date-input-group:has([data-slot=date-input-group-suffix]) .date-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=start]{flex:none;padding-right:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=end]{padding-left:0}.date-input-group__input:focus,.date-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.date-input-group__input-container{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;flex:1;align-items:center;width:fit-content;display:flex;overflow:auto clip}.date-input-group__segment{border-radius:calc(var(--radius) * .75);padding-inline:calc(var(--spacing) * .5);text-align:end;text-wrap:nowrap;--tw-outline-style:none;outline-style:none;display:inline-block}.date-input-group__segment[data-type=literal]{color:var(--muted);padding:0}.date-input-group__segment[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.date-input-group__segment:focus,.date-input-group__segment[data-focused=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.date-input-group__segment[data-disabled=true]{opacity:.5}.date-input-group__segment[data-invalid=true]{color:var(--danger)}.date-input-group__segment[data-invalid=true]:focus,.date-input-group__segment[data-invalid=true][data-focused=true]{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.date-input-group__prefix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group__suffix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--date-input-group-bg);--date-input-group-bg:var(--default);--date-input-group-bg-hover:var(--default-hover);--date-input-group-bg-focus:var(--default)}@media(hover:hover){.date-input-group--secondary:hover:not(:focus-within),.date-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--date-input-group-bg-hover)}}.date-input-group--secondary:focus-within,.date-input-group--secondary[data-focus-within=true]{background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group--secondary[data-invalid=true]:focus,.date-input-group--secondary[data-invalid=true]:focus-visible,.date-input-group--secondary[data-invalid=true][data-focused=true],.date-input-group--secondary[data-invalid=true][data-focus-visible=true],.date-input-group--secondary[data-invalid=true]:focus-within,.date-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary [data-slot=date-input-group-input]{background-color:#0000}.date-input-group--full-width{width:100%}.date-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-picker .date-input-group__suffix,.date-picker .date-input-group__prefix{pointer-events:auto}.date-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__trigger:focus-visible:not(:focus),.date-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-picker__trigger:disabled,.date-picker__trigger[data-disabled=true],.date-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-picker__popover:focus-visible:not(:focus),.date-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-picker__popover[data-exiting=true],.date-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.date-range-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-range-picker .date-input-group__suffix,.date-range-picker .date-input-group__prefix{pointer-events:auto}.date-range-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__trigger:focus-visible:not(:focus),.date-range-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-range-picker__trigger:disabled,.date-range-picker__trigger[data-disabled=true],.date-range-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-range-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-range-picker__range-separator{padding-inline:var(--spacing);color:var(--field-placeholder,var(--muted));-webkit-user-select:none;user-select:none}.date-range-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-range-picker__popover:focus-visible:not(:focus),.date-range-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-range-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-range-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-range-picker__popover[data-exiting=true],.date-range-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.card{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 4);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:column;display:flex;position:relative;overflow:visible}.card__header{flex-direction:column;display:flex}.card__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.card__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);color:var(--muted)}.card__content{gap:var(--spacing);flex-direction:column;flex:1;display:flex}.card__footer{flex-direction:row;align-items:center;display:flex}.card--transparent{--tw-border-style:none;--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000;border-style:none}.card--default{background-color:var(--surface)}.card--secondary{background-color:var(--surface-secondary)}.card--tertiary{background-color:var(--surface-tertiary)}.header{width:100%;padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 1.5);padding-bottom:var(--spacing);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted)}.separator{border-radius:calc(var(--radius) * .5);border-top-style:var(--tw-border-style);border-top-width:0;border-bottom-style:var(--tw-border-style);background-color:var(--separator);border-bottom-width:0;flex-shrink:0;width:100%;height:1px}.separator--horizontal{width:100%;height:1px}.separator--vertical{height:auto;min-height:calc(var(--spacing) * 2);align-self:stretch;width:1px}.separator--default{background-color:var(--separator)}.separator--secondary{background-color:var(--separator-secondary)}.separator--tertiary{background-color:var(--separator-tertiary)}.separator__container{align-items:center;gap:calc(var(--spacing) * 3);display:flex}.separator__container--horizontal{flex-direction:row;width:100%}.separator__container--vertical{flex-direction:column;justify-content:center;height:100%}.separator__line{flex-grow:1;flex-shrink:0}.separator__content{text-align:center;white-space:nowrap;color:var(--muted);justify-content:center;align-items:center;display:inline-flex}.separator__content--horizontal,.separator__content--vertical{text-align:center}.surface{color:var(--foreground);position:relative}.surface--transparent{background-color:#0000}.surface--default{background-color:var(--surface);color:var(--surface-foreground)}.surface--secondary{background-color:var(--surface-secondary);color:var(--surface-secondary-foreground)}.surface--tertiary{background-color:var(--surface-tertiary);color:var(--surface-tertiary-foreground)}.avatar{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);background-color:var(--default);flex-shrink:0;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}.avatar__fallback{background-color:var(--default);width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);justify-content:center;align-items:center;display:flex}.avatar__image{aspect-ratio:1;width:100%;height:100%;transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s;position:absolute;top:0;right:0;bottom:0;left:0}.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *),.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.avatar--sm{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2)}.avatar--lg{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12);border-radius:calc(var(--radius) * 3)}.avatar--lg .avatar__fallback{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.avatar__fallback--accent{color:var(--accent-soft-foreground)}.avatar__fallback--default{color:var(--default-soft-foreground)}.avatar__fallback--success{color:var(--success-soft-foreground)}.avatar__fallback--warning{color:var(--warning-soft-foreground)}.avatar__fallback--danger{color:var(--danger-soft-foreground)}.avatar--soft{background-color:#0000}.avatar--soft .avatar__fallback--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.avatar--soft .avatar__fallback--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.avatar--soft .avatar__fallback--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.avatar--soft .avatar__fallback--default{background-color:var(--default-soft);color:var(--default-soft-foreground)}.avatar--soft .avatar__fallback--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.alert-dialog__trigger:focus-visible:not(:focus),.alert-dialog__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.alert-dialog__trigger:disabled,.alert-dialog__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.alert-dialog__trigger:active,.alert-dialog__trigger[data-pressed=true]{transform:scale(.97)}.alert-dialog__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.alert-dialog__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.alert-dialog__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]{will-change:opacity}:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__backdrop--transparent{background-color:#0000}.alert-dialog__backdrop--opaque{background-color:var(--backdrop)}.alert-dialog__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.alert-dialog__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.alert-dialog__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.alert-dialog__container{pointer-events:none}.alert-dialog__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.alert-dialog__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.alert-dialog__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.alert-dialog__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.alert-dialog__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]{will-change:opacity,transform}:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;min-height:0;max-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative;overflow:clip}.alert-dialog__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.alert-dialog__dialog[data-placement=auto]{margin-block:auto}}.alert-dialog__dialog[data-placement=center]{margin-block:auto}.alert-dialog__dialog[data-placement=bottom]{margin-top:auto}.alert-dialog__dialog[data-placement=top]{margin-top:0}.alert-dialog__dialog--xs{max-width:var(--container-xs)}.alert-dialog__dialog--sm{max-width:var(--container-sm)}.alert-dialog__dialog--md{max-width:var(--container-md)}.alert-dialog__dialog--lg{max-width:var(--container-lg)}.alert-dialog__dialog--cover{width:100%;height:100%;min-height:100%}.alert-dialog__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.alert-dialog__header>.modal__icon{margin-bottom:0}.alert-dialog__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.alert-dialog__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.alert-dialog__icon [data-slot=alert-dialog-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.alert-dialog__icon--default{background-color:var(--default);color:var(--foreground)}.alert-dialog__icon--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.alert-dialog__icon--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.alert-dialog__icon--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.alert-dialog__icon--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.alert-dialog__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.alert-dialog__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.alert-dialog__header+.alert-dialog__body{margin-top:calc(var(--spacing) * 2)}.alert-dialog__header+.alert-dialog__footer,.alert-dialog__body+.alert-dialog__footer{margin-top:calc(var(--spacing) * 5)}.drawer__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.drawer__trigger:focus-visible:not(:focus),.drawer__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.drawer__trigger:disabled,.drawer__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.drawer__trigger:active,.drawer__trigger[data-pressed=true]{transform:scale(.97)}.drawer__backdrop{z-index:50;height:var(--visual-viewport-height);opacity:1;width:100%;transition:opacity .25s cubic-bezier(.32,.72,0,1);position:fixed;top:0;right:0;bottom:0;left:0}.drawer__backdrop[data-entering=true]{opacity:0}.drawer__backdrop[data-exiting=true]{opacity:0;transition-duration:.2s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.drawer__backdrop[data-exiting=true],.drawer__backdrop[data-entering=true]{will-change:opacity}@media(prefers-reduced-motion:reduce){.drawer__backdrop{transition:none}}.drawer__backdrop--transparent{background-color:#0000}.drawer__backdrop--opaque{background-color:var(--backdrop)}.drawer__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.drawer__content{pointer-events:none;z-index:50;height:var(--visual-viewport-height);width:100%;min-width:0;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.drawer__content--bottom{align-items:flex-end}.drawer__content--top{align-items:flex-start}.drawer__content--left{justify-content:flex-start}.drawer__content--right{justify-content:flex-end}.drawer__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;padding:calc(var(--spacing) * 6);pointer-events:auto;--drawer-enter-duration:.25s;--drawer-exit-duration:.2s;--drawer-enter-ease:cubic-bezier(.32, .72, 0, 1);--drawer-exit-ease:cubic-bezier(.32, .72, 0, 1);will-change:translate;transition:translate var(--drawer-enter-duration) var(--drawer-enter-ease);outline-style:none;flex-direction:column;display:flex;position:relative}@media(prefers-reduced-motion:reduce){.drawer__dialog{transition:none}}.drawer__dialog[data-placement=bottom]{border-top-left-radius:min(32px,var(--radius-2xl));border-top-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=top]{border-bottom-left-radius:min(32px,var(--radius-2xl));border-bottom-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=left]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=left]{width:calc(var(--spacing) * 96)}}.drawer__dialog[data-placement=right]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=right]{width:calc(var(--spacing) * 96)}}[data-exiting=true] .drawer__dialog{transition-duration:var(--drawer-exit-duration);transition-timing-function:var(--drawer-exit-ease)}.drawer__content--left .drawer__dialog,.drawer__content--right .drawer__dialog,.drawer__content--top .drawer__dialog,.drawer__content--bottom .drawer__dialog{translate:0}.drawer__content--left[data-entering=true] .drawer__dialog,.drawer__content--left[data-exiting=true] .drawer__dialog{translate:-100%}.drawer__content--right[data-entering=true] .drawer__dialog,.drawer__content--right[data-exiting=true] .drawer__dialog{translate:100%}.drawer__content--top[data-entering=true] .drawer__dialog,.drawer__content--top[data-exiting=true] .drawer__dialog{translate:0 -100%}.drawer__content--bottom[data-entering=true] .drawer__dialog,.drawer__content--bottom[data-exiting=true] .drawer__dialog{translate:0 100%}.drawer__dialog--top{padding-bottom:calc(var(--spacing) * 2)}.drawer__dialog--top .drawer__handle{padding-bottom:0}.drawer__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.drawer__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.drawer__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.drawer__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.drawer__handle{padding-bottom:calc(var(--spacing) * 2);justify-content:center;align-items:center;display:flex}.drawer__handle>[data-slot=drawer-handle-bar]{height:var(--spacing);width:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * .25);background-color:var(--separator)}.drawer__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.drawer__header+.drawer__body{margin-top:calc(var(--spacing) * 2)}.drawer__header+.drawer__footer,.drawer__body+.drawer__footer{margin-top:calc(var(--spacing) * 5)}.drawer__handle+.drawer__header,.drawer__handle+.drawer__body{margin-top:0}.modal__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.modal__trigger:focus-visible:not(:focus),.modal__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.modal__trigger:disabled,.modal__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.modal__trigger:active,.modal__trigger[data-pressed=true]{transform:scale(.97)}.modal__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.modal__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.modal__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]{will-change:opacity}:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__backdrop--transparent{background-color:#0000}.modal__backdrop--opaque{background-color:var(--backdrop)}.modal__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.modal__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.modal__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.modal__container{pointer-events:none}.modal__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.modal__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.modal__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.modal__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.modal__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-exiting=true],.modal__container[data-entering=true]{will-change:opacity,transform}:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__container--scroll-outside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);pointer-events:auto;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__container--full{padding:0}@media(min-width:40rem){.modal__container--full{padding:0}}.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% ;--tw-enter-scale:1}@media(min-width:40rem){.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% }}.modal__container--full[data-exiting=true]{--tw-exit-scale:1}.modal__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative}.modal__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.modal__dialog[data-placement=auto]{margin-block:auto}}.modal__dialog[data-placement=center]{margin-block:auto}.modal__dialog[data-placement=bottom]{margin-top:auto}.modal__dialog[data-placement=top]{margin-top:0}.modal__dialog--scroll-inside{min-height:0;max-height:100%;overflow:clip}.modal__dialog--scroll-outside{flex-shrink:0;height:auto;min-height:0}.modal__dialog--xs{max-width:var(--container-xs)}.modal__dialog--sm{max-width:var(--container-sm)}.modal__dialog--md{max-width:var(--container-md)}.modal__dialog--lg{max-width:var(--container-lg)}.modal__dialog--cover{width:100%;height:100%;min-height:100%}.modal__dialog--full{--tw-shadow:0 0 #0000;width:100%;height:100%;min-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:0}.modal__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.modal__header>.modal__icon{margin-bottom:0}.modal__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.modal__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.modal__body{min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow:visible}.modal__body--scroll-inside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__body--scroll-outside{overflow-y:visible}.modal__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.modal__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.modal__header+.modal__body{margin-top:calc(var(--spacing) * 2)}.modal__header+.modal__footer,.modal__body+.modal__footer{margin-top:calc(var(--spacing) * 5)}.popover{transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0}.popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.popover[data-exiting=true],.popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.popover__dialog{padding:calc(var(--spacing) * 4);--tw-outline-style:none;outline-style:none}.popover__heading{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.popover__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.popover__trigger{cursor:var(--cursor-interactive)}.popover__trigger:focus-visible:not(:focus),.popover__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.popover__trigger:disabled,.popover__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tooltip{max-width:var(--container-xs);transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);padding:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));word-break:break-all;border-radius:min(32px,var(--radius-xl));box-shadow:var(--shadow-overlay)}.tooltip[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.tooltip[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.tooltip[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.tooltip[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.tooltip[data-exiting=true],.tooltip[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.tooltip [data-slot=overlay-arrow]{stroke:var(--border)}@supports (color:color-mix(in lab,red,red)){.tooltip [data-slot=overlay-arrow]{stroke:color-mix(in oklab,var(--border) 40%,transparent)}}.tooltip [data-slot=overlay-arrow]{fill:var(--overlay)}.tooltip[data-placement=bottom] [data-slot=overlay-arrow]{rotate:180deg}.tooltip[data-placement=left] [data-slot=overlay-arrow]{rotate:-90deg}.tooltip[data-placement=right] [data-slot=overlay-arrow]{rotate:90deg}.tooltip__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tooltip__trigger:focus-visible:not(:focus),.tooltip__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.combo-box{gap:var(--spacing);flex-direction:column;display:flex}:is(.combo-box[data-invalid=true],.combo-box[aria-invalid=true]) [data-slot=description]{display:none}.combo-box [data-slot=label]{width:fit-content}.combo-box [data-slot=input]{flex:1;min-width:0}.combo-box [data-slot=input]:has(+.combo-box__trigger){padding-inline-end:calc(var(--spacing) * 7)}.combo-box [data-slot=input]:focus,.combo-box [data-slot=input][data-focus]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.combo-box [data-slot=input]:disabled,.combo-box [data-slot=input][data-disabled],.combo-box [data-slot=input][aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.combo-box__input-group{isolation:isolate;align-items:center;display:inline-flex;position:relative}.combo-box__trigger{--tw-translate-y: -50% ;height:100%;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:pointer;color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;-webkit-tap-highlight-color:transparent;--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-color:#0000;border-style:none;outline-style:none;flex-shrink:0;justify-content:center;align-items:center;padding-inline-end:calc(var(--spacing) * 2);transition-duration:.15s;display:flex;position:absolute;top:50%}@media(hover:hover){.combo-box__trigger:hover,.combo-box__trigger[data-hovered=true]{color:var(--field-foreground,var(--foreground))}}.combo-box__trigger:focus-visible:not(:focus),.combo-box__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-radius:.25rem;outline-style:none}.combo-box__trigger[data-pressed=true]{opacity:.7}.combo-box__trigger:disabled,.combo-box__trigger[data-disabled],.combo-box__trigger[aria-disabled=true]{cursor:not-allowed;opacity:.5}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;transition-duration:.15s}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.combo-box__trigger[data-open=true] [data-slot=combo-box-trigger-default-icon]{rotate:180deg}.combo-box__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.combo-box__popover:focus-visible:not(:focus),.combo-box__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.combo-box__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.combo-box__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.combo-box__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.combo-box__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.combo-box__popover[data-exiting=true],.combo-box__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.combo-box__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.combo-box__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.combo-box__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.combo-box__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.combo-box__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.combo-box__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.combo-box__popover [data-slot=list-box-item] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.combo-box--full-width,.combo-box__input-group--full-width{width:100%}.select{gap:var(--spacing);flex-direction:column;display:flex}:is(.select[data-invalid=true],.select[aria-invalid=true]) [data-slot=description]{display:none}.select [data-slot=label]{width:fit-content}.select__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.select__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.select__trigger:has(.select__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.select__trigger:hover,.select__trigger[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.select__trigger:focus-visible:not(:focus),.select__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-visible,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focused=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-visible=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-within,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{background-color:var(--field-focus)}.select__trigger:disabled,.select__trigger[data-disabled=true],.select__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.select--secondary .select__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--select-trigger-bg);--select-trigger-bg:var(--default);--select-trigger-bg-hover:var(--default-hover);--select-trigger-bg-focus:var(--default)}@media(hover:hover){.select--secondary .select__trigger:hover,.select--secondary .select__trigger[data-hovered=true]{background-color:var(--select-trigger-bg-hover)}}.select--secondary .select__trigger:focus-visible:not(:focus),.select--secondary .select__trigger[data-focus-visible=true],.select[data-invalid=true] :is(.select--secondary .select__trigger),.select[aria-invalid=true] :is(.select--secondary .select__trigger){background-color:var(--select-trigger-bg-focus)}.select__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.select__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.select__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.select__value [data-slot=list-box-item-indicator]{display:none}.select__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.select__indicator[data-open=true]{rotate:180deg}.select__indicator[data-slot=select-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.select__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.select__popover:focus-visible:not(:focus),.select__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.select__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.select__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.select__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.select__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.select__popover[data-exiting=true],.select__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.select__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.select__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.select__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.select__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.select__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.select__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.select--full-width,.select__trigger--full-width{width:100%}.autocomplete{gap:var(--spacing);flex-direction:column;display:flex}.autocomplete__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.autocomplete__trigger:has(.autocomplete__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.autocomplete__trigger:focus-visible:not(:focus),.autocomplete__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-visible,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focused=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-visible=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-within,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{background-color:var(--field-focus)}.autocomplete__trigger:disabled,.autocomplete__trigger[data-disabled=true],.autocomplete__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.autocomplete--secondary .autocomplete__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--autocomplete-trigger-bg);--autocomplete-trigger-bg:var(--default);--autocomplete-trigger-bg-hover:var(--default-hover);--autocomplete-trigger-bg-focus:var(--default)}@media(hover:hover){.autocomplete--secondary .autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete--secondary .autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--autocomplete-trigger-bg-hover)}}.autocomplete--secondary .autocomplete__trigger:focus-visible:not(:focus),.autocomplete--secondary .autocomplete__trigger[data-focus-visible=true],.autocomplete[data-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger),.autocomplete[aria-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger){background-color:var(--autocomplete-trigger-bg-focus)}.autocomplete__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.autocomplete__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.autocomplete__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.autocomplete__value [data-slot=list-box-item-indicator]{display:none}.autocomplete__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;cursor:var(--cursor-interactive);flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.autocomplete__indicator[data-open=true]{rotate:180deg}.autocomplete__indicator[data-slot=autocomplete-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.autocomplete__popover{width:var(--trigger-width);max-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);overscroll-behavior:contain;background-color:var(--overlay);padding:0;padding-top:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);overflow:hidden}.autocomplete__popover:focus-visible:not(:focus),.autocomplete__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.32, .72, 0, 1);--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.25s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.autocomplete__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.autocomplete__popover[data-exiting=true],.autocomplete__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.autocomplete__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.autocomplete__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.autocomplete__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.autocomplete__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.autocomplete__popover [data-slot=list-box]{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);max-height:320px;padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none;overflow-y:auto}.autocomplete__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.autocomplete__popover [data-slot=search-field]{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);--tw-outline-style:none;outline-style:none}.autocomplete__popover [data-slot=empty-state]{text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--overlay-foreground)}@supports (color:color-mix(in lab,red,red)){.autocomplete__popover [data-slot=empty-state]{color:color-mix(in oklab,var(--overlay-foreground) 60%,transparent)}}.autocomplete__popover-dialog,.autocomplete__popover-dialog:focus,.autocomplete__popover-dialog:focus-visible,.autocomplete__popover-dialog[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete--full-width,.autocomplete__trigger--full-width{width:100%}.autocomplete__clear-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);color:var(--muted);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);cursor:var(--cursor-interactive);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);background-color:#0000;flex-shrink:0;justify-content:center;align-self:center;align-items:center;margin-inline-end:0;display:inline-flex;position:relative}.autocomplete__clear-button:not([data-empty=true]){transition:opacity .15s var(--ease-smooth)}.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__clear-button[data-empty=true]{pointer-events:none;opacity:0}.autocomplete__clear-button [data-slot=autocomplete-clear-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(hover:hover){.autocomplete__clear-button:hover,.autocomplete__clear-button[data-hovered=true]{background-color:var(--default-hover)}}.autocomplete__clear-button:active,.autocomplete__clear-button[data-pressed=true]{transform:scale(.93)}.kbd{height:calc(var(--spacing) * 6);align-items:center;display:inline-flex}:where(.kbd>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * .5) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-x-reverse)))}.kbd{border-radius:calc(var(--radius) * 1);background-color:var(--default);padding-inline:calc(var(--spacing) * 2);text-align:center;font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;color:var(--muted)}:where(.kbd:where(:dir(rtl),[dir=rtl],[dir=rtl] *)>:not(:last-child)){--tw-space-x-reverse:1}.kbd{word-spacing:-.25rem}.kbd__abbr{justify-content:center;align-items:center;width:100%;height:100%;text-decoration:none;display:flex}.kbd__content{justify-content:center;align-items:center;display:flex}.kbd--light{background-color:#0000}.typography,.typography-prose{color:var(--foreground)}.typography-prose h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose p{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography-prose a{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--link);text-underline-offset:4px;text-decoration-line:underline}.typography-prose blockquote{margin-top:calc(var(--spacing) * 4);border-left-style:var(--tw-border-style);border-left-width:4px;border-color:var(--border);padding-left:calc(var(--spacing) * 4);color:var(--muted);font-style:italic}.typography-prose ul{margin-block:calc(var(--spacing) * 4);list-style-type:disc}:where(.typography-prose ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ul{padding-left:calc(var(--spacing) * 6)}.typography-prose ol{margin-block:calc(var(--spacing) * 4);list-style-type:decimal}:where(.typography-prose ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ol{padding-left:calc(var(--spacing) * 6)}.typography-prose li{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose hr{margin-block:calc(var(--spacing) * 8);border-color:var(--separator)}.typography-prose pre{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);background-color:var(--default);padding:calc(var(--spacing) * 4);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);overflow-x:auto}.typography-prose strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--foreground)}.typography-prose em{font-style:italic}.typography-prose img{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5)}.typography--h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--body{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography--body-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.typography--body-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.typography--code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography--align-start{text-align:left}.typography--align-start:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:right}.typography--align-center{text-align:center}.typography--align-end{text-align:right}.typography--align-end:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:left}.typography--align-justify{text-align:justify}.typography--color-default{color:var(--foreground)}.typography--color-muted{color:var(--muted)}.typography--truncate{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.typography--weight-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.typography--weight-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.typography--weight-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.typography--weight-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.scroll-shadow{--scroll-shadow-size:40px;--scroll-shadow-scrollbar-size:10px;position:relative}.scroll-shadow--vertical{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-y:auto}.scroll-shadow--horizontal{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-x:auto}.scroll-shadow--fade.scroll-shadow--vertical:where([data-top-scroll=true],[data-bottom-scroll=true],[data-top-bottom-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,100% 0;mask-repeat:no-repeat;mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%;-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,100% 0;-webkit-mask-repeat:no-repeat;-webkit-mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%}.scroll-shadow--fade.scroll-shadow--vertical[data-top-scroll=true]{--scroll-linear-gradient:0deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-bottom-scroll=true]{--scroll-linear-gradient:180deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-top-bottom-scroll=true]{--scroll-linear-gradient:#000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal:where([data-left-scroll=true],[data-right-scroll=true],[data-left-right-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,0 100%;mask-repeat:no-repeat;mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,0 100%;-webkit-mask-repeat:no-repeat;-webkit-mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size)}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-scroll=true]{--scroll-linear-gradient:270deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-right-scroll=true]{--scroll-linear-gradient:90deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-right-scroll=true]{--scroll-linear-gradient:to right, #000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--hide-scrollbar{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;--scroll-shadow-scrollbar-size:0px}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{inset-inline:0}.inset-y-0{inset-block:0}.top-0{top:0}.top-1\/2{top:50%}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.-right-3{right:calc(var(--spacing) * -3)}.right-0{right:0}.right-4{right:calc(var(--spacing) * 4)}.bottom-0{bottom:0}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-0{left:0}.left-1\/2{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[1\]{z-index:1}.z-\[2\]{z-index:2}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing) * -1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:var(--spacing)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-12{height:calc(var(--spacing) * 12)}.h-48{height:calc(var(--spacing) * 48)}.h-\[90px\]{height:90px}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:0}.min-h-full{min-height:100%}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-20{width:calc(var(--spacing) * 20)}.w-28{width:calc(var(--spacing) * 28)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-\[17rem\]{width:17rem}.w-\[calc\(100\%-2rem\)\]{width:calc(100% - 2rem)}.w-\[n\%\]{width:n%}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-44{max-width:calc(var(--spacing) * 44)}.max-w-\[1800px\]{max-width:1800px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-\[140px\]{min-width:140px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing) * 5);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-ew-resize{cursor:ew-resize}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y:pan-y;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--otari-line\)\]>:not(:last-child)){border-color:var(--otari-line)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:calc(var(--radius) * 1)}.rounded-md{border-radius:calc(var(--radius) * .75)}.rounded-xl{border-radius:calc(var(--radius) * 1.5)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-\[\#c2843a\]{border-color:#c2843a}.border-\[var\(--otari-brand\)\]{border-color:var(--otari-brand)}.border-\[var\(--otari-line\)\]{border-color:var(--otari-line)}.border-amber-200{border-color:var(--color-amber-200)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-red-500{border-left-color:var(--color-red-500)}.bg-\[var\(--otari-bg\)\]{background-color:var(--otari-bg)}.bg-\[var\(--otari-brand\)\],.bg-\[var\(--otari-brand\)\]\/10{background-color:var(--otari-brand)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--otari-brand\)\]\/10{background-color:color-mix(in oklab,var(--otari-brand) 10%,transparent)}}.bg-\[var\(--otari-brand-tint\)\]{background-color:var(--otari-brand-tint)}.bg-\[var\(--otari-line\)\]{background-color:var(--otari-line)}.bg-\[var\(--otari-surface\)\]{background-color:var(--otari-surface)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-500{background-color:var(--color-green-500)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1{padding-bottom:var(--spacing)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#b45309\]{color:#b45309}.text-\[var\(--otari-brand-dark\)\]{color:var(--otari-brand-dark)}.text-\[var\(--otari-ink\)\]{color:var(--otari-ink)}.text-\[var\(--otari-muted\)\]{color:var(--otari-muted)}.text-amber-400{color:var(--color-amber-400)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-emerald-700{color:var(--color-emerald-700)}.text-green-700{color:var(--color-green-700)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.accent-\[var\(--otari-brand\)\]{accent-color:var(--otari-brand)}.opacity-0{opacity:0}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.running{animation-play-state:running}.zoom-out{--tw-exit-scale:0}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-focus-visible\:ring-2:is(:where(.group):focus-visible *){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.group-focus-visible\:ring-\[var\(--otari-brand\)\]:is(:where(.group):focus-visible *){--tw-ring-color:var(--otari-brand)}.group-data-\[focus-visible\]\:outline-2:is(:where(.group)[data-focus-visible] *){outline-style:var(--tw-outline-style);outline-width:2px}.group-data-\[focus-visible\]\:outline-\[var\(--otari-brand\)\]:is(:where(.group)[data-focus-visible] *){outline-color:var(--otari-brand)}@media(hover:hover){.hover\:border-\[var\(--otari-brand\)\]:hover{border-color:var(--otari-brand)}.hover\:bg-\[var\(--otari-bg\)\]:hover{background-color:var(--otari-bg)}.hover\:bg-\[var\(--otari-brand\)\]:hover,.hover\:bg-\[var\(--otari-brand\)\]\/20:hover{background-color:var(--otari-brand)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--otari-brand\)\]\/20:hover{background-color:color-mix(in oklab,var(--otari-brand) 20%,transparent)}}.hover\:bg-\[var\(--otari-line\)\]:hover{background-color:var(--otari-line)}.hover\:text-\[var\(--otari-brand\)\]:hover{color:var(--otari-brand)}.hover\:text-\[var\(--otari-brand-dark\)\]:hover{color:var(--otari-brand-dark)}.hover\:text-\[var\(--otari-ink\)\]:hover{color:var(--otari-ink)}.hover\:text-amber-950:hover{color:var(--color-amber-950)}.hover\:text-red-700:hover{color:var(--color-red-700)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:not-sr-only:focus{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.focus\:absolute:focus{position:absolute}.focus\:top-3:focus{top:calc(var(--spacing) * 3)}.focus\:left-3:focus{left:calc(var(--spacing) * 3)}.focus\:z-50:focus{z-index:50}.focus\:rounded-lg:focus{border-radius:calc(var(--radius) * 1)}.focus\:border:focus{border-style:var(--tw-border-style);border-width:1px}.focus\:border-\[var\(--otari-brand\)\]:focus{border-color:var(--otari-brand)}.focus\:bg-\[var\(--otari-surface\)\]:focus{background-color:var(--otari-surface)}.focus\:px-4:focus{padding-inline:calc(var(--spacing) * 4)}.focus\:py-2:focus{padding-block:calc(var(--spacing) * 2)}.focus\:text-sm:focus{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.focus\:font-medium:focus{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.focus\:text-\[var\(--otari-brand-dark\)\]:focus{color:var(--otari-brand-dark)}.focus\:shadow-md:focus{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:bg-\[var\(--otari-brand\)\]:focus-visible{background-color:var(--otari-brand)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[var\(--otari-brand\)\]:focus-visible{--tw-ring-color:var(--otari-brand)}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-start-1{grid-column-start:1}.sm\:col-start-2{grid-column-start:2}.sm\:col-start-3{grid-column-start:3}.sm\:inline{display:inline}.sm\:w-28{width:calc(var(--spacing) * 28)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[minmax\(0\,1fr\)_16rem_10rem\]{grid-template-columns:minmax(0,1fr) 16rem 10rem}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-self-end{justify-self:flex-end}.sm\:justify-self-start{justify-self:flex-start}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}@media(min-width:48rem){.md\:flex{display:flex}.md\:hidden{display:none}.md\:px-6{padding-inline:calc(var(--spacing) * 6)}.md\:py-6{padding-block:calc(var(--spacing) * 6)}}@media(min-width:64rem){.lg\:sticky{position:sticky}.lg\:top-4{top:calc(var(--spacing) * 4)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_360px\]{grid-template-columns:minmax(0,1fr) 360px}.lg\:items-start{align-items:flex-start}}@media(min-width:80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--otari-brand:#4e8295;--otari-brand-dark:#3c6678;--otari-brand-soft:#8fb2bf;--otari-brand-tint:#eaf1f3;--otari-ink:#14242c;--otari-muted:#5b6b73;--otari-line:#dbe5e8;--otari-surface:#fff;--otari-bg:#f6f9fa;--otari-code-ink:#e8eef0}.otari-table.table-root{background-color:var(--otari-surface);border:1px solid var(--otari-line);border-radius:.75rem;padding:0;overflow:hidden}.otari-table .table__header{background-color:var(--otari-brand-tint);border-bottom:1px solid var(--otari-line)}.otari-table .table__column,.otari-table [role=row]>[role=presentation]:first-of-type>.table__column,.otari-table [role=row]>[role=presentation]:last-of-type>.table__column{color:var(--otari-ink);background-color:#0000;border-radius:0;font-weight:600}.otari-table .table__column:after{content:none}.otari-table .table__row .table__cell{border-color:var(--otari-line)}.otari-table .table__row:hover .table__cell{background-color:var(--otari-bg)}.otari-table .otari-detail-row>td{border-bottom:1px solid var(--otari-line);background-color:var(--otari-bg);padding:0}.otari-table .otari-detail-opening .table__cell{background-color:var(--otari-brand-tint)}.otari-detail-reveal{grid-template-rows:0fr;animation:.18s ease-out forwards otari-detail-open;display:grid}.otari-detail-reveal>div{overflow:hidden}@keyframes otari-detail-open{0%{opacity:.5;grid-template-rows:0fr}to{opacity:1;grid-template-rows:1fr}}.otari-bulk-bar{animation:.16s ease-out otari-bulk-bar-in}@keyframes otari-bulk-bar-in{0%{opacity:0;transform:translate(-50%,.5rem)}to{opacity:1;transform:translate(-50%)}}@media(prefers-reduced-motion:reduce){.otari-detail-reveal{grid-template-rows:1fr;animation:none}.otari-bulk-bar{animation:none}}.otari-markdown{color:var(--otari-ink);font-size:.875rem;line-height:1.65}.otari-markdown>:first-child{margin-top:0}.otari-markdown h1,.otari-markdown h2,.otari-markdown h3,.otari-markdown h4{color:var(--otari-ink);font-weight:600;line-height:1.3}.otari-markdown h1{margin:2rem 0 .75rem;font-size:1.5rem}.otari-markdown h2{border-bottom:1px solid var(--otari-line);margin:2rem 0 .5rem;padding-bottom:.3rem;font-size:1.25rem}.otari-markdown h3{margin:1.5rem 0 .5rem;font-size:1.05rem}.otari-markdown h4{margin:1.25rem 0 .25rem;font-size:.95rem}.otari-markdown p{margin:.75rem 0}.otari-markdown a{color:var(--otari-brand-dark);text-underline-offset:2px;text-decoration:underline}.otari-markdown a:hover{text-decoration-thickness:2px}.otari-markdown ul,.otari-markdown ol{margin:.75rem 0;padding-left:1.5rem}.otari-markdown ul{list-style:outside}.otari-markdown ol{list-style:decimal}.otari-markdown li,.otari-markdown li>ul,.otari-markdown li>ol{margin:.25rem 0}.otari-markdown code{background-color:var(--otari-brand-tint);color:var(--otari-brand-dark);border-radius:.35rem;padding:.1rem .35rem;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,monospace;font-size:.85em}.otari-markdown pre{background-color:var(--otari-ink);border-radius:.6rem;margin:1rem 0;padding:.85rem 1rem;overflow-x:auto}.otari-markdown pre code{color:var(--otari-code-ink);background-color:#0000;border-radius:0;padding:0;font-size:.82rem;line-height:1.55}.otari-markdown blockquote{border-left:3px solid var(--otari-brand);color:var(--otari-muted);margin:1rem 0;padding:.25rem 0 .25rem 1rem}.otari-markdown hr{border:0;border-top:1px solid var(--otari-line);margin:1.5rem 0}.otari-markdown-scroll{max-width:100%;margin:1rem 0;overflow-x:auto}.otari-markdown table{border-collapse:collapse;font-size:.85rem}.otari-markdown th,.otari-markdown td{border:1px solid var(--otari-line);text-align:left;vertical-align:top;padding:.4rem .7rem}.otari-markdown th{background-color:var(--otari-brand-tint);color:var(--otari-ink);font-weight:600}.otari-markdown tbody tr:hover td,.otari-markdown tr:hover td{background-color:var(--otari-bg)}html,body,#root{height:100%}body{background-color:var(--otari-bg);color:var(--otari-ink);margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}@keyframes caret-blink{0%,70%,to{opacity:1}20%,50%{opacity:0}}@keyframes skeleton{to{transform:translate(200%)}} +/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--tw-content:"";--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-space-y-reverse:0;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-700:oklch(50.5% .213 27.518);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-500:oklch(72.3% .219 149.579);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-xl:calc(var(--radius) * 1.5);--radius-2xl:calc(var(--radius) * 2);--radius-3xl:calc(var(--radius) * 3);--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow-surface:var(--surface-shadow);--shadow-overlay:var(--overlay-shadow);--border-width-field:var(--field-border-width,var(--border-width));--ease-smooth:ease;--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-fluid:cubic-bezier(.32, .72, 0, 1);--ease-linear:linear}@layer theme.base{:root,.light,.default,[data-theme=light],[data-theme=default]{color-scheme:light;--white:oklch(100% 0 0);--black:oklch(0% 0 0);--snow:oklch(99.11% 0 0);--eclipse:oklch(21.03% .0059 285.89);--spacing:.25rem;--border-width:1px;--field-border-width:0px;--disabled-opacity:.5;--ring-offset-width:2px;--cursor-interactive:pointer;--cursor-disabled:not-allowed;--radius:.5rem;--field-radius:calc(var(--radius) * 1.5);--background:oklch(97.02% 0 0);--foreground:var(--eclipse);--surface:var(--white);--surface-foreground:var(--foreground);--surface-secondary:oklch(95.24% .0013 286.37);--surface-secondary-foreground:var(--foreground);--surface-tertiary:oklch(93.73% .0013 286.37);--surface-tertiary-foreground:var(--foreground);--overlay:var(--white);--overlay-foreground:var(--foreground);--muted:oklch(55.17% .0138 285.94);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(94% .001 286.375);--default-foreground:var(--eclipse);--accent:oklch(62.04% .195 253.83);--accent-foreground:var(--snow);--field-background:var(--white);--field-foreground:oklch(21.03% .0059 285.89);--field-placeholder:var(--muted);--field-border:transparent;--success:oklch(73.29% .1935 150.81);--success-foreground:var(--eclipse);--warning:oklch(78.19% .1585 72.33);--warning-foreground:var(--eclipse);--danger:oklch(65.32% .2328 25.74);--danger-foreground:var(--snow);--segment:var(--white);--segment-foreground:var(--eclipse);--border:oklch(90% .004 286.32);--separator:oklch(92% .004 286.32);--focus:var(--accent);--link:var(--foreground);--backdrop:#00000080;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:color-mix(in oklab, var(--accent) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 70%, var(--foreground) 30%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:color-mix(in oklab, var(--accent) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 70%, var(--foreground) 40%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:color-mix(in oklab, var(--warning) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 70%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:color-mix(in oklab, var(--warning) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:color-mix(in oklab, var(--success) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 60%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:color-mix(in oklab, var(--success) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--overlay-shadow:0 2px 8px 0 #0000000f, 0 -6px 12px 0 #00000008, 0 14px 28px 0 #00000014;--field-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--skeleton-animation:shimmer;--tooltip-delay:1.5s;--tooltip-close-delay:.5s}.dark,[data-theme=dark]{color-scheme:dark;--background:oklch(12% .005 285.823);--foreground:var(--snow);--surface:oklch(21.03% .0059 285.89);--surface-foreground:var(--foreground);--surface-secondary:oklch(25.7% .0037 286.14);--surface-tertiary:oklch(27.21% .0024 247.91);--overlay:oklch(21.03% .0059 285.89);--overlay-foreground:var(--foreground);--muted:oklch(70.5% .015 286.067);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}.dark,[data-theme=dark]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(27.4% .006 286.033);--default-foreground:var(--snow);--field-background:oklch(21.03% .0059 285.89);--field-foreground:var(--foreground);--warning:oklch(82.03% .1388 76.34);--warning-foreground:var(--eclipse);--danger:oklch(59.4% .1967 24.63);--danger-foreground:var(--snow);--segment:oklch(39.64% .01 285.93);--segment-foreground:var(--foreground);--border:oklch(28% .006 286.033);--separator:oklch(25% .006 286.033);--focus:var(--accent);--link:var(--foreground);--backdrop:#0009;--surface-shadow:0 0 0 0 transparent inset;--overlay-shadow:0 0 1px 0 #ffffff4d inset;--field-shadow:0 0 0 0 transparent inset;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}.dark,[data-theme=dark]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}.dark,[data-theme=dark]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}.dark,[data-theme=dark]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}.dark,[data-theme=dark]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}.dark,[data-theme=dark]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}.dark,[data-theme=dark]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}.dark,[data-theme=dark]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}.dark,[data-theme=dark]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}.dark,[data-theme=dark]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}.dark,[data-theme=dark]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}.dark,[data-theme=dark]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}.dark,[data-theme=dark]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}.dark,[data-theme=dark]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft:color-mix(in oklab, var(--accent) 12%, transparent)}}.dark,[data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-hover:color-mix(in oklab, var(--accent) 16%, transparent)}}.dark,[data-theme=dark]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}.dark,[data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}.dark,[data-theme=dark]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft:color-mix(in oklab, var(--warning) 12%, transparent)}}.dark,[data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-hover:color-mix(in oklab, var(--warning) 16%, transparent)}}.dark,[data-theme=dark]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft:color-mix(in oklab, var(--success) 12%, transparent)}}.dark,[data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-hover:color-mix(in oklab, var(--success) 16%, transparent)}}.dark,[data-theme=dark]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}.dark,[data-theme=dark]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}.dark,[data-theme=dark]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}.dark,[data-theme=dark]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}}@layer components;}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--border,currentColor)}::file-selector-button{border-color:var(--border,currentColor)}:root{view-transition-name:none}::view-transition{pointer-events:none}[data-scrollbar=thin]{--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--scrollbar-gutter:auto}[data-scrollbar=default]{--scrollbar-width:auto;--scrollbar-color:auto;--scrollbar-gutter:auto}[data-scrollbar=none]{--scrollbar-width:none;--scrollbar-color:auto;--scrollbar-gutter:auto}}@layer components{.close-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),color .15s var(--ease-out),background-color .1s var(--ease-out),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.close-button:focus-visible:not(:focus),.close-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.close-button:disabled,.close-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.close-button[data-pending=true]{pointer-events:none}.close-button svg{pointer-events:none;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);flex-shrink:0;align-self:center}.close-button--default{background-color:var(--default);color:var(--muted)}@media(hover:hover){.close-button--default:hover,.close-button--default[data-hovered=true]{background-color:var(--default-hover)}}.close-button--default:active,.close-button--default[data-pressed=true]{transform:scale(.93)}.description{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted)}.error-message{height:auto;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *),.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.field-error{height:0;padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);opacity:0}.field-error[data-visible]{opacity:1;height:auto}.field-error{transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *),.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox>.field-error,.checkbox>[data-slot=field-error],.switch>.field-error,.switch>[data-slot=field-error],.radio>.field-error,.radio>[data-slot=field-error]{height:auto;min-height:0;color:var(--muted);opacity:1;margin:0;padding:0;transition:none}.label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}:is(.label--required,[data-required=true]:not([role=group]):not([role=radiogroup]):not([role=checkboxgroup])>.label,[data-required=true]:not([data-slot=radio]):not([data-slot=checkbox])>.label):after{margin-left:calc(var(--spacing) * .5);color:var(--danger);--tw-content:"*";content:var(--tw-content)}.label--disabled,[data-disabled=true] .label{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.label--invalid,[data-invalid=true] .label,[aria-invalid=true] .label{color:var(--danger)}.accordion{contain:layout style;width:100%}.accordion__body{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.accordion__body-inner{padding-inline:calc(var(--spacing) * 4);padding-top:0;padding-bottom:calc(var(--spacing) * 4);color:var(--muted)}.accordion__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__indicator[data-expanded=true]{rotate:-180deg}.accordion__item{--tw-border-style:none;border-style:none;position:relative}.accordion__item:after{content:"";border-radius:calc(var(--radius) * .25);background-color:var(--separator);width:100%;height:1px;position:absolute;bottom:0;left:0}.accordion__item:last-child:after{content:none}.accordion__item[data-hide-separator=true]:after{display:none}.accordion__trigger{cursor:var(--cursor-interactive);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 4);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-tap-highlight-color:transparent;transition:opacity .15s var(--ease-out),box-shadow .15s var(--ease-out);flex:1;justify-content:space-between;align-items:center;display:flex}.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:color-mix(in oklab,var(--foreground) 3%,transparent 90%)}}}.accordion__trigger:focus-visible:not(:focus),.accordion__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.accordion__trigger:disabled,.accordion__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.accordion__panel{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__panel[data-expanded=true]{will-change:height,opacity;opacity:1}.accordion--surface{background-color:var(--surface);border-radius:min(32px,var(--radius-3xl))}@media(hover:hover){.accordion--surface .accordion__trigger:hover:not([aria-expanded=true]),.accordion--surface .accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--default)}}.accordion--surface .accordion__item:after{background-color:var(--surface-foreground)}@supports (color:color-mix(in lab,red,red)){.accordion--surface .accordion__item:after{background-color:color-mix(in oklab,var(--surface-foreground) 6%,transparent)}}.accordion--surface .accordion__item:after{width:94%;left:3%}.accordion--surface .accordion__item:first-child [data-slot=accordion-trigger]{border-top-left-radius:min(32px,var(--radius-3xl));border-top-right-radius:min(32px,var(--radius-3xl))}.accordion--surface .accordion__item:last-child:not(:has([data-slot=accordion-trigger][aria-expanded=true])) [data-slot=accordion-trigger]{border-bottom-left-radius:min(32px,var(--radius-3xl));border-bottom-right-radius:min(32px,var(--radius-3xl))}.breadcrumbs{align-items:center;display:flex}.breadcrumbs .breadcrumbs__link{padding-inline:calc(var(--spacing) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);opacity:1;text-decoration-line:none;position:relative}.breadcrumbs .breadcrumbs__link:hover,.breadcrumbs .breadcrumbs__link[data-hovered=true]{text-decoration-line:underline}.breadcrumbs .breadcrumbs__link[data-current=true]{color:var(--link);opacity:1}.breadcrumbs .breadcrumbs__item{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);padding-inline:calc(var(--spacing) * .5);flex-shrink:0;display:flex}.breadcrumbs .breadcrumbs__separator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:var(--muted)}.breadcrumbs .breadcrumbs__separator:where(:dir(rtl),[dir=rtl],[dir=rtl] *){rotate:180deg}.disclosure-group{contain:layout style;width:100%}.disclosure{position:relative}.accordion__heading{display:flex}.disclosure__trigger{cursor:var(--cursor-interactive);-webkit-tap-highlight-color:transparent;display:inline-block}.disclosure__trigger:focus-visible:not(:focus),.disclosure__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.disclosure__trigger:disabled,.disclosure__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.disclosure__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:inherit;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__indicator[data-expanded=true]{rotate:-180deg}.disclosure__content{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__content[data-expanded=true]{will-change:height,opacity;opacity:1}.disclosure__body{padding:calc(var(--spacing) * 2)}.link{border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);width:fit-content;height:fit-content;font-weight:var(--font-weight-medium);color:var(--link);text-decoration-line:none;-webkit-text-decoration-color:var(--separator-tertiary);text-decoration-color:var(--separator-tertiary);text-underline-offset:4px;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .1s var(--ease-out);align-items:center;text-decoration-thickness:1.5px;display:inline-flex;position:relative}.link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link{cursor:var(--cursor-interactive)}@media(hover:hover){.link:hover,.link[data-hovered=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.link:hover,.link[data-hovered=true]{-webkit-text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent);text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent)}}:is(.link:hover,.link[data-hovered=true]) .link__icon{opacity:1}}.link:active,.link[data-pressed=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}:is(.link:active,.link[data-pressed=true]) .link__icon{opacity:1}.link:focus-visible:not(:focus),.link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}:is(.link:focus-visible:not(:focus),.link[data-focus-visible=true]) .link__icon{opacity:1}.link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.link .link__icon{pointer-events:none;color:currentColor;opacity:.6;width:.75em;height:.75em;transition:opacity .15s var(--ease-out);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link .link__icon svg{transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.link .link__icon[data-default-icon=true]{margin-left:var(--spacing);padding-bottom:calc(var(--spacing) * 1.5)}.link.button{gap:0;text-decoration-line:none}.pagination{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);flex-direction:column;width:100%;display:flex}@media(min-width:40rem){.pagination{flex-direction:row}}.pagination__summary{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__summary{align-self:center}}.pagination__content{align-items:center;gap:var(--spacing);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__content{align-self:center}}.pagination__item{display:inline-flex}.pagination__link{isolation:isolate;width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);transform-origin:50%;border-radius:calc(var(--radius) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}@media(min-width:48rem){.pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.pagination__link{--pagination-link-bg:transparent;--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover);--pagination-link-fg:var(--default-foreground);background-color:var(--pagination-link-bg);color:var(--pagination-link-fg)}.pagination__link:focus-visible,.pagination__link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.pagination__link:disabled,.pagination__link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.pagination__link:hover,.pagination__link[data-hovered=true]{background-color:var(--pagination-link-bg-hover)}}.pagination__link:active,.pagination__link[data-pressed=true]{background-color:var(--pagination-link-bg-pressed);transform:scale(.97)}.pagination__link[data-active=true]{--pagination-link-bg:var(--default);--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover)}.pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:inline-flex}@media(min-width:48rem){.pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link--nav{gap:calc(var(--spacing) * 1.5);width:auto;padding-inline:calc(var(--spacing) * 2.5)}.pagination--sm .pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__link{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__link:active,.pagination--sm .pagination__link[data-pressed=true]{transform:scale(.98)}.pagination--sm .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 2)}.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.pagination--lg .pagination__link{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__link{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__link:active,.pagination--lg .pagination__link[data-pressed=true]{transform:scale(.96)}.pagination--lg .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 3)}.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__summary{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.tabs{gap:calc(var(--spacing) * 2);display:flex}.tabs[data-orientation=horizontal]{flex-direction:column}.tabs[data-orientation=vertical]{flex-direction:row}.tabs__list-container{position:relative}.tabs__list{background-color:var(--default);padding:var(--spacing);border-radius:calc(var(--radius) * 2.5);display:inline-flex}.tabs__list[data-orientation=horizontal]{flex-direction:row;width:100%}.tabs__list[data-orientation=vertical]{gap:var(--spacing);flex-direction:column}.tabs__list[data-orientation=vertical] .tabs__tab{min-width:calc(var(--spacing) * 20)}.tabs__tab{z-index:1;cursor:var(--cursor-interactive);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);width:100%;padding-inline:calc(var(--spacing) * 4);text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .15s var(--ease-smooth);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__tab[data-selected=true]{color:var(--segment-foreground)}.tabs__tab[data-selected=true] .tabs__separator,.tabs__tab[data-selected=true]+.tabs__tab .tabs__separator{opacity:0}.tabs__tab:disabled,.tabs__tab[data-disabled=true],.tabs__tab[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.tabs__tab:not([data-selected=true]):not([data-disabled=true]):hover,.tabs__tab[data-hovered=true]:not([data-selected=true]):not([data-disabled=true]){opacity:.7}}.tabs__tab:focus-visible:not(:focus),.tabs__tab[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tabs__separator{border-radius:calc(var(--radius) * .5);background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.tabs__separator{background-color:color-mix(in oklab,var(--muted) 25%,transparent)}}.tabs__separator{pointer-events:none;transition:opacity .15s var(--ease-smooth);position:absolute}.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__list[data-orientation=horizontal] .tabs__separator{width:1px;height:50%;top:25%;left:0}.tabs__list[data-orientation=vertical] .tabs__separator{width:90%;height:1px;top:0;left:5%}.tabs__panel{width:100%;padding:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none}.tabs__panel[data-exiting=true]{width:100%;position:absolute;top:0;left:0}.tabs__panel[data-orientation=horizontal]{margin-top:calc(var(--spacing) * 4)}.tabs__panel[data-orientation=vertical]{margin-left:calc(var(--spacing) * 4)}.tabs__indicator{box-shadow:var(--shadow-surface);z-index:-1;border-radius:var(--radius-3xl);background-color:var(--segment);width:100%;height:100%;transition-property:translate,width,height;transition-duration:.25s;transition-timing-function:var(--ease-out-fluid);position:absolute;top:0;left:0}.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs--secondary>.tabs__list-container>.tabs__list{background-color:#0000;border-radius:0;padding:0}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=horizontal]{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border);max-width:100%;overflow:auto clip}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=vertical]{border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--border)}.tabs--secondary>.tabs__list-container .tabs__tab{border-radius:0}.tabs--secondary>.tabs__list-container .tabs__tab[data-selected=true]{color:var(--foreground)}.tabs--secondary>.tabs__list-container .tabs__separator{display:none}.tabs--secondary>.tabs__list-container .tabs__indicator{background-color:var(--accent);box-shadow:none;border-radius:0}.tabs--secondary[data-orientation=horizontal]>.tabs__list-container .tabs__indicator{height:2px;top:auto;bottom:0}.tabs--secondary[data-orientation=vertical]>.tabs__list-container .tabs__indicator{width:2px;height:100%;top:0;left:0}.button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.button{height:calc(var(--spacing) * 9)}}.button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button{cursor:var(--cursor-interactive);--button-bg:transparent;--button-bg-hover:var(--button-bg);--button-bg-pressed:var(--button-bg-hover);--button-fg:currentColor;background-color:var(--button-bg);color:var(--button-fg)}.button:focus-visible:not(:focus),.button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.button:disabled,.button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.button[data-pending=true]{pointer-events:none}.button:active,.button[data-pressed=true]{background-color:var(--button-bg-pressed);transform:scale(.97)}@media(hover:hover){.button:hover,.button[data-hovered=true]{background-color:var(--button-bg-hover)}}.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.button--sm{height:calc(var(--spacing) * 8)}}.button--sm svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.button--sm:active,.button--sm[data-pressed=true]{transform:scale(.98)}.button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.button--lg{height:calc(var(--spacing) * 10)}}.button--lg:active,.button--lg[data-pressed=true]{transform:scale(.96)}.button--primary{--button-bg:var(--accent);--button-bg-hover:var(--accent-hover);--button-bg-pressed:var(--accent-hover);--button-fg:var(--accent-foreground)}.button--secondary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover);--button-fg:var(--accent-soft-foreground)}.button--tertiary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover)}.button--ghost,.button--outline{--button-bg:transparent;--button-bg-hover:var(--default);--button-bg-pressed:var(--default);--button-fg:var(--default-foreground)}.button--outline{border-style:var(--tw-border-style);border-width:1px;border-color:var(--border);--button-bg-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.button--outline{--button-bg-hover:color-mix(in srgb, var(--default) 60%, transparent)}}.button--danger{--button-bg:var(--danger);--button-bg-hover:var(--danger-hover);--button-bg-pressed:var(--danger-hover);--button-fg:var(--danger-foreground)}.button--danger-soft{--button-bg:var(--danger-soft);--button-bg-hover:var(--danger-soft-hover);--button-bg-pressed:var(--danger-soft-hover);--button-fg:var(--danger-soft-foreground)}.button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.button--icon-only{width:calc(var(--spacing) * 9)}}.button--icon-only.button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.button--icon-only.button--sm{width:calc(var(--spacing) * 8)}}.button--icon-only.button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.button--icon-only.button--lg{width:calc(var(--spacing) * 10)}}.button--full-width{width:100%}.button-group{justify-content:center;align-items:center;gap:0;height:auto;display:inline-flex}.button-group--horizontal{flex-direction:row}.button-group--vertical{flex-direction:column}.button-group .button{border-radius:0}.button-group--horizontal .button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.button-group--vertical .button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group .button:active,.button-group .button[data-pressed=true]{transform:none}.button-group .button:focus-visible:not(:focus),.button-group .button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button-group--horizontal .button-group__separator{width:1px;height:50%;top:25%;left:-1px}.button-group--vertical .button-group__separator{width:50%;height:1px;top:-1px;left:25%}.button-group--horizontal .button--outline:first-child{border-inline-end-style:var(--tw-border-style);border-inline-end-width:0}.button-group--horizontal .button--outline:last-child{border-inline-start-style:var(--tw-border-style);border-inline-start-width:0}.button-group--horizontal .button--outline:not(:first-child):not(:last-child){border-inline-style:var(--tw-border-style);border-inline-width:0}.button-group--vertical .button--outline:first-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.button-group--vertical .button--outline:last-child{border-top-style:var(--tw-border-style);border-top-width:0}.button-group--vertical .button--outline:not(:first-child):not(:last-child){border-block-style:var(--tw-border-style);border-block-width:0}.button-group--full-width{width:100%}.toggle-button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.toggle-button{height:calc(var(--spacing) * 9)}}.toggle-button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button{cursor:var(--cursor-interactive);--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover);--toggle-button-fg:currentColor;--toggle-button-bg-selected:var(--accent-soft);--toggle-button-bg-selected-hover:var(--accent-soft-hover);--toggle-button-bg-selected-pressed:var(--accent-soft-hover);--toggle-button-fg-selected:var(--accent-soft-foreground);background-color:var(--toggle-button-bg);color:var(--toggle-button-fg)}.toggle-button:focus-visible:not(:focus),.toggle-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.toggle-button:disabled,.toggle-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.toggle-button:hover,.toggle-button[data-hovered=true]{background-color:var(--toggle-button-bg-hover)}}.toggle-button:active,.toggle-button[data-pressed=true]{background-color:var(--toggle-button-bg-pressed);transform:scale(.97)}.toggle-button[data-selected=true]{background-color:var(--toggle-button-bg-selected);color:var(--toggle-button-fg-selected)}@media(hover:hover){.toggle-button[data-selected=true]:hover,.toggle-button[data-selected=true][data-hovered=true]{background-color:var(--toggle-button-bg-selected-hover)}}.toggle-button[data-selected=true]:active,.toggle-button[data-selected=true][data-pressed=true]{background-color:var(--toggle-button-bg-selected-pressed)}.toggle-button svg{pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.toggle-button svg{margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.toggle-button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.toggle-button--sm{height:calc(var(--spacing) * 8)}}.toggle-button--sm svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toggle-button--sm:active,.toggle-button--sm[data-pressed=true]{transform:scale(.98)}.toggle-button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.toggle-button--lg{height:calc(var(--spacing) * 10)}}.toggle-button--lg:active,.toggle-button--lg[data-pressed=true]{transform:scale(.96)}.toggle-button--default{--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover)}.toggle-button--ghost{--toggle-button-bg:transparent;--toggle-button-bg-hover:var(--default);--toggle-button-bg-pressed:var(--default);--toggle-button-fg:var(--default-foreground)}.toggle-button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.toggle-button--icon-only{width:calc(var(--spacing) * 9)}}.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 8)}}.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 10)}}.toggle-button-group{justify-content:center;align-items:center;gap:0;width:fit-content;height:auto;display:inline-flex}.toggle-button-group--horizontal{flex-direction:row}.toggle-button-group--vertical{flex-direction:column}.toggle-button-group--full-width{width:100%}.toggle-button-group .toggle-button{border-radius:0}.toggle-button-group--horizontal .toggle-button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group .toggle-button:active,.toggle-button-group .toggle-button[data-pressed=true]{transform:none}.toggle-button-group .toggle-button:focus-visible:not(:focus),.toggle-button-group .toggle-button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.toggle-button-group--full-width .toggle-button{flex:1}.toggle-button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button-group--horizontal .toggle-button-group__separator{width:1px;height:50%;top:25%;left:-1px}.toggle-button-group--vertical .toggle-button-group__separator{width:50%;height:1px;top:-1px;left:25%}.toggle-button-group--detached{gap:var(--spacing)}.toggle-button-group--detached .toggle-button{border-radius:calc(var(--radius) * 3)}.toggle-button-group--detached .toggle-button-group__separator{display:none}.toolbar{align-items:center;gap:calc(var(--spacing) * 2);grid-auto-flow:column;width:fit-content;display:grid}.toolbar .separator--vertical{align-self:center;height:50%}.toolbar .separator--horizontal{justify-content:center;justify-self:center;width:50%}.toolbar--vertical{grid-auto-flow:row;justify-content:flex-start;align-items:flex-start}.toolbar--vertical .button-group{justify-content:flex-start}.toolbar--attached{border-radius:calc(var(--radius) * 3);background-color:var(--surface);padding:var(--spacing);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dropdown{gap:var(--spacing);flex-direction:column;display:flex}.dropdown__trigger{--tw-outline-style:none;transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;display:inline-block}.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.dropdown__trigger{cursor:var(--cursor-interactive)}.dropdown__trigger:focus-visible:not(:focus),.dropdown__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.dropdown__trigger:disabled,.dropdown__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.dropdown__trigger[data-pending=true]{pointer-events:none}.dropdown__trigger:active,.dropdown__trigger[data-pressed=true]{transform:scale(.97)}.dropdown__popover{max-width:48svw;transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));padding:0;overflow-y:auto}@media(min-width:48rem){.dropdown__popover{min-width:calc(var(--spacing) * 55)}}.dropdown__popover{border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay)}.dropdown__popover:focus-visible:not(:focus),.dropdown__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.dropdown__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.dropdown__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.dropdown__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.dropdown__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.dropdown__popover[data-exiting=true],.dropdown__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.dropdown__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.dropdown__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.dropdown__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.dropdown__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.dropdown__popover [data-slot=dropdown-menu]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.dropdown__popover [data-slot=menu-item]{padding-inline:calc(var(--spacing) * 2.5)}.dropdown__menu{gap:calc(var(--spacing) * .5);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.dropdown__menu [data-slot=separator]{width:94%;margin-left:3%}.list-box-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item{cursor:var(--cursor-interactive)}.list-box-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.list-box-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.list-box-item:has(.list-box-item__indicator){padding-inline-end:calc(var(--spacing) * 7)}.list-box-item:focus-visible:not(:focus),.list-box-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.list-box-item:active,.list-box-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.list-box-item:hover,.list-box-item[data-hovered=true]{background-color:var(--default)}}.list-box-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.list-box-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--default-foreground);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-end:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]{transition:stroke-dashoffset .25s linear}:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item--danger .list-box-item__indicator,.list-box-item--danger [data-slot=label]{color:var(--danger)}.list-box-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.list-box{width:100%;padding:var(--spacing);position:relative;overflow:clip}.list-box>*+*{margin-top:var(--spacing)}.list-box [data-slot=separator][data-orientation=horizontal]{width:94%;margin-left:3%}.menu-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item{cursor:var(--cursor-interactive)}.menu-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.menu-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.menu-item [data-slot=submenu-indicator] svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.menu-item:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 7)}.menu-item[data-has-submenu=true]:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 7)}.menu-item:focus-visible:not(:focus),.menu-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.menu-item:active,.menu-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.menu-item:hover,.menu-item[data-hovered=true]{background-color:var(--default)}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]{transition:stroke-dashoffset .1s linear}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--dot]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.menu-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.menu-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-start:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item[data-has-submenu=true] .menu-item__indicator{inset-inline-start:auto;inset-inline-end:calc(var(--spacing) * 2)}.menu-item__indicator [data-slot=menu-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:0}.menu-item__indicator--submenu{color:var(--muted)}.menu-item__indicator--submenu svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.menu-item--danger .menu-item__indicator,.menu-item--danger [data-slot=label]{color:var(--danger)}.menu-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.menu{gap:var(--spacing);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.menu [data-slot=separator]{width:94%;margin-left:3%}.tag-group{gap:var(--spacing);flex-direction:column;display:flex;position:relative}.tag-group__list{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex;position:relative}.tag-group [slot=description],.tag-group [data-slot=description],.tag-group [slot=errorMessage],.tag-group [data-slot=error-message]{padding:var(--spacing)}.tag{--optical-offset:.031em;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:inline-flex;position:relative}.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tag{cursor:var(--cursor-interactive)}.tag svg{pointer-events:none;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:currentColor;flex-shrink:0;align-self:center}.tag:is([data-disabled=true],[aria-disabled=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tag:is(:focus-visible,[data-focus-visible]){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tag:is([data-selected=true],[aria-selected=true]){background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.tag:is([data-selected=true],[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-soft-hover)}}.tag--sm{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--md{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--lg{border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.tag--default{background-color:var(--default);color:var(--default-foreground)}@media(hover:hover){.tag--default:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--default-hover)}}.tag--surface{background-color:var(--surface);color:var(--surface-foreground)}@media(hover:hover){.tag--surface:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--surface-hover)}}.tag__remove-button{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:inherit}.tag__remove-button svg{width:inherit;height:inherit;color:currentColor;flex-shrink:0;align-self:center}.color-area{width:100%;max-width:calc(var(--spacing) * 56);border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;aspect-ratio:1;background:var(--color-area-background);flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-area[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-area--show-dots:after{content:"";pointer-events:none;border-radius:inherit;background-image:radial-gradient(circle,#fff3 1px,#0000 1px);background-size:8px 8px;position:absolute;top:0;right:0;bottom:0;left:0}.color-area__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);will-change:width,height;background-color:var(--color-area-thumb-color);transition:width .15s var(--ease-out),height .15s var(--ease-out);border:3px solid #fff;box-shadow:0 0 0 1px #0000001a,inset 0 0 0 1px #0000001a}.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-area__thumb[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-area__thumb[data-dragging=true]{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.color-area__thumb[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker{display:inline-flex}.color-picker__trigger{align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-flex}.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-picker__trigger [data-slot=label]{cursor:var(--cursor-interactive)}.color-picker__trigger:focus-visible:not(:focus),.color-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-picker__trigger:disabled,.color-picker__trigger[data-disabled=true],.color-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker__popover{min-width:calc(var(--spacing) * 62);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 3);box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5));gap:calc(var(--spacing) * 3);flex-direction:column;display:flex;overflow:hidden auto}.color-picker__popover:focus-visible:not(:focus),.color-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.color-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.color-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.color-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.color-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.color-picker__popover[data-exiting=true],.color-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.color-slider{gap:var(--spacing);grid-template:"label output""track track"/1fr auto;width:100%;display:grid}.color-slider:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template:"track"/1fr;gap:0}.color-slider:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-columns:1fr;grid-template-areas:"label""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output){grid-template-columns:1fr;grid-template-areas:"output""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output) .color-slider__output{justify-self:end}.color-slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.color-slider .color-slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.color-slider .color-slider__track{border-radius:calc(var(--radius) * 2);grid-area:track;position:relative}.color-slider .color-slider__track:before,.color-slider .color-slider__track:after{content:"";z-index:0;pointer-events:none;position:absolute}.color-slider .color-slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;border-style:var(--tw-border-style);border-width:3px;border-color:var(--color-white);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);z-index:1;transition:transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-slider .color-slider__thumb[data-dragging=true]{cursor:grabbing}.color-slider .color-slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-slider .color-slider__thumb[data-disabled=true]{cursor:default;background-color:var(--default)}.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]) [data-slot=label]{opacity:1}.color-slider[data-orientation=horizontal]{flex-direction:column}.color-slider[data-orientation=horizontal] .color-slider__track{height:calc(var(--spacing) * 5);border-radius:0;justify-self:center;width:calc(100% - 1.25rem);box-shadow:inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:before,.color-slider[data-orientation=horizontal] .color-slider__track:after{width:.625rem;height:100%;top:0}.color-slider[data-orientation=horizontal] .color-slider__track:before{border-top-left-radius:calc(var(--radius) * 2);border-bottom-left-radius:calc(var(--radius) * 2);background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;left:-.625rem;box-shadow:inset 1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:after{border-top-right-radius:calc(var(--radius) * 2);border-bottom-right-radius:calc(var(--radius) * 2);background-color:var(--track-end-color,transparent);right:-.625rem;box-shadow:inset -1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);top:50%}.color-slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;place-items:center;height:100%}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template-rows:1fr;grid-template-areas:"track";gap:0}.color-slider[data-orientation=vertical]:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-rows:1fr auto;grid-template-areas:"track""label"}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):has(.color-slider__output){grid-template-rows:auto 1fr;grid-template-areas:"output""track"}.color-slider[data-orientation=vertical] .color-slider__output,.color-slider[data-orientation=vertical] [data-slot=label]{text-align:center}.color-slider[data-orientation=vertical] .color-slider__track{width:calc(var(--spacing) * 5);border-radius:0;justify-self:center;height:calc(100% - 1.25rem);box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:before,.color-slider[data-orientation=vertical] .color-slider__track:after{width:100%;height:.625rem;left:0}.color-slider[data-orientation=vertical] .color-slider__track:before{background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;border-bottom-right-radius:999px;border-bottom-left-radius:999px;bottom:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:after{background-color:var(--track-end-color,transparent);border-top-left-radius:999px;border-top-right-radius:999px;top:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);left:50%}.color-swatch{box-sizing:border-box;width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);background:linear-gradient(var(--color-swatch-current),var(--color-swatch-current)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-swatch--circle{border-radius:calc(var(--radius) * 2)}.color-swatch--square{border-radius:calc(var(--radius) * .75)}.color-swatch--xs{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.color-swatch--xs.color-swatch--circle{border-radius:calc(var(--radius) * 1)}.color-swatch--sm{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.color-swatch--sm.color-swatch--circle{border-radius:calc(var(--radius) * 1.5)}.color-swatch--lg{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.color-swatch--lg.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.color-swatch--xl.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch-picker{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.color-swatch-picker__item{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);border-style:var(--tw-border-style);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:border-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);border-width:2px;border-color:#0000;outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__item:focus-visible,.color-swatch-picker__item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-swatch-picker__item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-swatch-picker__item[data-selected=true]{border-color:var(--color-swatch-current);box-shadow:var(--field-shadow)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{transform:scale(.77)}.color-swatch-picker__swatch{border-radius:inherit;width:100%;height:100%;transition:transform .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:block}.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-swatch-picker__swatch:hover{transform:scale(1.1)}}.color-swatch-picker__indicator{pointer-events:none;z-index:10;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.color-swatch-picker__indicator>*{width:33.3333%;height:33.3333%;color:var(--color-white);transition:transform .15s var(--ease-out);transform:scale(0)translateZ(0)}.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__indicator[data-light-color=true] .color-swatch-picker__indicator>*{color:var(--color-black)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__indicator>*{transform:scale(1)translateZ(0)}.color-swatch-picker--stack{flex-direction:column}.color-swatch-picker--xs .color-swatch-picker__item{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px}.color-swatch-picker--sm .color-swatch-picker__item{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);border-style:var(--tw-border-style);border-width:2px}.color-swatch-picker--lg .color-swatch-picker__item{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--xl .color-swatch-picker__item{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--square .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-input-group:hover:not(:focus-within),.color-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.color-input-group[data-focus-within=true],.color-input-group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.color-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group[data-invalid=true]:focus,.color-input-group[data-invalid=true]:focus-visible,.color-input-group[data-invalid=true][data-focused=true],.color-input-group[data-invalid=true][data-focus-visible=true],.color-input-group[data-invalid=true]:focus-within,.color-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.color-input-group[data-disabled=true],.color-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-input-group__input{cursor:text;border-style:var(--tw-border-style);height:100%;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;display:flex}@media(min-width:40rem){.color-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.color-input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}.color-input-group:has([data-slot=color-input-group-prefix]) .color-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.color-input-group:has([data-slot=color-input-group-suffix]) .color-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.color-input-group__input:focus,.color-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.color-input-group__prefix{color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group__suffix{color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--color-input-group-bg);--color-input-group-bg:var(--default);--color-input-group-bg-hover:var(--default-hover);--color-input-group-bg-focus:var(--default)}@media(hover:hover){.color-input-group--secondary:hover:not(:focus-within),.color-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--color-input-group-bg-hover)}}.color-input-group--secondary:focus-within,.color-input-group--secondary[data-focus-within=true]{background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group--secondary[data-invalid=true]:focus,.color-input-group--secondary[data-invalid=true]:focus-visible,.color-input-group--secondary[data-invalid=true][data-focused=true],.color-input-group--secondary[data-invalid=true][data-focus-visible=true],.color-input-group--secondary[data-invalid=true]:focus-within,.color-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary [data-slot=color-input-group-input]{background-color:#0000}.color-input-group--full-width{width:100%}.color-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.color-field[data-invalid=true],.color-field[aria-invalid=true]) [data-slot=description]{display:none}.color-field [data-slot=label]{width:fit-content}.color-field--full-width{width:100%}.slider{gap:var(--spacing);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.slider .slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.slider .slider__track{border-radius:calc(var(--radius) * 1.5);background-color:var(--default);grid-area:track;position:relative}.slider .slider__fill{pointer-events:none;background-color:var(--accent);position:absolute}.slider .slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 1.5);background-color:var(--accent);-webkit-tap-highlight-color:transparent;transition:background-color .25s var(--ease-smooth),transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.slider .slider__thumb:after{z-index:10;border-radius:calc(var(--radius) * 1);background-color:var(--accent-foreground);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);content:"";transform-origin:50%;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));position:relative}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:after:not(:is()){transition-property:none}}.slider .slider__thumb[data-dragging=true]{cursor:grabbing}.slider .slider__thumb[data-dragging=true]:after{scale:.9}@media(prefers-reduced-motion:reduce){.slider .slider__thumb[data-dragging=true]:after:not(:is()){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.slider .slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.slider .slider__thumb[data-disabled=true]{cursor:default}.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]) [data-slot=label]{opacity:1}.slider[data-orientation=horizontal]{flex-direction:column}.slider[data-orientation=horizontal] .slider__track{height:calc(var(--spacing) * 5);border-inline-style:var(--tw-border-style);border-inline-width:.75rem;border-inline-color:#0000;width:100%}.slider[data-orientation=horizontal] .slider__track[data-fill-start=true]{border-inline-start-color:var(--accent)}.slider[data-orientation=horizontal] .slider__track[data-fill-end=true]{border-inline-end-color:var(--accent)}.slider[data-orientation=horizontal] .slider__fill,.slider[data-orientation=horizontal] .slider__thumb{height:100%}.slider[data-orientation=horizontal] .slider__thumb{width:1.75rem;top:50%}.slider[data-orientation=horizontal] .slider__thumb:after{width:1.5rem;height:1rem}.slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;height:100%}.slider[data-orientation=vertical] .slider__output,.slider[data-orientation=vertical] [data-slot=label]{text-align:center}.slider[data-orientation=vertical] .slider__track{height:100%;width:calc(var(--spacing) * 5);border-block-style:var(--tw-border-style);border-block-width:.75rem;border-block-color:#0000;justify-self:center}.slider[data-orientation=vertical] .slider__track[data-fill-start=true]{border-bottom-color:var(--accent)}.slider[data-orientation=vertical] .slider__track[data-fill-end=true]{border-top-color:var(--accent)}.slider[data-orientation=vertical] .slider__fill,.slider[data-orientation=vertical] .slider__thumb{width:100%}.slider[data-orientation=vertical] .slider__thumb{height:1.75rem;left:50%}.slider[data-orientation=vertical] .slider__thumb:after{width:1rem;height:1.5rem}.switch{align-items:flex-start;gap:var(--spacing);-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);--switch-control-bg:var(--default);--switch-control-bg-hover:var(--switch-control-bg);flex-direction:column;display:flex}@supports (color:color-mix(in lab,red,red)){.switch{--switch-control-bg-hover:color-mix(in oklab, var(--switch-control-bg), transparent 20%)}}.switch{--switch-control-bg-pressed:var(--switch-control-bg-hover);--switch-control-bg-checked:var(--accent);--switch-control-bg-checked-hover:var(--accent-hover)}.switch[data-disabled=true],.switch[data-disabled=true] [data-slot=description],.switch[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.switch[data-disabled=true] .switch__thumb{background-color:var(--default-foreground)}@supports (color:color-mix(in lab,red,red)){.switch[data-disabled=true] .switch__thumb{background-color:color-mix(in oklab,var(--default-foreground) 20%,transparent)}}.switch>[data-slot=description]{width:100%;min-width:0;padding-inline-start:3.25rem}.switch>[data-slot=field-error]{width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--muted);padding-inline-start:3.25rem}.switch.switch--sm>[data-slot=description],.switch.switch--sm>[data-slot=field-error]{padding-inline-start:2.75rem}.switch.switch--lg>[data-slot=description],.switch.switch--lg>[data-slot=field-error]{padding-inline-start:3.75rem}:is(.switch:disabled[aria-checked=true],.switch:disabled[data-selected=true],.switch[data-disabled=true][aria-checked=true],.switch[data-disabled=true][data-selected=true],.switch[aria-disabled=true][aria-checked=true],.switch[aria-disabled=true][data-selected=true]) .switch__thumb{opacity:.4}.switch__control{border-radius:calc(var(--radius) * 1.5);background-color:var(--switch-control-bg);width:2.5rem;height:1.25rem;transition:background-color .25s var(--ease-smooth),box-shadow .15s var(--ease-out);flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch:focus-visible .switch__control,.switch:has([data-slot=switch-content][data-focus-visible=true]) .switch__control,.switch [data-slot=switch-content][data-focus-visible=true] .switch__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.switch:hover .switch__control,.switch:has([data-slot=switch-content][data-hovered=true]) .switch__control,.switch [data-slot=switch-content][data-hovered=true] .switch__control{background-color:var(--switch-control-bg-hover)}.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control{background-color:var(--switch-control-bg-pressed)}:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transform:none}@media(prefers-reduced-motion:reduce){:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transform:none}}.switch[aria-checked=true] .switch__control,.switch[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked)}.switch[aria-checked=true]:hover .switch__control,.switch[data-selected=true]:hover .switch__control,.switch[aria-checked=true][data-hovered=true] .switch__control,.switch[data-selected=true][data-hovered=true] .switch__control,.switch:has([data-slot=switch-content][data-hovered=true])[data-selected=true] .switch__control,.switch[aria-checked=true]:active .switch__control,.switch[data-selected=true]:active .switch__control,.switch[aria-checked=true][data-pressed=true] .switch__control,.switch[data-selected=true][data-pressed=true] .switch__control,.switch:has([data-slot=switch-content][data-pressed=true])[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked-hover)}.switch__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.switch--sm .switch__control{border-radius:calc(var(--radius) * 1);width:2rem;height:1rem}.switch--lg .switch__control{width:3rem;height:1.5rem}.switch__thumb{transform-origin:50%;border-radius:calc(var(--radius) * 1);background-color:var(--color-white);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);width:1.375rem;height:1rem;transition:margin .3s var(--ease-out-fluid),background-color .2s var(--ease-out);margin-inline-start:calc(var(--spacing) * .5);display:flex}.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch[aria-checked=true] .switch__thumb,.switch[data-selected=true] .switch__thumb{background-color:var(--accent-foreground);color:var(--accent);margin-inline-start:calc(100% - 1.5rem);box-shadow:0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d}.switch--sm .switch__thumb{border-radius:calc(var(--radius) * .75);width:1.03125rem;height:.75rem}.switch[aria-checked=true] :is(.switch--sm .switch__thumb),.switch[data-selected=true] :is(.switch--sm .switch__thumb){margin-inline-start:calc(100% - 1.15625rem)}.switch--lg .switch__thumb{border-radius:calc(var(--radius) * 1.5);width:1.71875rem;height:1.25rem}.switch[aria-checked=true] :is(.switch--lg .switch__thumb),.switch[data-selected=true] :is(.switch--lg .switch__thumb){margin-inline-start:calc(100% - 1.84375rem)}.switch__thumb>*{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.switch__label{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.switch [data-slot=label]{-webkit-user-select:none;user-select:none}.switch__content [data-slot=label]{cursor:var(--cursor-interactive)}.switch [data-slot=description]{cursor:default;-webkit-user-select:none;user-select:none}.switch-group{gap:calc(var(--spacing) * 6);flex-direction:column;display:flex}.switch-group__items{gap:calc(var(--spacing) * 4);display:flex}.switch-group--horizontal .switch-group__items{flex-direction:row}.switch-group--vertical .switch-group__items{flex-direction:column}.badge{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);min-height:calc(var(--spacing) * 7);min-width:calc(var(--spacing) * 7);border-radius:calc(var(--radius) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:1.34;--badge-bg:var(--default);--badge-fg:var(--default-foreground);--badge-border:var(--background);background-color:var(--badge-bg);color:var(--badge-fg);border:1px solid var(--badge-border);flex-shrink:0;line-height:1.34;display:inline-flex}.badge__label{padding-inline:calc(var(--spacing) * .5)}.badge-anchor{flex-shrink:0;display:inline-flex;position:relative}.badge--lg{min-height:calc(var(--spacing) * 8);min-width:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;line-height:1.43}.badge--sm{min-height:calc(var(--spacing) * 4);min-width:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);--tw-leading:1.34;font-size:10px;line-height:1.34}.badge--accent{--badge-fg:var(--accent-soft-foreground)}.badge--default{--badge-fg:var(--default-foreground)}.badge--success{--badge-fg:var(--success-soft-foreground)}.badge--warning{--badge-fg:var(--warning-soft-foreground)}.badge--danger{--badge-fg:var(--danger-soft-foreground)}.badge--top-right{position:absolute;top:0;right:0;transform:translate(25%,-25%)}.badge--top-left{position:absolute;top:0;left:0;transform:translate(-25%,-25%)}.badge--bottom-right{position:absolute;bottom:0;right:0;transform:translate(25%,25%)}.badge--bottom-left{position:absolute;bottom:0;left:0;transform:translate(-25%,25%)}.badge--primary.badge--accent{--badge-bg:var(--accent);--badge-fg:var(--accent-foreground)}.badge--primary.badge--default{--badge-bg:var(--default);--badge-fg:var(--default-foreground)}.badge--primary.badge--success{--badge-bg:var(--success);--badge-fg:var(--success-foreground)}.badge--primary.badge--warning{--badge-bg:var(--warning);--badge-fg:var(--warning-foreground)}.badge--primary.badge--danger{--badge-bg:var(--danger);--badge-fg:var(--danger-foreground)}.badge--soft.badge--accent{--badge-bg:var(--accent-soft);--badge-fg:var(--accent-soft-foreground)}.badge--soft.badge--default{--badge-bg:var(--default-soft);--badge-fg:var(--default-soft-foreground)}.badge--soft.badge--success{--badge-bg:var(--success-soft);--badge-fg:var(--success-soft-foreground)}.badge--soft.badge--warning{--badge-bg:var(--warning-soft);--badge-fg:var(--warning-soft-foreground)}.badge--soft.badge--danger{--badge-bg:var(--danger-soft);--badge-fg:var(--danger-soft-foreground)}.chip{align-items:center;gap:calc(var(--spacing) * .5);border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--chip-bg:var(--default);--chip-fg:currentColor;background-color:var(--chip-bg);color:var(--chip-fg);flex-shrink:0;display:inline-flex}.chip__label{padding-inline:calc(var(--spacing) * .5)}.chip--accent{--chip-fg:var(--accent-soft-foreground)}.chip--danger{--chip-fg:var(--danger-soft-foreground)}.chip--default{--chip-fg:var(--default-foreground)}.chip--success{--chip-fg:var(--success-soft-foreground)}.chip--warning{--chip-fg:var(--warning-soft-foreground)}.chip--tertiary{--chip-bg:transparent}.chip--sm{padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));padding-block:0}.chip--md{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.chip--lg{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.chip--primary.chip--accent{--chip-bg:var(--accent);--chip-fg:var(--accent-foreground)}.chip--primary.chip--success{--chip-bg:var(--success);--chip-fg:var(--success-foreground)}.chip--primary.chip--warning{--chip-bg:var(--warning);--chip-fg:var(--warning-foreground)}.chip--primary.chip--danger{--chip-bg:var(--danger);--chip-fg:var(--danger-foreground)}.chip--accent.chip--soft{--chip-bg:var(--accent-soft);--chip-fg:var(--accent-soft-foreground)}.chip--success.chip--soft{--chip-bg:var(--success-soft);--chip-fg:var(--success-soft-foreground)}.chip--warning.chip--soft{--chip-bg:var(--warning-soft);--chip-fg:var(--warning-soft-foreground)}.chip--danger.chip--soft{--chip-bg:var(--danger-soft);--chip-fg:var(--danger-soft-foreground)}.chip--default.chip--soft{--chip-bg:var(--default-soft);--chip-fg:var(--default-soft-foreground)}.table-root{grid-template-columns:minmax(0,1fr);width:100%;display:grid;position:relative;overflow:clip}.table__scroll-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;overflow-x:auto}.table-root--primary{background-color:var(--surface-secondary);padding-inline:var(--spacing);padding-bottom:var(--spacing);border-radius:min(32px,calc(var(--radius) * 2.5))}.table-root--secondary .table__header{border-bottom-style:var(--tw-border-style);background-color:#0000;border-bottom-width:0}.table-root--secondary .table__column{background-color:var(--surface-secondary)}.table-root--secondary :is(th.table__column:first-child,[role=row]>[role=presentation]:first-of-type>.table__column){border-start-start-radius:min(32px,var(--radius-2xl));border-end-start-radius:min(32px,var(--radius-2xl))}.table-root--secondary :is(th.table__column:last-child,[role=row]>[role=presentation]:last-of-type>.table__column){border-start-end-radius:min(32px,var(--radius-2xl));border-end-end-radius:min(32px,var(--radius-2xl))}.table-root--secondary .table__body{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table-root--secondary .table__body tr:first-child td:first-child,.table-root--secondary .table__body tr:first-child td:last-child,.table-root--secondary .table__body tr:last-child td:first-child,.table-root--secondary .table__body tr:last-child td:last-child{border-radius:0}.table-root--secondary .table__body:not(tbody){border-radius:0;overflow:visible}.table-root--secondary .table__row .table__cell{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row .table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table-root--secondary .table__row .table__cell{background-color:#0000}@media(hover:hover){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--default) 50%,transparent)}}}.table__content{border-collapse:separate;--tw-border-spacing-x:0;--tw-border-spacing-y:0;width:100%;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.table-root--primary .table__content{overflow:clip}.table__header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator)}@supports (color:color-mix(in lab,red,red)){.table__header{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__header{background-color:var(--surface-secondary)}.table__column{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);position:relative}.table__column:after{content:"";pointer-events:none;height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .5);background-color:var(--separator);inset-inline-end:calc(var(--spacing) * 0);position:absolute;top:50%}.table__column:last-child:not(:only-child):after{content:none}.table__column[data-allows-sorting=true]{cursor:var(--cursor-interactive)}@media(hover:hover){.table__column[data-allows-sorting=true]:hover,.table__column[data-allows-sorting=true][data-hovered=true]{color:var(--foreground)}}.table__column:focus-visible,.table__column[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}[role=row]>[role=presentation]:last-of-type:not(:only-of-type)>.table__column:after{content:none}.table__sortable-column-header{justify-content:space-between;align-items:center;display:flex}.table__sortable-column-indicator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out)}.table__sortable-column-indicator[data-direction=descending]{rotate:180deg}.table__body tr:first-child td:first-child{border-start-start-radius:min(32px,var(--radius-2xl))}.table__body tr:first-child td:last-child{border-start-end-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:first-child{border-end-start-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:last-child{border-end-end-radius:min(32px,var(--radius-2xl))}.table__body:not(tbody){border-radius:min(32px,var(--radius-2xl));height:100%;position:relative;overflow:clip}.table__row{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator);height:100%;position:relative}@supports (color:color-mix(in lab,red,red)){.table__row{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__row:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 40%,transparent)}}}.table__row[data-selected=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row[data-selected=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 10%,transparent)}}.table__row[aria-disabled=true],.table__row[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.table__row:focus-visible,.table__row[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.table__row[data-dragging=true]{opacity:.5}.table__row[data-drop-target=true] .table__cell{background-color:var(--accent-soft)}.table__cell{background-color:var(--surface);height:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);vertical-align:middle;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table__cell:focus-visible,.table__cell[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true]) :is(.table__cell,.table__column){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):only-child,.table__row:is(:focus-visible,[data-focus-visible=true])>:only-child :is(.table__cell,.table__column){border-radius:calc(var(--radius) * 1);--tw-shadow:inset 0 0 0 2px var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):first-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:first-child:not(:only-child) :is(.table__cell,.table__column){border-top-left-radius:calc(var(--radius) * 1);border-bottom-left-radius:calc(var(--radius) * 1);--tw-shadow:inset 2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):last-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:last-child:not(:only-child) :is(.table__cell,.table__column){border-top-right-radius:calc(var(--radius) * 1);border-bottom-right-radius:calc(var(--radius) * 1);--tw-shadow:inset -2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):not(:first-child):not(:last-child):not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:not(:first-child):not(:last-child):not(:only-child) :is(.table__cell,.table__column){--tw-shadow:inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__cell[data-tree-column]{padding-inline-start:calc(1rem * var(--table-row-level,1))}.table__footer{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);align-items:center;display:flex}.table__resizable-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;position:relative;overflow:auto}.table__column-resizer{height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;border-radius:calc(var(--radius) * .5);background-color:var(--separator);box-sizing:content-box;--tw-translate-x: 50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:col-resize;touch-action:none;padding-inline:calc(var(--spacing) * 2);--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-clip:content-box;border-style:none;outline-style:none;position:absolute;top:50%}.table__column-resizer[data-hovered=true],.table__column-resizer:hover,.table__column-resizer[data-resizing=true]{height:100%;width:calc(var(--spacing) * .5);background-color:var(--accent)}.table__column-resizer[data-focus-visible=true],.table__column-resizer:focus-visible{height:100%;width:calc(var(--spacing) * .5);background-color:var(--focus)}.table__column:has(.table__column-resizer):after{content:none}.table__load-more td,.table__load-more [role=rowheader]{padding-block:calc(var(--spacing) * 3);text-align:center}:is(.table__load-more td,.table__load-more [role=rowheader])>*{margin-inline:auto}.table__load-more-content{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 2);display:flex}.alert{justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 4);background-color:var(--surface);width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex}.alert__content{flex-direction:column;flex-grow:1;align-items:flex-start;height:100%;display:flex}.alert__indicator{padding:var(--spacing);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:flex}.alert__indicator [data-slot=alert-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.alert__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.alert__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.alert--default .alert__indicator,.alert--default .alert__title{color:var(--foreground)}.alert--accent .alert__indicator,.alert--accent .alert__title{color:var(--accent-soft-foreground)}.alert--success .alert__indicator,.alert--success .alert__title{color:var(--success-soft-foreground)}.alert--warning .alert__indicator,.alert--warning .alert__title{color:var(--warning-soft-foreground)}.alert--danger .alert__indicator,.alert--danger .alert__title{color:var(--danger-soft-foreground)}.empty-state{padding:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.skeleton{pointer-events:none;border-radius:calc(var(--radius) * .5);background-color:var(--surface-tertiary);position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.skeleton{background-color:color-mix(in oklab,var(--surface-tertiary) 70%,transparent)}}.skeleton--shimmer:after{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-gradient-position:to right;animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}@supports (background-image:linear-gradient(in lab,red,red)){.skeleton--shimmer:after{--tw-gradient-position:to right in oklab}}.skeleton--shimmer:after{background-image:linear-gradient(var(--tw-gradient-stops));--tw-gradient-from:transparent;--tw-gradient-via:var(--surface-tertiary);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));--tw-gradient-to:transparent;--tw-content:"";content:var(--tw-content)}.skeleton--shimmer:has(.skeleton):after{content:none}.skeleton--shimmer:has(.skeleton):before{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-content:"";content:var(--tw-content);z-index:10;pointer-events:none;mix-blend-mode:overlay;background:linear-gradient(90deg,#0000,#ffffff80,#0000);animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}.skeleton--shimmer:has(.skeleton) .skeleton:after{content:none}.skeleton--pulse{animation:var(--animate-pulse)}.meter{gap:var(--spacing);--meter-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.meter [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.meter .meter__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.meter .meter__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.meter .meter__fill{border-radius:calc(var(--radius) * .5);background-color:var(--meter-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]) [data-slot=label]{opacity:1}.meter--sm .meter__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.meter--sm .meter__fill{border-radius:calc(var(--radius) * .25)}.meter--lg .meter__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.meter--lg .meter__fill{border-radius:calc(var(--radius) * .75)}.meter--default{--meter-fill:var(--default-foreground)}.meter--accent{--meter-fill:var(--accent)}.meter--success{--meter-fill:var(--success)}.meter--warning{--meter-fill:var(--warning)}.meter--danger{--meter-fill:var(--danger)}.progress-bar{gap:var(--spacing);--progress-bar-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.progress-bar [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.progress-bar .progress-bar__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.progress-bar .progress-bar__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.progress-bar .progress-bar__fill{border-radius:calc(var(--radius) * .5);background-color:var(--progress-bar-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-bar:not([aria-valuenow]) .progress-bar__fill{width:40%;animation:1.5s cubic-bezier(.65,0,.35,1) infinite progress-bar-indeterminate}.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]) [data-slot=label]{opacity:1}@keyframes progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(350%)}}.progress-bar--sm .progress-bar__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.progress-bar--sm .progress-bar__fill{border-radius:calc(var(--radius) * .25)}.progress-bar--lg .progress-bar__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.progress-bar--lg .progress-bar__fill{border-radius:calc(var(--radius) * .75)}.progress-bar--default{--progress-bar-fill:var(--default-foreground)}.progress-bar--accent{--progress-bar-fill:var(--accent)}.progress-bar--success{--progress-bar-fill:var(--success)}.progress-bar--warning{--progress-bar-fill:var(--warning)}.progress-bar--danger{--progress-bar-fill:var(--danger)}.progress-circle{--progress-circle-stroke:var(--accent);--progress-circle-track-stroke:var(--default);justify-content:center;align-items:center;display:inline-flex}.progress-circle .progress-circle__track{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.progress-circle .progress-circle__track-circle{stroke:var(--progress-circle-track-stroke)}.progress-circle .progress-circle__fill-circle{stroke:var(--progress-circle-stroke);transition:stroke-dashoffset .3s var(--ease-out)}.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-circle:not([aria-valuenow]) .progress-circle__track{animation:1s linear infinite progress-circle-spin}.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-circle:disabled,.progress-circle[data-disabled=true],.progress-circle[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@keyframes progress-circle-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.progress-circle--sm .progress-circle__track{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.progress-circle--lg .progress-circle__track{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.progress-circle--default{--progress-circle-stroke:var(--default-foreground)}.progress-circle--accent{--progress-circle-stroke:var(--accent)}.progress-circle--success{--progress-circle-stroke:var(--success)}.progress-circle--warning{--progress-circle-stroke:var(--warning)}.progress-circle--danger{--progress-circle-stroke:var(--danger)}.spinner{pointer-events:none;width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);flex-shrink:0;animation:.75s linear infinite spin;display:inline-flex}.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *),.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.spinner--sm{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.spinner--lg{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.spinner--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.spinner--current{color:inherit}.spinner--accent{color:var(--accent)}.spinner--danger{color:var(--danger)}.spinner--success{color:var(--success)}.spinner--warning{color:var(--warning)}.toast-region{pointer-events:none;z-index:50;--tw-outline-style:none;outline-style:none;width:calc(100vw - 2rem);position:fixed}@media(min-width:40rem){.toast-region{width:auto;min-width:var(--toast-width)}}.toast-region{display:block}.toast-region--bottom{bottom:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--bottom-start{bottom:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--bottom-end{right:calc(var(--spacing) * 4);bottom:calc(var(--spacing) * 4)}.toast-region--top{top:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--top-start{top:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--top-end{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4)}.toast-region:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast{pointer-events:auto;justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 1.5);background-color:var(--surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex;position:absolute;left:0;right:0}.toast--bottom,.toast--bottom-start,.toast--bottom-end{bottom:0}.toast--top,.toast--top-start,.toast--top-end{top:0}.toast:not([data-frontmost=true]){pointer-events:none;height:var(--front-height);overflow:hidden}.toast:not([data-frontmost=true]) .toast__close-button{pointer-events:none;opacity:0;outline:none}.toast[data-hidden=true]{pointer-events:none;opacity:0;display:flex}.toast:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast--bottom,.toast--bottom-start,.toast--bottom-end{view-transition-class:toast-bottom}.toast--top,.toast--top-start,.toast--top-end{view-transition-class:toast-top}.toast__content{flex-direction:column;flex-grow:1;align-self:center;align-items:flex-start;height:100%;display:flex}.toast__indicator{padding:var(--spacing);color:var(--overlay-foreground);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.toast__indicator [data-slot=toast-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__indicator [data-slot=spinner],.toast__indicator [data-slot=spinner-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--overlay-foreground)}.toast__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.toast__close-button{pointer-events:none;top:calc(var(--spacing) * -1);right:calc(var(--spacing) * -1);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);border-color:var(--border);background-color:var(--default);opacity:0;position:absolute}@media(min-width:40rem){.toast__close-button{border-style:var(--tw-border-style);background-color:var(--overlay);border-width:1px}}.toast__close-button{transition:opacity .15s var(--ease-smooth)}.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(min-width:40rem){.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}}@media(hover:hover){.toast__close-button:hover,.toast__close-button[data-hovered=true]{background-color:var(--default)}}.toast[data-frontmost=true]:hover .toast__close-button{pointer-events:auto;opacity:1}.toast__action{margin-top:calc(var(--spacing) * 2)}@media(min-width:40rem){.toast__action{margin-top:0}}.toast--accent .toast__title{color:var(--accent-soft-foreground)}.toast--success .toast__title,.toast--success .toast__indicator{color:var(--success-soft-foreground)}.toast--warning .toast__title,.toast--warning .toast__indicator{color:var(--warning-soft-foreground)}.toast--danger .toast__title,.toast--danger .toast__indicator{color:var(--danger-soft-foreground)}::view-transition-old(*){will-change:translate,opacity}::view-transition-new(*){will-change:translate,opacity}::view-transition-new(.toast-bottom):only-child{animation:.35s toast-slide-bottom-in}::view-transition-old(.toast-bottom):only-child{animation:.35s forwards toast-slide-bottom-out}::view-transition-new(.toast-top):only-child{animation:.35s toast-slide-top-in}::view-transition-old(.toast-top):only-child{animation:.35s forwards toast-slide-top-out}@keyframes toast-slide-bottom-in{0%{opacity:0;translate:0 100%}}@keyframes toast-slide-bottom-out{to{opacity:0;translate:0 100%}}@keyframes toast-slide-top-in{0%{opacity:0;translate:0 -100%}}@keyframes toast-slide-top-out{to{opacity:0;translate:0 -100%}}.checkbox-group{flex-direction:column;display:flex}.checkbox-group [data-slot=checkbox]{margin-top:calc(var(--spacing) * 4)}.checkbox{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.checkbox>[data-slot=description],.checkbox>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.checkbox [data-slot=label]{-webkit-user-select:none;user-select:none}.checkbox .checkbox__content [data-slot=label]{cursor:var(--cursor-interactive)}.checkbox[data-disabled=true],.checkbox[data-disabled=true] [data-slot=description],.checkbox[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.checkbox[data-selected=true],.checkbox[data-indeterminate=true]) .checkbox__indicator{border-color:var(--accent-foreground)}.checkbox [data-slot=checkbox-default-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);stroke-width:2.5px;color:var(--accent-foreground);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.2s;transition-duration:.2s}.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox[data-selected=true] [data-slot=checkbox-default-indicator--checkmark]{transition:stroke-dashoffset .15s linear 15ms}.checkbox[data-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[data-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark]{color:var(--danger-foreground)}.checkbox[data-indeterminate=true] [data-slot=checkbox-default-indicator--indeterminate]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.checkbox[data-indeterminate=true][data-invalid=true] [data-slot=checkbox-default-indicator--indeterminate],.checkbox[data-indeterminate=true][aria-invalid=true] [data-slot=checkbox-default-indicator--indeterminate]{color:var(--danger-foreground)}.checkbox__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .75);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative;overflow:hidden}.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox__control{cursor:var(--cursor-interactive)}.checkbox__control:before{pointer-events:none;z-index:0;transform-origin:50%;--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);border-radius:calc(var(--radius) * .75);background-color:var(--accent);opacity:0;--tw-content:"";content:var(--tw-content);transition:scale .1s var(--ease-linear),opacity .2s var(--ease-linear),background-color .2s var(--ease-out);position:absolute;top:0;right:0;bottom:0;left:0}@media(prefers-reduced-motion:reduce){.checkbox__control:before:not(:is()){transition-property:none}}.checkbox:focus-visible .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-focus-visible=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-focus-visible=true] .checkbox__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control{border-color:var(--field-border-hover)}:is(.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control):before{background-color:var(--accent-hover)}.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control{color:var(--accent-foreground);border-color:#0000}:is(.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.checkbox[data-indeterminate=true] .checkbox__control{background-color:var(--accent);color:var(--accent-foreground)}.checkbox:active[data-indeterminate=true] .checkbox__control,.checkbox[data-pressed=true][data-indeterminate=true] .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-pressed=true])[data-indeterminate=true] .checkbox__control{background-color:var(--accent-hover)}.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-visible,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focused=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-visible=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-within,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground);border-color:#0000}:is(.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);background-color:var(--danger);opacity:1}.checkbox[data-indeterminate=true][aria-invalid=true] .checkbox__control,.checkbox[data-indeterminate=true][data-invalid=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground)}.checkbox__indicator{z-index:10;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);justify-content:center;align-items:center;display:flex;position:relative}.checkbox__indicator svg{width:100%;height:100%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.checkbox--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.checkbox--secondary .checkbox__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--checkbox-control-bg);--checkbox-control-bg:var(--default)}.checkbox:hover :is(.checkbox--secondary .checkbox__control),.checkbox:has([data-slot=checkbox-content][data-hovered=true]) :is(.checkbox--secondary .checkbox__control),.checkbox [data-slot=checkbox-content][data-hovered=true] :is(.checkbox--secondary .checkbox__control){border-color:var(--field-border-hover)}.checkbox__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.checkbox--secondary:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{background-color:var(--checkbox-control-bg)}:is(.checkbox--secondary[aria-checked=true] .checkbox__control,.checkbox--secondary[data-selected=true] .checkbox__control):before,.checkbox--secondary[data-indeterminate=true] .checkbox__control,.checkbox--secondary[data-indeterminate=true] .checkbox__control:before{background-color:var(--accent)}.fieldset{gap:calc(var(--spacing) * 6);flex-direction:column;flex:1 1 0;display:flex}.fieldset__legend{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.fieldset__field_group{width:100%}:where(.fieldset__field_group>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.fieldset__actions{align-items:center;gap:calc(var(--spacing) * 2);padding-top:var(--spacing);display:flex}.input-otp{align-items:center;gap:calc(var(--spacing) * 2);display:flex;position:relative}.input-otp[data-disabled=true]{cursor:not-allowed;opacity:.5}.input-otp__group{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.input-otp__slot{height:calc(var(--spacing) * 10);width:calc(var(--spacing) * 9.5);border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:var(--field-radius,calc(var(--radius) * 1.5));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;flex:1;justify-content:center;align-items:center;display:flex;position:relative}.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-otp__slot:hover,.input-otp__slot[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-otp__slot[data-active=true]{z-index:10;background-color:var(--field-focus);--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.input-otp__slot[data-filled=true]{background-color:var(--field-focus)}.input-otp__slot[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input-otp__slot[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-otp__slot[data-invalid=true]:focus,.input-otp__slot[data-invalid=true]:focus-visible,.input-otp__slot[data-invalid=true][data-focused=true],.input-otp__slot[data-invalid=true][data-focus-visible=true],.input-otp__slot[data-invalid=true]:focus-within,.input-otp__slot[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-otp__slot[data-invalid=true]{background-color:var(--field-focus)}.input-otp__slot-value{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-tracking:-.27px;letter-spacing:-.27px;animation:slot-value-in .25s var(--ease-smooth) both;transform-origin:bottom}.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.input-otp__caret{height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .5);background-color:var(--field-placeholder,var(--muted));width:2px;animation:1.2s ease-out infinite caret-blink;position:absolute}.input-otp__separator{border-radius:calc(var(--radius) * .5);background-color:var(--separator);flex-shrink:0;width:6px;height:2px}.input-otp--secondary .input-otp__slot{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-otp-slot-bg);--input-otp-slot-bg:var(--default);--input-otp-slot-bg-hover:var(--default-hover);--input-otp-slot-bg-focus:var(--default)}@media(hover:hover){.input-otp--secondary .input-otp__slot:hover,.input-otp--secondary .input-otp__slot[data-hovered=true]{background-color:var(--input-otp-slot-bg-hover)}}.input-otp--secondary .input-otp__slot[data-active=true],.input-otp--secondary .input-otp__slot[data-filled=true]{background-color:var(--input-otp-slot-bg-focus)}@keyframes slot-value-in{0%{opacity:0;transform:translateY(8px)scale(.8)}to{opacity:1;transform:translateY(0)scale(1)}}.input{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input{border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input:hover:not(:focus):not(:focus-visible),.input[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input:focus,.input[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input[data-invalid=true]:focus,.input[data-invalid=true]:focus-visible,.input[data-invalid=true][data-focused=true],.input[data-invalid=true][data-focus-visible=true],.input[data-invalid=true]:focus-within,.input[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input[data-invalid=true]{background-color:var(--field-focus)}.input:disabled,.input[data-disabled=true],.input[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-bg);--input-bg:var(--default);--input-bg-hover:var(--default-hover);--input-bg-focus:var(--default)}@media(hover:hover){.input--secondary:hover:not(:focus):not(:focus-visible),.input--secondary[data-hovered=true]:not([data-focus-visible=true]):not([data-focused=true]){background-color:var(--input-bg-hover)}}.input--secondary:focus,.input--secondary[data-focused=true]{background-color:var(--input-bg-focus)}.input--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input--secondary[data-invalid=true]:focus,.input--secondary[data-invalid=true]:focus-visible,.input--secondary[data-invalid=true][data-focused=true],.input--secondary[data-invalid=true][data-focus-visible=true],.input--secondary[data-invalid=true]:focus-within,.input--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input--secondary[data-invalid=true]{background-color:var(--input-bg-focus)}.input--full-width{width:100%}.input-group{min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);outline-style:none;align-items:center;display:inline-flex}.input-group:has([data-slot=input-group-textarea]){align-items:flex-start;height:auto}.input-group{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-group:hover:not(:focus-within),.input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-group:has([data-slot=input-group-input]:focus),.input-group:has([data-slot=input-group-textarea]:focus){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group[data-invalid=true]:focus,.input-group[data-invalid=true]:focus-visible,.input-group[data-invalid=true][data-focused=true],.input-group[data-invalid=true][data-focus-visible=true],.input-group[data-invalid=true]:focus-within,.input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.input-group[data-disabled=true],.input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.input-group:has([data-slot=input-group-input]:-webkit-autofill),.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.input-group__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}.input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input-group:has([data-slot=input-group-prefix]) .input-group__input{border-top-left-radius:0;border-bottom-left-radius:0;padding-left:0}.input-group:has([data-slot=input-group-suffix]) .input-group__input{border-top-right-radius:0;border-bottom-right-radius:0;padding-right:0}.input-group__input:focus,.input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.input-group__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input[data-slot=input-group-textarea]{resize:vertical;min-height:38px}.input-group__prefix{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-right-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-left:none;border-top-right-radius:0;border-bottom-right-radius:0;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__prefix{align-items:flex-start;padding-top:.5rem}.input-group__prefix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group__suffix{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-left-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-right:none;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__suffix{align-items:flex-start;padding-top:.5rem}.input-group__suffix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-group-bg);--input-group-bg:var(--default);--input-group-bg-hover:var(--default-hover);--input-group-bg-focus:var(--default)}@media(hover:hover){.input-group--secondary:hover:not(:focus-within),.input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--input-group-bg-hover)}}.input-group--secondary:has([data-slot=input-group-input]:focus),.input-group--secondary:has([data-slot=input-group-textarea]:focus){background-color:var(--input-group-bg-focus)}.input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group--secondary[data-invalid=true]:focus,.input-group--secondary[data-invalid=true]:focus-visible,.input-group--secondary[data-invalid=true][data-focused=true],.input-group--secondary[data-invalid=true][data-focus-visible=true],.input-group--secondary[data-invalid=true]:focus-within,.input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--input-group-bg-focus)}.input-group--secondary [data-slot=input-group-input],.input-group--secondary [data-slot=input-group-textarea]{background-color:#0000}.input-group--full-width{width:100%}.number-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.number-field[data-invalid=true],.number-field[aria-invalid=true]) [data-slot=description]{display:none}.number-field [data-slot=label]{width:fit-content}.number-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;grid-template-columns:40px 1fr 40px;align-items:center;display:grid;overflow:hidden}.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.number-field__group:hover:not(:focus-within),.number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.number-field__group[data-focus-within=true],.number-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field__group[data-invalid=true]:focus,.number-field__group[data-invalid=true]:focus-visible,.number-field__group[data-invalid=true][data-focused=true],.number-field__group[data-invalid=true][data-focus-visible=true],.number-field__group[data-invalid=true]:focus-within,.number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.number-field__group[data-disabled=true],.number-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.number-field__group:has([data-slot=number-field-input]:-webkit-autofill),.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.number-field__input{border-style:var(--tw-border-style);min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none}@media(min-width:40rem){.number-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.number-field__group:has([slot=decrement]) .number-field__input{border-top-left-radius:0;border-bottom-left-radius:0}.number-field__group:has([slot=increment]) .number-field__input{border-top-right-radius:0;border-bottom-right-radius:0}.number-field__input:focus,.number-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.number-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__increment-button,.number-field__decrement-button{height:100%;width:calc(var(--spacing) * 10);color:var(--field-foreground,var(--foreground));--tw-outline-style:none;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth);background-color:#0000;border-style:solid;border-radius:0;outline-style:none;justify-content:center;align-items:center;display:flex}:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.number-field__increment-button,.number-field__decrement-button{cursor:var(--cursor-interactive)}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:var(--field-foreground,var(--foreground))}@supports (color:color-mix(in lab,red,red)){:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:color-mix(in oklab,var(--field-foreground,var(--foreground)) 10%,transparent)}}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{transform:scale(.97)}:is(.number-field__increment-button,.number-field__decrement-button):disabled,:is(.number-field__increment-button,.number-field__decrement-button)[data-disabled=true],:is(.number-field__increment-button,.number-field__decrement-button)[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-increment-button-icon],:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-decrement-button-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.number-field__increment-button{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--field-placeholder,var(--muted))}@supports (color:color-mix(in lab,red,red)){.number-field__increment-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field__decrement-button{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--field-placeholder,var(--muted));border-top-right-radius:0;border-bottom-right-radius:0}@supports (color:color-mix(in lab,red,red)){.number-field__decrement-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field--secondary .number-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--number-field-group-bg);--number-field-group-bg:var(--default);--number-field-group-bg-hover:var(--default-hover);--number-field-group-bg-focus:var(--default)}@media(hover:hover){.number-field--secondary .number-field__group:hover:not(:focus-within),.number-field--secondary .number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--number-field-group-bg-hover)}}.number-field--secondary .number-field__group:focus-within,.number-field--secondary .number-field__group[data-focus-within=true]{background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field--secondary .number-field__group[data-invalid=true]:focus,.number-field--secondary .number-field__group[data-invalid=true]:focus-visible,.number-field--secondary .number-field__group[data-invalid=true][data-focused=true],.number-field--secondary .number-field__group[data-invalid=true][data-focus-visible=true],.number-field--secondary .number-field__group[data-invalid=true]:focus-within,.number-field--secondary .number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field--secondary .number-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group [data-slot=number-field-input]{background-color:#0000}.number-field--full-width,.number-field__group--full-width{width:100%}.radio-group{flex-direction:column;display:flex}.radio-group[data-orientation=vertical] [data-slot=radio]{margin-top:calc(var(--spacing) * 4)}.radio-group[data-orientation=horizontal]{gap:calc(var(--spacing) * 4);flex-flow:wrap}.radio-group--secondary .radio__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--radio-control-bg);--radio-control-bg:var(--default);--radio-control-bg-hover:var(--default-hover)}.radio:has([data-slot=radio-content][data-hovered=true]) :is(.radio-group--secondary .radio__control),.radio [data-slot=radio-content][data-hovered=true] :is(.radio-group--secondary .radio__control){border-color:var(--field-border-hover)}.radio:not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg-hover)}.radio{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.radio [data-slot=label]{-webkit-user-select:none;user-select:none}.radio .radio__content [data-slot=label]{cursor:var(--cursor-interactive)}.radio>[data-slot=description],.radio>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=description],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.radio__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.radio__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.radio__control{cursor:var(--cursor-interactive)}.radio:has([data-slot=radio-content][data-focus-visible=true]) .radio__control,.radio [data-slot=radio-content][data-focus-visible=true] .radio__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.radio:has([data-slot=radio-content][data-hovered=true]) .radio__control,.radio [data-slot=radio-content][data-hovered=true] .radio__control{border-color:var(--field-border-hover)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) .radio__control .radio__indicator:empty:before{background-color:var(--field-hover)}.radio:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio [data-slot=radio-content][data-pressed=true] .radio__control{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.radio[data-selected] .radio__control,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__control,.radio:has(input:checked) .radio__control{background-color:var(--accent);border-color:#0000}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__control,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__control{background-color:var(--accent-hover)}.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-visible,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focused=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-within,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-visible,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focused=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-within,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio__indicator{pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.radio__indicator:empty:before{content:"";border-radius:calc(var(--radius) * 1);background-color:var(--field-background,var(--default));width:100%;height:100%;transition:scale .2s var(--ease-out),background-color .2s var(--ease-out);scale:1}@media(prefers-reduced-motion:reduce){.radio__indicator:empty:before:not(:is()){transition-property:none}}.radio[data-selected] .radio__indicator:empty:before,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked) .radio__indicator:empty:before{background-color:var(--accent-foreground);scale:.4286}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before{scale:.5714}.radio--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textfield{gap:var(--spacing);flex-direction:column;display:flex}:is(.textfield[data-invalid=true],.textfield[aria-invalid=true]) [data-slot=description]{display:none}.textfield--full-width,.textfield--full-width [data-slot=input],.textfield--full-width [data-slot=textarea]{width:100%}.search-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.search-field[data-invalid=true],.search-field[aria-invalid=true]) [data-slot=description]{display:none}.search-field [data-slot=label]{width:fit-content}.search-field[data-empty=true] [data-slot=search-field-clear-button]{pointer-events:none;opacity:0}.search-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;position:relative;overflow:hidden}.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.search-field__group:hover:not(:focus-within),.search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.search-field__group[data-focus-within=true],.search-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field__group[data-invalid=true]:focus,.search-field__group[data-invalid=true]:focus-visible,.search-field__group[data-invalid=true][data-focused=true],.search-field__group[data-invalid=true][data-focus-visible=true],.search-field__group[data-invalid=true]:focus-within,.search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.search-field__group[data-disabled=true],.search-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.search-field__group:has([data-slot=search-field-input]:-webkit-autofill),.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.search-field__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}@media(min-width:40rem){.search-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.search-field__input::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__input::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__group:has([data-slot=search-field-search-icon]) .search-field__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.search-field__group:has([slot=clear]) .search-field__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.search-field__input:focus,.search-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.search-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__search-icon{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);flex-shrink:0}.search-field__clear-button{margin-right:calc(var(--spacing) * 2);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0}.search-field__clear-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.search-field--secondary .search-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--search-field-group-bg);--search-field-group-bg:var(--default);--search-field-group-bg-hover:var(--default-hover);--search-field-group-bg-focus:var(--default)}@media(hover:hover){.search-field--secondary .search-field__group:hover:not(:focus-within),.search-field--secondary .search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--search-field-group-bg-hover)}}.search-field--secondary .search-field__group:focus-within,.search-field--secondary .search-field__group[data-focus-within=true]{background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field--secondary .search-field__group[data-invalid=true]:focus,.search-field--secondary .search-field__group[data-invalid=true]:focus-visible,.search-field--secondary .search-field__group[data-invalid=true][data-focused=true],.search-field--secondary .search-field__group[data-invalid=true][data-focus-visible=true],.search-field--secondary .search-field__group[data-invalid=true]:focus-within,.search-field--secondary .search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field--secondary .search-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group [data-slot=search-field-input]{background-color:#0000}.search-field--full-width,.search-field__group--full-width{width:100%}.textarea{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.textarea::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.textarea{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.textarea{border-width:var(--border-width-field);border-color:var(--field-border);min-height:38px;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *),.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.textarea:hover:not(:focus):not(:focus-visible),.textarea[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.textarea:focus,.textarea[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.textarea[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea[data-invalid=true]:focus,.textarea[data-invalid=true]:focus-visible,.textarea[data-invalid=true][data-focused=true],.textarea[data-invalid=true][data-focus-visible=true],.textarea[data-invalid=true]:focus-within,.textarea[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea[data-invalid=true]{background-color:var(--field-focus)}.textarea:disabled,.textarea[data-disabled=true],.textarea[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textarea--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--textarea-bg);--textarea-bg:var(--default);--textarea-bg-hover:var(--default-hover);--textarea-bg-focus:var(--default)}@media(hover:hover){.textarea--secondary:hover:not(:focus):not(:focus-visible),.textarea--secondary[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--textarea-bg-hover)}}.textarea--secondary:focus,.textarea--secondary[data-focused=true]{background-color:var(--textarea-bg-focus)}.textarea--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea--secondary[data-invalid=true]:focus,.textarea--secondary[data-invalid=true]:focus-visible,.textarea--secondary[data-invalid=true][data-focused=true],.textarea--secondary[data-invalid=true][data-focus-visible=true],.textarea--secondary[data-invalid=true]:focus-within,.textarea--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea--secondary[data-invalid=true]{background-color:var(--textarea-bg-focus)}.textarea--full-width{width:100%}.calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.calendar--week-view .calendar__cell,.calendar--day-view .calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.calendar--day-view .calendar__grid{flex-direction:column;display:flex}.calendar--day-view .calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-header>tr{display:contents}.calendar--day-view .calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-body>tr{display:contents}.calendar--day-view .calendar__grid-body>tr:first-child>td{margin-top:0}.calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .calendar__nav-button{pointer-events:none;opacity:0}.calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 2);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.calendar__nav-button:hover,.calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.calendar__nav-button:active,.calendar__nav-button[data-pressed=true]{transform:scale(.95)}.calendar__nav-button:focus-visible,.calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__nav-button:disabled,.calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar__grid[aria-readonly=true] .calendar__cell{pointer-events:none}.calendar__grid-header,.calendar__grid-header>tr,.calendar__grid-body,.calendar__grid-body>tr{display:contents}.calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.calendar__grid-row{display:contents}.calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.calendar__cell{aspect-ratio:1;border-radius:calc(var(--radius) * 3);text-align:center;width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;will-change:scale;transition:transform .25s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__cell{cursor:var(--cursor-interactive)}.calendar__cell:focus-visible:not(:focus),.calendar__cell[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__cell[data-today=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.calendar__cell[data-today=true]:hover:not([data-selected=true]),.calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true]){background-color:var(--accent-soft-hover)}}.calendar__cell[data-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}.calendar__cell:active,.calendar__cell[data-pressed=true]{background-color:var(--default);transform:scale(.95)}:is(.calendar__cell:active,.calendar__cell[data-pressed=true])[data-selected=true]{background-color:var(--accent-hover)}@media(hover:hover){.calendar__cell:hover:not([data-selected=true]),.calendar__cell[data-hovered=true]:not([data-selected=true]){background-color:var(--default)}}.calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.calendar__cell[data-selected=true][data-outside-month=true]{background-color:var(--default)}.calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__cell:disabled:not([data-outside-month=true]),.calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.calendar__cell-indicator{background-color:var(--accent-foreground)}.range-calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.range-calendar--week-view .range-calendar__cell,.range-calendar--day-view .range-calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.range-calendar--day-view .range-calendar__grid{flex-direction:column;display:flex}.range-calendar--day-view .range-calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-header>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-body>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body>tr:first-child>td{margin-top:0}.range-calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.range-calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .range-calendar__nav-button{pointer-events:none;opacity:0}.range-calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.range-calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.range-calendar__nav-button:hover,.range-calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.range-calendar__nav-button:active,.range-calendar__nav-button[data-pressed=true]{transform:scale(.95)}.range-calendar__nav-button:focus-visible,.range-calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__nav-button:disabled,.range-calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.range-calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar__grid[aria-readonly=true] .range-calendar__cell{pointer-events:none}.range-calendar__grid-header,.range-calendar__grid-header>tr,.range-calendar__grid-body,.range-calendar__grid-body>tr{display:contents}.range-calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.range-calendar__grid-row{display:contents}.range-calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.range-calendar__cell{z-index:1;border-radius:calc(var(--radius) * 3);--tw-outline-style:none;cursor:var(--cursor-interactive);will-change:background-color,border-color;transition:box-shadow .1s var(--ease-out),border-color .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;margin-block:2px;margin-inline:0;padding:0;position:relative}.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell .range-calendar__cell-button{aspect-ratio:1;border-radius:calc(var(--radius) * 3);width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);-webkit-tap-highlight-color:transparent;will-change:scale;transition:scale .2s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]{z-index:2}:is(.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]) .range-calendar__cell-button{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__cell[data-today=true] .range-calendar__cell-button{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){:is(.range-calendar__cell[data-today=true]:hover:not([data-selected=true]),.range-calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--accent-soft-hover)}}.range-calendar__cell[data-selected=true]:not([data-outside-month=true]){background-color:var(--accent-soft);border-radius:0}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*){border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*)[data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*){border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*)[data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){z-index:2}:is(.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true])) .range-calendar__cell-button{background-color:var(--accent);color:var(--accent-foreground)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]){border-top-left-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){border-top-right-radius:calc(var(--radius) * 3);border-bottom-right-radius:calc(var(--radius) * 3)}:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true]) .range-calendar__cell-button{scale:.9}:is(:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-start=true],:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-end=true]) .range-calendar__cell-button{background-color:var(--accent-hover)}@media(hover:hover){:is(.range-calendar__cell:hover:not([data-selected=true]),.range-calendar__cell[data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--default)}}.range-calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:color-mix(in oklab,var(--default) 20%,transparent)}}.range-calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__cell:disabled:not([data-outside-month=true]),.range-calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true]{border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true]{border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.range-calendar__cell-indicator{background-color:var(--accent-foreground)}.calendar:has(.calendar-year-picker__year-grid),.range-calendar:has(.calendar-year-picker__year-grid){position:relative}.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]{will-change:opacity;transition:opacity .15s var(--ease-out),visibility 0s linear}:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]{pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s var(--ease-out),visibility 0s linear .15s}:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger{justify-content:flex-start;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1);--tw-outline-style:none;cursor:var(--cursor-interactive);touch-action:manipulation;outline-style:none;flex:1;display:flex}.calendar-year-picker__trigger:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar-year-picker__trigger-heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition:color .15s var(--ease-out)}.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger-indicator{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--accent-soft-foreground);transition:transform .15s var(--ease-out)}.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-indicator{transform:rotate(90deg)}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-heading{color:var(--accent-soft-foreground)}.calendar-year-picker__year-grid{pointer-events:none;scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);align-content:flex-start;gap:var(--spacing);padding:var(--spacing);opacity:0;will-change:opacity;grid-template-columns:repeat(3,1fr);display:grid;position:absolute;left:0;right:0;overflow-y:auto}.calendar-year-picker__year-grid[data-open=true]{pointer-events:auto;opacity:1;transition:opacity .2s var(--ease-out) 50ms}.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);padding-inline:calc(var(--spacing) * 2.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{cursor:var(--cursor-interactive)}@media(hover:hover)and (pointer:fine){.calendar-year-picker__year-cell:is(:hover,[data-hovered=true]):not([data-selected=true]){background-color:var(--default);color:var(--default-foreground)}}.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}@media(hover:hover)and (pointer:fine){:is(.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-hover)}}.calendar-year-picker__year-cell:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.date-field[data-invalid=true],.date-field[aria-invalid=true]) [data-slot=description]{display:none}.date-field [data-slot=label]{width:fit-content}.date-field--full-width{width:100%}.time-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.time-field[data-invalid=true],.time-field[aria-invalid=true]) [data-slot=description]{display:none}.time-field [data-slot=label]{width:fit-content}.time-field--full-width{width:100%}.date-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.date-input-group:hover:not(:focus-within),.date-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.date-input-group[data-focus-within=true]:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])),.date-input-group:focus-within:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.date-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group[data-invalid=true]:focus,.date-input-group[data-invalid=true]:focus-visible,.date-input-group[data-invalid=true][data-focused=true],.date-input-group[data-invalid=true][data-focus-visible=true],.date-input-group[data-invalid=true]:focus-within,.date-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.date-input-group[data-disabled=true],.date-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-input-group__input{cursor:text;border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;gap:1px;display:flex}@media(min-width:40rem){.date-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.date-input-group:has([data-slot=date-input-group-prefix]) .date-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.date-input-group:has([data-slot=date-input-group-suffix]) .date-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=start]{flex:none;padding-right:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=end]{padding-left:0}.date-input-group__input:focus,.date-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.date-input-group__input-container{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;flex:1;align-items:center;width:fit-content;display:flex;overflow:auto clip}.date-input-group__segment{border-radius:calc(var(--radius) * .75);padding-inline:calc(var(--spacing) * .5);text-align:end;text-wrap:nowrap;--tw-outline-style:none;outline-style:none;display:inline-block}.date-input-group__segment[data-type=literal]{color:var(--muted);padding:0}.date-input-group__segment[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.date-input-group__segment:focus,.date-input-group__segment[data-focused=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.date-input-group__segment[data-disabled=true]{opacity:.5}.date-input-group__segment[data-invalid=true]{color:var(--danger)}.date-input-group__segment[data-invalid=true]:focus,.date-input-group__segment[data-invalid=true][data-focused=true]{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.date-input-group__prefix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group__suffix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--date-input-group-bg);--date-input-group-bg:var(--default);--date-input-group-bg-hover:var(--default-hover);--date-input-group-bg-focus:var(--default)}@media(hover:hover){.date-input-group--secondary:hover:not(:focus-within),.date-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--date-input-group-bg-hover)}}.date-input-group--secondary:focus-within,.date-input-group--secondary[data-focus-within=true]{background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group--secondary[data-invalid=true]:focus,.date-input-group--secondary[data-invalid=true]:focus-visible,.date-input-group--secondary[data-invalid=true][data-focused=true],.date-input-group--secondary[data-invalid=true][data-focus-visible=true],.date-input-group--secondary[data-invalid=true]:focus-within,.date-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary [data-slot=date-input-group-input]{background-color:#0000}.date-input-group--full-width{width:100%}.date-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-picker .date-input-group__suffix,.date-picker .date-input-group__prefix{pointer-events:auto}.date-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__trigger:focus-visible:not(:focus),.date-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-picker__trigger:disabled,.date-picker__trigger[data-disabled=true],.date-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-picker__popover:focus-visible:not(:focus),.date-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-picker__popover[data-exiting=true],.date-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.date-range-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-range-picker .date-input-group__suffix,.date-range-picker .date-input-group__prefix{pointer-events:auto}.date-range-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__trigger:focus-visible:not(:focus),.date-range-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-range-picker__trigger:disabled,.date-range-picker__trigger[data-disabled=true],.date-range-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-range-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-range-picker__range-separator{padding-inline:var(--spacing);color:var(--field-placeholder,var(--muted));-webkit-user-select:none;user-select:none}.date-range-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-range-picker__popover:focus-visible:not(:focus),.date-range-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-range-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-range-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-range-picker__popover[data-exiting=true],.date-range-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.card{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 4);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:column;display:flex;position:relative;overflow:visible}.card__header{flex-direction:column;display:flex}.card__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.card__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);color:var(--muted)}.card__content{gap:var(--spacing);flex-direction:column;flex:1;display:flex}.card__footer{flex-direction:row;align-items:center;display:flex}.card--transparent{--tw-border-style:none;--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000;border-style:none}.card--default{background-color:var(--surface)}.card--secondary{background-color:var(--surface-secondary)}.card--tertiary{background-color:var(--surface-tertiary)}.header{width:100%;padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 1.5);padding-bottom:var(--spacing);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted)}.separator{border-radius:calc(var(--radius) * .5);border-top-style:var(--tw-border-style);border-top-width:0;border-bottom-style:var(--tw-border-style);background-color:var(--separator);border-bottom-width:0;flex-shrink:0;width:100%;height:1px}.separator--horizontal{width:100%;height:1px}.separator--vertical{height:auto;min-height:calc(var(--spacing) * 2);align-self:stretch;width:1px}.separator--default{background-color:var(--separator)}.separator--secondary{background-color:var(--separator-secondary)}.separator--tertiary{background-color:var(--separator-tertiary)}.separator__container{align-items:center;gap:calc(var(--spacing) * 3);display:flex}.separator__container--horizontal{flex-direction:row;width:100%}.separator__container--vertical{flex-direction:column;justify-content:center;height:100%}.separator__line{flex-grow:1;flex-shrink:0}.separator__content{text-align:center;white-space:nowrap;color:var(--muted);justify-content:center;align-items:center;display:inline-flex}.separator__content--horizontal,.separator__content--vertical{text-align:center}.surface{color:var(--foreground);position:relative}.surface--transparent{background-color:#0000}.surface--default{background-color:var(--surface);color:var(--surface-foreground)}.surface--secondary{background-color:var(--surface-secondary);color:var(--surface-secondary-foreground)}.surface--tertiary{background-color:var(--surface-tertiary);color:var(--surface-tertiary-foreground)}.avatar{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);background-color:var(--default);flex-shrink:0;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}.avatar__fallback{background-color:var(--default);width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);justify-content:center;align-items:center;display:flex}.avatar__image{aspect-ratio:1;width:100%;height:100%;transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s;position:absolute;top:0;right:0;bottom:0;left:0}.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *),.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.avatar--sm{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2)}.avatar--lg{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12);border-radius:calc(var(--radius) * 3)}.avatar--lg .avatar__fallback{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.avatar__fallback--accent{color:var(--accent-soft-foreground)}.avatar__fallback--default{color:var(--default-soft-foreground)}.avatar__fallback--success{color:var(--success-soft-foreground)}.avatar__fallback--warning{color:var(--warning-soft-foreground)}.avatar__fallback--danger{color:var(--danger-soft-foreground)}.avatar--soft{background-color:#0000}.avatar--soft .avatar__fallback--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.avatar--soft .avatar__fallback--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.avatar--soft .avatar__fallback--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.avatar--soft .avatar__fallback--default{background-color:var(--default-soft);color:var(--default-soft-foreground)}.avatar--soft .avatar__fallback--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.alert-dialog__trigger:focus-visible:not(:focus),.alert-dialog__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.alert-dialog__trigger:disabled,.alert-dialog__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.alert-dialog__trigger:active,.alert-dialog__trigger[data-pressed=true]{transform:scale(.97)}.alert-dialog__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.alert-dialog__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.alert-dialog__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]{will-change:opacity}:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__backdrop--transparent{background-color:#0000}.alert-dialog__backdrop--opaque{background-color:var(--backdrop)}.alert-dialog__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.alert-dialog__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.alert-dialog__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.alert-dialog__container{pointer-events:none}.alert-dialog__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.alert-dialog__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.alert-dialog__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.alert-dialog__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.alert-dialog__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]{will-change:opacity,transform}:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;min-height:0;max-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative;overflow:clip}.alert-dialog__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.alert-dialog__dialog[data-placement=auto]{margin-block:auto}}.alert-dialog__dialog[data-placement=center]{margin-block:auto}.alert-dialog__dialog[data-placement=bottom]{margin-top:auto}.alert-dialog__dialog[data-placement=top]{margin-top:0}.alert-dialog__dialog--xs{max-width:var(--container-xs)}.alert-dialog__dialog--sm{max-width:var(--container-sm)}.alert-dialog__dialog--md{max-width:var(--container-md)}.alert-dialog__dialog--lg{max-width:var(--container-lg)}.alert-dialog__dialog--cover{width:100%;height:100%;min-height:100%}.alert-dialog__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.alert-dialog__header>.modal__icon{margin-bottom:0}.alert-dialog__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.alert-dialog__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.alert-dialog__icon [data-slot=alert-dialog-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.alert-dialog__icon--default{background-color:var(--default);color:var(--foreground)}.alert-dialog__icon--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.alert-dialog__icon--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.alert-dialog__icon--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.alert-dialog__icon--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.alert-dialog__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.alert-dialog__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.alert-dialog__header+.alert-dialog__body{margin-top:calc(var(--spacing) * 2)}.alert-dialog__header+.alert-dialog__footer,.alert-dialog__body+.alert-dialog__footer{margin-top:calc(var(--spacing) * 5)}.drawer__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.drawer__trigger:focus-visible:not(:focus),.drawer__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.drawer__trigger:disabled,.drawer__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.drawer__trigger:active,.drawer__trigger[data-pressed=true]{transform:scale(.97)}.drawer__backdrop{z-index:50;height:var(--visual-viewport-height);opacity:1;width:100%;transition:opacity .25s cubic-bezier(.32,.72,0,1);position:fixed;top:0;right:0;bottom:0;left:0}.drawer__backdrop[data-entering=true]{opacity:0}.drawer__backdrop[data-exiting=true]{opacity:0;transition-duration:.2s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.drawer__backdrop[data-exiting=true],.drawer__backdrop[data-entering=true]{will-change:opacity}@media(prefers-reduced-motion:reduce){.drawer__backdrop{transition:none}}.drawer__backdrop--transparent{background-color:#0000}.drawer__backdrop--opaque{background-color:var(--backdrop)}.drawer__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.drawer__content{pointer-events:none;z-index:50;height:var(--visual-viewport-height);width:100%;min-width:0;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.drawer__content--bottom{align-items:flex-end}.drawer__content--top{align-items:flex-start}.drawer__content--left{justify-content:flex-start}.drawer__content--right{justify-content:flex-end}.drawer__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;padding:calc(var(--spacing) * 6);pointer-events:auto;--drawer-enter-duration:.25s;--drawer-exit-duration:.2s;--drawer-enter-ease:cubic-bezier(.32, .72, 0, 1);--drawer-exit-ease:cubic-bezier(.32, .72, 0, 1);will-change:translate;transition:translate var(--drawer-enter-duration) var(--drawer-enter-ease);outline-style:none;flex-direction:column;display:flex;position:relative}@media(prefers-reduced-motion:reduce){.drawer__dialog{transition:none}}.drawer__dialog[data-placement=bottom]{border-top-left-radius:min(32px,var(--radius-2xl));border-top-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=top]{border-bottom-left-radius:min(32px,var(--radius-2xl));border-bottom-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=left]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=left]{width:calc(var(--spacing) * 96)}}.drawer__dialog[data-placement=right]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=right]{width:calc(var(--spacing) * 96)}}[data-exiting=true] .drawer__dialog{transition-duration:var(--drawer-exit-duration);transition-timing-function:var(--drawer-exit-ease)}.drawer__content--left .drawer__dialog,.drawer__content--right .drawer__dialog,.drawer__content--top .drawer__dialog,.drawer__content--bottom .drawer__dialog{translate:0}.drawer__content--left[data-entering=true] .drawer__dialog,.drawer__content--left[data-exiting=true] .drawer__dialog{translate:-100%}.drawer__content--right[data-entering=true] .drawer__dialog,.drawer__content--right[data-exiting=true] .drawer__dialog{translate:100%}.drawer__content--top[data-entering=true] .drawer__dialog,.drawer__content--top[data-exiting=true] .drawer__dialog{translate:0 -100%}.drawer__content--bottom[data-entering=true] .drawer__dialog,.drawer__content--bottom[data-exiting=true] .drawer__dialog{translate:0 100%}.drawer__dialog--top{padding-bottom:calc(var(--spacing) * 2)}.drawer__dialog--top .drawer__handle{padding-bottom:0}.drawer__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.drawer__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.drawer__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.drawer__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.drawer__handle{padding-bottom:calc(var(--spacing) * 2);justify-content:center;align-items:center;display:flex}.drawer__handle>[data-slot=drawer-handle-bar]{height:var(--spacing);width:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * .25);background-color:var(--separator)}.drawer__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.drawer__header+.drawer__body{margin-top:calc(var(--spacing) * 2)}.drawer__header+.drawer__footer,.drawer__body+.drawer__footer{margin-top:calc(var(--spacing) * 5)}.drawer__handle+.drawer__header,.drawer__handle+.drawer__body{margin-top:0}.modal__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.modal__trigger:focus-visible:not(:focus),.modal__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.modal__trigger:disabled,.modal__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.modal__trigger:active,.modal__trigger[data-pressed=true]{transform:scale(.97)}.modal__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.modal__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.modal__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]{will-change:opacity}:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__backdrop--transparent{background-color:#0000}.modal__backdrop--opaque{background-color:var(--backdrop)}.modal__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.modal__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.modal__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.modal__container{pointer-events:none}.modal__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.modal__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.modal__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.modal__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.modal__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-exiting=true],.modal__container[data-entering=true]{will-change:opacity,transform}:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__container--scroll-outside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);pointer-events:auto;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__container--full{padding:0}@media(min-width:40rem){.modal__container--full{padding:0}}.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% ;--tw-enter-scale:1}@media(min-width:40rem){.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% }}.modal__container--full[data-exiting=true]{--tw-exit-scale:1}.modal__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative}.modal__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.modal__dialog[data-placement=auto]{margin-block:auto}}.modal__dialog[data-placement=center]{margin-block:auto}.modal__dialog[data-placement=bottom]{margin-top:auto}.modal__dialog[data-placement=top]{margin-top:0}.modal__dialog--scroll-inside{min-height:0;max-height:100%;overflow:clip}.modal__dialog--scroll-outside{flex-shrink:0;height:auto;min-height:0}.modal__dialog--xs{max-width:var(--container-xs)}.modal__dialog--sm{max-width:var(--container-sm)}.modal__dialog--md{max-width:var(--container-md)}.modal__dialog--lg{max-width:var(--container-lg)}.modal__dialog--cover{width:100%;height:100%;min-height:100%}.modal__dialog--full{--tw-shadow:0 0 #0000;width:100%;height:100%;min-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:0}.modal__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.modal__header>.modal__icon{margin-bottom:0}.modal__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.modal__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.modal__body{min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow:visible}.modal__body--scroll-inside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__body--scroll-outside{overflow-y:visible}.modal__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.modal__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.modal__header+.modal__body{margin-top:calc(var(--spacing) * 2)}.modal__header+.modal__footer,.modal__body+.modal__footer{margin-top:calc(var(--spacing) * 5)}.popover{transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0}.popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.popover[data-exiting=true],.popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.popover__dialog{padding:calc(var(--spacing) * 4);--tw-outline-style:none;outline-style:none}.popover__heading{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.popover__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.popover__trigger{cursor:var(--cursor-interactive)}.popover__trigger:focus-visible:not(:focus),.popover__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.popover__trigger:disabled,.popover__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tooltip{max-width:var(--container-xs);transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);padding:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));word-break:break-all;border-radius:min(32px,var(--radius-xl));box-shadow:var(--shadow-overlay)}.tooltip[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.tooltip[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.tooltip[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.tooltip[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.tooltip[data-exiting=true],.tooltip[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.tooltip [data-slot=overlay-arrow]{stroke:var(--border)}@supports (color:color-mix(in lab,red,red)){.tooltip [data-slot=overlay-arrow]{stroke:color-mix(in oklab,var(--border) 40%,transparent)}}.tooltip [data-slot=overlay-arrow]{fill:var(--overlay)}.tooltip[data-placement=bottom] [data-slot=overlay-arrow]{rotate:180deg}.tooltip[data-placement=left] [data-slot=overlay-arrow]{rotate:-90deg}.tooltip[data-placement=right] [data-slot=overlay-arrow]{rotate:90deg}.tooltip__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tooltip__trigger:focus-visible:not(:focus),.tooltip__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.combo-box{gap:var(--spacing);flex-direction:column;display:flex}:is(.combo-box[data-invalid=true],.combo-box[aria-invalid=true]) [data-slot=description]{display:none}.combo-box [data-slot=label]{width:fit-content}.combo-box [data-slot=input]{flex:1;min-width:0}.combo-box [data-slot=input]:has(+.combo-box__trigger){padding-inline-end:calc(var(--spacing) * 7)}.combo-box [data-slot=input]:focus,.combo-box [data-slot=input][data-focus]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.combo-box [data-slot=input]:disabled,.combo-box [data-slot=input][data-disabled],.combo-box [data-slot=input][aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.combo-box__input-group{isolation:isolate;align-items:center;display:inline-flex;position:relative}.combo-box__trigger{--tw-translate-y: -50% ;height:100%;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:pointer;color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;-webkit-tap-highlight-color:transparent;--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-color:#0000;border-style:none;outline-style:none;flex-shrink:0;justify-content:center;align-items:center;padding-inline-end:calc(var(--spacing) * 2);transition-duration:.15s;display:flex;position:absolute;top:50%}@media(hover:hover){.combo-box__trigger:hover,.combo-box__trigger[data-hovered=true]{color:var(--field-foreground,var(--foreground))}}.combo-box__trigger:focus-visible:not(:focus),.combo-box__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-radius:.25rem;outline-style:none}.combo-box__trigger[data-pressed=true]{opacity:.7}.combo-box__trigger:disabled,.combo-box__trigger[data-disabled],.combo-box__trigger[aria-disabled=true]{cursor:not-allowed;opacity:.5}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;transition-duration:.15s}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.combo-box__trigger[data-open=true] [data-slot=combo-box-trigger-default-icon]{rotate:180deg}.combo-box__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.combo-box__popover:focus-visible:not(:focus),.combo-box__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.combo-box__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.combo-box__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.combo-box__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.combo-box__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.combo-box__popover[data-exiting=true],.combo-box__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.combo-box__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.combo-box__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.combo-box__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.combo-box__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.combo-box__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.combo-box__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.combo-box__popover [data-slot=list-box-item] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.combo-box--full-width,.combo-box__input-group--full-width{width:100%}.select{gap:var(--spacing);flex-direction:column;display:flex}:is(.select[data-invalid=true],.select[aria-invalid=true]) [data-slot=description]{display:none}.select [data-slot=label]{width:fit-content}.select__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.select__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.select__trigger:has(.select__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.select__trigger:hover,.select__trigger[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.select__trigger:focus-visible:not(:focus),.select__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-visible,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focused=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-visible=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-within,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{background-color:var(--field-focus)}.select__trigger:disabled,.select__trigger[data-disabled=true],.select__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.select--secondary .select__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--select-trigger-bg);--select-trigger-bg:var(--default);--select-trigger-bg-hover:var(--default-hover);--select-trigger-bg-focus:var(--default)}@media(hover:hover){.select--secondary .select__trigger:hover,.select--secondary .select__trigger[data-hovered=true]{background-color:var(--select-trigger-bg-hover)}}.select--secondary .select__trigger:focus-visible:not(:focus),.select--secondary .select__trigger[data-focus-visible=true],.select[data-invalid=true] :is(.select--secondary .select__trigger),.select[aria-invalid=true] :is(.select--secondary .select__trigger){background-color:var(--select-trigger-bg-focus)}.select__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.select__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.select__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.select__value [data-slot=list-box-item-indicator]{display:none}.select__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.select__indicator[data-open=true]{rotate:180deg}.select__indicator[data-slot=select-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.select__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.select__popover:focus-visible:not(:focus),.select__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.select__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.select__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.select__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.select__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.select__popover[data-exiting=true],.select__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.select__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.select__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.select__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.select__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.select__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.select__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.select--full-width,.select__trigger--full-width{width:100%}.autocomplete{gap:var(--spacing);flex-direction:column;display:flex}.autocomplete__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.autocomplete__trigger:has(.autocomplete__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.autocomplete__trigger:focus-visible:not(:focus),.autocomplete__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-visible,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focused=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-visible=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-within,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{background-color:var(--field-focus)}.autocomplete__trigger:disabled,.autocomplete__trigger[data-disabled=true],.autocomplete__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.autocomplete--secondary .autocomplete__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--autocomplete-trigger-bg);--autocomplete-trigger-bg:var(--default);--autocomplete-trigger-bg-hover:var(--default-hover);--autocomplete-trigger-bg-focus:var(--default)}@media(hover:hover){.autocomplete--secondary .autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete--secondary .autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--autocomplete-trigger-bg-hover)}}.autocomplete--secondary .autocomplete__trigger:focus-visible:not(:focus),.autocomplete--secondary .autocomplete__trigger[data-focus-visible=true],.autocomplete[data-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger),.autocomplete[aria-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger){background-color:var(--autocomplete-trigger-bg-focus)}.autocomplete__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.autocomplete__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.autocomplete__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.autocomplete__value [data-slot=list-box-item-indicator]{display:none}.autocomplete__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;cursor:var(--cursor-interactive);flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.autocomplete__indicator[data-open=true]{rotate:180deg}.autocomplete__indicator[data-slot=autocomplete-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.autocomplete__popover{width:var(--trigger-width);max-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);overscroll-behavior:contain;background-color:var(--overlay);padding:0;padding-top:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);overflow:hidden}.autocomplete__popover:focus-visible:not(:focus),.autocomplete__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.32, .72, 0, 1);--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.25s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.autocomplete__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.autocomplete__popover[data-exiting=true],.autocomplete__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.autocomplete__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.autocomplete__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.autocomplete__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.autocomplete__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.autocomplete__popover [data-slot=list-box]{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);max-height:320px;padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none;overflow-y:auto}.autocomplete__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.autocomplete__popover [data-slot=search-field]{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);--tw-outline-style:none;outline-style:none}.autocomplete__popover [data-slot=empty-state]{text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--overlay-foreground)}@supports (color:color-mix(in lab,red,red)){.autocomplete__popover [data-slot=empty-state]{color:color-mix(in oklab,var(--overlay-foreground) 60%,transparent)}}.autocomplete__popover-dialog,.autocomplete__popover-dialog:focus,.autocomplete__popover-dialog:focus-visible,.autocomplete__popover-dialog[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete--full-width,.autocomplete__trigger--full-width{width:100%}.autocomplete__clear-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);color:var(--muted);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);cursor:var(--cursor-interactive);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);background-color:#0000;flex-shrink:0;justify-content:center;align-self:center;align-items:center;margin-inline-end:0;display:inline-flex;position:relative}.autocomplete__clear-button:not([data-empty=true]){transition:opacity .15s var(--ease-smooth)}.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__clear-button[data-empty=true]{pointer-events:none;opacity:0}.autocomplete__clear-button [data-slot=autocomplete-clear-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(hover:hover){.autocomplete__clear-button:hover,.autocomplete__clear-button[data-hovered=true]{background-color:var(--default-hover)}}.autocomplete__clear-button:active,.autocomplete__clear-button[data-pressed=true]{transform:scale(.93)}.kbd{height:calc(var(--spacing) * 6);align-items:center;display:inline-flex}:where(.kbd>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * .5) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-x-reverse)))}.kbd{border-radius:calc(var(--radius) * 1);background-color:var(--default);padding-inline:calc(var(--spacing) * 2);text-align:center;font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;color:var(--muted)}:where(.kbd:where(:dir(rtl),[dir=rtl],[dir=rtl] *)>:not(:last-child)){--tw-space-x-reverse:1}.kbd{word-spacing:-.25rem}.kbd__abbr{justify-content:center;align-items:center;width:100%;height:100%;text-decoration:none;display:flex}.kbd__content{justify-content:center;align-items:center;display:flex}.kbd--light{background-color:#0000}.typography,.typography-prose{color:var(--foreground)}.typography-prose h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose p{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography-prose a{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--link);text-underline-offset:4px;text-decoration-line:underline}.typography-prose blockquote{margin-top:calc(var(--spacing) * 4);border-left-style:var(--tw-border-style);border-left-width:4px;border-color:var(--border);padding-left:calc(var(--spacing) * 4);color:var(--muted);font-style:italic}.typography-prose ul{margin-block:calc(var(--spacing) * 4);list-style-type:disc}:where(.typography-prose ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ul{padding-left:calc(var(--spacing) * 6)}.typography-prose ol{margin-block:calc(var(--spacing) * 4);list-style-type:decimal}:where(.typography-prose ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ol{padding-left:calc(var(--spacing) * 6)}.typography-prose li{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose hr{margin-block:calc(var(--spacing) * 8);border-color:var(--separator)}.typography-prose pre{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);background-color:var(--default);padding:calc(var(--spacing) * 4);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);overflow-x:auto}.typography-prose strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--foreground)}.typography-prose em{font-style:italic}.typography-prose img{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5)}.typography--h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--body{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography--body-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.typography--body-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.typography--code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography--align-start{text-align:left}.typography--align-start:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:right}.typography--align-center{text-align:center}.typography--align-end{text-align:right}.typography--align-end:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:left}.typography--align-justify{text-align:justify}.typography--color-default{color:var(--foreground)}.typography--color-muted{color:var(--muted)}.typography--truncate{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.typography--weight-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.typography--weight-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.typography--weight-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.typography--weight-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.scroll-shadow{--scroll-shadow-size:40px;--scroll-shadow-scrollbar-size:10px;position:relative}.scroll-shadow--vertical{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-y:auto}.scroll-shadow--horizontal{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-x:auto}.scroll-shadow--fade.scroll-shadow--vertical:where([data-top-scroll=true],[data-bottom-scroll=true],[data-top-bottom-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,100% 0;mask-repeat:no-repeat;mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%;-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,100% 0;-webkit-mask-repeat:no-repeat;-webkit-mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%}.scroll-shadow--fade.scroll-shadow--vertical[data-top-scroll=true]{--scroll-linear-gradient:0deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-bottom-scroll=true]{--scroll-linear-gradient:180deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-top-bottom-scroll=true]{--scroll-linear-gradient:#000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal:where([data-left-scroll=true],[data-right-scroll=true],[data-left-right-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,0 100%;mask-repeat:no-repeat;mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,0 100%;-webkit-mask-repeat:no-repeat;-webkit-mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size)}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-scroll=true]{--scroll-linear-gradient:270deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-right-scroll=true]{--scroll-linear-gradient:90deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-right-scroll=true]{--scroll-linear-gradient:to right, #000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--hide-scrollbar{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;--scroll-shadow-scrollbar-size:0px}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{inset-inline:0}.inset-y-0{inset-block:0}.top-0{top:0}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.-right-3{right:calc(var(--spacing) * -3)}.right-0{right:0}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-0{left:0}.left-1\/2{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing) * -1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:var(--spacing)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-12{height:calc(var(--spacing) * 12)}.h-64{height:calc(var(--spacing) * 64)}.h-\[90px\]{height:90px}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:0}.min-h-full{min-height:100%}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-20{width:calc(var(--spacing) * 20)}.w-28{width:calc(var(--spacing) * 28)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-\[17rem\]{width:17rem}.w-\[calc\(100\%-2rem\)\]{width:calc(100% - 2rem)}.w-\[n\%\]{width:n%}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-44{max-width:calc(var(--spacing) * 44)}.max-w-\[1800px\]{max-width:1800px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-\[140px\]{min-width:140px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing) * 5);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-crosshair{cursor:crosshair}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y:pan-y;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.scrollbar{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter)}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--otari-line\)\]>:not(:last-child)){border-color:var(--otari-line)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:calc(var(--radius) * 1)}.rounded-md{border-radius:calc(var(--radius) * .75)}.rounded-sm{border-radius:calc(var(--radius) * .5)}.rounded-xl{border-radius:calc(var(--radius) * 1.5)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-\[\#c2843a\]{border-color:#c2843a}.border-\[var\(--otari-brand\)\]{border-color:var(--otari-brand)}.border-\[var\(--otari-line\)\]{border-color:var(--otari-line)}.border-amber-200{border-color:var(--color-amber-200)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-red-500{border-left-color:var(--color-red-500)}.bg-\[var\(--otari-bg\)\]{background-color:var(--otari-bg)}.bg-\[var\(--otari-brand\)\],.bg-\[var\(--otari-brand\)\]\/40{background-color:var(--otari-brand)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--otari-brand\)\]\/40{background-color:color-mix(in oklab,var(--otari-brand) 40%,transparent)}}.bg-\[var\(--otari-brand-tint\)\]{background-color:var(--otari-brand-tint)}.bg-\[var\(--otari-line\)\]{background-color:var(--otari-line)}.bg-\[var\(--otari-surface\)\]{background-color:var(--otari-surface)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-500{background-color:var(--color-green-500)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1{padding-bottom:var(--spacing)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#b45309\]{color:#b45309}.text-\[var\(--otari-brand-dark\)\]{color:var(--otari-brand-dark)}.text-\[var\(--otari-ink\)\]{color:var(--otari-ink)}.text-\[var\(--otari-muted\)\]{color:var(--otari-muted)}.text-amber-400{color:var(--color-amber-400)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-emerald-700{color:var(--color-emerald-700)}.text-green-700{color:var(--color-green-700)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.accent-\[var\(--otari-brand\)\]{accent-color:var(--otari-brand)}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.running{animation-play-state:running}.zoom-out{--tw-exit-scale:0}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-data-\[focus-visible\]\:outline-2:is(:where(.group)[data-focus-visible] *){outline-style:var(--tw-outline-style);outline-width:2px}.group-data-\[focus-visible\]\:outline-\[var\(--otari-brand\)\]:is(:where(.group)[data-focus-visible] *){outline-color:var(--otari-brand)}@media(hover:hover){.hover\:border-\[var\(--otari-brand\)\]:hover{border-color:var(--otari-brand)}.hover\:bg-\[var\(--otari-bg\)\]:hover{background-color:var(--otari-bg)}.hover\:bg-\[var\(--otari-brand\)\]:hover,.hover\:bg-\[var\(--otari-brand\)\]\/60:hover{background-color:var(--otari-brand)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--otari-brand\)\]\/60:hover{background-color:color-mix(in oklab,var(--otari-brand) 60%,transparent)}}.hover\:bg-\[var\(--otari-line\)\]:hover{background-color:var(--otari-line)}.hover\:text-\[var\(--otari-brand\)\]:hover{color:var(--otari-brand)}.hover\:text-\[var\(--otari-brand-dark\)\]:hover{color:var(--otari-brand-dark)}.hover\:text-\[var\(--otari-ink\)\]:hover{color:var(--otari-ink)}.hover\:text-amber-950:hover{color:var(--color-amber-950)}.hover\:text-red-700:hover{color:var(--color-red-700)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:not-sr-only:focus{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.focus\:absolute:focus{position:absolute}.focus\:top-3:focus{top:calc(var(--spacing) * 3)}.focus\:left-3:focus{left:calc(var(--spacing) * 3)}.focus\:z-50:focus{z-index:50}.focus\:rounded-lg:focus{border-radius:calc(var(--radius) * 1)}.focus\:border:focus{border-style:var(--tw-border-style);border-width:1px}.focus\:border-\[var\(--otari-brand\)\]:focus{border-color:var(--otari-brand)}.focus\:bg-\[var\(--otari-surface\)\]:focus{background-color:var(--otari-surface)}.focus\:px-4:focus{padding-inline:calc(var(--spacing) * 4)}.focus\:py-2:focus{padding-block:calc(var(--spacing) * 2)}.focus\:text-sm:focus{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.focus\:font-medium:focus{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.focus\:text-\[var\(--otari-brand-dark\)\]:focus{color:var(--otari-brand-dark)}.focus\:shadow-md:focus{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:bg-\[var\(--otari-brand\)\]:focus-visible{background-color:var(--otari-brand)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[var\(--otari-brand\)\]:focus-visible{--tw-ring-color:var(--otari-brand)}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-start-1{grid-column-start:1}.sm\:col-start-2{grid-column-start:2}.sm\:col-start-3{grid-column-start:3}.sm\:inline{display:inline}.sm\:w-28{width:calc(var(--spacing) * 28)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[minmax\(0\,1fr\)_16rem_10rem\]{grid-template-columns:minmax(0,1fr) 16rem 10rem}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-self-end{justify-self:flex-end}.sm\:justify-self-start{justify-self:flex-start}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}@media(min-width:48rem){.md\:flex{display:flex}.md\:hidden{display:none}.md\:px-6{padding-inline:calc(var(--spacing) * 6)}.md\:py-6{padding-block:calc(var(--spacing) * 6)}}@media(min-width:64rem){.lg\:sticky{position:sticky}.lg\:top-4{top:calc(var(--spacing) * 4)}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_360px\]{grid-template-columns:minmax(0,1fr) 360px}.lg\:items-start{align-items:flex-start}}@media(min-width:80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--otari-brand:#4e8295;--otari-brand-dark:#3c6678;--otari-brand-soft:#8fb2bf;--otari-brand-tint:#eaf1f3;--otari-ink:#14242c;--otari-muted:#5b6b73;--otari-line:#dbe5e8;--otari-surface:#fff;--otari-bg:#f6f9fa;--otari-cat-1:#08899f;--otari-cat-2:#b76522;--otari-cat-3:#8560ac;--otari-cat-4:#47a34e;--otari-cat-5:#9d486c;--otari-cat-6:#0871c1;--otari-cat-7:#a9912b;--otari-cat-8:#a64450;--otari-cat-other:#8b969b;--otari-danger:#dc2626;--otari-code-ink:#e8eef0}.otari-table.table-root{background-color:var(--otari-surface);border:1px solid var(--otari-line);border-radius:.75rem;padding:0;overflow:hidden}.otari-table .table__header{background-color:var(--otari-brand-tint);border-bottom:1px solid var(--otari-line)}.otari-table .table__column,.otari-table [role=row]>[role=presentation]:first-of-type>.table__column,.otari-table [role=row]>[role=presentation]:last-of-type>.table__column{color:var(--otari-ink);background-color:#0000;border-radius:0;font-weight:600}.otari-table .table__column:after{content:none}.otari-table .table__row .table__cell{border-color:var(--otari-line)}.otari-table .table__row:hover .table__cell{background-color:var(--otari-bg)}.otari-table .otari-detail-row>td{border-bottom:1px solid var(--otari-line);background-color:var(--otari-bg);padding:0}.otari-table .otari-detail-opening .table__cell{background-color:var(--otari-brand-tint)}.otari-detail-reveal{grid-template-rows:0fr;animation:.18s ease-out forwards otari-detail-open;display:grid}.otari-detail-reveal>div{overflow:hidden}@keyframes otari-detail-open{0%{opacity:.5;grid-template-rows:0fr}to{opacity:1;grid-template-rows:1fr}}.otari-bulk-bar{animation:.16s ease-out otari-bulk-bar-in}@keyframes otari-bulk-bar-in{0%{opacity:0;transform:translate(-50%,.5rem)}to{opacity:1;transform:translate(-50%)}}@media(prefers-reduced-motion:reduce){.otari-detail-reveal{grid-template-rows:1fr;animation:none}.otari-bulk-bar{animation:none}}.otari-markdown{color:var(--otari-ink);font-size:.875rem;line-height:1.65}.otari-markdown>:first-child{margin-top:0}.otari-markdown h1,.otari-markdown h2,.otari-markdown h3,.otari-markdown h4{color:var(--otari-ink);font-weight:600;line-height:1.3}.otari-markdown h1{margin:2rem 0 .75rem;font-size:1.5rem}.otari-markdown h2{border-bottom:1px solid var(--otari-line);margin:2rem 0 .5rem;padding-bottom:.3rem;font-size:1.25rem}.otari-markdown h3{margin:1.5rem 0 .5rem;font-size:1.05rem}.otari-markdown h4{margin:1.25rem 0 .25rem;font-size:.95rem}.otari-markdown p{margin:.75rem 0}.otari-markdown a{color:var(--otari-brand-dark);text-underline-offset:2px;text-decoration:underline}.otari-markdown a:hover{text-decoration-thickness:2px}.otari-markdown ul,.otari-markdown ol{margin:.75rem 0;padding-left:1.5rem}.otari-markdown ul{list-style:outside}.otari-markdown ol{list-style:decimal}.otari-markdown li,.otari-markdown li>ul,.otari-markdown li>ol{margin:.25rem 0}.otari-markdown code{background-color:var(--otari-brand-tint);color:var(--otari-brand-dark);border-radius:.35rem;padding:.1rem .35rem;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,monospace;font-size:.85em}.otari-markdown pre{background-color:var(--otari-ink);border-radius:.6rem;margin:1rem 0;padding:.85rem 1rem;overflow-x:auto}.otari-markdown pre code{color:var(--otari-code-ink);background-color:#0000;border-radius:0;padding:0;font-size:.82rem;line-height:1.55}.otari-markdown blockquote{border-left:3px solid var(--otari-brand);color:var(--otari-muted);margin:1rem 0;padding:.25rem 0 .25rem 1rem}.otari-markdown hr{border:0;border-top:1px solid var(--otari-line);margin:1.5rem 0}.otari-markdown-scroll{max-width:100%;margin:1rem 0;overflow-x:auto}.otari-markdown table{border-collapse:collapse;font-size:.85rem}.otari-markdown th,.otari-markdown td{border:1px solid var(--otari-line);text-align:left;vertical-align:top;padding:.4rem .7rem}.otari-markdown th{background-color:var(--otari-brand-tint);color:var(--otari-ink);font-weight:600}.otari-markdown tbody tr:hover td,.otari-markdown tr:hover td{background-color:var(--otari-bg)}html,body,#root{height:100%}body{background-color:var(--otari-bg);color:var(--otari-ink);margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}@keyframes caret-blink{0%,70%,to{opacity:1}20%,50%{opacity:0}}@keyframes skeleton{to{transform:translate(200%)}} diff --git a/src/gateway/static/dashboard/assets/index-Dhxz7Eyv.js b/src/gateway/static/dashboard/assets/index-Dhxz7Eyv.js new file mode 100644 index 000000000..ec06f4b5e --- /dev/null +++ b/src/gateway/static/dashboard/assets/index-Dhxz7Eyv.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-BSXD7oi2.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/charts-BI8Uczg4.js","assets/recharts-BwTTRGtj.js","assets/heroui-DZj66Arc.js","assets/tableSelection-CojkFPwd.js","assets/ConfirmDialog-DawcDVEg.js","assets/DataTable-CrQq0sYf.js","assets/FilterChips-BlzD0qFP.js","assets/TablePagination-BYC0DnfO.js","assets/AliasesPage-DFSg4QUS.js","assets/Field-DEJ6Wjg9.js","assets/UserComboBox-nt7pHfqn.js","assets/BudgetsPage-CnOzEeql.js","assets/DocsPage-CgRlIVtI.js","assets/KeysPage-HexHbKWR.js","assets/ModelScopeControl-Bs976Tb8.js","assets/ModelsPage-Cwjl8fM-.js","assets/OverviewPage-C0SW-na1.js","assets/ProvidersPage-17Tj43ca.js","assets/SettingsPage-CY71vadM.js","assets/ToolsGuardrailsPage-D_8zOvld.js","assets/UsagePage-r45FObnV.js","assets/UsersPage-DJTKoEIl.js"])))=>i.map(i=>d[i]); +var Ie=Object.defineProperty;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>qe(e,typeof t!="symbol"?t+"":t,r);import{u as g,j as n,a as p,b as x,k as z,Q as Re,c as Oe}from"./tanstack-query-1t81HyiD.js";import{d as Me,r as o,N as ee,L as Fe,O as Ue,H as Ke,e as Be,f as j,h as $e}from"./react-dgEcD0HR.js";import{B as C,C as K,L as xe,I as ye,a as ze,b as Qe,d as I,S as Ve,c as T,T as We,e as He}from"./heroui-DZj66Arc.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ge=Me();const Je="modulepreload",Ye=function(e){return"/"+e},ue={},P=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let u=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(r.map(y=>{if(y=Ye(y),y in ue)return;ue[y]=!0;const h=y.endsWith(".css"),b=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Je,h||(m.as="script"),m.crossOrigin="",m.href=y,f&&m.setAttribute("nonce",f),document.head.appendChild(m),h)return new Promise((N,M)=>{m.addEventListener("load",N),m.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};class L extends Error{constructor(r,s){super(s);ce(this,"status");this.name="ApiError",this.status=r}}let B=null;function de(e){B=e}async function te(e){try{const t=await e.json();if(typeof t.detail=="string")return t.detail;if(t.detail!=null)return JSON.stringify(t.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Xe(e){let t;try{t=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(t.status===401||t.status===403)return!1;if(!t.ok)throw new L(t.status,await te(t));return!0}async function Ze(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function l(e,t={}){const r=new Headers(t.headers);r.set("Accept","application/json"),t.body!=null&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let s;try{s=await fetch(e,{...t,headers:r})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(s.status===401||s.status===403)throw B==null||B(),new L(s.status,await te(s));if(!s.ok)throw new L(s.status,await te(s));if(s.status!==204)return await s.json()}const ne="otari.dashboard.hasSession",ve=o.createContext(null);function et(){try{return window.localStorage.getItem(ne)==="1"}catch{return!1}}function tt({children:e}){const t=g(),[r,s]=o.useState(et),a=o.useCallback(()=>{Ze(),s(!1),t.clear();try{window.localStorage.removeItem(ne)}catch{}},[t]),i=o.useCallback(()=>{t.clear(),s(!0);try{window.localStorage.setItem(ne,"1")}catch{}},[t]);o.useEffect(()=>(de(a),()=>de(null)),[a]);const u=o.useMemo(()=>({isAuthenticated:r,login:i,logout:a}),[r,i,a]);return n.jsx(ve.Provider,{value:u,children:e})}function re(){const e=o.useContext(ve);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function nt(e){return e instanceof L&&e.status===0}function rt(){const e=g(),[t,r]=o.useState(!1);return o.useEffect(()=>{const s=e.getQueryCache(),a=()=>s.getAll().some(i=>i.state.status==="error"&&nt(i.state.error));return r(a()),s.subscribe(()=>r(a()))},[e]),t}function st(){return rt()?n.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const Q=3600,_=86400,at=365*_,dn=[{key:"1h",label:"Last hour",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"90d",label:"90d",seconds:90*_,bucket:"day"},{key:"12mo",label:"12mo",seconds:at,bucket:"day"}],mn="30d",fn=[{key:"1h",label:"1h",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"all",label:"All",seconds:null,bucket:"day"}],hn="24h",xn="custom";function yn(e,t){return e.find(r=>r.key===t)}function it(e,t=Date.now()){return new Date(t-e*1e3).toISOString()}function ot(e){return(e==="hour"?Q:_)*1e3}function vn(e,t,r=Date.now()){const s=new Date(e).getTime();return(t?new Date(t).getTime():r)-s<=_*1e3?"hour":"day"}function gn(e,t,r,s){if(e.length===0)return null;const a=Math.max(0,Math.min(t,r)),i=Math.min(e.length-1,Math.max(t,r)),u=new Date(e[a]).getTime(),d=new Date(e[i]).getTime()+ot(s);return{startIso:new Date(u).toISOString(),endIso:new Date(d).toISOString()}}function pn(e,t,r){const s=e.length;if(s===0)return{startIndex:0,endIndex:0};const a=e.map(d=>new Date(d).getTime());let i=0;if(t){const d=new Date(t).getTime();for(let f=0;fl("/v1/models"),staleTime:6e4})}function dt(){return p({queryKey:[ct],queryFn:()=>l("/dashboard-build.json"),refetchInterval:ut,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function jn(){return p({queryKey:[ae],queryFn:()=>l("/v1/models/discoverable"),staleTime:5*6e4})}function Sn(){return p({queryKey:[ie],queryFn:()=>l("/v1/providers"),staleTime:5*6e4})}function kn(){return p({queryKey:["provider-catalog"],queryFn:()=>l("/v1/providers/catalog"),staleTime:1/0})}function En(e){return p({queryKey:["provider-catalog",e],queryFn:()=>l(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Pn(){return p({queryKey:[oe],queryFn:()=>l("/v1/providers/health"),staleTime:me,refetchInterval:me})}function Nn(){const e=g();return x({mutationFn:()=>l("/v1/providers/health?refresh=true"),onSuccess:t=>e.setQueryData([oe],t)})}function Cn(){return p({queryKey:[be],queryFn:()=>l("/v1/provider-credentials"),staleTime:6e4})}function W(e){e.invalidateQueries({queryKey:[be]}),e.invalidateQueries({queryKey:[ie]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]}),e.invalidateQueries({queryKey:[oe]})}function Tn(){const e=g();return x({mutationFn:t=>l("/v1/provider-credentials",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>W(e)})}function _n(){const e=g();return x({mutationFn:({instance:t,body:r})=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>W(e)})}function Ln(){const e=g();return x({mutationFn:t=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>W(e)})}function Dn(){const e=g();return x({mutationFn:()=>l("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>W(e)})}function An(){return x({mutationFn:e=>l(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function In(){return x({mutationFn:e=>l("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function qn(){return p({queryKey:[lt],queryFn:()=>l("/v1/models/metadata"),staleTime:10*6e4})}function Rn(){return p({queryKey:[se],queryFn:()=>l("/v1/aliases"),staleTime:6e4})}function On(){const e=g();return x({mutationFn:t=>l("/v1/aliases",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function Mn(){const e=g();return x({mutationFn:({name:t,userId:r})=>{const s=r==null?"":`?user_id=${encodeURIComponent(r)}`;return l(`/v1/aliases/${encodeURIComponent(t)}${s}`,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function mt(){return p({queryKey:[ge],queryFn:()=>l("/v1/settings"),staleTime:6e4})}function ft(){const e=g();return x({mutationFn:t=>l("/v1/settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([ge],t),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]})}})}function Fn(){return x({mutationFn:()=>l("/v1/settings/master-key/rotate",{method:"POST"})})}function Un(){return p({queryKey:[pe],queryFn:()=>l("/v1/tool-settings"),staleTime:6e4})}function Kn(){const e=g();return x({mutationFn:t=>l("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([pe],t)}})}function Bn(){return x({mutationFn:({service:e,url:t})=>l(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:t})})})}const G=1e3,ht=100;async function xt(){const e=[];for(let t=0;tl("/v1/pricing",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Qn(){const e=g();return x({mutationFn:t=>l(`/v1/pricing/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Vn(){return x({mutationFn:()=>l("/v1/pricing/refresh",{method:"POST"})})}function Wn(){const e=g();return x({mutationFn:()=>l("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ie]})}})}function Hn(){return x({mutationFn:()=>l("/v1/pricing/refresh/reject",{method:"POST"})})}const J=1e3,yt=100;async function vt(){const e=[];for(let t=0;tl("/v1/keys",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Yn(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Xn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Zn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}const Y=1e3,gt=100;async function pt(){const e=[];for(let t=0;tl(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function nr(){const e=g();return x({mutationFn:t=>l("/v1/budgets",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function rr(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function sr(){const e=g();return x({mutationFn:t=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}const X=1e3,bt=100;async function wt(){const e=[];for(let t=0;tl("/v1/users",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>le(e)})}function or(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>le(e)})}function lr(){const e=g();return x({mutationFn:t=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{le(e),e.invalidateQueries({queryKey:[R]})}})}function U(e){const t=new URLSearchParams;return e.start_date&&t.set("start_date",e.start_date),e.end_date&&t.set("end_date",e.end_date),e.status&&t.set("status",e.status),e.model&&t.set("model",e.model),e.endpoint&&t.set("endpoint",e.endpoint),e.user_id&&t.set("user_id",e.user_id),e.api_key_id&&t.set("api_key_id",e.api_key_id),e.source&&t.set("source",e.source),e.priced!==void 0&&t.set("priced",String(e.priced)),e.counts_toward_budget!==void 0&&t.set("counts_toward_budget",String(e.counts_toward_budget)),t}function cr(e,t,r){return p({queryKey:[q,"list",e,t,r],queryFn:()=>{const s=U(e);return s.set("skip",String(t*r)),s.set("limit",String(r)),l(`/v1/usage?${s.toString()}`)},placeholderData:z,staleTime:1e4})}function ur(e,t=!0){return p({queryKey:[q,"count",e],queryFn:()=>l(`/v1/usage/count?${U(e).toString()}`),enabled:t,placeholderData:z,staleTime:1e4})}const jt=6e4;function St(e,t=!0){return p({queryKey:[q,"count","failures",e],queryFn:()=>{const r={status:"error",source:"gateway",start_date:it(e)};return l(`/v1/usage/count?${U(r).toString()}`)},enabled:t,refetchInterval:jt,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function dr(){const e=g();return x({mutationFn:t=>l("/v1/usage",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}function mr(){const e=g();return x({mutationFn:t=>l("/v1/usage/set-price",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}function fr(e,t,r=!0){return p({queryKey:[q,"summary",e,t],queryFn:()=>{const s=U(e);return s.set("bucket",t),l(`/v1/usage/summary?${s.toString()}`)},enabled:r,placeholderData:z,staleTime:3e4})}function hr(e,t,r,s=!0){return p({queryKey:[q,"series",e,t,r],queryFn:()=>{const a=U(e);return a.set("bucket",t),a.set("group_by",r),l(`/v1/usage/series?${a.toString()}`)},enabled:s&&r!==null,placeholderData:z,staleTime:3e4})}function xr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function yr(e){if(e==null)return"$0.00";const t=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}function vr(e){if(e==null)return"—";if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){const t=Math.round(e/1e3);return t>=1e3?"1M":`${t}K`}return String(e)}const kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function gr(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})/.exec(e);if(!t)return e;const r=Number(t[2])-1;return r<0||r>11?t[1]:`${kt[r]} ${t[1]}`}const Et=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function pr(e){return Et.format(e)}function br(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Pt(e){return`${(e*100).toFixed(1)}%`}function wr(e,t){return t===void 0||t===0?null:(e-t)/t}function Nt(e,t=Date.now()){if(!e)return"never";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const s=Math.round((t-r.getTime())/1e3),a=s<0,i=Math.abs(s),u=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let d=i,f="second";for(const[h,b]of u){if(f=h,d0?"▲":e<0?"▼":"•";return n.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t," ",Pt(Math.abs(e))," vs prev"]})}function Ct(e){return e instanceof L||e instanceof Error?e.message:"Something went wrong."}function Tt({error:e}){return e?n.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:Ct(e)}):null}function _t({tone:e="info",children:t}){const r=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return n.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${r}`,children:t})}function kr({title:e,description:t,action:r}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),r?n.jsx("div",{className:"flex flex-wrap gap-2",children:r}):null]})}function Lt(e){const[t,r]=o.useState(()=>Date.now());return o.useEffect(()=>{let s;const a=()=>{s===void 0&&(s=setInterval(()=>r(Date.now()),e))},i=()=>{s!==void 0&&(clearInterval(s),s=void 0)},u=()=>{r(Date.now()),document.visibilityState==="visible"?a():i()};return u(),document.addEventListener("visibilitychange",u),()=>{i(),document.removeEventListener("visibilitychange",u)}},[e]),t}function Er({onRefresh:e,isFetching:t=!1,updatedAt:r,label:s="Refresh"}){const a=Lt(15e3),i=r?Nt(new Date(r).toISOString(),a):null;return n.jsxs("span",{className:"inline-flex items-center gap-2",children:[i?n.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Updated ",i]}):null,n.jsx(C,{variant:"outline",size:"sm",isIconOnly:!0,isDisabled:t,onPress:e,"aria-label":s,children:n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`h-4 w-4 ${t?"animate-spin":""}`,"aria-hidden":"true",children:[n.jsx("path",{d:"M20 11a8 8 0 1 0-.5 4",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M20 4v5h-5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function Pr({title:e,description:t,actionLabel:r,onAction:s,isActionDisabled:a,children:i}){return n.jsx(I,{children:n.jsxs(I.Content,{className:"flex flex-col gap-4 p-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),i,r&&s?n.jsx("div",{children:n.jsx(C,{variant:"primary",isDisabled:a,onPress:s,children:r})}):null]})})}function Nr({label:e="Loading…"}){return n.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 px-4 py-10 text-sm text-[var(--otari-muted)]",children:[n.jsx(Ve,{size:"sm"}),n.jsx("span",{children:e})]})}function Cr({children:e,confirmLabel:t,onConfirm:r,isPending:s}){const[a,i]=o.useState(!1);return a?n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(C,{size:"sm",variant:"danger",isDisabled:s,onPress:r,children:t}),n.jsx(C,{size:"sm",variant:"ghost",isDisabled:s,onPress:()=>i(!1),children:"Cancel"})]}):n.jsx(C,{size:"sm",variant:"danger-soft",onPress:()=>i(!0),children:e})}const Dt="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Tr({id:e,label:t,ariaLabel:r,value:s,onChange:a,options:i,children:u,disabled:d}){const f=o.useId(),y=e??(t?f:void 0),h=n.jsx("select",{id:y,"aria-label":t?void 0:r,value:s,disabled:d,onChange:b=>a(b.target.value),className:Dt,children:i?i.map(b=>n.jsx("option",{value:b.value,children:b.label},b.value)):u});return t?n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),h]}):h}function _r({label:e,value:t,onChange:r,options:s,placeholder:a,maxVisible:i=50,allowsCustom:u=!1}){const d=m=>{var N;return((N=s.find(M=>M.value===m))==null?void 0:N.label)??m},[f,y]=o.useState(()=>d(t));o.useEffect(()=>{y(d(t))},[t]);const h=f.trim().toLowerCase(),b=s.filter(m=>!h||m.value.toLowerCase().includes(h)||m.label.toLowerCase().includes(h)).slice(0,i);return n.jsxs(K.Root,{allowsEmptyCollection:!0,allowsCustomValue:u,menuTrigger:"focus",inputValue:f,onInputChange:m=>{y(m),u?r(m.trim()):m.trim()===""&&r("")},onSelectionChange:m=>{m!=null&&r(String(m))},className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),n.jsxs(K.InputGroup,{children:[n.jsx(ye,{placeholder:a,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),n.jsx(K.Trigger,{})]}),n.jsx(K.Popover,{children:n.jsx(ze,{items:b,className:"max-h-72 overflow-auto",children:m=>n.jsx(Qe,{id:m.value,textValue:m.label,children:m.label})})})]})}function At(){var f,y;const e=mt(),t=ft(),[r,s]=o.useState(!1),i=((f=e.data)==null?void 0:f.require_pricing)===!0&&e.data.default_pricing===!1&&!r,d=((y=St(Q,i).data)==null?void 0:y.total)??0;return i?n.jsx("div",{className:"shrink-0 px-6 pt-3",children:n.jsx(_t,{tone:"warning",children:n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("span",{children:["Requests are rejected until pricing is set (",n.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away.",d>0?n.jsxs(n.Fragment,{children:[" ",n.jsxs("strong",{className:"font-semibold",children:[d.toLocaleString()," ",d===1?"request":"requests"," failed in the last hour."]})," ",n.jsx(Fe,{to:"/activity?status=error&range=1h&source=gateway",className:"underline underline-offset-2",children:"View failed requests"})]}):null]}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(C,{size:"sm",variant:"primary",isDisabled:t.isPending,onPress:()=>t.mutate({default_pricing:!0}),children:t.isPending?"Enabling…":"Enable default pricing"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Dismiss"})]})]})})}):null}function It(){const{data:e}=dt(),t=o.useRef(null);return e&&t.current===null&&(t.current=e.build),e!=null&&t.current!=null&&e.build!==t.current}function qt(){const e=It(),[t,r]=o.useState(!1);return!e||t?null:n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:n.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),n.jsx(C,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>r(!0),children:"Later"})]})})}const je=200,Se=480,Z=240,Rt=60,ke="otari.dashboard.sidebarWidth",Ee="otari.dashboard.sidebarCollapsed",he=16,Pe="(max-width: 767px)",$=e=>Math.min(Se,Math.max(je,e));function Ot(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(Pe).matches}const Mt='a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ft(e){return e?Array.from(e.querySelectorAll(Mt)).filter(t=>t.offsetParent!==null||t===document.activeElement):[]}function Ut(){if(typeof window>"u")return Z;try{const e=window.localStorage.getItem(ke),t=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(t)?Z:$(t)}catch{return Z}}function Kt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ee)==="1"}catch{return!1}}const Bt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],$t=[{to:"/",section:"home",label:"Overview",end:!0,icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),n.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),n.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),n.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),n.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function zt(){const{logout:e}=re(),t=o.useRef(null),r=o.useRef(null),s=o.useRef(null),[a,i]=o.useState(Ut),[u,d]=o.useState(Kt),[f,y]=o.useState(!1),[h,b]=o.useState(Ot),[m,N]=o.useState(!1);o.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const c=window.matchMedia(Pe),v=w=>{b(w.matches),w.matches||N(!1)};return typeof c.addEventListener=="function"?(c.addEventListener("change",v),()=>c.removeEventListener("change",v)):(c.addListener(v),()=>c.removeListener(v))},[]),o.useEffect(()=>{if(!m)return;const c=v=>{v.key==="Escape"&&N(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[m]),o.useEffect(()=>{var c,v,w;h&&(m?(c=t.current)==null||c.focus():(v=t.current)!=null&&v.contains(document.activeElement)&&((w=s.current)==null||w.focus()))},[h,m]);const M=o.useCallback(c=>{if(c.key!=="Tab")return;const v=Ft(t.current);if(v.length===0)return;const w=v[0],k=v[v.length-1],F=document.activeElement;c.shiftKey&&(F===w||F===t.current)?(c.preventDefault(),k.focus()):!c.shiftKey&&F===k&&(c.preventDefault(),w.focus())},[]);o.useEffect(()=>{const c=window.setTimeout(()=>{try{window.localStorage.setItem(ke,String(Math.round(a)))}catch{}},200);return()=>window.clearTimeout(c)},[a]),o.useEffect(()=>{try{window.localStorage.setItem(Ee,u?"1":"0")}catch{}},[u]);const Ce=o.useCallback(c=>{c.preventDefault(),c.currentTarget.setPointerCapture(c.pointerId),y(!0)},[]),Te=o.useCallback(c=>{var w;if(!c.currentTarget.hasPointerCapture(c.pointerId))return;const v=((w=t.current)==null?void 0:w.getBoundingClientRect().left)??0;i($(c.clientX-v))},[]),_e=o.useCallback(c=>{c.currentTarget.hasPointerCapture(c.pointerId)&&c.currentTarget.releasePointerCapture(c.pointerId),y(!1)},[]),Le=o.useCallback(c=>{var v;c.preventDefault(),(v=r.current)==null||v.focus()},[]),De=o.useCallback(c=>{c.key==="ArrowLeft"?(c.preventDefault(),i(v=>$(v-he))):c.key==="ArrowRight"&&(c.preventDefault(),i(v=>$(v+he)))},[]),Ae=u?Rt:a,S=h?!1:u,H=h&&m?!0:void 0;return n.jsxs("div",{className:T("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[n.jsx("button",{type:"button",inert:H,onClick:Le,className:"sr-only focus:not-sr-only focus:absolute focus:top-3 focus:left-3 focus:z-50 focus:rounded-lg focus:border focus:border-[var(--otari-brand)] focus:bg-[var(--otari-surface)] focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-[var(--otari-brand-dark)] focus:shadow-md focus:outline-none",children:"Skip to main content"}),n.jsxs("header",{inert:H,className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("button",{type:"button",ref:s,onClick:()=>N(c=>!c),"aria-label":m?"Close navigation":"Open navigation","aria-expanded":m,"aria-controls":"app-sidebar",className:"-ml-1 flex h-8 w-8 items-center justify-center rounded-lg text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)] md:hidden",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5",children:n.jsx("path",{d:"M4 6h16M4 12h16M4 18h16",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),n.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),n.jsx(C,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),n.jsx(qt,{}),n.jsx(st,{}),n.jsx(At,{}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[h&&m?n.jsx("div",{"aria-hidden":"true",onClick:()=>N(!1),className:"fixed inset-0 z-30 bg-black/40 md:hidden"}):null,n.jsxs("aside",{ref:t,id:"app-sidebar",role:h?"dialog":void 0,"aria-modal":h&&m?!0:void 0,"aria-label":h?"Navigation":void 0,tabIndex:h?-1:void 0,inert:h&&!m?!0:void 0,onKeyDown:h&&m?M:void 0,style:h?void 0:{width:Ae},className:T("flex flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)] focus:outline-none",h?T("fixed inset-y-0 left-0 z-40 w-[17rem] shadow-xl transition-transform duration-200",m?"translate-x-0":"-translate-x-full"):T("relative shrink-0",!f&&"transition-[width] duration-150")),children:[n.jsx("button",{type:"button",onClick:()=>d(c=>!c),"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-pressed":u,title:u?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 hidden h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)] md:flex",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:T("h-3.5 w-3.5 transition-transform",u&&"rotate-180"),children:n.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("nav",{className:T("flex flex-col py-4",S?"px-2":"px-3"),children:Bt.map((c,v)=>{const w=$t.filter(k=>k.section===c.key);return w.length===0?null:n.jsxs("div",{className:v>0?"mt-4":void 0,children:[!S&&c.label?n.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:c.label}):null,v>0&&(S||!c.label)?n.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,n.jsx("div",{className:"flex flex-col gap-1",children:w.map(k=>n.jsxs(ee,{to:k.to,end:k.end,onClick:()=>N(!1),"aria-label":S?k.label:void 0,title:S?k.label:void 0,className:({isActive:F})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"justify-center px-0":"gap-3 px-3",F?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,S?null:k.label]},k.to))})]},c.key)})}),n.jsxs("div",{className:"mt-auto flex flex-col gap-1 pb-3",children:[n.jsxs(ee,{to:"/docs",onClick:()=>N(!1),"aria-label":S?"User guide":void 0,title:S?"User guide":void 0,className:({isActive:c})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"mx-2 justify-center px-0":"mx-3 gap-3 px-3",c?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[n.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.5V18c4 0 6.5.5 8 2 1.5-1.5 4-2 8-2V4.5c-4 0-6.5.5-8 2z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 6.5V20",strokeLinecap:"round"})]}),S?null:"User guide"]}),n.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai: the hosted Otari gateway",className:T("flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",S?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),S?null:n.jsxs("span",{className:"flex-1",children:["otari.ai ",n.jsx("span",{"aria-hidden":!0,children:"↗"})]})]})]}),u||h?null:n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(a),"aria-valuemin":je,"aria-valuemax":Se,tabIndex:0,onPointerDown:Ce,onPointerMove:Te,onPointerUp:_e,onKeyDown:De,className:T("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),n.jsx("main",{ref:r,id:"main-content",tabIndex:-1,inert:H,className:"flex-1 overflow-y-auto focus:outline-none",children:n.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-4 py-5 md:px-6 md:py-6",children:n.jsx(Ue,{})})})]})]})}function Qt(){const{login:e}=re(),[t,r]=o.useState(""),[s,a]=o.useState(null),[i,u]=o.useState(!1),d=async()=>{const f=t.trim();if(!(!f||i)){u(!0),a(null);try{await Xe(f)?e():a(new Error("Invalid master key."))}catch(y){a(y)}finally{u(!1)}}};return n.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:n.jsx(I,{className:"w-full max-w-md",children:n.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),n.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),d()},children:[n.jsxs(We,{value:t,onChange:f=>{r(f),s&&a(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),n.jsx(ye,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),n.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[n.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),n.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",n.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",n.jsx("code",{children:"Your master key:"})," (for example, run"," ",n.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),n.jsx(Tt,{error:s}),n.jsx(C,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!t.trim()||i,children:i?"Signing in…":"Sign in"})]}),n.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),n.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:n.jsx(He,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const Vt=o.lazy(async()=>({default:(await P(async()=>{const{ActivityPage:e}=await import("./ActivityPage-BSXD7oi2.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))).ActivityPage})),Wt=o.lazy(async()=>({default:(await P(async()=>{const{AliasesPage:e}=await import("./AliasesPage-DFSg4QUS.js");return{AliasesPage:e}},__vite__mapDeps([11,1,2,6,5,7,8,12,13]))).AliasesPage})),Ht=o.lazy(async()=>({default:(await P(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-CnOzEeql.js");return{BudgetsPage:e}},__vite__mapDeps([14,1,2,6,5,7,8,12]))).BudgetsPage})),Gt=o.lazy(async()=>({default:(await P(async()=>{const{DocsPage:e}=await import("./DocsPage-CgRlIVtI.js");return{DocsPage:e}},__vite__mapDeps([15,1,2,5]))).DocsPage})),Jt=o.lazy(async()=>({default:(await P(async()=>{const{KeysPage:e}=await import("./KeysPage-HexHbKWR.js");return{KeysPage:e}},__vite__mapDeps([16,1,2,6,5,7,8,12,17,13]))).KeysPage})),Yt=o.lazy(async()=>({default:(await P(async()=>{const{ModelsPage:e}=await import("./ModelsPage-Cwjl8fM-.js");return{ModelsPage:e}},__vite__mapDeps([18,1,2,6,5,8,10]))).ModelsPage})),Xt=o.lazy(async()=>({default:(await P(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-C0SW-na1.js");return{OverviewIndex:e}},__vite__mapDeps([19,1,2,3,4,5,8]))).OverviewIndex})),Zt=o.lazy(async()=>({default:(await P(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-17Tj43ca.js");return{ProvidersPage:e}},__vite__mapDeps([20,1,2,12,5,8]))).ProvidersPage})),en=o.lazy(async()=>({default:(await P(async()=>{const{SettingsPage:e}=await import("./SettingsPage-CY71vadM.js");return{SettingsPage:e}},__vite__mapDeps([21,1,2,5]))).SettingsPage})),tn=o.lazy(async()=>({default:(await P(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-D_8zOvld.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([22,1,2,5]))).ToolsGuardrailsPage})),nn=o.lazy(async()=>({default:(await P(async()=>{const{UsagePage:e}=await import("./UsagePage-r45FObnV.js");return{UsagePage:e}},__vite__mapDeps([23,1,2,3,4,5,8,9]))).UsagePage})),rn=o.lazy(async()=>({default:(await P(async()=>{const{UsersPage:e}=await import("./UsersPage-DJTKoEIl.js");return{UsersPage:e}},__vite__mapDeps([24,1,2,6,5,7,8,12,17]))).UsersPage}));function E(e){return n.jsx(o.Suspense,{fallback:n.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function sn(){const{isAuthenticated:e}=re();return e?n.jsx(Ke,{children:n.jsx(Be,{children:n.jsxs(j,{element:n.jsx(zt,{}),children:[n.jsx(j,{index:!0,element:E(n.jsx(Xt,{}))}),n.jsx(j,{path:"providers",element:E(n.jsx(Zt,{}))}),n.jsx(j,{path:"keys",element:E(n.jsx(Jt,{}))}),n.jsx(j,{path:"users",element:E(n.jsx(rn,{}))}),n.jsx(j,{path:"budgets",element:E(n.jsx(Ht,{}))}),n.jsx(j,{path:"activity",element:E(n.jsx(Vt,{}))}),n.jsx(j,{path:"usage",element:E(n.jsx(nn,{}))}),n.jsx(j,{path:"models",element:E(n.jsx(Yt,{}))}),n.jsx(j,{path:"aliases",element:E(n.jsx(Wt,{}))}),n.jsx(j,{path:"tools",element:E(n.jsx(tn,{}))}),n.jsx(j,{path:"settings",element:E(n.jsx(en,{}))}),n.jsx(j,{path:"docs",element:E(n.jsx(Gt,{}))}),n.jsx(j,{path:"*",element:n.jsx($e,{to:"/",replace:!0})})]})})}):n.jsx(Qt,{})}function an({children:e}){const[t]=o.useState(()=>new Re({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(r,s)=>s instanceof L&&(s.status===401||s.status===403)?!1:r<2}}}));return n.jsx(Oe,{client:t,children:n.jsx(tt,{children:e})})}const Ne=document.getElementById("root");if(!Ne)throw new Error("Root element #root not found");Ge.createRoot(Ne).render(n.jsx(o.StrictMode,{children:n.jsx(an,{children:n.jsx(sn,{})})}));export{wr as $,hn as A,Pr as B,xn as C,tr as D,Tt as E,Tr as F,Yn as G,Xn as H,_t as I,Zn as J,Jn as K,wn as L,$n as M,qn as N,zn as O,kr as P,vr as Q,Er as R,Qn as S,Ct as T,gr as U,mt as V,yr as W,Sn as X,at as Y,Nr as Z,Pn as _,ot as a,jr as a0,pr as a1,Sr as a2,xr as a3,Pt as a4,Nt as a5,Cn as a6,Ln as a7,An as a8,ft as a9,_n as aa,Nn as ab,Tn as ac,En as ad,kn as ae,In as af,Vn as ag,Wn as ah,Hn as ai,Fn as aj,Dn as ak,Un as al,Kn as am,Bn as an,hr as ao,mn as ap,dn as aq,br as ar,lr as as,ir as at,pn as b,Gn as c,cr as d,ur as e,bn as f,fr as g,yn as h,vn as i,dr as j,mr as k,fn as l,_r as m,it as n,jn as o,Rn as p,Mn as q,gn as r,Cr as s,On as t,ar as u,er as v,nr as w,rr as x,sr as y,or as z}; diff --git a/src/gateway/static/dashboard/assets/index-DsUY4UvK.js b/src/gateway/static/dashboard/assets/index-DsUY4UvK.js deleted file mode 100644 index 37fb1da7d..000000000 --- a/src/gateway/static/dashboard/assets/index-DsUY4UvK.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-VQgwkhn4.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/FilterChips-Dah6AI5Z.js","assets/heroui-BI50yK5B.js","assets/recharts-C4kRDmvS.js","assets/tableSelection-9hV37uhu.js","assets/ConfirmDialog-NCJIhH2z.js","assets/DataTable-Bmn_eYSV.js","assets/TablePagination-DgA36VXY.js","assets/AliasesPage-nuRqwFaK.js","assets/Field-Dwp6u3t8.js","assets/UserComboBox-a9wxf8eF.js","assets/BudgetsPage-_DPQrLj-.js","assets/DocsPage-LBlDxv2S.js","assets/KeysPage-C7uXJfSL.js","assets/ModelScopeControl-B4eI_pm-.js","assets/ModelsPage-Dgku-JK2.js","assets/OverviewPage-C5sP44tb.js","assets/charts-DIsd9m--.js","assets/ProvidersPage-CYSSSf8R.js","assets/SettingsPage-DaOqG5a9.js","assets/ToolsGuardrailsPage-B5j54QGf.js","assets/UsagePage-DQoRJkY3.js","assets/UsersPage-DUd7-214.js"])))=>i.map(i=>d[i]); -var Ie=Object.defineProperty;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>qe(e,typeof t!="symbol"?t+"":t,r);import{u as g,j as n,a as p,b as x,k as ne,Q as Re,c as Oe}from"./tanstack-query-1t81HyiD.js";import{d as Me,r as o,N as Z,L as Fe,O as Ue,H as Ke,e as Be,f as j,h as $e}from"./react-dgEcD0HR.js";import{B as C,C as U,L as xe,I as ye,a as ze,b as Qe,d as I,S as Ve,c as T,T as We,e as He}from"./heroui-BI50yK5B.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ge=Me();const Je="modulepreload",Ye=function(e){return"/"+e},ue={},P=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let u=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(r.map(y=>{if(y=Ye(y),y in ue)return;ue[y]=!0;const h=y.endsWith(".css"),b=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Je,h||(m.as="script"),m.crossOrigin="",m.href=y,f&&m.setAttribute("nonce",f),document.head.appendChild(m),h)return new Promise((N,M)=>{m.addEventListener("load",N),m.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};class L extends Error{constructor(r,s){super(s);ce(this,"status");this.name="ApiError",this.status=r}}let K=null;function de(e){K=e}async function ee(e){try{const t=await e.json();if(typeof t.detail=="string")return t.detail;if(t.detail!=null)return JSON.stringify(t.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Xe(e){let t;try{t=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(t.status===401||t.status===403)return!1;if(!t.ok)throw new L(t.status,await ee(t));return!0}async function Ze(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function c(e,t={}){const r=new Headers(t.headers);r.set("Accept","application/json"),t.body!=null&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let s;try{s=await fetch(e,{...t,headers:r})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(s.status===401||s.status===403)throw K==null||K(),new L(s.status,await ee(s));if(!s.ok)throw new L(s.status,await ee(s));if(s.status!==204)return await s.json()}const te="otari.dashboard.hasSession",ve=o.createContext(null);function et(){try{return window.localStorage.getItem(te)==="1"}catch{return!1}}function tt({children:e}){const t=g(),[r,s]=o.useState(et),a=o.useCallback(()=>{Ze(),s(!1),t.clear();try{window.localStorage.removeItem(te)}catch{}},[t]),i=o.useCallback(()=>{t.clear(),s(!0);try{window.localStorage.setItem(te,"1")}catch{}},[t]);o.useEffect(()=>(de(a),()=>de(null)),[a]);const u=o.useMemo(()=>({isAuthenticated:r,login:i,logout:a}),[r,i,a]);return n.jsx(ve.Provider,{value:u,children:e})}function re(){const e=o.useContext(ve);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function nt(e){return e instanceof L&&e.status===0}function rt(){const e=g(),[t,r]=o.useState(!1);return o.useEffect(()=>{const s=e.getQueryCache(),a=()=>s.getAll().some(i=>i.state.status==="error"&&nt(i.state.error));return r(a()),s.subscribe(()=>r(a()))},[e]),t}function st(){return rt()?n.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const $=3600,_=86400,at=365*_,dn=[{key:"1h",label:"Last hour",seconds:$,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"90d",label:"90d",seconds:90*_,bucket:"day"},{key:"12mo",label:"12mo",seconds:at,bucket:"day"}],mn="30d",fn=[{key:"1h",label:"1h",seconds:$,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"all",label:"All",seconds:null,bucket:"day"}],hn="24h",xn="custom";function yn(e,t){return e.find(r=>r.key===t)}function it(e,t=Date.now()){return new Date(t-e*1e3).toISOString()}function ot(e){return(e==="hour"?$:_)*1e3}function vn(e,t,r=Date.now()){const s=new Date(e).getTime();return(t?new Date(t).getTime():r)-s<=_*1e3?"hour":"day"}function gn(e,t,r,s){if(e.length===0)return null;const a=Math.max(0,Math.min(t,r)),i=Math.min(e.length-1,Math.max(t,r)),u=new Date(e[a]).getTime(),d=new Date(e[i]).getTime()+ot(s);return{startIso:new Date(u).toISOString(),endIso:new Date(d).toISOString()}}function pn(e,t,r){const s=e.length;if(s===0)return{startIndex:0,endIndex:0};const a=e.map(d=>new Date(d).getTime());let i=0;if(t){const d=new Date(t).getTime();for(let f=0;fc("/v1/models"),staleTime:6e4})}function dt(){return p({queryKey:[ct],queryFn:()=>c("/dashboard-build.json"),refetchInterval:ut,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function jn(){return p({queryKey:[ae],queryFn:()=>c("/v1/models/discoverable"),staleTime:5*6e4})}function Sn(){return p({queryKey:[ie],queryFn:()=>c("/v1/providers"),staleTime:5*6e4})}function kn(){return p({queryKey:["provider-catalog"],queryFn:()=>c("/v1/providers/catalog"),staleTime:1/0})}function En(e){return p({queryKey:["provider-catalog",e],queryFn:()=>c(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Pn(){return p({queryKey:[oe],queryFn:()=>c("/v1/providers/health"),staleTime:me,refetchInterval:me})}function Nn(){const e=g();return x({mutationFn:()=>c("/v1/providers/health?refresh=true"),onSuccess:t=>e.setQueryData([oe],t)})}function Cn(){return p({queryKey:[be],queryFn:()=>c("/v1/provider-credentials"),staleTime:6e4})}function Q(e){e.invalidateQueries({queryKey:[be]}),e.invalidateQueries({queryKey:[ie]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]}),e.invalidateQueries({queryKey:[oe]})}function Tn(){const e=g();return x({mutationFn:t=>c("/v1/provider-credentials",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>Q(e)})}function _n(){const e=g();return x({mutationFn:({instance:t,body:r})=>c(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>Q(e)})}function Ln(){const e=g();return x({mutationFn:t=>c(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>Q(e)})}function Dn(){const e=g();return x({mutationFn:()=>c("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>Q(e)})}function An(){return x({mutationFn:e=>c(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function In(){return x({mutationFn:e=>c("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function qn(){return p({queryKey:[lt],queryFn:()=>c("/v1/models/metadata"),staleTime:10*6e4})}function Rn(){return p({queryKey:[se],queryFn:()=>c("/v1/aliases"),staleTime:6e4})}function On(){const e=g();return x({mutationFn:t=>c("/v1/aliases",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function Mn(){const e=g();return x({mutationFn:({name:t,userId:r})=>{const s=r==null?"":`?user_id=${encodeURIComponent(r)}`;return c(`/v1/aliases/${encodeURIComponent(t)}${s}`,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function mt(){return p({queryKey:[ge],queryFn:()=>c("/v1/settings"),staleTime:6e4})}function ft(){const e=g();return x({mutationFn:t=>c("/v1/settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([ge],t),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]})}})}function Fn(){return x({mutationFn:()=>c("/v1/settings/master-key/rotate",{method:"POST"})})}function Un(){return p({queryKey:[pe],queryFn:()=>c("/v1/tool-settings"),staleTime:6e4})}function Kn(){const e=g();return x({mutationFn:t=>c("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([pe],t)}})}function Bn(){return x({mutationFn:({service:e,url:t})=>c(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:t})})})}const H=1e3,ht=100;async function xt(){const e=[];for(let t=0;tc("/v1/pricing",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]})}})}function Qn(){const e=g();return x({mutationFn:t=>c(`/v1/pricing/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]})}})}function Vn(){return x({mutationFn:()=>c("/v1/pricing/refresh",{method:"POST"})})}function Wn(){const e=g();return x({mutationFn:()=>c("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[z]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ie]})}})}function Hn(){return x({mutationFn:()=>c("/v1/pricing/refresh/reject",{method:"POST"})})}const G=1e3,yt=100;async function vt(){const e=[];for(let t=0;tc("/v1/keys",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Yn(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/keys/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Xn(){const e=g();return x({mutationFn:t=>c(`/v1/keys/${encodeURIComponent(t)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}function Zn(){const e=g();return x({mutationFn:t=>c(`/v1/keys/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[q]})})}const J=1e3,gt=100;async function pt(){const e=[];for(let t=0;tc(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function nr(){const e=g();return x({mutationFn:t=>c("/v1/budgets",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function rr(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/budgets/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function sr(){const e=g();return x({mutationFn:t=>c(`/v1/budgets/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}const Y=1e3,bt=100;async function wt(){const e=[];for(let t=0;tc("/v1/users",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>le(e)})}function or(){const e=g();return x({mutationFn:({id:t,body:r})=>c(`/v1/users/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>le(e)})}function lr(){const e=g();return x({mutationFn:t=>c(`/v1/users/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{le(e),e.invalidateQueries({queryKey:[q]})}})}function V(e){const t=new URLSearchParams;return e.start_date&&t.set("start_date",e.start_date),e.end_date&&t.set("end_date",e.end_date),e.status&&t.set("status",e.status),e.model&&t.set("model",e.model),e.endpoint&&t.set("endpoint",e.endpoint),e.user_id&&t.set("user_id",e.user_id),e.api_key_id&&t.set("api_key_id",e.api_key_id),e.source&&t.set("source",e.source),e.priced!==void 0&&t.set("priced",String(e.priced)),e.counts_toward_budget!==void 0&&t.set("counts_toward_budget",String(e.counts_toward_budget)),t}function cr(e,t,r){return p({queryKey:[O,"list",e,t,r],queryFn:()=>{const s=V(e);return s.set("skip",String(t*r)),s.set("limit",String(r)),c(`/v1/usage?${s.toString()}`)},placeholderData:ne,staleTime:1e4})}function ur(e,t=!0){return p({queryKey:[O,"count",e],queryFn:()=>c(`/v1/usage/count?${V(e).toString()}`),enabled:t,placeholderData:ne,staleTime:1e4})}const jt=6e4;function St(e,t=!0){return p({queryKey:[O,"count","failures",e],queryFn:()=>{const r={status:"error",source:"gateway",start_date:it(e)};return c(`/v1/usage/count?${V(r).toString()}`)},enabled:t,refetchInterval:jt,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function dr(){const e=g();return x({mutationFn:t=>c("/v1/usage",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]})}})}function mr(){const e=g();return x({mutationFn:t=>c("/v1/usage/set-price",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[O]})}})}function fr(e,t,r=!0){return p({queryKey:[O,"summary",e,t],queryFn:()=>{const s=V(e);return s.set("bucket",t),c(`/v1/usage/summary?${s.toString()}`)},enabled:r,placeholderData:ne,staleTime:3e4})}function hr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function xr(e){if(e==null)return"$0.00";const t=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}function yr(e){if(e==null)return"—";if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){const t=Math.round(e/1e3);return t>=1e3?"1M":`${t}K`}return String(e)}const kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function vr(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})/.exec(e);if(!t)return e;const r=Number(t[2])-1;return r<0||r>11?t[1]:`${kt[r]} ${t[1]}`}const Et=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function gr(e){return Et.format(e)}function pr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Pt(e){return`${(e*100).toFixed(1)}%`}function br(e,t){return t===void 0||t===0?null:(e-t)/t}function Nt(e,t=Date.now()){if(!e)return"never";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const s=Math.round((t-r.getTime())/1e3),a=s<0,i=Math.abs(s),u=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let d=i,f="second";for(const[h,b]of u){if(f=h,d0?"▲":e<0?"▼":"•";return n.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t," ",Pt(Math.abs(e))," vs prev"]})}function Ct(e){return e instanceof L||e instanceof Error?e.message:"Something went wrong."}function Tt({error:e}){return e?n.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:Ct(e)}):null}function _t({tone:e="info",children:t}){const r=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return n.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${r}`,children:t})}function Sr({title:e,description:t,action:r}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),r?n.jsx("div",{className:"flex flex-wrap gap-2",children:r}):null]})}function Lt(e){const[t,r]=o.useState(()=>Date.now());return o.useEffect(()=>{let s;const a=()=>{s===void 0&&(s=setInterval(()=>r(Date.now()),e))},i=()=>{s!==void 0&&(clearInterval(s),s=void 0)},u=()=>{r(Date.now()),document.visibilityState==="visible"?a():i()};return u(),document.addEventListener("visibilitychange",u),()=>{i(),document.removeEventListener("visibilitychange",u)}},[e]),t}function kr({onRefresh:e,isFetching:t=!1,updatedAt:r,label:s="Refresh"}){const a=Lt(15e3),i=r?Nt(new Date(r).toISOString(),a):null;return n.jsxs("span",{className:"inline-flex items-center gap-2",children:[i?n.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Updated ",i]}):null,n.jsx(C,{variant:"outline",size:"sm",isIconOnly:!0,isDisabled:t,onPress:e,"aria-label":s,children:n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`h-4 w-4 ${t?"animate-spin":""}`,"aria-hidden":"true",children:[n.jsx("path",{d:"M20 11a8 8 0 1 0-.5 4",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M20 4v5h-5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function Er({title:e,description:t,actionLabel:r,onAction:s,isActionDisabled:a,children:i}){return n.jsx(I,{children:n.jsxs(I.Content,{className:"flex flex-col gap-4 p-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),i,r&&s?n.jsx("div",{children:n.jsx(C,{variant:"primary",isDisabled:a,onPress:s,children:r})}):null]})})}function Pr({label:e="Loading…"}){return n.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 px-4 py-10 text-sm text-[var(--otari-muted)]",children:[n.jsx(Ve,{size:"sm"}),n.jsx("span",{children:e})]})}function Nr({children:e,confirmLabel:t,onConfirm:r,isPending:s}){const[a,i]=o.useState(!1);return a?n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(C,{size:"sm",variant:"danger",isDisabled:s,onPress:r,children:t}),n.jsx(C,{size:"sm",variant:"ghost",isDisabled:s,onPress:()=>i(!1),children:"Cancel"})]}):n.jsx(C,{size:"sm",variant:"danger-soft",onPress:()=>i(!0),children:e})}const Dt="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Cr({id:e,label:t,ariaLabel:r,value:s,onChange:a,options:i,children:u,disabled:d}){const f=o.useId(),y=e??(t?f:void 0),h=n.jsx("select",{id:y,"aria-label":t?void 0:r,value:s,disabled:d,onChange:b=>a(b.target.value),className:Dt,children:i?i.map(b=>n.jsx("option",{value:b.value,children:b.label},b.value)):u});return t?n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),h]}):h}function Tr({label:e,value:t,onChange:r,options:s,placeholder:a,maxVisible:i=50,allowsCustom:u=!1}){const d=m=>{var N;return((N=s.find(M=>M.value===m))==null?void 0:N.label)??m},[f,y]=o.useState(()=>d(t));o.useEffect(()=>{y(d(t))},[t]);const h=f.trim().toLowerCase(),b=s.filter(m=>!h||m.value.toLowerCase().includes(h)||m.label.toLowerCase().includes(h)).slice(0,i);return n.jsxs(U.Root,{allowsEmptyCollection:!0,allowsCustomValue:u,menuTrigger:"focus",inputValue:f,onInputChange:m=>{y(m),u?r(m.trim()):m.trim()===""&&r("")},onSelectionChange:m=>{m!=null&&r(String(m))},className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),n.jsxs(U.InputGroup,{children:[n.jsx(ye,{placeholder:a,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),n.jsx(U.Trigger,{})]}),n.jsx(U.Popover,{children:n.jsx(ze,{items:b,className:"max-h-72 overflow-auto",children:m=>n.jsx(Qe,{id:m.value,textValue:m.label,children:m.label})})})]})}function At(){var f,y;const e=mt(),t=ft(),[r,s]=o.useState(!1),i=((f=e.data)==null?void 0:f.require_pricing)===!0&&e.data.default_pricing===!1&&!r,d=((y=St($,i).data)==null?void 0:y.total)??0;return i?n.jsx("div",{className:"shrink-0 px-6 pt-3",children:n.jsx(_t,{tone:"warning",children:n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("span",{children:["Requests are rejected until pricing is set (",n.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away.",d>0?n.jsxs(n.Fragment,{children:[" ",n.jsxs("strong",{className:"font-semibold",children:[d.toLocaleString()," ",d===1?"request":"requests"," failed in the last hour."]})," ",n.jsx(Fe,{to:"/activity?status=error&range=1h&source=gateway",className:"underline underline-offset-2",children:"View failed requests"})]}):null]}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(C,{size:"sm",variant:"primary",isDisabled:t.isPending,onPress:()=>t.mutate({default_pricing:!0}),children:t.isPending?"Enabling…":"Enable default pricing"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Dismiss"})]})]})})}):null}function It(){const{data:e}=dt(),t=o.useRef(null);return e&&t.current===null&&(t.current=e.build),e!=null&&t.current!=null&&e.build!==t.current}function qt(){const e=It(),[t,r]=o.useState(!1);return!e||t?null:n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:n.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),n.jsx(C,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>r(!0),children:"Later"})]})})}const je=200,Se=480,X=240,Rt=60,ke="otari.dashboard.sidebarWidth",Ee="otari.dashboard.sidebarCollapsed",he=16,Pe="(max-width: 767px)",B=e=>Math.min(Se,Math.max(je,e));function Ot(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(Pe).matches}const Mt='a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ft(e){return e?Array.from(e.querySelectorAll(Mt)).filter(t=>t.offsetParent!==null||t===document.activeElement):[]}function Ut(){if(typeof window>"u")return X;try{const e=window.localStorage.getItem(ke),t=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(t)?X:B(t)}catch{return X}}function Kt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ee)==="1"}catch{return!1}}const Bt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],$t=[{to:"/",section:"home",label:"Overview",end:!0,icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),n.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),n.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),n.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),n.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function zt(){const{logout:e}=re(),t=o.useRef(null),r=o.useRef(null),s=o.useRef(null),[a,i]=o.useState(Ut),[u,d]=o.useState(Kt),[f,y]=o.useState(!1),[h,b]=o.useState(Ot),[m,N]=o.useState(!1);o.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const l=window.matchMedia(Pe),v=w=>{b(w.matches),w.matches||N(!1)};return typeof l.addEventListener=="function"?(l.addEventListener("change",v),()=>l.removeEventListener("change",v)):(l.addListener(v),()=>l.removeListener(v))},[]),o.useEffect(()=>{if(!m)return;const l=v=>{v.key==="Escape"&&N(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[m]),o.useEffect(()=>{var l,v,w;h&&(m?(l=t.current)==null||l.focus():(v=t.current)!=null&&v.contains(document.activeElement)&&((w=s.current)==null||w.focus()))},[h,m]);const M=o.useCallback(l=>{if(l.key!=="Tab")return;const v=Ft(t.current);if(v.length===0)return;const w=v[0],k=v[v.length-1],F=document.activeElement;l.shiftKey&&(F===w||F===t.current)?(l.preventDefault(),k.focus()):!l.shiftKey&&F===k&&(l.preventDefault(),w.focus())},[]);o.useEffect(()=>{const l=window.setTimeout(()=>{try{window.localStorage.setItem(ke,String(Math.round(a)))}catch{}},200);return()=>window.clearTimeout(l)},[a]),o.useEffect(()=>{try{window.localStorage.setItem(Ee,u?"1":"0")}catch{}},[u]);const Ce=o.useCallback(l=>{l.preventDefault(),l.currentTarget.setPointerCapture(l.pointerId),y(!0)},[]),Te=o.useCallback(l=>{var w;if(!l.currentTarget.hasPointerCapture(l.pointerId))return;const v=((w=t.current)==null?void 0:w.getBoundingClientRect().left)??0;i(B(l.clientX-v))},[]),_e=o.useCallback(l=>{l.currentTarget.hasPointerCapture(l.pointerId)&&l.currentTarget.releasePointerCapture(l.pointerId),y(!1)},[]),Le=o.useCallback(l=>{var v;l.preventDefault(),(v=r.current)==null||v.focus()},[]),De=o.useCallback(l=>{l.key==="ArrowLeft"?(l.preventDefault(),i(v=>B(v-he))):l.key==="ArrowRight"&&(l.preventDefault(),i(v=>B(v+he)))},[]),Ae=u?Rt:a,S=h?!1:u,W=h&&m?!0:void 0;return n.jsxs("div",{className:T("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[n.jsx("button",{type:"button",inert:W,onClick:Le,className:"sr-only focus:not-sr-only focus:absolute focus:top-3 focus:left-3 focus:z-50 focus:rounded-lg focus:border focus:border-[var(--otari-brand)] focus:bg-[var(--otari-surface)] focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-[var(--otari-brand-dark)] focus:shadow-md focus:outline-none",children:"Skip to main content"}),n.jsxs("header",{inert:W,className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("button",{type:"button",ref:s,onClick:()=>N(l=>!l),"aria-label":m?"Close navigation":"Open navigation","aria-expanded":m,"aria-controls":"app-sidebar",className:"-ml-1 flex h-8 w-8 items-center justify-center rounded-lg text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)] md:hidden",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5",children:n.jsx("path",{d:"M4 6h16M4 12h16M4 18h16",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),n.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),n.jsx(C,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),n.jsx(qt,{}),n.jsx(st,{}),n.jsx(At,{}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[h&&m?n.jsx("div",{"aria-hidden":"true",onClick:()=>N(!1),className:"fixed inset-0 z-30 bg-black/40 md:hidden"}):null,n.jsxs("aside",{ref:t,id:"app-sidebar",role:h?"dialog":void 0,"aria-modal":h&&m?!0:void 0,"aria-label":h?"Navigation":void 0,tabIndex:h?-1:void 0,inert:h&&!m?!0:void 0,onKeyDown:h&&m?M:void 0,style:h?void 0:{width:Ae},className:T("flex flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)] focus:outline-none",h?T("fixed inset-y-0 left-0 z-40 w-[17rem] shadow-xl transition-transform duration-200",m?"translate-x-0":"-translate-x-full"):T("relative shrink-0",!f&&"transition-[width] duration-150")),children:[n.jsx("button",{type:"button",onClick:()=>d(l=>!l),"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-pressed":u,title:u?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 hidden h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)] md:flex",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:T("h-3.5 w-3.5 transition-transform",u&&"rotate-180"),children:n.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("nav",{className:T("flex flex-col py-4",S?"px-2":"px-3"),children:Bt.map((l,v)=>{const w=$t.filter(k=>k.section===l.key);return w.length===0?null:n.jsxs("div",{className:v>0?"mt-4":void 0,children:[!S&&l.label?n.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:l.label}):null,v>0&&(S||!l.label)?n.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,n.jsx("div",{className:"flex flex-col gap-1",children:w.map(k=>n.jsxs(Z,{to:k.to,end:k.end,onClick:()=>N(!1),"aria-label":S?k.label:void 0,title:S?k.label:void 0,className:({isActive:F})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"justify-center px-0":"gap-3 px-3",F?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,S?null:k.label]},k.to))})]},l.key)})}),n.jsxs("div",{className:"mt-auto flex flex-col gap-1 pb-3",children:[n.jsxs(Z,{to:"/docs",onClick:()=>N(!1),"aria-label":S?"User guide":void 0,title:S?"User guide":void 0,className:({isActive:l})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"mx-2 justify-center px-0":"mx-3 gap-3 px-3",l?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[n.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.5V18c4 0 6.5.5 8 2 1.5-1.5 4-2 8-2V4.5c-4 0-6.5.5-8 2z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 6.5V20",strokeLinecap:"round"})]}),S?null:"User guide"]}),n.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai: the hosted Otari gateway",className:T("flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",S?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),S?null:n.jsxs("span",{className:"flex-1",children:["otari.ai ",n.jsx("span",{"aria-hidden":!0,children:"↗"})]})]})]}),u||h?null:n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(a),"aria-valuemin":je,"aria-valuemax":Se,tabIndex:0,onPointerDown:Ce,onPointerMove:Te,onPointerUp:_e,onKeyDown:De,className:T("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),n.jsx("main",{ref:r,id:"main-content",tabIndex:-1,inert:W,className:"flex-1 overflow-y-auto focus:outline-none",children:n.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-4 py-5 md:px-6 md:py-6",children:n.jsx(Ue,{})})})]})]})}function Qt(){const{login:e}=re(),[t,r]=o.useState(""),[s,a]=o.useState(null),[i,u]=o.useState(!1),d=async()=>{const f=t.trim();if(!(!f||i)){u(!0),a(null);try{await Xe(f)?e():a(new Error("Invalid master key."))}catch(y){a(y)}finally{u(!1)}}};return n.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:n.jsx(I,{className:"w-full max-w-md",children:n.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),n.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),d()},children:[n.jsxs(We,{value:t,onChange:f=>{r(f),s&&a(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),n.jsx(ye,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),n.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[n.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),n.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",n.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",n.jsx("code",{children:"Your master key:"})," (for example, run"," ",n.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),n.jsx(Tt,{error:s}),n.jsx(C,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!t.trim()||i,children:i?"Signing in…":"Sign in"})]}),n.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),n.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:n.jsx(He,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const Vt=o.lazy(async()=>({default:(await P(async()=>{const{ActivityPage:e}=await import("./ActivityPage-VQgwkhn4.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))).ActivityPage})),Wt=o.lazy(async()=>({default:(await P(async()=>{const{AliasesPage:e}=await import("./AliasesPage-nuRqwFaK.js");return{AliasesPage:e}},__vite__mapDeps([10,1,2,6,4,7,8,11,12]))).AliasesPage})),Ht=o.lazy(async()=>({default:(await P(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-_DPQrLj-.js");return{BudgetsPage:e}},__vite__mapDeps([13,1,2,6,4,7,8,11]))).BudgetsPage})),Gt=o.lazy(async()=>({default:(await P(async()=>{const{DocsPage:e}=await import("./DocsPage-LBlDxv2S.js");return{DocsPage:e}},__vite__mapDeps([14,1,2,4]))).DocsPage})),Jt=o.lazy(async()=>({default:(await P(async()=>{const{KeysPage:e}=await import("./KeysPage-C7uXJfSL.js");return{KeysPage:e}},__vite__mapDeps([15,1,2,6,4,7,8,11,16,12]))).KeysPage})),Yt=o.lazy(async()=>({default:(await P(async()=>{const{ModelsPage:e}=await import("./ModelsPage-Dgku-JK2.js");return{ModelsPage:e}},__vite__mapDeps([17,1,2,6,4,8,9]))).ModelsPage})),Xt=o.lazy(async()=>({default:(await P(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-C5sP44tb.js");return{OverviewIndex:e}},__vite__mapDeps([18,1,2,19,5,4,8]))).OverviewIndex})),Zt=o.lazy(async()=>({default:(await P(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-CYSSSf8R.js");return{ProvidersPage:e}},__vite__mapDeps([20,1,2,11,4,8]))).ProvidersPage})),en=o.lazy(async()=>({default:(await P(async()=>{const{SettingsPage:e}=await import("./SettingsPage-DaOqG5a9.js");return{SettingsPage:e}},__vite__mapDeps([21,1,2,4]))).SettingsPage})),tn=o.lazy(async()=>({default:(await P(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-B5j54QGf.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([22,1,2,4]))).ToolsGuardrailsPage})),nn=o.lazy(async()=>({default:(await P(async()=>{const{UsagePage:e}=await import("./UsagePage-DQoRJkY3.js");return{UsagePage:e}},__vite__mapDeps([23,1,2,3,4,5,6,19,7,8,9]))).UsagePage})),rn=o.lazy(async()=>({default:(await P(async()=>{const{UsersPage:e}=await import("./UsersPage-DUd7-214.js");return{UsersPage:e}},__vite__mapDeps([24,1,2,6,4,7,8,11,16]))).UsersPage}));function E(e){return n.jsx(o.Suspense,{fallback:n.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function sn(){const{isAuthenticated:e}=re();return e?n.jsx(Ke,{children:n.jsx(Be,{children:n.jsxs(j,{element:n.jsx(zt,{}),children:[n.jsx(j,{index:!0,element:E(n.jsx(Xt,{}))}),n.jsx(j,{path:"providers",element:E(n.jsx(Zt,{}))}),n.jsx(j,{path:"keys",element:E(n.jsx(Jt,{}))}),n.jsx(j,{path:"users",element:E(n.jsx(rn,{}))}),n.jsx(j,{path:"budgets",element:E(n.jsx(Ht,{}))}),n.jsx(j,{path:"activity",element:E(n.jsx(Vt,{}))}),n.jsx(j,{path:"usage",element:E(n.jsx(nn,{}))}),n.jsx(j,{path:"models",element:E(n.jsx(Yt,{}))}),n.jsx(j,{path:"aliases",element:E(n.jsx(Wt,{}))}),n.jsx(j,{path:"tools",element:E(n.jsx(tn,{}))}),n.jsx(j,{path:"settings",element:E(n.jsx(en,{}))}),n.jsx(j,{path:"docs",element:E(n.jsx(Gt,{}))}),n.jsx(j,{path:"*",element:n.jsx($e,{to:"/",replace:!0})})]})})}):n.jsx(Qt,{})}function an({children:e}){const[t]=o.useState(()=>new Re({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(r,s)=>s instanceof L&&(s.status===401||s.status===403)?!1:r<2}}}));return n.jsx(Oe,{client:t,children:n.jsx(tt,{children:e})})}const Ne=document.getElementById("root");if(!Ne)throw new Error("Root element #root not found");Ge.createRoot(Ne).render(n.jsx(o.StrictMode,{children:n.jsx(an,{children:n.jsx(sn,{})})}));export{hr as $,hn as A,Zn as B,xn as C,Jn as D,Tt as E,Cr as F,wn as G,$n as H,_t as I,qn as J,zn as K,yr as L,Qn as M,Ct as N,vr as O,Sr as P,mt as Q,kr as R,xr as S,Sn as T,Pr as U,Pn as V,br as W,wr as X,at as Y,gr as Z,jr as _,Gn as a,Pt as a0,Nt as a1,Cn as a2,Ln as a3,An as a4,ft as a5,_n as a6,Nn as a7,Tn as a8,En as a9,kn as aa,In as ab,Vn as ac,Wn as ad,Hn as ae,Fn as af,Dn as ag,Un as ah,Kn as ai,Bn as aj,mn as ak,dn as al,pr as am,bn as an,ot as ao,pn as ap,gn as aq,lr as ar,ir as as,cr as b,ur as c,fr as d,vn as e,yn as f,dr as g,mr as h,fn as i,Tr as j,it as k,jn as l,Rn as m,Mn as n,Nr as o,On as p,er as q,nr as r,rr as s,sr as t,ar as u,or as v,Er as w,tr as x,Yn as y,Xn as z}; diff --git a/src/gateway/static/dashboard/assets/recharts-BwTTRGtj.js b/src/gateway/static/dashboard/assets/recharts-BwTTRGtj.js new file mode 100644 index 000000000..dcb953be4 --- /dev/null +++ b/src/gateway/static/dashboard/assets/recharts-BwTTRGtj.js @@ -0,0 +1,79 @@ +var Hg=Object.defineProperty;var Yg=(e,t,r)=>t in e?Hg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ui=(e,t,r)=>Yg(e,typeof t!="symbol"?t+"":t,r);import{r as h,c as pv,a as mv,g as Vg,R as qg}from"./react-dgEcD0HR.js";import{c as te,r as Xg}from"./heroui-DZj66Arc.js";var Gg=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function Cu(e){if(typeof e!="string")return!1;var t=Gg;return t.includes(e)}var Zg=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],Qg=new Set(Zg);function yv(e){return typeof e!="string"?!1:Qg.has(e)}function gv(e){return typeof e=="string"&&e.startsWith("data-")}function Ot(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(yv(r)||gv(r))&&(t[r]=e[r]);return t}function Fn(e){if(e==null)return null;if(h.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Ot(t)}return typeof e=="object"&&!Array.isArray(e)?Ot(e):null}function Xe(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(yv(r)||gv(r)||Cu(r))&&(t[r]=e[r]);return t}function Jg(e){return e==null?null:h.isValidElement(e)?Xe(e.props):typeof e=="object"&&!Array.isArray(e)?Xe(e):null}var e0=["children","width","height","viewBox","className","style","title","desc"];function Ro(){return Ro=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.width,i=e.height,a=e.viewBox,o=e.className,u=e.style,l=e.title,c=e.desc,s=t0(e,e0),f=a||{width:n,height:i,x:0,y:0},d=te("recharts-surface",o);return h.createElement("svg",Ro({},Xe(s),{className:d,width:n,height:i,style:u,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),h.createElement("title",null,l),h.createElement("desc",null,c),r)}),n0=["children","className"];function Lo(){return Lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.className,i=i0(e,n0),a=te("recharts-layer",n);return h.createElement("g",Lo({className:a},Xe(i),{ref:t}),r)});function Bo(e){return e==="__proto__"}function xv(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}function ku(e){var t;return typeof e=="string"||typeof e=="symbol"?e:Object.is((t=e==null?void 0:e.valueOf)==null?void 0:t.call(e),-0)?"-0":String(e)}function wv(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(wv).join(",");const t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}function ju(e){if(Array.isArray(e))return e.map(ku);if(typeof e=="symbol")return[e];e=wv(e);const t=[],r=e.length;if(r===0)return t;let n=0,i="",a="",o=!1;for(e.charCodeAt(0)===46&&t.push("");n1&&arguments[1]!==void 0?arguments[1]:u0,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function Ie(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{var u=r[o-1];return typeof u=="string"?i+u+a:u!==void 0?i+_t(u)+a:i+a},"")}var Ye=e=>e===0?0:e>0?1:-1,Pt=e=>typeof e=="number"&&e!=+e,gr=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,D=e=>(typeof e=="number"||e instanceof Number)&&!Pt(e),Be=e=>D(e)||typeof e=="string",l0=0,_n=e=>{var t=++l0;return"".concat(e||"").concat(t)},st=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!D(t)&&typeof t!="string")return n;var a;if(gr(t)){if(r==null)return n;var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return Pt(a)&&(a=n),i&&r!=null&&a>r&&(a=r),a},Av=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;nn&&(typeof t=="function"?t(n):Tt(n,t))===r)}var oe=e=>e===null||typeof e>"u",Tu=e=>oe(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function gt(e){return e!=null}function Sr(){}function Mu(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}function dc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ht(e){for(var t=1;t{var t=e.viewBox,r=e.position,n=e.offset,i=n===void 0?0:n,a=e.parentViewBox,o=Mu(t),u=o.x,l=o.y,c=o.height,s=o.upperWidth,f=o.lowerWidth,d=u,v=u+(s-f)/2,p=(d+v)/2,m=(s+f)/2,y=d+s/2,g=c>=0?1:-1,x=g*i,A=g>0?"end":"start",w=g>0?"start":"end",O=s>=0?1:-1,b=O*i,S=O>0?"end":"start",I=O>0?"start":"end",_=a;if(r==="top"){var j={x:d+s/2,y:l-x,horizontalAnchor:"middle",verticalAnchor:A};return _&&(j.height=Math.max(l-_.y,0),j.width=s),j}if(r==="bottom"){var k={x:v+f/2,y:l+c+x,horizontalAnchor:"middle",verticalAnchor:w};return _&&(k.height=Math.max(_.y+_.height-(l+c),0),k.width=f),k}if(r==="left"){var E={x:p-b,y:l+c/2,horizontalAnchor:S,verticalAnchor:"middle"};return _&&(E.width=Math.max(E.x-_.x,0),E.height=c),E}if(r==="right"){var R={x:p+m+b,y:l+c/2,horizontalAnchor:I,verticalAnchor:"middle"};return _&&(R.width=Math.max(_.x+_.width-R.x,0),R.height=c),R}var N=_?{width:m,height:c}:{};return r==="insideLeft"?ht({x:p+b,y:l+c/2,horizontalAnchor:I,verticalAnchor:"middle"},N):r==="insideRight"?ht({x:p+m-b,y:l+c/2,horizontalAnchor:S,verticalAnchor:"middle"},N):r==="insideTop"?ht({x:d+s/2,y:l+x,horizontalAnchor:"middle",verticalAnchor:w},N):r==="insideBottom"?ht({x:v+f/2,y:l+c-x,horizontalAnchor:"middle",verticalAnchor:A},N):r==="insideTopLeft"?ht({x:d+b,y:l+x,horizontalAnchor:I,verticalAnchor:w},N):r==="insideTopRight"?ht({x:d+s-b,y:l+x,horizontalAnchor:S,verticalAnchor:w},N):r==="insideBottomLeft"?ht({x:v+b,y:l+c-x,horizontalAnchor:I,verticalAnchor:A},N):r==="insideBottomRight"?ht({x:v+f-b,y:l+c-x,horizontalAnchor:S,verticalAnchor:A},N):r&&typeof r=="object"&&(D(r.x)||gr(r.x))&&(D(r.y)||gr(r.y))?ht({x:u+st(r.x,m),y:l+st(r.y,c),horizontalAnchor:"end",verticalAnchor:"end"},N):ht({x:y,y:l+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},N)},v0=["top","left","right","bottom"];function h0(e){return e==null?!1:typeof e=="object"?!0:v0.includes(e)}var p0=h.createContext(null);function le(e){return function(){return e}}const zo=Math.PI,Fo=2*zo,ur=1e-6,m0=Fo-ur;function Pv(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Pv;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;iur)if(!(Math.abs(f*l-c*s)>ur)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let v=n-o,p=i-u,m=l*l+c*c,y=v*v+p*p,g=Math.sqrt(m),x=Math.sqrt(d),A=a*Math.tan((zo-Math.acos((m+d-y)/(2*g*x)))/2),w=A/x,O=A/g;Math.abs(w-1)>ur&&this._append`L${t+w*s},${r+w*f}`,this._append`A${a},${a},0,0,${+(f*v>s*p)},${this._x1=t+O*l},${this._y1=r+O*c}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),l=n*Math.sin(i),c=t+u,s=r+l,f=1^o,d=o?i-a:a-i;this._x1===null?this._append`M${c},${s}`:(Math.abs(this._x1-c)>ur||Math.abs(this._y1-s)>ur)&&this._append`L${c},${s}`,n&&(d<0&&(d=d%Fo+Fo),d>m0?this._append`A${n},${n},0,1,${f},${t-u},${r-l}A${n},${n},0,1,${f},${this._x1=c},${this._y1=s}`:d>ur&&this._append`A${n},${n},0,${+(d>=zo)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Sv(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new g0(t)}function Du(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Ev(e){this._context=e}Ev.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function ba(e){return new Ev(e)}function Iv(e){return e[0]}function _v(e){return e[1]}function Cv(e,t){var r=le(!0),n=null,i=ba,a=null,o=Sv(u);e=typeof e=="function"?e:e===void 0?Iv:le(e),t=typeof t=="function"?t:t===void 0?_v:le(t);function u(l){var c,s=(l=Du(l)).length,f,d=!1,v;for(n==null&&(a=i(v=o())),c=0;c<=s;++c)!(c=v;--p)u.point(A[p],w[p]);u.lineEnd(),u.areaEnd()}g&&(A[d]=+e(y,d,f),w[d]=+t(y,d,f),u.point(n?+n(y,d,f):A[d],r?+r(y,d,f):w[d]))}if(x)return u=null,x+""||null}function s(){return Cv().defined(i).curve(o).context(a)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:le(+f),n=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:le(+f),c):e},c.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:le(+f),c):n},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:le(+f),r=null,c):t},c.y0=function(f){return arguments.length?(t=typeof f=="function"?f:le(+f),c):t},c.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:le(+f),c):r},c.lineX0=c.lineY0=function(){return s().x(e).y(t)},c.lineY1=function(){return s().x(e).y(r)},c.lineX1=function(){return s().x(n).y(t)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:le(!!f),c):i},c.curve=function(f){return arguments.length?(o=f,a!=null&&(u=o(a)),c):o},c.context=function(f){return arguments.length?(f==null?a=u=null:u=o(a=f),c):a},c}class kv{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function b0(e){return new kv(e,!0)}function x0(e){return new kv(e,!1)}function ki(){}function ji(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function jv(e){this._context=e}jv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ji(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ji(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function w0(e){return new jv(e)}function Tv(e){this._context=e}Tv.prototype={areaStart:ki,areaEnd:ki,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ji(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function A0(e){return new Tv(e)}function Mv(e){this._context=e}Mv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ji(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function O0(e){return new Mv(e)}function Dv(e){this._context=e}Dv.prototype={areaStart:ki,areaEnd:ki,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function P0(e){return new Dv(e)}function vc(e){return e<0?-1:1}function hc(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),u=(a*i+o*n)/(n+i);return(vc(a)+vc(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function pc(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function io(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,u=(a-n)/3;e._context.bezierCurveTo(n+u,i+u*t,a-u,o-u*r,a,o)}function Ti(e){this._context=e}Ti.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:io(this,this._t0,pc(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,io(this,pc(this,r=hc(this,e,t)),r);break;default:io(this,this._t0,r=hc(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function $v(e){this._context=new Nv(e)}($v.prototype=Object.create(Ti.prototype)).point=function(e,t){Ti.prototype.point.call(this,t,e)};function Nv(e){this._context=e}Nv.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function S0(e){return new Ti(e)}function E0(e){return new $v(e)}function Rv(e){this._context=e}Rv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=mc(e),i=mc(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function _0(e){return new xa(e,.5)}function C0(e){return new xa(e,0)}function k0(e){return new xa(e,1)}function br(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,u=a.length;r=0;)r[t]=t;return r}function j0(e,t){return e[t]}function T0(e){const t=[];return t.key=e,t}function M0(){var e=le([]),t=Wo,r=br,n=j0;function i(a){var o=Array.from(e.apply(this,arguments),T0),u,l=o.length,c=-1,s;for(const f of a)for(u=0,++c;u0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n"radius"in e&&"startAngle"in e&&"endAngle"in e,$u=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(h.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{Cu(i)&&typeof r[i]=="function"&&(n[i]=(a=>r[i](r,a)))}),n},R0=(e,t,r)=>n=>(e(t,r,n),null),Nu=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var a=e[i];Cu(i)&&typeof a=="function"&&(n||(n={}),n[i]=R0(a,t,r))}),n};function yc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function L0(e){for(var t=1;t(o[u]===void 0&&n[u]!==void 0&&(o[u]=n[u]),o),r);return a}function W0(e,t){const r=new Map;for(let n=0;nObject.prototype.propertyIsEnumerable.call(e,t))}function Cn(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const zv="[object RegExp]",Ru="[object String]",Lu="[object Number]",Bu="[object Boolean]",Fv="[object Arguments]",Wv="[object Symbol]",Kv="[object Date]",Uv="[object Map]",Hv="[object Set]",Yv="[object Array]",Y0="[object Function]",Vv="[object ArrayBuffer]",Si="[object Object]",V0="[object Error]",qv="[object DataView]",Xv="[object Uint8Array]",Gv="[object Uint8ClampedArray]",Zv="[object Uint16Array]",Qv="[object Uint32Array]",q0="[object BigUint64Array]",Jv="[object Int8Array]",eh="[object Int16Array]",th="[object Int32Array]",X0="[object BigInt64Array]",rh="[object Float32Array]",nh="[object Float64Array]",gc=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Ho(e){return typeof gc.Buffer<"u"&&gc.Buffer.isBuffer(e)}function G0(e,t){return sr(e,void 0,e,new Map,t)}function sr(e,t,r,n=new Map,i=void 0){const a=i==null?void 0:i(e,t,r,n);if(a!==void 0)return a;if(Ko(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const o=new Array(e.length);n.set(e,o);for(let u=0;u{}):Yo(e,t,function n(i,a,o,u,l,c){const s=r(i,a,o,u,l,c);return s!==void 0?!!s:Yo(i,a,n,c,!1)},new Map,!0)}function Yo(e,t,r,n,i=!1){if(t===e)return!0;switch(typeof t){case"object":return J0(e,t,r,n);case"function":return Object.keys(t).length>0?Yo(e,{...t},r,n,i):Pn(e,t);default:return ih(e)&&i?typeof t=="string"?t==="":!0:Pn(e,t)}}function J0(e,t,r,n){if(t==null)return!0;if(Array.isArray(t))return oh(e,t,r,n);if(t instanceof Map)return eb(e,t,r,n);if(t instanceof Set)return tb(e,t,r,n);const i=Object.keys(t);if(e==null||Ko(e))return i.length===0;if(i.length===0)return!0;if(n!=null&&n.has(t))return n.get(t)===e;n==null||n.set(t,e);try{for(let a=0;a{})}function rb(e){return e=Q0(e),t=>uh(t,e)}function nb(e,t){return G0(e,(r,n,i,a)=>{if(typeof e=="object"){if(Cn(e)==="[object Object]"&&typeof e.constructor!="function"){const o={};return a.set(e,o),ut(o,e,i,a),o}switch(Object.prototype.toString.call(e)){case Lu:case Ru:case Bu:{const o=new e.constructor(e==null?void 0:e.valueOf());return ut(o,e),o}case Fv:{const o={};return ut(o,e),o.length=e.length,o[Symbol.iterator]=e[Symbol.iterator],o}default:return}}})}function ib(e){return nb(e)}const ab=/^(?:0|[1-9]\d*)$/;function lh(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e=0}function ch(e){return e!=null&&typeof e!="function"&&sb(e.length)}function fb(e){return typeof e=="object"&&e!==null}function db(e){return fb(e)&&ch(e)}function bc(e,t=Bv){return db(e)?W0(Array.from(e),K0(cb(t),1)):[]}function vb(e,t,r){return t===!0?bc(e,r):typeof t=="function"?bc(e,t):e}var ao={exports:{}},oo={};/** + * @license React + * use-sync-external-store-shim/with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var xc;function hb(){if(xc)return oo;xc=1;var e=pv(),t=Xg();function r(c,s){return c===s&&(c!==0||1/c===1/s)||c!==c&&s!==s}var n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,u=e.useMemo,l=e.useDebugValue;return oo.useSyncExternalStoreWithSelector=function(c,s,f,d,v){var p=a(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=u(function(){function g(b){if(!x){if(x=!0,A=b,b=d(b),v!==void 0&&m.hasValue){var S=m.value;if(v(S,b))return w=S}return w=b}if(S=w,n(A,b))return S;var I=d(b);return v!==void 0&&v(S,I)?(A=b,S):(A=b,w=I)}var x=!1,A,w,O=f===void 0?null:f;return[function(){return g(s())},O===null?void 0:function(){return g(O())}]},[s,f,d,v]);var y=i(c,p[0],p[1]);return o(function(){m.hasValue=!0,m.value=y},[y]),l(y),y},oo}var wc;function pb(){return wc||(wc=1,ao.exports=hb()),ao.exports}var mb=pb(),zu=h.createContext(null),yb=e=>e,ie=()=>{var e=h.useContext(zu);return e?e.store.dispatch:yb},Ei=()=>{},gb=()=>Ei,bb=(e,t)=>e===t;function $(e){var t=h.useContext(zu),r=h.useMemo(()=>t?n=>{if(n!=null)return e(n)}:Ei,[t,e]);return mb.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:gb,t?t.store.getState:Ei,t?t.store.getState:Ei,r,bb)}function xb(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function wb(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Ac=e=>Array.isArray(e)?e:[e];function Ab(e){const t=Array.isArray(e[0])?e[0]:e;return wb(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Ob(e,t){const r=[],{length:n}=e;for(let i=0;itypeof WeakRef>"u"?Pb:WeakRef,sh=Sb(),Eb=0,Oc=1;function ci(){return{s:Eb,v:void 0,o:null,p:null}}function Ib(e){return e instanceof sh?e.deref():e}function fh(e,t={}){let r=ci();const{resultEqualityCheck:n}=t;let i,a=0;function o(){let u=r;const{length:l}=arguments;for(let f=0,d=l;f{r=ci(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function _b(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let a=0,o=0,u,l={},c=i.pop();typeof c=="object"&&(l=c,c=i.pop()),xb(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const s={...r,...l},{memoize:f,memoizeOptions:d=[],argsMemoize:v=fh,argsMemoizeOptions:p=[]}=s,m=Ac(d),y=Ac(p),g=Ab(i),x=f(function(){return a++,c.apply(null,arguments)},...m),A=v(function(){o++;const O=Ob(g,arguments);return u=x.apply(null,O),u},...y);return Object.assign(A,{resultFunc:c,memoizedResultFunc:x,dependencies:g,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:f,argsMemoize:v})};return Object.assign(n,{withTypes:()=>n}),n}var P=_b(fh);function Cb(e,t=1){const r=[],n=Math.floor(t),i=(a,o)=>{for(let u=0;u{if(e!==t){const n=Pc(e),i=Pc(t);if(n===i&&n===0){if(et)return r==="desc"?-1:1}return r==="desc"?i-n:n-i}return 0};function dh(e){return typeof e=="symbol"||e instanceof Symbol}const jb=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tb=/^\w*$/;function Mb(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||dh(e)?!0:typeof e=="string"&&(Tb.test(e)||!jb.test(e))||t!=null}function Db(e,t,r,n){if(e==null)return[];r=r,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(r)||(r=r==null?[]:[r]),r=r.map(u=>String(u));const i=(u,l)=>{let c=u;for(let s=0;sl==null||u==null?l:typeof u=="object"&&"key"in u?Object.hasOwn(l,u.key)?l[u.key]:i(l,u.path):typeof u=="function"?u(l):Array.isArray(u)?i(l,u):typeof l=="object"?l[u]:l,o=t.map(u=>(Array.isArray(u)&&u.length===1&&(u=u[0]),u==null||typeof u=="function"||Array.isArray(u)||Mb(u)?u:{key:u,path:ju(u)}));return e.map(u=>({original:u,criteria:o.map(l=>a(l,u))})).slice().sort((u,l)=>{for(let c=0;cu.original)}function wa(e,...t){const r=t.length;return r>1&&Vo(e,t[0],t[1])?t=[]:r>2&&Vo(t[0],t[1],t[2])&&(t=[t[0]]),Db(e,Cb(t),["asc"])}var vh=e=>e.legend.settings,$b=e=>e.legend.size,Nb=e=>e.legend.payload;P([Nb,vh],(e,t)=>{var r=t.itemSorter,n=e.flat(1);return r?wa(n,r):n});function Rb(e,t){return Fb(e)||zb(e,t)||Bb(e,t)||Lb()}function Lb(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bb(e,t){if(e){if(typeof e=="string")return Sc(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Sc(e,t):void 0}}function Sc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rsi||Math.abs(e.left-t.left)>si||Math.abs(e.top-t.top)>si||Math.abs(e.width-t.width)>si}function Ic(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function Wb(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=h.useState({height:0,left:0,top:0,width:0}),r=Rb(t,2),n=r[0],i=r[1],a=h.useRef(null),o=h.useRef(n);o.current=n;var u=h.useCallback(l=>{if(a.current!=null&&(a.current.disconnect(),a.current=null),l!=null){var c=Ic(l);if(Ec(c,o.current)&&i(c),typeof ResizeObserver<"u"){var s=new ResizeObserver(()=>{var f=Ic(l);Ec(f,o.current)&&i(f)});s.observe(l),a.current=s}}},[...e]);return h.useEffect(()=>()=>{var l;(l=a.current)===null||l===void 0||l.disconnect()},[]),[n,u]}function Ee(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Kb=typeof Symbol=="function"&&Symbol.observable||"@@observable",_c=Kb,uo=()=>Math.random().toString(36).substring(7).split("").join("."),Ub={INIT:`@@redux/INIT${uo()}`,REPLACE:`@@redux/REPLACE${uo()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${uo()}`},Mi=Ub;function Fu(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function hh(e,t,r){if(typeof e!="function")throw new Error(Ee(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ee(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ee(1));return r(hh)(e,t)}let n=e,i=t,a=new Map,o=a,u=0,l=!1;function c(){o===a&&(o=new Map,a.forEach((y,g)=>{o.set(g,y)}))}function s(){if(l)throw new Error(Ee(3));return i}function f(y){if(typeof y!="function")throw new Error(Ee(4));if(l)throw new Error(Ee(5));let g=!0;c();const x=u++;return o.set(x,y),function(){if(g){if(l)throw new Error(Ee(6));g=!1,c(),o.delete(x),a=null}}}function d(y){if(!Fu(y))throw new Error(Ee(7));if(typeof y.type>"u")throw new Error(Ee(8));if(typeof y.type!="string")throw new Error(Ee(17));if(l)throw new Error(Ee(9));try{l=!0,i=n(i,y)}finally{l=!1}return(a=o).forEach(x=>{x()}),y}function v(y){if(typeof y!="function")throw new Error(Ee(10));n=y,d({type:Mi.REPLACE})}function p(){const y=f;return{subscribe(g){if(typeof g!="object"||g===null)throw new Error(Ee(11));function x(){const w=g;w.next&&w.next(s())}return x(),{unsubscribe:y(x)}},[_c](){return this}}}return d({type:Mi.INIT}),{dispatch:d,subscribe:f,getState:s,replaceReducer:v,[_c]:p}}function Hb(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Mi.INIT})>"u")throw new Error(Ee(12));if(typeof r(void 0,{type:Mi.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ee(13))})}function ph(e){const t=Object.keys(e),r={};for(let a=0;a"u")throw u&&u.type,new Error(Ee(14));c[f]=p,l=l||p!==v}return l=l||n.length!==Object.keys(o).length,l?c:o}}function Di(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Yb(...e){return t=>(r,n)=>{const i=t(r,n);let a=()=>{throw new Error(Ee(15))};const o={getState:i.getState,dispatch:(l,...c)=>a(l,...c)},u=e.map(l=>l(o));return a=Di(...u)(i.dispatch),{...i,dispatch:a}}}function mh(e){return Fu(e)&&"type"in e&&typeof e.type=="string"}var yh=Symbol.for("immer-nothing"),Cc=Symbol.for("immer-draftable"),Te=Symbol.for("immer-state");function lt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ve=Object,Hr=Ve.getPrototypeOf,$i="constructor",Aa="prototype",qo="configurable",Ni="enumerable",Ii="writable",kn="value",Mt=e=>!!e&&!!e[Te];function et(e){var t;return e?gh(e)||Pa(e)||!!e[Cc]||!!((t=e[$i])!=null&&t[Cc])||Sa(e)||Ea(e):!1}var Vb=Ve[Aa][$i].toString(),kc=new WeakMap;function gh(e){if(!e||!Wu(e))return!1;const t=Hr(e);if(t===null||t===Ve[Aa])return!0;const r=Ve.hasOwnProperty.call(t,$i)&&t[$i];if(r===Object)return!0;if(!Br(r))return!1;let n=kc.get(r);return n===void 0&&(n=Function.toString.call(r),kc.set(r,n)),n===Vb}function Oa(e,t,r=!0){Wn(e)===0?(r?Reflect.ownKeys(e):Ve.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function Wn(e){const t=e[Te];return t?t.type_:Pa(e)?1:Sa(e)?2:Ea(e)?3:0}var lo=(e,t,r=Wn(e))=>r===2?e.has(t):Ve[Aa].hasOwnProperty.call(e,t),Xo=(e,t,r=Wn(e))=>r===2?e.get(t):e[t],Ri=(e,t,r,n=Wn(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function qb(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Pa=Array.isArray,Sa=e=>e instanceof Map,Ea=e=>e instanceof Set,Wu=e=>typeof e=="object",Br=e=>typeof e=="function",co=e=>typeof e=="boolean";function Xb(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Et=e=>e.copy_||e.base_,Ku=e=>e.modified_?e.copy_:e.base_;function Go(e,t){if(Sa(e))return new Map(e);if(Ea(e))return new Set(e);if(Pa(e))return Array[Aa].slice.call(e);const r=gh(e);if(t===!0||t==="class_only"&&!r){const n=Ve.getOwnPropertyDescriptors(e);delete n[Te];let i=Reflect.ownKeys(n);for(let a=0;a1&&Ve.defineProperties(e,{set:fi,add:fi,clear:fi,delete:fi}),Ve.freeze(e),t&&Oa(e,(r,n)=>{Uu(n,!0)},!1)),e}function Gb(){lt(2)}var fi={[kn]:Gb};function Ia(e){return e===null||!Wu(e)?!0:Ve.isFrozen(e)}var Li="MapSet",Zo="Patches",jc="ArrayMethods",bh={};function xr(e){const t=bh[e];return t||lt(0,e),t}var Tc=e=>!!bh[e],jn,xh=()=>jn,Zb=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Tc(Li)?xr(Li):void 0,arrayMethodsPlugin_:Tc(jc)?xr(jc):void 0});function Mc(e,t){t&&(e.patchPlugin_=xr(Zo),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Qo(e){Jo(e),e.drafts_.forEach(Qb),e.drafts_=null}function Jo(e){e===jn&&(jn=e.parent_)}var Dc=e=>jn=Zb(jn,e);function Qb(e){const t=e[Te];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function $c(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[Te].modified_&&(Qo(t),lt(4)),et(e)&&(e=Nc(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(r[Te].base_,e,t)}else e=Nc(t,r);return Jb(t,e,!0),Qo(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==yh?e:void 0}function Nc(e,t){if(Ia(t))return t;const r=t[Te];if(!r)return Bi(t,e.handledSet_,e);if(!_a(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);Oh(r,e)}return r.copy_}function Jb(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Uu(t,r)}function wh(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var _a=(e,t)=>e.scope_===t,ex=[];function Ah(e,t,r,n){const i=Et(e),a=e.type_;if(n!==void 0&&Xo(i,n,a)===t){Ri(i,n,r,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;Oa(i,(l,c)=>{if(Mt(c)){const s=u.get(c)||[];s.push(l),u.set(c,s)}})}const o=e.draftLocations_.get(t)??ex;for(const u of o)Ri(i,u,r,a)}function tx(e,t,r){e.callbacks_.push(function(i){var u;const a=t;if(!a||!_a(a,i))return;(u=i.mapSetPlugin_)==null||u.fixSetContents(a);const o=Ku(a);Ah(e,a.draft_??a,o,r),Oh(a,i)})}function Oh(e,t){var n;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((n=e.assigned_)==null?void 0:n.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const a=i.getPath(e);a&&i.generatePatches_(e,a,t)}wh(e)}}function rx(e,t,r){const{scope_:n}=e;if(Mt(r)){const i=r[Te];_a(i,n)&&i.callbacks_.push(function(){_i(e);const o=Ku(i);Ah(e,r,o,t)})}else et(r)&&e.callbacks_.push(function(){const a=Et(e);e.type_===3?a.has(r)&&Bi(r,n.handledSet_,n):Xo(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Bi(Xo(e.copy_,t,e.type_),n.handledSet_,n)})}function Bi(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Mt(e)||t.has(e)||!et(e)||Ia(e)||(t.add(e),Oa(e,(n,i)=>{if(Mt(i)){const a=i[Te];if(_a(a,r)){const o=Ku(a);Ri(e,n,o,e.type_),wh(a)}}else et(i)&&Bi(i,t,r)})),e}function nx(e,t){const r=Pa(e),n={type_:r?1:0,scope_:t?t.scope_:xh(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=n,a=zi;r&&(i=[n],a=Tn);const{revoke:o,proxy:u}=Proxy.revocable(i,a);return n.draft_=u,n.revoke_=o,[u,n]}var zi={get(e,t){if(t===Te)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const i=Et(e);if(!lo(i,t,e.type_))return ax(e,i,t);const a=i[t];if(e.finalized_||!et(a)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&Xb(t))return a;if(a===so(e.base_,t)||ix(e,t,a)){_i(e);const o=e.type_===1?+t:t,u=tu(e.scope_,a,e,o);return e.copy_[o]=u}return a},has(e,t){return t in Et(e)},ownKeys(e){return Reflect.ownKeys(Et(e))},set(e,t,r){const n=Ph(Et(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=so(Et(e),t),a=i==null?void 0:i[Te];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(qb(r,i)&&(r!==void 0||lo(e.base_,t,e.type_)))return!0;_i(e),eu(e)}return e.copy_[t]===r&&(r!==void 0||lo(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),rx(e,t,r)),!0},deleteProperty(e,t){return _i(e),so(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),eu(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Et(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Ii]:!0,[qo]:e.type_!==1||t!=="length",[Ni]:n[Ni],[kn]:r[t]}},defineProperty(){lt(11)},getPrototypeOf(e){return Hr(e.base_)},setPrototypeOf(){lt(12)}},Tn={};for(let e in zi){let t=zi[e];Tn[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Tn.deleteProperty=function(e,t){return Tn.set.call(this,e,t,void 0)};Tn.set=function(e,t,r){return zi.set.call(this,e[0],t,r,e[0])};function so(e,t){const r=e[Te];return(r?Et(r):e)[t]}function ix(e,t,r){var n;return e.type_!==1||!e.allIndicesReassigned_||(n=e.assigned_)!=null&&n.get(t)||!et(r)||r[Te]?!1:e.baseRefs_.has(r)}function ax(e,t,r){var i;const n=Ph(t,r);return n?kn in n?n[kn]:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function Ph(e,t){if(!(t in e))return;let r=Hr(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Hr(r)}}function eu(e){e.modified_||(e.modified_=!0,e.parent_&&eu(e.parent_))}function _i(e){e.copy_||(e.assigned_=new Map,e.copy_=Go(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ox=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(Br(t)&&!Br(r)){const a=r;r=t;const o=this;return function(l=a,...c){return o.produce(l,s=>r.call(this,s,...c))}}Br(r)||lt(6),n!==void 0&&!Br(n)&<(7);let i;if(et(t)){const a=Dc(this),o=tu(a,t,void 0);let u=!0;try{i=r(o),u=!1}finally{u?Qo(a):Jo(a)}return Mc(a,n),$c(i,a)}else if(!t||!Wu(t)){if(i=r(t),i===void 0&&(i=t),i===yh&&(i=void 0),this.autoFreeze_&&Uu(i,!0),n){const a=[],o=[];xr(Zo).generateReplacementPatches_(t,i,{patches_:a,inversePatches_:o}),n(a,o)}return i}else lt(1,t)},this.produceWithPatches=(t,r)=>{if(Br(t))return(o,...u)=>this.produceWithPatches(o,l=>t(l,...u));let n,i;return[this.produce(t,r,(o,u)=>{n=o,i=u}),n,i]},co(e==null?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),co(e==null?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),co(e==null?void 0:e.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){et(e)||lt(8),Mt(e)&&(e=Qe(e));const t=Dc(this),r=tu(t,e,void 0);return r[Te].isManual_=!0,Jo(t),r}finishDraft(e,t){const r=e&&e[Te];(!r||!r.isManual_)&<(9);const{scope_:n}=r;return Mc(n,t),$c(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=xr(Zo).applyPatches_;return Mt(e)?n(e,t):this.produce(e,i=>n(i,t))}};function tu(e,t,r,n){const[i,a]=Sa(t)?xr(Li).proxyMap_(t,r):Ea(t)?xr(Li).proxySet_(t,r):nx(t,r);return((r==null?void 0:r.scope_)??xh()).drafts_.push(i),a.callbacks_=(r==null?void 0:r.callbacks_)??[],a.key_=n,r&&n!==void 0?tx(r,a,n):a.callbacks_.push(function(l){var s;(s=l.mapSetPlugin_)==null||s.fixSetContents(a);const{patchPlugin_:c}=l;a.modified_&&c&&c.generatePatches_(a,[],l)}),i}function Qe(e){return Mt(e)||lt(10,e),Sh(e)}function Sh(e){if(!et(e)||Ia(e))return e;const t=e[Te];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Go(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Go(e,!0);return Oa(r,(i,a)=>{Ri(r,i,Sh(a))},n),t&&(t.finalized_=!1),r}var ux=new ox,Eh=ux.produce,q=e=>e;function Ih(e){return({dispatch:r,getState:n})=>i=>a=>typeof a=="function"?a(r,n,e):i(a)}var lx=Ih(),cx=Ih,sx=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Di:Di.apply(null,arguments)};function Ge(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(qe(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>mh(n)&&n.type===e,r}var _h=class wn extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,wn.prototype)}static get[Symbol.species](){return wn}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new wn(...t[0].concat(this)):new wn(...t.concat(this))}};function Rc(e){return et(e)?Eh(e,()=>{}):e}function di(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function fx(e){return typeof e=="boolean"}var dx=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new _h;return r&&(fx(r)?o.push(lx):o.push(cx(r.extraArgument))),o},Ch="RTK_autoBatch",re=()=>e=>({payload:e,meta:{[Ch]:!0}}),Lc=e=>t=>{setTimeout(t,e)},vx=(e,t)=>r=>{let n=!1;const i=()=>{n||(n=!0,cancelAnimationFrame(a),clearTimeout(o),r())},a=e(i),o=setTimeout(i,t)},kh=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,a=!1,o=!1;const u=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?vx(window.requestAnimationFrame,100):Lc(10):e.type==="callback"?e.queueNotification:Lc(e.timeout),c=()=>{o=!1,a&&(a=!1,u.forEach(s=>s()))};return Object.assign({},n,{subscribe(s){const f=()=>i&&s(),d=n.subscribe(f);return u.add(s),()=>{d(),u.delete(s)}},dispatch(s){var f;try{return i=!((f=s==null?void 0:s.meta)!=null&&f[Ch]),a=!i,a&&(o||(o=!0,l(c))),n.dispatch(s)}finally{i=!0}}})},hx=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new _h(e);return n&&i.push(kh(typeof n=="object"?n:void 0)),i};function px(e){const t=dx(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let u;if(typeof r=="function")u=r;else if(Fu(r))u=ph(r);else throw new Error(qe(1));let l;typeof n=="function"?l=n(t):l=t();let c=Di;i&&(c=sx({trace:!1,...typeof i=="object"&&i}));const s=Yb(...l),f=hx(s);let d=typeof o=="function"?o(f):f();const v=c(...d);return hh(u,a,v)}function jh(e){const t={},r=[];let n;const i={addCase(a,o){const u=typeof a=="string"?a:a.type;if(!u)throw new Error(qe(28));if(u in t)throw new Error(qe(29));return t[u]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&r.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return r.push({matcher:a,reducer:o}),i},addDefaultCase(a){return n=a,i}};return e(i),[t,r,n]}function mx(e){return typeof e=="function"}function yx(e,t){let[r,n,i]=jh(t),a;if(mx(e))a=()=>Rc(e());else{const u=Rc(e);a=()=>u}function o(u=a(),l){let c=[r[l.type],...n.filter(({matcher:s})=>s(l)).map(({reducer:s})=>s)];return c.filter(s=>!!s).length===0&&(c=[i]),c.reduce((s,f)=>{if(f)if(Mt(s)){const v=f(s,l);return v===void 0?s:v}else{if(et(s))return Eh(s,d=>f(d,l));{const d=f(s,l);if(d===void 0){if(s===null)return s;throw Error("A case reducer on a non-draftable value must not return undefined")}return d}}return s},u)}return o.getInitialState=a,o}var gx="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",bx=(e=21)=>{let t="",r=e;for(;r--;)t+=gx[Math.random()*64|0];return t},xx=Symbol.for("rtk-slice-createasyncthunk");function wx(e,t){return`${e}/${t}`}function Ax({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[xx];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(qe(11));const u=(typeof i.reducers=="function"?i.reducers(Px()):i.reducers)||{},l=Object.keys(u),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(w,O){const b=typeof w=="string"?w:w.type;if(!b)throw new Error(qe(12));if(b in c.sliceCaseReducersByType)throw new Error(qe(13));return c.sliceCaseReducersByType[b]=O,s},addMatcher(w,O){return c.sliceMatchers.push({matcher:w,reducer:O}),s},exposeAction(w,O){return c.actionCreators[w]=O,s},exposeCaseReducer(w,O){return c.sliceCaseReducersByName[w]=O,s}};l.forEach(w=>{const O=u[w],b={reducerName:w,type:wx(a,w),createNotation:typeof i.reducers=="function"};Ex(O)?_x(b,O,s,t):Sx(b,O,s)});function f(){const[w={},O=[],b=void 0]=typeof i.extraReducers=="function"?jh(i.extraReducers):[i.extraReducers],S={...w,...c.sliceCaseReducersByType};return yx(i.initialState,I=>{for(let _ in S)I.addCase(_,S[_]);for(let _ of c.sliceMatchers)I.addMatcher(_.matcher,_.reducer);for(let _ of O)I.addMatcher(_.matcher,_.reducer);b&&I.addDefaultCase(b)})}const d=w=>w,v=new Map,p=new WeakMap;let m;function y(w,O){return m||(m=f()),m(w,O)}function g(){return m||(m=f()),m.getInitialState()}function x(w,O=!1){function b(I){let _=I[w];return typeof _>"u"&&O&&(_=di(p,b,g)),_}function S(I=d){const _=di(v,O,()=>new WeakMap);return di(_,I,()=>{const j={};for(const[k,E]of Object.entries(i.selectors??{}))j[k]=Ox(E,I,()=>di(p,I,g),O);return j})}return{reducerPath:w,getSelectors:S,get selectors(){return S(b)},selectSlice:b}}const A={name:a,reducer:y,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:g,...x(o),injectInto(w,{reducerPath:O,...b}={}){const S=O??o;return w.inject({reducerPath:S,reducer:y},b),{...A,...x(S,!0)}}};return A}}function Ox(e,t,r,n){function i(a,...o){let u=t(a);return typeof u>"u"&&n&&(u=r()),e(u,...o)}return i.unwrapped=e,i}var Me=Ax();function Px(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function Sx({type:e,reducerName:t,createNotation:r},n,i){let a,o;if("reducer"in n){if(r&&!Ix(n))throw new Error(qe(17));a=n.reducer,o=n.prepare}else a=n;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Ge(e,o):Ge(e))}function Ex(e){return e._reducerDefinitionType==="asyncThunk"}function Ix(e){return e._reducerDefinitionType==="reducerWithPrepare"}function _x({type:e,reducerName:t},r,n,i){if(!i)throw new Error(qe(18));const{payloadCreator:a,fulfilled:o,pending:u,rejected:l,settled:c,options:s}=r,f=i(e,a,s);n.exposeAction(t,f),o&&n.addCase(f.fulfilled,o),u&&n.addCase(f.pending,u),l&&n.addCase(f.rejected,l),c&&n.addMatcher(f.settled,c),n.exposeCaseReducer(t,{fulfilled:o||vi,pending:u||vi,rejected:l||vi,settled:c||vi})}function vi(){}var Cx="task",Th="listener",Mh="completed",Hu="cancelled",kx=`task-${Hu}`,jx=`task-${Mh}`,ru=`${Th}-${Hu}`,Tx=`${Th}-${Mh}`,Ca=class{constructor(e){ui(this,"code");ui(this,"name","TaskAbortError");ui(this,"message");this.code=e,this.message=`${Cx} ${Hu} (reason: ${e})`}},Yu=(e,t)=>{if(typeof e!="function")throw new TypeError(qe(32))},Fi=()=>{},Dh=(e,t=Fi)=>(e.catch(t),e),$h=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),hr=e=>{if(e.aborted)throw new Ca(e.reason)};function Nh(e,t){let r=Fi;return new Promise((n,i)=>{const a=()=>i(new Ca(e.reason));if(e.aborted){a();return}r=$h(e,a),t.finally(()=>r()).then(n,i)}).finally(()=>{r=Fi})}var Mx=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof Ca?"cancelled":"rejected",error:r}}finally{t==null||t()}},Wi=e=>t=>Dh(Nh(e,t).then(r=>(hr(e),r))),Rh=e=>{const t=Wi(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Wr}=Object,Bc={},ka="listenerMiddleware",Dx=(e,t)=>{const r=n=>$h(e,()=>n.abort(e.reason));return(n,i)=>{Yu(n);const a=new AbortController;r(a);const o=Mx(async()=>{hr(e),hr(a.signal);const u=await n({pause:Wi(a.signal),delay:Rh(a.signal),signal:a.signal});return hr(a.signal),u},()=>a.abort(jx));return i!=null&&i.autoJoin&&t.push(o.catch(Fi)),{result:Wi(e)(o),cancel(){a.abort(kx)}}}},$x=(e,t)=>{const r=async(n,i)=>{hr(t);let a=()=>{};const u=[new Promise((l,c)=>{let s=e({predicate:n,effect:(f,d)=>{d.unsubscribe(),l([f,d.getState(),d.getOriginalState()])}});a=()=>{s(),c()}})];i!=null&&u.push(new Promise(l=>setTimeout(l,i,null)));try{const l=await Nh(t,Promise.race(u));return hr(t),l}finally{a()}};return((n,i)=>Dh(r(n,i)))},Lh=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:a}=e;if(t)i=Ge(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(!i)throw new Error(qe(21));return Yu(a),{predicate:i,type:t,effect:a}},Bh=Wr(e=>{const{type:t,predicate:r,effect:n}=Lh(e);return{id:bx(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(qe(22))}}},{withTypes:()=>Bh}),zc=(e,t)=>{const{type:r,effect:n,predicate:i}=Lh(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===i)&&a.effect===n)},nu=e=>{e.pending.forEach(t=>{t.abort(ru)})},Nx=(e,t)=>()=>{for(const r of t.keys())nu(r);e.clear()},Fc=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},zh=Wr(Ge(`${ka}/add`),{withTypes:()=>zh}),Rx=Ge(`${ka}/removeAll`),Fh=Wr(Ge(`${ka}/remove`),{withTypes:()=>Fh}),Lx=(...e)=>{console.error(`${ka}/error`,...e)},Kn=(e={})=>{const t=new Map,r=new Map,n=v=>{const p=r.get(v)??0;r.set(v,p+1)},i=v=>{const p=r.get(v)??1;p===1?r.delete(v):r.set(v,p-1)},{extra:a,onError:o=Lx}=e;Yu(o);const u=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),p=>{v.unsubscribe(),p!=null&&p.cancelActive&&nu(v)}),l=(v=>{const p=zc(t,v)??Bh(v);return u(p)});Wr(l,{withTypes:()=>l});const c=v=>{const p=zc(t,v);return p&&(p.unsubscribe(),v.cancelActive&&nu(p)),!!p};Wr(c,{withTypes:()=>c});const s=async(v,p,m,y)=>{const g=new AbortController,x=$x(l,g.signal),A=[];try{v.pending.add(g),n(v),await Promise.resolve(v.effect(p,Wr({},m,{getOriginalState:y,condition:(w,O)=>x(w,O).then(Boolean),take:x,delay:Rh(g.signal),pause:Wi(g.signal),extra:a,signal:g.signal,fork:Dx(g.signal,A),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((w,O,b)=>{w!==g&&(w.abort(ru),b.delete(w))})},cancel:()=>{g.abort(ru),v.pending.delete(g)},throwIfCancelled:()=>{hr(g.signal)}})))}catch(w){w instanceof Ca||Fc(o,w,{raisedBy:"effect"})}finally{await Promise.all(A),g.abort(Tx),i(v),v.pending.delete(g)}},f=Nx(t,r);return{middleware:v=>p=>m=>{if(!mh(m))return p(m);if(zh.match(m))return l(m.payload);if(Rx.match(m)){f();return}if(Fh.match(m))return c(m.payload);let y=v.getState();const g=()=>{if(y===Bc)throw new Error(qe(23));return y};let x;try{if(x=p(m),t.size>0){const A=v.getState(),w=Array.from(t.values());for(const O of w){let b=!1;try{b=O.predicate(m,A,y)}catch(S){b=!1,Fc(o,S,{raisedBy:"predicate"})}b&&s(O,m,v,g)}}}finally{y=Bc}return x},startListening:l,stopListening:c,clearListeners:f}};function qe(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Bx={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},Wh=Me({name:"chartLayout",initialState:Bx,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,n,i,a;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(n=t.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),ja=Wh.actions,zx=ja.setMargin,Fx=ja.setLayout,Wx=ja.setChartSize,Kx=ja.setScale,Ux=Wh.reducer;function Kh(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function G(e){return Number.isFinite(e)}function Gt(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Wc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Le(e){for(var t=1;t{if(t&&r){var n=r.width,i=r.height,a=t.align,o=t.verticalAlign,u=t.layout,l=t.position,c=t.offset,s=c===void 0?0:c;if(l!=null){if(h0(l)){if(l==="top"&&D(e.top))return Le(Le({},e),{},{top:e.top+(i||0)+s});if(l==="bottom"&&D(e.bottom))return Le(Le({},e),{},{bottom:e.bottom+(i||0)+s});if(l==="left"&&D(e.left))return Le(Le({},e),{},{left:e.left+(n||0)+s});if(l==="right"&&D(e.right))return Le(Le({},e),{},{right:e.right+(n||0)+s})}return e}if((u==="vertical"||u==="horizontal"&&o==="middle")&&a!=="center"&&D(e[a]))return Le(Le({},e),{},{[a]:e[a]+(n||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&o!=="middle"&&D(e[o]))return Le(Le({},e),{},{[o]:e[o]+(i||0)})}return e},Rt=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",Xx=(e,t)=>{if(!t||t.length!==2||!D(t[0])||!D(t[1]))return e;var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!D(e[0])||e[0]n)&&(i[1]=n),i[0]>n&&(i[0]=n),i[1]{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var i=0;i=0?(c[0]=a,a+=d,c[1]=a):(c[0]=o,o+=d,c[1]=o)}}}},Zx=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var i=0;i=0?(l[0]=a,a+=c,l[1]=a):(l[0]=0,l[1]=0)}}}},Qx={sign:Gx,expand:D0,none:br,silhouette:$0,wiggle:N0,positive:Zx},Jx=(e,t,r)=>{var n,i=(n=Qx[r])!==null&&n!==void 0?n:br,a=M0().keys(t).value((u,l)=>Number(se(u,l,0))).order(Wo).offset(i),o=a(e);return o.forEach((u,l)=>{u.forEach((c,s)=>{var f=se(e[s],t[l],0);Array.isArray(f)&&f.length===2&&D(f[0])&&D(f[1])&&(c[0]=f[0],c[1]=f[1])})}),o};function ew(e){return e==null?void 0:String(e)}function Kc(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!oe(i[t.dataKey])){var u=Ov(r,"value",i[t.dataKey]);if(u)return u.coordinate+n/2}return r!=null&&r[a]?r[a].coordinate+n/2:null}var l=se(i,oe(o)?t.dataKey:o),c=t.scale.map(l);return D(c)?c:null}var Uc=e=>{var t=e.axis,r=e.ticks,n=e.offset,i=e.bandSize,a=e.entry,o=e.index;if(t.type==="category")return r[o]?r[o].coordinate+n:null;var u=se(a,t.dataKey,t.scale.domain()[o]);if(oe(u))return null;var l=t.scale.map(u);return D(l)?l-i/2+n:null},tw=e=>{var t=e.numericAxis,r=t.scale.domain();if(t.type==="number"){var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return n<=0&&i>=0?0:i<0?i:n}return r[0]},rw=e=>{var t=e.flat(2).filter(D);return[Math.min(...t),Math.max(...t)]},nw=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],iw=(e,t,r)=>{if(!(e==null||Object.keys(e).length===0))return nw(Object.keys(e).reduce((n,i)=>{var a=e[i];if(!a)return n;var o=a.stackedData,u=o.reduce((l,c)=>{var s=Kh(c,t,r),f=rw(s);return!G(f[0])||!G(f[1])?l:[Math.min(l[0],f[0]),Math.max(l[1],f[1])]},[1/0,-1/0]);return[Math.min(u[0],n[0]),Math.max(u[1],n[1])]},[1/0,-1/0]))},Hc=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Yc=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Yr=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var i=wa(t,m=>m.coordinate),a=[],o=0,u=1,l=i.length;ud&&(v=Math.min(p,v));return v===1/0?0:v}return r?void 0:0};function Vc(e){var t=e.tooltipEntrySettings,r=e.dataKey,n=e.payload,i=e.value,a=e.name;return Le(Le({},t),{},{dataKey:r,payload:n,value:i,name:a})}function Ta(e,t){if(e!=null)return String(e);if(typeof t=="string")return t}var aw=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},ow=(e,t)=>t==="centric"?e.angle:e.radius,Lt=e=>e.layout.width,Bt=e=>e.layout.height,uw=e=>e.layout.scale,Uh=e=>e.layout.margin,Ma=P(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Da=P(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),lw="data-recharts-item-index",cw="data-recharts-item-id",Un=60,Vu=30;function qc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hi(e){for(var t=1;te.brush.height;function hw(e){var t=Da(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:Un;return r+i}return r},0)}function pw(e){var t=Da(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:Un;return r+i}return r},0)}function mw(e){var t=Ma(e);return t.reduce((r,n)=>{if(n.orientation==="top"&&!n.mirror&&!n.hide){var i=typeof n.height=="number"?n.height:Vu;return r+i}return r},0)}function yw(e){var t=Ma(e);return t.reduce((r,n)=>{if(n.orientation==="bottom"&&!n.mirror&&!n.hide){var i=typeof n.height=="number"?n.height:Vu;return r+i}return r},0)}var Ae=P([Lt,Bt,Uh,vw,hw,pw,mw,yw,vh,$b],(e,t,r,n,i,a,o,u,l,c)=>{var s={left:(r.left||0)+i,right:(r.right||0)+a},f={top:(r.top||0)+o,bottom:(r.bottom||0)+u},d=hi(hi({},f),s),v=d.bottom;d.bottom+=n,d=qx(d,l,c);var p=e-d.left-d.right,m=t-d.top-d.bottom;return hi(hi({brushBottom:v},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),gw=P(Ae,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),qu=P(Lt,Bt,(e,t)=>({x:0,y:0,width:e,height:t})),bw=h.createContext(null),De=()=>h.useContext(bw)!=null,$a=e=>e.brush,Na=P([$a,Ae,Uh],(e,t,r)=>({height:e.height,x:D(e.x)?e.x:t.left,y:D(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:D(e.width)?e.width:t.width}));function xw(e,t,{signal:r,edges:n}={}){let i,a=null;const o=n!=null&&n.includes("leading"),u=n==null||n.includes("trailing"),l=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},c=()=>{u&&l(),v()};let s=null;const f=()=>{s!=null&&clearTimeout(s),s=setTimeout(()=>{s=null,c()},t)},d=()=>{s!==null&&(clearTimeout(s),s=null)},v=()=>{d(),i=void 0,a=null},p=()=>{l()},m=function(...y){if(r!=null&&r.aborted)return;i=this,a=y;const g=s==null;f(),o&&g&&l()};return m.schedule=f,m.cancel=v,m.flush=p,r==null||r.addEventListener("abort",v,{once:!0}),m}function ww(e,t=0,r={}){typeof r!="object"&&(r={});const{leading:n=!1,trailing:i=!0,maxWait:a}=r,o=Array(2);n&&(o[0]="leading"),i&&(o[1]="trailing");let u,l=null;const c=xw(function(...d){u=e.apply(this,d),l=null},t,{edges:o}),s=function(...d){return a!=null&&(l===null&&(l=Date.now()),Date.now()-l>=a)?(u=e.apply(this,d),l=Date.now(),c.cancel(),c.schedule(),u):(c.apply(this,d),u)},f=()=>(c.flush(),u);return s.cancel=c.cancel,s.flush=f,s}function Aw(e,t=0,r={}){const{leading:n=!0,trailing:i=!0}=r;return ww(e,t,{leading:n,maxWait:t,trailing:i})}var Xc=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai[o++]))}},bt={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},Hh=(e,t,r)=>{var n=r.width,i=n===void 0?bt.width:n,a=r.height,o=a===void 0?bt.height:a,u=r.aspect,l=r.maxHeight,c=gr(i)?e:Number(i),s=gr(o)?t:Number(o);return u&&u>0&&(c?s=c/u:s&&(c=s*u),l&&s!=null&&s>l&&(s=l)),{calculatedWidth:c,calculatedHeight:s}},Ow={width:0,height:0,overflow:"visible"},Pw={width:0,overflowX:"visible"},Sw={height:0,overflowY:"visible"},Ew={},Iw=e=>{var t=e.width,r=e.height,n=gr(t),i=gr(r);return n&&i?Ow:n?Pw:i?Sw:Ew};function _w(e){var t=e.width,r=e.height,n=e.aspect,i=t,a=r;return i===void 0&&a===void 0?(i=bt.width,a=bt.height):i===void 0?i=n&&n>0?void 0:bt.width:a===void 0&&(a=n&&n>0?void 0:bt.height),{width:i,height:a}}var Cw=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function Ki(){return Ki=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r({width:r,height:n}),[r,n]);return zw(i)?h.createElement(Yh.Provider,{value:i},t):null}var Xu=()=>h.useContext(Yh),Fw=h.forwardRef((e,t)=>{var r=e.aspect,n=e.initialDimension,i=n===void 0?bt.initialDimension:n,a=e.width,o=e.height,u=e.minWidth,l=u===void 0?bt.minWidth:u,c=e.minHeight,s=e.maxHeight,f=e.children,d=e.debounce,v=d===void 0?bt.debounce:d,p=e.id,m=e.className,y=e.onResize,g=e.style,x=g===void 0?{}:g,A=Lw(e,Cw),w=h.useRef(null),O=h.useRef();O.current=y,h.useImperativeHandle(t,()=>w.current);var b=h.useState({containerWidth:i.width,containerHeight:i.height}),S=Mw(b,2),I=S[0],_=S[1],j=h.useCallback((U,H)=>{_(L=>{var V=Math.round(U),W=Math.round(H);return L.containerWidth===V&&L.containerHeight===W?L:{containerWidth:V,containerHeight:W}})},[]);h.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return Sr;var U=fe=>{var de,ue=fe[0];if(ue!=null){var Ne=ue.contentRect,Ke=Ne.width,at=Ne.height;j(Ke,at),(de=O.current)===null||de===void 0||de.call(O,Ke,at)}};v>0&&(U=Aw(U,v,{trailing:!0,leading:!1}));var H=new ResizeObserver(U),L=w.current.getBoundingClientRect(),V=L.width,W=L.height;return j(V,W),H.observe(w.current),()=>{H.disconnect()}},[j,v]);var k=I.containerWidth,E=I.containerHeight;Xc(!r||r>0,"The aspect(%s) must be greater than zero.",r);var R=Hh(k,E,{width:a,height:o,aspect:r,maxHeight:s}),N=R.calculatedWidth,F=R.calculatedHeight;return Xc(k<0||E<0||N!=null&&N>0||F!=null&&F>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,N,F,a,o,l,c,r),h.createElement("div",Ki({id:p?"".concat(p):void 0,className:te("recharts-responsive-container",m),style:Zc(Zc({},x),{},{width:a,height:o,minWidth:l,minHeight:c,maxHeight:s}),ref:w},A),h.createElement("div",{style:Iw({width:a,height:o})},h.createElement(Vh,{width:N,height:F},f)))}),fR=h.forwardRef((e,t)=>{var r=Xu();if(Gt(r.width)&&Gt(r.height))return e.children;var n=_w({width:e.width,height:e.height,aspect:e.aspect}),i=n.width,a=n.height,o=Hh(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight}),u=o.calculatedWidth,l=o.calculatedHeight;return D(u)&&D(l)?h.createElement(Vh,{width:u,height:l},e.children):h.createElement(Fw,Ki({},e,{width:i,height:a,ref:t}))}),Ra=()=>{var e,t=De(),r=$(gw),n=$(Na),i=(e=$($a))===null||e===void 0?void 0:e.padding;return!t||!n||!i?r:{width:n.width-i.left-i.right,height:n.height-i.top-i.bottom,x:i.left,y:i.top}},Ww={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},Kw=()=>{var e;return(e=$(Ae))!==null&&e!==void 0?e:Ww},Uw=()=>$(Lt),Hw=()=>$(Bt),Z=e=>e.layout.layoutType,Er=()=>$(Z),qh=()=>{var e=Er();if(e==="horizontal"||e==="vertical")return e},Xh=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Yw=()=>{var e=Er();return e!==void 0},Hn=e=>{var t=ie(),r=De(),n=e.width,i=e.height,a=Xu(),o=n,u=i;return a&&(o=a.width>0?a.width:n,u=a.height>0?a.height:i),h.useEffect(()=>{!r&&Gt(o)&&Gt(u)&&t(Wx({width:o,height:u}))},[t,r,o,u]),null},Vw={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value",position:void 0,offset:0},size:{width:0,height:0},payload:[]},Gh=Me({name:"legend",initialState:Vw,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter,e.settings.position=t.payload.position,e.settings.offset=t.payload.offset},addLegendPayload:{reducer(e,t){e.payload.push(q(t.payload))},prepare:re()},replaceLegendPayload:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,a=Qe(e).payload.indexOf(q(n));a>-1&&(e.payload[a]=q(i))},prepare:re()},removeLegendPayload:{reducer(e,t){var r=Qe(e).payload.indexOf(q(t.payload));r>-1&&e.payload.splice(r,1)},prepare:re()}}}),Yn=Gh.actions;Yn.setLegendSize;Yn.setLegendSettings;var qw=Yn.addLegendPayload,Xw=Yn.replaceLegendPayload,Gw=Yn.removeLegendPayload,Zw=Gh.reducer,fo={exports:{}},vo={};/** + * @license React + * use-sync-external-store-with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Jc;function Qw(){if(Jc)return vo;Jc=1;var e=pv();function t(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,u=e.useDebugValue;return vo.useSyncExternalStoreWithSelector=function(l,c,s,f,d){var v=i(null);if(v.current===null){var p={hasValue:!1,value:null};v.current=p}else p=v.current;v=o(function(){function y(O){if(!g){if(g=!0,x=O,O=f(O),d!==void 0&&p.hasValue){var b=p.value;if(d(b,O))return A=b}return A=O}if(b=A,r(x,O))return b;var S=f(O);return d!==void 0&&d(b,S)?(x=O,b):(x=O,A=S)}var g=!1,x,A,w=s===void 0?null:s;return[function(){return y(c())},w===null?void 0:function(){return y(w())}]},[c,s,f,d]);var m=n(l,v[0],v[1]);return a(function(){p.hasValue=!0,p.value=m},[m]),u(m),m},vo}var es;function Jw(){return es||(es=1,fo.exports=Qw()),fo.exports}Jw();function eA(e){e()}function tA(){let e=null,t=null;return{clear(){e=null,t=null},notify(){eA(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var ts={notify(){},get:()=>[]};function rA(e,t){let r,n=ts,i=0,a=!1;function o(m){s();const y=n.subscribe(m);let g=!1;return()=>{g||(g=!0,y(),f())}}function u(){n.notify()}function l(){p.onStateChange&&p.onStateChange()}function c(){return a}function s(){i++,r||(r=e.subscribe(l),n=tA())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=ts)}function d(){a||(a=!0,s())}function v(){a&&(a=!1,f())}const p={addNestedSub:o,notifyNestedSubs:u,handleChangeWrapper:l,isSubscribed:c,trySubscribe:d,tryUnsubscribe:v,getListeners:()=>n};return p}var nA=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",iA=nA(),aA=()=>typeof navigator<"u"&&navigator.product==="ReactNative",oA=aA(),uA=()=>iA||oA?h.useLayoutEffect:h.useEffect,lA=uA();function rs(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function cA(e,t){if(rs(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i=0;i{const l=rA(i);return{store:i,subscription:l,getServerState:n?()=>n:void 0}},[i,n]),o=h.useMemo(()=>i.getState(),[i]);lA(()=>{const{subscription:l}=a;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),o!==i.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[a,o]);const u=r||fA;return h.createElement(u.Provider,{value:a},t)}var vA=dA,hA=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function pA(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Vn(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(hA.has(n)){if(e[n]==null&&t[n]==null)continue;if(!cA(e[n],t[n]))return!1}else if(!pA(e[n],t[n]))return!1;return!0}function iu(){return iu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.separator,r=t===void 0?Tr.separator:t,n=e.contentStyle,i=e.itemStyle,a=e.labelStyle,o=a===void 0?Tr.labelStyle:a,u=e.payload,l=e.formatter,c=e.itemSorter,s=e.wrapperClassName,f=e.labelClassName,d=e.label,v=e.labelFormatter,p=e.accessibilityLayer,m=p===void 0?Tr.accessibilityLayer:p,y=()=>{if(u&&u.length){var I={padding:0,margin:0},_=SA(u,c),j=_.map((k,E)=>{if(!k||k.type==="none")return null;var R=k.formatter||l||PA,N=k.value,F=k.name,U=N,H=F;if(R){var L=R(N,F,k,E,u);if(Array.isArray(L)){var V=bA(L,2);U=V[0],H=V[1]}else if(L!=null)U=L;else return null}var W=fn(fn({},Tr.itemStyle),{},{color:k.color||Tr.itemStyle.color},i);return h.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(E),style:W},Be(H)?h.createElement("span",{className:"recharts-tooltip-item-name"},H):null,Be(H)?h.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,h.createElement("span",{className:"recharts-tooltip-item-value"},U),h.createElement("span",{className:"recharts-tooltip-item-unit"},k.unit||""))});return h.createElement("ul",{className:"recharts-tooltip-item-list",style:I},j)}return null},g=fn(fn({},Tr.contentStyle),n),x=fn({margin:0},o),A=!oe(d),w=A?d:"",O=te("recharts-default-tooltip",s),b=te("recharts-tooltip-label",f);A&&v&&u!==void 0&&u!==null&&(w=v(d,u));var S=m?{role:"status","aria-live":"assertive"}:{};return h.createElement("div",iu({className:O,style:g},S),h.createElement("p",{className:b,style:x},h.isValidElement(w)?w:"".concat(w)),y())},dn="recharts-tooltip-wrapper",IA={visibility:"hidden"};function _A(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return te(dn,{["".concat(dn,"-right")]:D(r)&&t&&D(t.x)&&r>=t.x,["".concat(dn,"-left")]:D(r)&&t&&D(t.x)&&r=t.y,["".concat(dn,"-top")]:D(n)&&t&&D(t.y)&&n0?i:0),f=r[n]+i;if(t[n])return o[n]?s:f;var d=l[n];if(d==null)return 0;if(o[n]){var v=s,p=d;return vy?Math.max(s,d):Math.max(f,d)}function CA(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function kA(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTop,i=e.offsetLeft,a=e.position,o=e.reverseDirection,u=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,s,f,d;return u&&u.height>0&&u.width>0&&r?(f=as({allowEscapeViewBox:t,coordinate:r,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:u.width,viewBox:c,viewBoxDimension:c.width}),d=as({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:a,reverseDirection:o,tooltipDimension:u.height,viewBox:c,viewBoxDimension:c.height}),s=CA({translateX:f,translateY:d,useTranslate3d:l})):s=IA,{cssProperties:s,cssClasses:_A({translateX:f,translateY:d,coordinate:r})}}var jA=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),qn={isSsr:jA()};function TA(e,t){return NA(e)||$A(e,t)||DA(e,t)||MA()}function MA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DA(e,t){if(e){if(typeof e=="string")return os(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?os(e,t):void 0}}function os(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rqn.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=TA(e,2),r=t[0],n=t[1];return h.useEffect(()=>{if(window.matchMedia){var i=window.matchMedia("(prefers-reduced-motion: reduce)"),a=()=>{n(i.matches)};return i.addEventListener("change",a),()=>{i.removeEventListener("change",a)}}},[]),r}function us(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Mr(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),c=zA(l,2),s=c[0],f=c[1];h.useEffect(()=>{var g=x=>{if(x.key==="Escape"){var A,w,O,b;f({dismissed:!0,dismissedAtCoordinate:{x:(A=(w=e.coordinate)===null||w===void 0?void 0:w.x)!==null&&A!==void 0?A:0,y:(O=(b=e.coordinate)===null||b===void 0?void 0:b.y)!==null&&O!==void 0?O:0}})}};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(r=e.coordinate)===null||r===void 0?void 0:r.y]),s.dismissed&&(((n=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)!==s.dismissedAtCoordinate.x||((a=(o=e.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==s.dismissedAtCoordinate.y)&&f(Mr(Mr({},s),{},{dismissed:!1}));var d=kA({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:e.lastBoundingBox,useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),v=d.cssClasses,p=d.cssProperties,m=e.hasPortalFromProps?{}:Mr(Mr({transition:HA({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},p),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),y=Mr(Mr({},m),{},{visibility:!s.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return h.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:v,style:y,ref:e.innerRef},e.children)}var VA=h.memo(YA),Qh=()=>{var e;return(e=$(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function au(){return au=Object.assign?Object.assign.bind():function(e){for(var t=1;tG(e.x)&&G(e.y),ds=e=>e.base!=null&&Ui(e.base)&&Ui(e),vn=e=>e.x,hn=e=>e.y,ZA=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(Tu(e));if((r==="curveMonotone"||r==="curveBump")&&t){var n=fs["".concat(r).concat(t==="vertical"?"Y":"X")];if(n)return n}return fs[r]||ba},vs={connectNulls:!1,type:"linear"},QA=e=>{var t=e.type,r=t===void 0?vs.type:t,n=e.points,i=n===void 0?[]:n,a=e.baseLine,o=e.layout,u=e.connectNulls,l=u===void 0?vs.connectNulls:u,c=ZA(r,o),s=l?i.filter(Ui):i;if(Array.isArray(a)){var f,d=i.map((g,x)=>ss(ss({},g),{},{base:a[x]}));o==="vertical"?f=li().y(hn).x1(vn).x0(g=>g.base.x):f=li().x(vn).y1(hn).y0(g=>g.base.y);var v=f.defined(ds).curve(c),p=l?d.filter(ds):d;return v(p)}var m;o==="vertical"&&D(a)?m=li().y(hn).x1(vn).x0(a):D(a)?m=li().x(vn).y1(hn).y0(a):m=Cv().x(vn).y(hn);var y=m.defined(Ui).curve(c);return y(s)},Jh=e=>{var t=e.className,r=e.points,n=e.path,i=e.pathRef,a=Er();if((!r||!r.length)&&!n)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},u=r&&r.length?QA(o):n;return h.createElement("path",au({},Ot(e),$u(e),{className:te("recharts-curve",t),d:u===null?void 0:u,ref:i}))},JA=["x","y","top","left","width","height","className"];function ou(){return ou=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(i,"v").concat(n,"M").concat(a,",").concat(t,"h").concat(r),u1=e=>{var t=e.x,r=t===void 0?0:t,n=e.y,i=n===void 0?0:n,a=e.top,o=a===void 0?0:a,u=e.left,l=u===void 0?0:u,c=e.width,s=c===void 0?0:c,f=e.height,d=f===void 0?0:f,v=e.className,p=i1(e,JA),m=e1({x:r,y:i,top:o,left:l,width:s,height:d},p);return!D(r)||!D(i)||!D(s)||!D(d)||!D(o)||!D(l)?null:h.createElement("path",ou({},Xe(m),{className:te("recharts-cross",v),d:o1(r,i,s,d,o,l)}))};function l1(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-i,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}var Hi=1e-4,ep=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],tp=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),ps=(e,t)=>r=>{var n=ep(e,t);return tp(n,r)},c1=(e,t)=>r=>{var n=ep(e,t),i=[...n.map((a,o)=>a*o).slice(1),0];return tp(i,r)},s1=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var n=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(n==null||n.length!==4)return null;var i=n.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},f1=function(){for(var t=arguments.length,r=new Array(t),n=0;n{var i=ps(e,r),a=ps(t,n),o=c1(e,r),u=c=>c>1?1:c<0?0:c,l=c=>{for(var s=c>1?1:c,f=s,d=0;d<8;++d){var v=i(f)-s,p=o(f);if(Math.abs(v-s)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,u=o===void 0?16.67:o,l=1,c=[0],s=0,f=0,d=1e4,v=0;v{var x,A,w;if(g<=0)return 0;if(g>=1)return l;var O=g*y,b=Math.floor(O),S=O-b;return((x=c[b])!==null&&x!==void 0?x:0)+(((A=c[b+1])!==null&&A!==void 0?A:0)-((w=c[b])!==null&&w!==void 0?w:0))*S}},h1=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return ms(e);case"spring":return v1();default:if(e.split("(")[0]==="cubic-bezier")return ms(e)}return typeof e=="function"?e:null},p1=(e,t,r)=>{var n,i=a=>{var o=t.tick(a);if(t.getState()==="active"){if(r(t.getInterpolated()),t.getProgress()===1){t.complete(),n=void 0;return}n=e.setTimeout(i,o);return}n=e.setTimeout(i,o)};return n=e.setTimeout(i,0),()=>{var a;return(a=n)===null||a===void 0?void 0:a()}},rp=h.createContext(p1);rp.Provider;function m1(e){var t=h.useContext(rp);return h.useMemo(()=>e??t,[e,t])}function y1(e,t,r){return(t=g1(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function g1(e){var t=b1(e,"string");return typeof t=="symbol"?t:t+""}function b1(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ys="init",gs="pending",bs="active",x1="completed";function mo(e){return Math.max(0,e)}class w1{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(t){var r;y1(this,"state",ys),this.animationId=t.animationId,this.onAnimationEnd=t.onAnimationEnd,this.animationDuration=mo(t.animationDuration),this.animationBegin=mo(t.animationBegin),this.progress=0,this.from=t.from,this.to=t.to,this.easing=t.easing,(r=t.onAnimationStart)===null||r===void 0||r.call(t)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(t){if(this.getState()===ys)return this.state=gs,this.beginStartedTime=t,this.animationBegin;if(this.getState()===gs){if(this.beginStartedTime==null)throw new Error;var r=t-this.beginStartedTime;return r>=this.animationBegin?(this.state=bs,this.animationStartedTime=t,this.nextAnimationUpdate(0)):mo(this.animationBegin-r)}if(this.getState()===bs){if(this.animationStartedTime==null)throw new Error;var n=t-this.animationStartedTime;return this.setProgress(n/this.animationDuration),this.nextAnimationUpdate(n)}return 0}setProgress(t){this.progress=Math.min(1,Math.max(0,t))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state==="active"){var t;(t=this.onAnimationEnd)===null||t===void 0||t.call(this)}this.state=x1}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class A1 extends w1{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(ve(this.getFrom(),this.getTo(),this.getProgress()))}}class O1{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),i=null,a=o=>{o-n>=r?t(o):i=requestAnimationFrame(a)};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function P1(e,t){return _1(e)||I1(e,t)||E1(e,t)||S1()}function S1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E1(e,t){if(e){if(typeof e=="string")return xs(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xs(e,t):void 0}}function xs(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{},onAnimationStart:()=>{}},ws=0,yo=1;function np(e){var t=We(e,C1),r=t.animationId,n=t.isActive,i=t.canBegin,a=t.duration,o=t.easing,u=t.begin,l=t.onAnimationEnd,c=t.onAnimationStart,s=t.children,f=Zh(),d=n==="auto"?!qn.isSsr&&!f:n,v=m1(t.animationController),p=h.useState(d?ws:yo),m=P1(p,2),y=m[0],g=m[1];return h.useEffect(()=>{d||g(yo)},[d]),h.useEffect(()=>{var x=h1(o);if(!d||!i||x==null)return Sr;var A=new O1,w=new A1({animationId:r,easing:x,animationDuration:a,animationBegin:u,onAnimationStart:c,onAnimationEnd:l,from:ws,to:yo});return v(A,w,g)},[v,r,d,i,a,o,u,c,l]),s(Number(y))}function ip(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=h.useRef(_n(t)),n=h.useRef(e);return n.current!==e&&(r.current=_n(t),n.current=e),r.current}var k1=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),j1=(e,t,r)=>e.map(n=>"".concat(k1(n)," ").concat(t,"ms ").concat(r)).join(","),T1=["radius"],M1=["radius"],As,Os,Ps,Ss,Es,Is,_s,Cs,ks,js;function Ts(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ms(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var a=_t(r),o=_t(n),u=Math.min(Math.abs(a)/2,Math.abs(o)/2),l=o>=0?1:-1,c=a>=0?1:-1,s=o>=0&&a>=0||o<0&&a<0?1:0,f;if(u>0&&Array.isArray(i)){for(var d=[0,0,0,0],v=0,p=4;vu?u:y}f=Ie(As||(As=pt(["M",",",""])),e,t+l*d[0]),d[0]>0&&(f+=Ie(Os||(Os=pt(["A ",",",",0,0,",",",",",""])),d[0],d[0],s,e+c*d[0],t)),f+=Ie(Ps||(Ps=pt(["L ",",",""])),e+r-c*d[1],t),d[1]>0&&(f+=Ie(Ss||(Ss=pt(["A ",",",",0,0,",`, + `,",",""])),d[1],d[1],s,e+r,t+l*d[1])),f+=Ie(Es||(Es=pt(["L ",",",""])),e+r,t+n-l*d[2]),d[2]>0&&(f+=Ie(Is||(Is=pt(["A ",",",",0,0,",`, + `,",",""])),d[2],d[2],s,e+r-c*d[2],t+n)),f+=Ie(_s||(_s=pt(["L ",",",""])),e+c*d[3],t+n),d[3]>0&&(f+=Ie(Cs||(Cs=pt(["A ",",",",0,0,",`, + `,",",""])),d[3],d[3],s,e,t+n-l*d[3])),f+="Z"}else if(u>0&&i===+i&&i>0){var g=Math.min(u,i);f=Ie(ks||(ks=pt(["M ",",",` + A `,",",",0,0,",",",",",` + L `,",",` + A `,",",",0,0,",",",",",` + L `,",",` + A `,",",",0,0,",",",",",` + L `,",",` + A `,",",",0,0,",",",","," Z"])),e,t+l*g,g,g,s,e+c*g,t,e+r-c*g,t,g,g,s,e+r,t+l*g,e+r,t+n-l*g,g,g,s,e+r-c*g,t+n,e+c*g,t+n,g,g,s,e,t+n-l*g)}else f=Ie(js||(js=pt(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return f},Rs={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Gu=e=>{var t=We(e,Rs),r=h.useRef(null),n=h.useState(-1),i=L1(n,2),a=i[0],o=i[1];h.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var L=r.current.getTotalLength();L&&o(L)}catch{}},[]);var u=t.x,l=t.y,c=t.width,s=t.height,f=t.radius,d=t.className,v=t.animationEasing,p=t.animationDuration,m=t.animationBegin,y=t.isAnimationActive,g=t.isUpdateAnimationActive,x=h.useRef(c),A=h.useRef(s),w=h.useRef(u),O=h.useRef(l),b=h.useMemo(()=>({x:u,y:l,width:c,height:s,radius:f}),[u,l,c,s,f]),S=ip(b,"rectangle-");if(u!==+u||l!==+l||c!==+c||s!==+s||c===0||s===0)return null;var I=te("recharts-rectangle",d);if(!g){var _=Xe(t);_.radius;var j=Ds(_,T1);return h.createElement("path",Yi({},j,{x:_t(u),y:_t(l),width:_t(c),height:_t(s),radius:typeof f=="number"?f:void 0,className:I,d:Ns(u,l,c,s,f)}))}var k=x.current,E=A.current,R=w.current,N=O.current,F="0px ".concat(a===-1?1:a,"px"),U="".concat(a,"px ").concat(a,"px"),H=j1(["strokeDasharray"],p,typeof v=="string"?v:Rs.animationEasing);return h.createElement(np,{animationId:S,key:S,canBegin:a>0,duration:p,easing:v,isActive:g,begin:m},L=>{var V=ve(k,c,L),W=ve(E,s,L),fe=ve(R,u,L),de=ve(N,l,L);r.current&&(x.current=V,A.current=W,w.current=fe,O.current=de);var ue;y?L>0?ue={transition:H,strokeDasharray:U}:ue={strokeDasharray:F}:ue={strokeDasharray:U};var Ne=Xe(t);Ne.radius;var Ke=Ds(Ne,M1);return h.createElement("path",Yi({},Ke,{radius:typeof f=="number"?f:void 0,className:I,d:Ns(fe,de,V,W,f),ref:r,style:Ms(Ms({},ue),t.style)}))})};function Ls(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Bs(e){for(var t=1;te*180/Math.PI,Ce=(e,t,r,n)=>({x:e+Math.cos(-Vi*n)*r,y:t+Math.sin(-Vi*n)*r}),V1=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},q1=(e,t)=>{var r=e.x,n=e.y,i=t.x,a=t.y;return Math.sqrt((r-i)**2+(n-a)**2)},X1=(e,t)=>{var r=e.x,n=e.y,i=t.cx,a=t.cy,o=q1({x:r,y:n},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var u=(r-i)/o,l=Math.acos(u);return n>a&&(l=2*Math.PI-l),{radius:o,angle:Y1(l),angleInRadian:l}},G1=e=>{var t=e.startAngle,r=e.endAngle,n=Math.floor(t/360),i=Math.floor(r/360),a=Math.min(n,i);return{startAngle:t-a*360,endAngle:r-a*360}},Z1=(e,t)=>{var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return e+o*360},Q1=(e,t)=>{var r=e.relativeX,n=e.relativeY,i=X1({x:r,y:n},t),a=i.radius,o=i.angle,u=t.innerRadius,l=t.outerRadius;if(al||a===0)return null;var c=G1(t),s=c.startAngle,f=c.endAngle,d=o,v;if(s<=f){for(;d>f;)d-=360;for(;d=s&&d<=f}else{for(;d>s;)d-=360;for(;d=f&&d<=s}return v?Bs(Bs({},t),{},{radius:a,angle:Z1(d,t)}):null};function ap(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,a=e.endAngle,o=Ce(t,r,n,i),u=Ce(t,r,n,a);return{points:[o,u],cx:t,cy:r,radius:n,startAngle:i,endAngle:a}}var zs,Fs,Ws,Ks,Us,Hs,Ys;function uu(){return uu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=Ye(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},pi=e=>{var t=e.cx,r=e.cy,n=e.radius,i=e.angle,a=e.sign,o=e.isExternal,u=e.cornerRadius,l=e.cornerIsExternal,c=u*(o?1:-1)+n,s=Math.asin(u/c)/Vi,f=l?i:i+a*s,d=Ce(t,r,c,f),v=Ce(t,r,n,f),p=l?i-a*s:i,m=Ce(t,r,c*Math.cos(s*Vi),p);return{center:d,circleTangency:v,lineTangency:m,theta:s}},op=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,a=e.startAngle,o=e.endAngle,u=J1(a,o),l=a+u,c=Ce(t,r,i,a),s=Ce(t,r,i,l),f=Ie(zs||(zs=fr(["M ",",",` + A `,",",`,0, + `,",",`, + `,",",` + `])),c.x,c.y,i,i,+(Math.abs(u)>180),+(a>l),s.x,s.y);if(n>0){var d=Ce(t,r,n,a),v=Ce(t,r,n,l);f+=Ie(Fs||(Fs=fr(["L ",",",` + A `,",",`,0, + `,",",`, + `,","," Z"])),v.x,v.y,n,n,+(Math.abs(u)>180),+(a<=l),d.x,d.y)}else f+=Ie(Ws||(Ws=fr(["L ",","," Z"])),t,r);return f},eO=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,o=e.forceCornerRadius,u=e.cornerIsExternal,l=e.startAngle,c=e.endAngle,s=Ye(c-l),f=pi({cx:t,cy:r,radius:i,angle:l,sign:s,cornerRadius:a,cornerIsExternal:u}),d=f.circleTangency,v=f.lineTangency,p=f.theta,m=pi({cx:t,cy:r,radius:i,angle:c,sign:-s,cornerRadius:a,cornerIsExternal:u}),y=m.circleTangency,g=m.lineTangency,x=m.theta,A=u?Math.abs(l-c):Math.abs(l-c)-p-x;if(A<0)return o?Ie(Ks||(Ks=fr(["M ",",",` + a`,",",",0,0,1,",`,0 + a`,",",",0,0,1,",`,0 + `])),v.x,v.y,a,a,a*2,a,a,-a*2):op({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:l,endAngle:c});var w=Ie(Us||(Us=fr(["M ",",",` + A`,",",",0,0,",",",",",` + A`,",",",0,",",",",",",",` + A`,",",",0,0,",",",",",` + `])),v.x,v.y,a,a,+(s<0),d.x,d.y,i,i,+(A>180),+(s<0),y.x,y.y,a,a,+(s<0),g.x,g.y);if(n>0){var O=pi({cx:t,cy:r,radius:n,angle:l,sign:s,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),b=O.circleTangency,S=O.lineTangency,I=O.theta,_=pi({cx:t,cy:r,radius:n,angle:c,sign:-s,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),j=_.circleTangency,k=_.lineTangency,E=_.theta,R=u?Math.abs(l-c):Math.abs(l-c)-I-E;if(R<0&&a===0)return"".concat(w,"L").concat(t,",").concat(r,"Z");w+=Ie(Hs||(Hs=fr(["L",",",` + A`,",",",0,0,",",",",",` + A`,",",",0,",",",",",",",` + A`,",",",0,0,",",",",","Z"])),k.x,k.y,a,a,+(s<0),j.x,j.y,n,n,+(R>180),+(s>0),b.x,b.y,a,a,+(s<0),S.x,S.y)}else w+=Ie(Ys||(Ys=fr(["L",",","Z"])),t,r);return w},tO={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},rO=e=>{var t=We(e,tO),r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,u=t.forceCornerRadius,l=t.cornerIsExternal,c=t.startAngle,s=t.endAngle,f=t.className;if(a0&&Math.abs(c-s)<360?m=eO({cx:r,cy:n,innerRadius:i,outerRadius:a,cornerRadius:Math.min(p,v/2),forceCornerRadius:u,cornerIsExternal:l,startAngle:c,endAngle:s}):m=op({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:c,endAngle:s}),h.createElement("path",uu({},Xe(t),{className:d,d:m}))};function nO(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(Lv(t)){if(e==="centric"){var n=t.cx,i=t.cy,a=t.innerRadius,o=t.outerRadius,u=t.angle,l=Ce(n,i,a,u),c=Ce(n,i,o,u);return[{x:l.x,y:l.y},{x:c.x,y:c.y}]}return ap(t)}}function iO(e){return dh(e)?NaN:Number(e)}function go(e){return e?(e=iO(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function up(e,t,r){r&&typeof r!="number"&&Vo(e,t,r)&&(t=r=void 0),e=go(e),t===void 0?(t=e,e=0):t=go(t),r=r===void 0?ee.chartData,Zu=P([dt],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Xn=(e,t,r,n)=>n?Zu(e):dt(e),aO=(e,t,r)=>r?Zu(e):dt(e),oO=P([Xn],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});P([Zu],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});var uO=P([dt],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});function Qu(e,t){return fO(e)||sO(e,t)||cO(e,t)||lO()}function lO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cO(e,t){if(e){if(typeof e=="string")return Vs(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Vs(e,t):void 0}}function Vs(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};M.decimalPlaces=M.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ne;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};M.dividedBy=M.div=function(e){return jt(this,new this.constructor(e))};M.dividedToIntegerBy=M.idiv=function(e){var t=this,r=t.constructor;return ee(jt(t,new r(e),0,1),r.precision)};M.equals=M.eq=function(e){return!this.cmp(e)};M.exponent=function(){return he(this)};M.greaterThan=M.gt=function(e){return this.cmp(e)>0};M.greaterThanOrEqualTo=M.gte=function(e){return this.cmp(e)>=0};M.isInteger=M.isint=function(){return this.e>this.d.length-2};M.isNegative=M.isneg=function(){return this.s<0};M.isPositive=M.ispos=function(){return this.s>0};M.isZero=function(){return this.s===0};M.lessThan=M.lt=function(e){return this.cmp(e)<0};M.lessThanOrEqualTo=M.lte=function(e){return this.cmp(e)<1};M.logarithm=M.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(He))throw Error(tt+"NaN");if(r.s<1)throw Error(tt+(r.s?"NaN":"-Infinity"));return r.eq(He)?new n(0):(ae=!1,t=jt(Mn(r,a),Mn(e,a),a),ae=!0,ee(t,i))};M.minus=M.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?dp(t,e):sp(t,(e.s=-e.s,e))};M.modulo=M.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(tt+"NaN");return r.s?(ae=!1,t=jt(r,e,0,1).times(e),ae=!0,r.minus(t)):ee(new n(r),i)};M.naturalExponential=M.exp=function(){return fp(this)};M.naturalLogarithm=M.ln=function(){return Mn(this)};M.negated=M.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};M.plus=M.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?sp(t,e):dp(t,(e.s=-e.s,e))};M.precision=M.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(pr+e);if(t=he(i)+1,n=i.d.length-1,r=n*ne+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};M.squareRoot=M.sqrt=function(){var e,t,r,n,i,a,o,u=this,l=u.constructor;if(u.s<1){if(!u.s)return new l(0);throw Error(tt+"NaN")}for(e=he(u),ae=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=xt(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=en((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(jt(u,a,o+2)).times(.5),xt(a.d).slice(0,o)===(t=xt(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(ee(a,r+1,0),a.times(a).eq(u)){n=a;break}}else if(t!="9999")break;o+=4}return ae=!0,ee(n,r)};M.times=M.mul=function(e){var t,r,n,i,a,o,u,l,c,s=this,f=s.constructor,d=s.d,v=(e=new f(e)).d;if(!s.s||!e.s)return new f(0);for(e.s*=s.s,r=s.e+e.e,l=d.length,c=v.length,l=0;){for(t=0,i=l+n;i>n;)u=a[i]+v[n]*d[i-n-1]+t,a[i--]=u%xe|0,t=u/xe|0;a[i]=(a[i]+t)%xe|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,ae?ee(e,f.precision):e};M.toDecimalPlaces=M.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(St(e,0,Jr),t===void 0?t=n.rounding:St(t,0,8),ee(r,e+he(r)+1,t))};M.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=wr(n,!0):(St(e,0,Jr),t===void 0?t=i.rounding:St(t,0,8),n=ee(new i(n),e+1,t),r=wr(n,!0,e+1)),r};M.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?wr(i):(St(e,0,Jr),t===void 0?t=a.rounding:St(t,0,8),n=ee(new a(i),e+he(i)+1,t),r=wr(n.abs(),!1,e+he(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};M.toInteger=M.toint=function(){var e=this,t=e.constructor;return ee(new t(e),he(e)+1,t.rounding)};M.toNumber=function(){return+this};M.toPower=M.pow=function(e){var t,r,n,i,a,o,u=this,l=u.constructor,c=12,s=+(e=new l(e));if(!e.s)return new l(He);if(u=new l(u),!u.s){if(e.s<1)throw Error(tt+"Infinity");return u}if(u.eq(He))return u;if(n=l.precision,e.eq(He))return ee(u,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=u.s,o){if((r=s<0?-s:s)<=cp){for(i=new l(He),t=Math.ceil(n/ne+4),ae=!1;r%2&&(i=i.times(u),Gs(i.d,t)),r=en(r/2),r!==0;)u=u.times(u),Gs(u.d,t);return ae=!0,e.s<0?new l(He).div(i):ee(i,n)}}else if(a<0)throw Error(tt+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,ae=!1,i=e.times(Mn(u,n+c)),ae=!0,i=fp(i),i.s=a,i};M.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=he(i),n=wr(i,r<=a.toExpNeg||r>=a.toExpPos)):(St(e,1,Jr),t===void 0?t=a.rounding:St(t,0,8),i=ee(new a(i),e,t),r=he(i),n=wr(i,e<=r||r<=a.toExpNeg,e)),n};M.toSignificantDigits=M.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(St(e,1,Jr),t===void 0?t=n.rounding:St(t,0,8)),ee(new n(r),e,t)};M.toString=M.valueOf=M.val=M.toJSON=M[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=he(e),r=e.constructor;return wr(e,t<=r.toExpNeg||t>=r.toExpPos)};function sp(e,t){var r,n,i,a,o,u,l,c,s=e.constructor,f=s.precision;if(!e.s||!t.s)return t.s||(t=new s(e)),ae?ee(t,f):t;if(l=e.d,c=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,u=c.length):(n=c,i=o,u=l.length),o=Math.ceil(f/ne),u=o>u?o+1:u+1,a>u&&(a=u,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(u=l.length,a=c.length,u-a<0&&(a=u,n=c,c=l,l=n),r=0;a;)r=(l[--a]=l[a]+c[a]+r)/xe|0,l[a]%=xe;for(r&&(l.unshift(r),++i),u=l.length;l[--u]==0;)l.pop();return t.d=l,t.e=i,ae?ee(t,f):t}function St(e,t,r){if(e!==~~e||er)throw Error(pr+e)}function xt(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(u=l=0;ui[u]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var u,l,c,s,f,d,v,p,m,y,g,x,A,w,O,b,S,I,_=n.constructor,j=n.s==i.s?1:-1,k=n.d,E=i.d;if(!n.s)return new _(n);if(!i.s)throw Error(tt+"Division by zero");for(l=n.e-i.e,S=E.length,O=k.length,v=new _(j),p=v.d=[],c=0;E[c]==(k[c]||0);)++c;if(E[c]>(k[c]||0)&&--l,a==null?x=a=_.precision:o?x=a+(he(n)-he(i))+1:x=a,x<0)return new _(0);if(x=x/ne+2|0,c=0,S==1)for(s=0,E=E[0],x++;(c1&&(E=e(E,s),k=e(k,s),S=E.length,O=k.length),w=S,m=k.slice(0,S),y=m.length;y=xe/2&&++b;do s=0,u=t(E,m,S,y),u<0?(g=m[0],S!=y&&(g=g*xe+(m[1]||0)),s=g/b|0,s>1?(s>=xe&&(s=xe-1),f=e(E,s),d=f.length,y=m.length,u=t(f,m,d,y),u==1&&(s--,r(f,S16)throw Error(Ju+he(e));if(!e.s)return new s(He);for(ae=!1,u=f,o=new s(.03125);e.abs().gte(.1);)e=e.times(o),c+=5;for(n=Math.log(lr(2,c))/Math.LN10*2+5|0,u+=n,r=i=a=new s(He),s.precision=u;;){if(i=ee(i.times(e),u),r=r.times(++l),o=a.plus(jt(i,r,u)),xt(o.d).slice(0,u)===xt(a.d).slice(0,u)){for(;c--;)a=ee(a.times(a),u);return s.precision=f,t==null?(ae=!0,ee(a,f)):a}a=o}}function he(e){for(var t=e.e*ne,r=e.d[0];r>=10;r/=10)t++;return t}function bo(e,t,r){if(t>e.LN10.sd())throw ae=!0,r&&(e.precision=r),Error(tt+"LN10 precision limit exceeded");return ee(new e(e.LN10),t)}function Ht(e){for(var t="";e--;)t+="0";return t}function Mn(e,t){var r,n,i,a,o,u,l,c,s,f=1,d=10,v=e,p=v.d,m=v.constructor,y=m.precision;if(v.s<1)throw Error(tt+(v.s?"NaN":"-Infinity"));if(v.eq(He))return new m(0);if(t==null?(ae=!1,c=y):c=t,v.eq(10))return t==null&&(ae=!0),bo(m,c);if(c+=d,m.precision=c,r=xt(p),n=r.charAt(0),a=he(v),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(e),r=xt(v.d),n=r.charAt(0),f++;a=he(v),n>1?(v=new m("0."+r),a++):v=new m(n+"."+r.slice(1))}else return l=bo(m,c+2,y).times(a+""),v=Mn(new m(n+"."+r.slice(1)),c-d).plus(l),m.precision=y,t==null?(ae=!0,ee(v,y)):v;for(u=o=v=jt(v.minus(He),v.plus(He),c),s=ee(v.times(v),c),i=3;;){if(o=ee(o.times(s),c),l=u.plus(jt(o,new m(i),c)),xt(l.d).slice(0,c)===xt(u.d).slice(0,c))return u=u.times(2),a!==0&&(u=u.plus(bo(m,c+2,y).times(a+""))),u=jt(u,new m(f),c),m.precision=y,t==null?(ae=!0,ee(u,y)):u;u=l,i+=2}}function Xs(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=en(r/ne),e.d=[],n=(r+1)%ne,r<0&&(n+=ne),nqi||e.e<-qi))throw Error(Ju+r)}else e.s=0,e.e=0,e.d=[0];return e}function ee(e,t,r){var n,i,a,o,u,l,c,s,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=ne,i=t,c=f[s=0];else{if(s=Math.ceil((n+1)/ne),a=f.length,s>=a)return e;for(c=a=f[s],o=1;a>=10;a/=10)o++;n%=ne,i=n-ne+o}if(r!==void 0&&(a=lr(10,o-i-1),u=c/a%10|0,l=t<0||f[s+1]!==void 0||c%a,l=r<4?(u||l)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||l||r==6&&(n>0?i>0?c/lr(10,o-i):0:f[s-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return l?(a=he(e),f.length=1,t=t-a-1,f[0]=lr(10,(ne-t%ne)%ne),e.e=en(-t/ne)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=s,a=1,s--):(f.length=s+1,a=lr(10,ne-n),f[s]=i>0?(c/lr(10,o-i)%lr(10,i)|0)*a:0),l)for(;;)if(s==0){(f[0]+=a)==xe&&(f[0]=1,++e.e);break}else{if(f[s]+=a,f[s]!=xe)break;f[s--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(ae&&(e.e>qi||e.e<-qi))throw Error(Ju+he(e));return e}function dp(e,t){var r,n,i,a,o,u,l,c,s,f,d=e.constructor,v=d.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new d(e),ae?ee(t,v):t;if(l=e.d,f=t.d,n=t.e,c=e.e,l=l.slice(),o=c-n,o){for(s=o<0,s?(r=l,o=-o,u=f.length):(r=f,n=c,u=l.length),i=Math.max(Math.ceil(v/ne),u)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,u=f.length,s=i0;--i)l[u++]=0;for(i=f.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+Ht(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Ht(-i-1)+a,r&&(n=r-o)>0&&(a+=Ht(n))):i>=o?(a+=Ht(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Ht(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=Ht(n))),e.s<0?"-"+a:a}function Gs(e,t){if(e.length>t)return e.length=t,!0}function vp(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(pr+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return Xs(o,a.toString())}else if(typeof a!="string")throw Error(pr+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,hO.test(a))Xs(o,a);else throw Error(pr+a)}if(i.prototype=M,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=vp,i.config=i.set=pO,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(pr+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(pr+r+": "+n);return this}var el=vp(vO);He=new el(1);const Y=el;function hp(e){var t;return e===0?t=1:t=Math.floor(new Y(e).abs().log(10).toNumber())+1,t}function pp(e,t,r){for(var n=new Y(e),i=0,a=[];n.lt(t)&&i<1e5;)a.push(n.toNumber()),n=n.add(r),i++;return a}function Dn(e,t){return bO(e)||gO(e,t)||yO(e,t)||mO()}function mO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yO(e,t){if(e){if(typeof e=="string")return Zs(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Zs(e,t):void 0}}function Zs(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=Dn(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]},tl=(e,t,r)=>{if(e.lte(0))return new Y(0);var n=hp(e.toNumber()),i=new Y(10).pow(n),a=e.div(i),o=n!==1?.05:.1,u=new Y(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=u.mul(i);return t?new Y(l.toNumber()):new Y(Math.ceil(l.toNumber()))},yp=(e,t,r)=>{var n;if(e.lte(0))return new Y(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new Y(a).abs().log(10).toNumber()),u=new Y(10).pow(o),l=e.div(u).toNumber(),c=i.findIndex(v=>v>=l-1e-10);if(c===-1&&(u=u.mul(10),c=0),c+=r,c>=i.length){var s=Math.floor(c/i.length);c%=i.length,u=u.mul(new Y(10).pow(s))}var f=(n=i[c])!==null&&n!==void 0?n:1,d=new Y(f).mul(u);return t?d:new Y(Math.ceil(d.toNumber()))},xO=(e,t,r)=>{var n=new Y(1),i=new Y(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new Y(10).pow(hp(e)-1),i=new Y(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new Y(Math.floor(e)))}else e===0?i=new Y(Math.floor((t-1)/2)):r||(i=new Y(Math.floor(e)));for(var o=Math.floor((t-1)/2),u=[],l=0;l4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:tl;if(!Number.isFinite((r-t)/(n-1)))return{step:new Y(0),tickMin:new Y(0),tickMax:new Y(0)};var u=o(new Y(r).sub(t).div(n-1),i,a),l;t<=0&&r>=0?l=new Y(0):(l=new Y(t).add(r).div(2),l=l.sub(new Y(l).mod(u)));var c=Math.ceil(l.sub(t).div(u).toNumber()),s=Math.ceil(new Y(r).sub(l).div(u).toNumber()),f=c+s+1;return f>n?gp(t,r,n,i,a+1,o):(f0?s+(n-f):s,c=r>0?c:c+(n-f)),{step:u,tickMin:l.sub(new Y(c).mul(u)),tickMax:l.add(new Y(s).mul(u))})},Qs=function(t){var r=Dn(t,2),n=r[0],i=r[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",l=Math.max(a,2),c=mp([n,i]),s=Dn(c,2),f=s[0],d=s[1];if(f===-1/0||d===1/0){var v=d===1/0?[f,...Array(a-1).fill(1/0)]:[...Array(a-1).fill(-1/0),d];return n>i?v.reverse():v}if(f===d)return xO(f,a,o);var p=u==="snap125"?yp:tl,m=gp(f,d,l,o,0,p),y=m.step,g=m.tickMin,x=m.tickMax,A=pp(g,x.add(new Y(.1).mul(y)),y);return n>i?A.reverse():A},Js=function(t,r){var n=Dn(t,2),i=n[0],a=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",l=mp([i,a]),c=Dn(l,2),s=c[0],f=c[1];if(s===-1/0||f===1/0)return[i,a];if(s===f)return[s];var d=u==="snap125"?yp:tl,v=Math.max(r,2),p=d(new Y(f).sub(s).div(v-1),o,0),m=[...pp(new Y(s),new Y(f),p),f];if(o===!1){m=m.map(g=>Math.round(g));var y=m.length-1;y>0&&m[y]===m[y-1]&&(m=m.slice(0,y))}return i>a?m.reverse():m},bp=e=>e.rootProps.maxBarSize,wO=e=>e.rootProps.barGap,xp=e=>e.rootProps.barCategoryGap,AO=e=>e.rootProps.barSize,La=e=>e.rootProps.stackOffset,wp=e=>e.rootProps.reverseStackOrder,rl=e=>e.options.chartName,nl=e=>e.rootProps.syncId,Ap=e=>e.rootProps.syncMethod,il=e=>e.options.eventEmitter,we={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},nr={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},mt={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Ba=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function za(e,t,r){if(r!=="auto")return r;if(e!=null)return Rt(e,t)?"category":"number"}function ef(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Xi(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},al=P([EO,Xh],(e,t)=>{var r;if(e!=null)return e;var n=(r=za(t,"angleAxis",tf.type))!==null&&r!==void 0?r:"category";return Xi(Xi({},tf),{},{type:n})}),IO=(e,t)=>e.polarAxis.radiusAxis[t],ol=P([IO,Xh],(e,t)=>{var r;if(e!=null)return e;var n=(r=za(t,"radiusAxis",rf.type))!==null&&r!==void 0?r:"category";return Xi(Xi({},rf),{},{type:n})}),Fa=e=>e.polarOptions,ul=P([Lt,Bt,Ae],V1),Op=P([Fa,ul],(e,t)=>{if(e!=null)return st(e.innerRadius,t,0)}),Pp=P([Fa,ul],(e,t)=>{if(e!=null)return st(e.outerRadius,t,t*.8)}),_O=e=>{if(e==null)return[0,0];var t=e.startAngle,r=e.endAngle;return[t,r]},Sp=P([Fa],_O);P([al,Sp],Ba);var Ep=P([ul,Op,Pp],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});P([ol,Ep],Ba);var Ip=P([Z,Fa,Op,Pp,Lt,Bt],(e,t,r,n,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var o=t.cx,u=t.cy,l=t.startAngle,c=t.endAngle;return{cx:st(o,i,i/2),cy:st(u,a,a/2),innerRadius:r,outerRadius:n,startAngle:l,endAngle:c,clockWise:!1}}}),Oe=(e,t)=>t,Wa=(e,t,r)=>r;function ll(e){return e==null?void 0:e.id}function _p(e,t,r){var n=t.chartData,i=n===void 0?[]:n,a=r.allowDuplicatedCategory,o=r.dataKey,u=new Map;return e.forEach(l=>{var c,s=(c=l.data)!==null&&c!==void 0?c:i;if(!(s==null||s.length===0)){var f=ll(l);s.forEach((d,v)=>{var p=o==null||a?v:String(se(d,o,null)),m=se(d,l.dataKey,0),y;u.has(p)?y=u.get(p):y={},Object.assign(y,{[f]:m}),u.set(p,y)})}}),Array.from(u.values())}function Ka(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Gn=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Ua(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function CO(e,t){if(e.length===t.length){for(var r=0;r{var t=Z(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},tn=e=>e.tooltip.settings.axisId;function cl(e){if(e!=null){var t=e.ticks,r=e.bandwidth,n=e.range(),i=[Math.min(...n),Math.max(...n)];return{domain:()=>e.domain(),range:(function(a){function o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var o=i[0],u=i[1];return o<=u?a>=o&&a<=u:a>=u&&a<=o},bandwidth:r?()=>r.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,o)=>{var u=e(a);if(u!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var l=e.bandwidth();switch(o.position){case"middle":u+=l/2;break;case"end":u+=l;break}}return u}}}}}var kO=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!wt(t)){for(var r,n,i=0;in)&&(n=a))}return r!==void 0&&n!==void 0?[r,n]:void 0}return t}default:return t}};function qt(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function jO(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function sl(e){let t,r,n;e.length!==2?(t=qt,r=(u,l)=>qt(e(u),l),n=(u,l)=>e(u)-l):(t=e===qt||e===jO?e:TO,r=e,n=e);function i(u,l,c=0,s=u.length){if(c>>1;r(u[f],l)<0?c=f+1:s=f}while(c>>1;r(u[f],l)<=0?c=f+1:s=f}while(cc&&n(u[f-1],l)>-n(u[f],l)?f-1:f}return{left:i,center:o,right:a}}function TO(){return 0}function Cp(e){return e===null?NaN:+e}function*MO(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const DO=sl(qt),Zn=DO.right;sl(Cp).center;class nf extends Map{constructor(t,r=RO){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(af(this,t))}has(t){return super.has(af(this,t))}set(t,r){return super.set($O(this,t),r)}delete(t){return super.delete(NO(this,t))}}function af({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function $O({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function NO({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function RO(e){return e!==null&&typeof e=="object"?e.valueOf():e}function LO(e=qt){if(e===qt)return kp;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function kp(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const BO=Math.sqrt(50),zO=Math.sqrt(10),FO=Math.sqrt(2);function Gi(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=BO?10:a>=zO?5:a>=FO?2:1;let u,l,c;return i<0?(c=Math.pow(10,-i)/o,u=Math.round(e*c),l=Math.round(t*c),u/ct&&--l,c=-c):(c=Math.pow(10,i)*o,u=Math.round(e/c),l=Math.round(t/c),u*ct&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const u=a-i+1,l=new Array(u);if(n)if(o<0)for(let c=0;c=n)&&(r=n);return r}function uf(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function jp(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?kp:LO(i);n>r;){if(n-r>600){const l=n-r+1,c=t-r+1,s=Math.log(l),f=.5*Math.exp(2*s/3),d=.5*Math.sqrt(s*f*(l-f)/l)*(c-l/2<0?-1:1),v=Math.max(r,Math.floor(t-c*f/l+d)),p=Math.min(n,Math.floor(t+(l-c)*f/l+d));jp(e,t,v,p,i)}const a=e[t];let o=r,u=n;for(pn(e,r,t),i(e[n],a)>0&&pn(e,r,n);o0;)--u}i(e[r],a)===0?pn(e,r,u):(++u,pn(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function pn(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function WO(e,t,r){if(e=Float64Array.from(MO(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return uf(e);if(t>=1)return of(e);var n,i=(n-1)*t,a=Math.floor(i),o=of(jp(e,a).subarray(0,a+1)),u=uf(e.subarray(a+1));return o+(u-o)*(i-a)}}function KO(e,t,r=Cp){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),u=+r(e[a+1],a+1,e);return o+(u-o)*(i-a)}}function UO(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?mi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?mi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=VO.exec(e))?new ze(t[1],t[2],t[3],1):(t=qO.exec(e))?new ze(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=XO.exec(e))?mi(t[1],t[2],t[3],t[4]):(t=GO.exec(e))?mi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ZO.exec(e))?hf(t[1],t[2]/100,t[3]/100,1):(t=QO.exec(e))?hf(t[1],t[2]/100,t[3]/100,t[4]):lf.hasOwnProperty(e)?ff(lf[e]):e==="transparent"?new ze(NaN,NaN,NaN,0):null}function ff(e){return new ze(e>>16&255,e>>8&255,e&255,1)}function mi(e,t,r,n){return n<=0&&(e=t=r=NaN),new ze(e,t,r,n)}function tP(e){return e instanceof Qn||(e=Rn(e)),e?(e=e.rgb(),new ze(e.r,e.g,e.b,e.opacity)):new ze}function du(e,t,r,n){return arguments.length===1?tP(e):new ze(e,t,r,n??1)}function ze(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}vl(ze,du,Mp(Qn,{brighter(e){return e=e==null?Zi:Math.pow(Zi,e),new ze(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$n:Math.pow($n,e),new ze(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ze(mr(this.r),mr(this.g),mr(this.b),Qi(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:df,formatHex:df,formatHex8:rP,formatRgb:vf,toString:vf}));function df(){return`#${dr(this.r)}${dr(this.g)}${dr(this.b)}`}function rP(){return`#${dr(this.r)}${dr(this.g)}${dr(this.b)}${dr((isNaN(this.opacity)?1:this.opacity)*255)}`}function vf(){const e=Qi(this.opacity);return`${e===1?"rgb(":"rgba("}${mr(this.r)}, ${mr(this.g)}, ${mr(this.b)}${e===1?")":`, ${e})`}`}function Qi(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function mr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function dr(e){return e=mr(e),(e<16?"0":"")+e.toString(16)}function hf(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ct(e,t,r,n)}function Dp(e){if(e instanceof ct)return new ct(e.h,e.s,e.l,e.opacity);if(e instanceof Qn||(e=Rn(e)),!e)return new ct;if(e instanceof ct)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,u=a-i,l=(a+i)/2;return u?(t===a?o=(r-n)/u+(r0&&l<1?0:o,new ct(o,u,l,e.opacity)}function nP(e,t,r,n){return arguments.length===1?Dp(e):new ct(e,t,r,n??1)}function ct(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}vl(ct,nP,Mp(Qn,{brighter(e){return e=e==null?Zi:Math.pow(Zi,e),new ct(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$n:Math.pow($n,e),new ct(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new ze(xo(e>=240?e-240:e+120,i,n),xo(e,i,n),xo(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new ct(pf(this.h),yi(this.s),yi(this.l),Qi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Qi(this.opacity);return`${e===1?"hsl(":"hsla("}${pf(this.h)}, ${yi(this.s)*100}%, ${yi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function pf(e){return e=(e||0)%360,e<0?e+360:e}function yi(e){return Math.max(0,Math.min(1,e||0))}function xo(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const hl=e=>()=>e;function iP(e,t){return function(r){return e+r*t}}function aP(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function oP(e){return(e=+e)==1?$p:function(t,r){return r-t?aP(t,r,e):hl(isNaN(t)?r:t)}}function $p(e,t){var r=t-e;return r?iP(e,r):hl(isNaN(e)?t:e)}const mf=(function e(t){var r=oP(t);function n(i,a){var o=r((i=du(i)).r,(a=du(a)).r),u=r(i.g,a.g),l=r(i.b,a.b),c=$p(i.opacity,a.opacity);return function(s){return i.r=o(s),i.g=u(s),i.b=l(s),i.opacity=c(s),i+""}}return n.gamma=e,n})(1);function uP(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),u[o]?u[o]+=a:u[++o]=a),(n=n[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,l.push({i:o,x:Ji(n,i)})),r=wo.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function gP(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?bP:gP,l=c=null,f}function f(d){return d==null||isNaN(d=+d)?a:(l||(l=u(e.map(n),t,r)))(n(o(d)))}return f.invert=function(d){return o(i((c||(c=u(t,e.map(n),Ji)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,ea),s()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),s()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),r=pl,s()},f.clamp=function(d){return arguments.length?(o=d?!0:Re,s()):o!==Re},f.interpolate=function(d){return arguments.length?(r=d,s()):r},f.unknown=function(d){return arguments.length?(a=d,f):a},function(d,v){return n=d,i=v,s()}}function ml(){return Ha()(Re,Re)}function xP(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function ta(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Vr(e){return e=ta(Math.abs(e)),e?e[1]:NaN}function wP(e,t){return function(r,n){for(var i=r.length,a=[],o=0,u=e[0],l=0;i>0&&u>0&&(l+u+1>n&&(u=Math.max(1,n-l)),a.push(r.substring(i-=u,i+u)),!((l+=u+1)>n));)u=e[o=(o+1)%e.length];return a.reverse().join(t)}}function AP(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var OP=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ln(e){if(!(t=OP.exec(e)))throw new Error("invalid format: "+e);var t;return new yl({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ln.prototype=yl.prototype;function yl(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}yl.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function PP(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var ra;function SP(e,t){var r=ta(e,t);if(!r)return ra=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(ra=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+ta(e,Math.max(0,t+a-1))[0]}function gf(e,t){var r=ta(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const bf={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:xP,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>gf(e*100,t),r:gf,s:SP,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function xf(e){return e}var wf=Array.prototype.map,Af=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function EP(e){var t=e.grouping===void 0||e.thousands===void 0?xf:wP(wf.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?xf:AP(wf.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(f,d){f=Ln(f);var v=f.fill,p=f.align,m=f.sign,y=f.symbol,g=f.zero,x=f.width,A=f.comma,w=f.precision,O=f.trim,b=f.type;b==="n"?(A=!0,b="g"):bf[b]||(w===void 0&&(w=12),O=!0,b="g"),(g||v==="0"&&p==="=")&&(g=!0,v="0",p="=");var S=(d&&d.prefix!==void 0?d.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),I=(y==="$"?n:/[%p]/.test(b)?o:"")+(d&&d.suffix!==void 0?d.suffix:""),_=bf[b],j=/[defgprs%]/.test(b);w=w===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function k(E){var R=S,N=I,F,U,H;if(b==="c")N=_(E)+N,E="";else{E=+E;var L=E<0||1/E<0;if(E=isNaN(E)?l:_(Math.abs(E),w),O&&(E=PP(E)),L&&+E==0&&m!=="+"&&(L=!1),R=(L?m==="("?m:u:m==="-"||m==="("?"":m)+R,N=(b==="s"&&!isNaN(E)&&ra!==void 0?Af[8+ra/3]:"")+N+(L&&m==="("?")":""),j){for(F=-1,U=E.length;++FH||H>57){N=(H===46?i+E.slice(F+1):E.slice(F))+N,E=E.slice(0,F);break}}}A&&!g&&(E=t(E,1/0));var V=R.length+E.length+N.length,W=V>1)+R+E+N+W.slice(V);break;default:E=W+R+E+N;break}return a(E)}return k.toString=function(){return f+""},k}function s(f,d){var v=Math.max(-8,Math.min(8,Math.floor(Vr(d)/3)))*3,p=Math.pow(10,-v),m=c((f=Ln(f),f.type="f",f),{suffix:Af[8+v/3]});return function(y){return m(p*y)}}return{format:c,formatPrefix:s}}var gi,gl,Np;IP({thousands:",",grouping:[3],currency:["$",""]});function IP(e){return gi=EP(e),gl=gi.format,Np=gi.formatPrefix,gi}function _P(e){return Math.max(0,-Vr(Math.abs(e)))}function CP(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Vr(t)/3)))*3-Vr(Math.abs(e)))}function kP(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Vr(t)-Vr(e))+1}function Rp(e,t,r,n){var i=su(e,t,r),a;switch(n=Ln(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=CP(i,o))&&(n.precision=a),Np(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=kP(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=_P(i))&&(n.precision=a-(n.type==="%")*2);break}}return gl(n)}function er(e){var t=e.domain;return e.ticks=function(r){var n=t();return lu(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return Rp(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],u=n[a],l,c,s=10;for(u0;){if(c=cu(o,u,r),c===l)return n[i]=o,n[a]=u,t(n);if(c>0)o=Math.floor(o/c)*c,u=Math.ceil(u/c)*c;else if(c<0)o=Math.ceil(o*c)/c,u=Math.floor(u*c)/c;else break;l=c}return e},e}function Lp(){var e=ml();return e.copy=function(){return Jn(e,Lp())},rt.apply(e,arguments),er(e)}function Bp(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,ea),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Bp(e).unknown(t)},e=arguments.length?Array.from(e,ea):[0,1],er(r)}function zp(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function $P(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function Sf(e){return(t,r)=>-e(-t,r)}function bl(e){const t=e(Of,Pf),r=t.domain;let n=10,i,a;function o(){return i=$P(n),a=DP(n),r()[0]<0?(i=Sf(i),a=Sf(a),e(jP,TP)):e(Of,Pf),t}return t.base=function(u){return arguments.length?(n=+u,o()):n},t.domain=function(u){return arguments.length?(r(u),o()):r()},t.ticks=u=>{const l=r();let c=l[0],s=l[l.length-1];const f=s0){for(;d<=v;++d)for(p=1;ps)break;g.push(m)}}else for(;d<=v;++d)for(p=n-1;p>=1;--p)if(m=d>0?p/a(-d):p*a(d),!(ms)break;g.push(m)}g.length*2{if(u==null&&(u=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Ln(l)).precision==null&&(l.trim=!0),l=gl(l)),u===1/0)return l;const c=Math.max(1,n*u/t.ticks().length);return s=>{let f=s/a(Math.round(i(s)));return f*nr(zp(r(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function Fp(){const e=bl(Ha()).domain([1,10]);return e.copy=()=>Jn(e,Fp()).base(e.base()),rt.apply(e,arguments),e}function Ef(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function If(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function xl(e){var t=1,r=e(Ef(t),If(t));return r.constant=function(n){return arguments.length?e(Ef(t=+n),If(t)):t},er(r)}function Wp(){var e=xl(Ha());return e.copy=function(){return Jn(e,Wp()).constant(e.constant())},rt.apply(e,arguments)}function _f(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function NP(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function RP(e){return e<0?-e*e:e*e}function wl(e){var t=e(Re,Re),r=1;function n(){return r===1?e(Re,Re):r===.5?e(NP,RP):e(_f(r),_f(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},er(t)}function Al(){var e=wl(Ha());return e.copy=function(){return Jn(e,Al()).exponent(e.exponent())},rt.apply(e,arguments),e}function LP(){return Al.apply(null,arguments).exponent(.5)}function Cf(e){return Math.sign(e)*e*e}function BP(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Kp(){var e=ml(),t=[0,1],r=!1,n;function i(a){var o=BP(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(Cf(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,ea)).map(Cf)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return Kp(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},rt.apply(i,arguments),er(i)}function Up(){var e=[],t=[],r=[],n;function i(){var o=0,u=Math.max(1,t.length);for(r=new Array(u-1);++o0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[c-1],n[c]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return Hp().domain([e,t]).range(i).unknown(a)},rt.apply(er(o),arguments)}function Yp(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[Zn(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Yp().domain(e).range(t).unknown(r)},rt.apply(i,arguments)}const Ao=new Date,Oo=new Date;function ge(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),u=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,u)=>{const l=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a0))return l;let c;do l.push(c=new Date(+a)),t(a,u),e(a);while(cge(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!a(o););else for(;--u>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Ao.setTime(+a),Oo.setTime(+o),e(Ao),e(Oo),Math.floor(r(Ao,Oo))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const na=ge(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);na.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ge(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):na);na.range;const Ct=1e3,Je=Ct*60,kt=Je*60,Dt=kt*24,Ol=Dt*7,kf=Dt*30,Po=Dt*365,vr=ge(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ct)},(e,t)=>(t-e)/Ct,e=>e.getUTCSeconds());vr.range;const Pl=ge(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ct)},(e,t)=>{e.setTime(+e+t*Je)},(e,t)=>(t-e)/Je,e=>e.getMinutes());Pl.range;const Sl=ge(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Je)},(e,t)=>(t-e)/Je,e=>e.getUTCMinutes());Sl.range;const El=ge(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ct-e.getMinutes()*Je)},(e,t)=>{e.setTime(+e+t*kt)},(e,t)=>(t-e)/kt,e=>e.getHours());El.range;const Il=ge(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*kt)},(e,t)=>(t-e)/kt,e=>e.getUTCHours());Il.range;const ei=ge(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Je)/Dt,e=>e.getDate()-1);ei.range;const Ya=ge(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Dt,e=>e.getUTCDate()-1);Ya.range;const Vp=ge(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Dt,e=>Math.floor(e/Dt));Vp.range;function Ir(e){return ge(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Je)/Ol)}const Va=Ir(0),ia=Ir(1),zP=Ir(2),FP=Ir(3),qr=Ir(4),WP=Ir(5),KP=Ir(6);Va.range;ia.range;zP.range;FP.range;qr.range;WP.range;KP.range;function _r(e){return ge(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Ol)}const qa=_r(0),aa=_r(1),UP=_r(2),HP=_r(3),Xr=_r(4),YP=_r(5),VP=_r(6);qa.range;aa.range;UP.range;HP.range;Xr.range;YP.range;VP.range;const _l=ge(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());_l.range;const Cl=ge(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Cl.range;const $t=ge(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());$t.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ge(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});$t.range;const Nt=ge(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Nt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ge(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Nt.range;function qp(e,t,r,n,i,a){const o=[[vr,1,Ct],[vr,5,5*Ct],[vr,15,15*Ct],[vr,30,30*Ct],[a,1,Je],[a,5,5*Je],[a,15,15*Je],[a,30,30*Je],[i,1,kt],[i,3,3*kt],[i,6,6*kt],[i,12,12*kt],[n,1,Dt],[n,2,2*Dt],[r,1,Ol],[t,1,kf],[t,3,3*kf],[e,1,Po]];function u(c,s,f){const d=sy).right(o,d);if(v===o.length)return e.every(su(c/Po,s/Po,f));if(v===0)return na.every(Math.max(su(c,s,f),1));const[p,m]=o[d/o[v-1][2]53)return null;"w"in C||(C.w=1),"Z"in C?(Q=Eo(mn(C.y,0,1)),B=Q.getUTCDay(),Q=B>4||B===0?aa.ceil(Q):aa(Q),Q=Ya.offset(Q,(C.V-1)*7),C.y=Q.getUTCFullYear(),C.m=Q.getUTCMonth(),C.d=Q.getUTCDate()+(C.w+6)%7):(Q=So(mn(C.y,0,1)),B=Q.getDay(),Q=B>4||B===0?ia.ceil(Q):ia(Q),Q=ei.offset(Q,(C.V-1)*7),C.y=Q.getFullYear(),C.m=Q.getMonth(),C.d=Q.getDate()+(C.w+6)%7)}else("W"in C||"U"in C)&&("w"in C||(C.w="u"in C?C.u%7:"W"in C?1:0),B="Z"in C?Eo(mn(C.y,0,1)).getUTCDay():So(mn(C.y,0,1)).getDay(),C.m=0,C.d="W"in C?(C.w+6)%7+C.W*7-(B+5)%7:C.w+C.U*7-(B+6)%7);return"Z"in C?(C.H+=C.Z/100|0,C.M+=C.Z%100,Eo(C)):So(C)}}function I(T,K,z,C){for(var ke=0,Q=K.length,B=z.length,Ue,rr;ke=B)return-1;if(Ue=K.charCodeAt(ke++),Ue===37){if(Ue=K.charAt(ke++),rr=O[Ue in jf?K.charAt(ke++):Ue],!rr||(C=rr(T,z,C))<0)return-1}else if(Ue!=z.charCodeAt(C++))return-1}return C}function _(T,K,z){var C=c.exec(K.slice(z));return C?(T.p=s.get(C[0].toLowerCase()),z+C[0].length):-1}function j(T,K,z){var C=v.exec(K.slice(z));return C?(T.w=p.get(C[0].toLowerCase()),z+C[0].length):-1}function k(T,K,z){var C=f.exec(K.slice(z));return C?(T.w=d.get(C[0].toLowerCase()),z+C[0].length):-1}function E(T,K,z){var C=g.exec(K.slice(z));return C?(T.m=x.get(C[0].toLowerCase()),z+C[0].length):-1}function R(T,K,z){var C=m.exec(K.slice(z));return C?(T.m=y.get(C[0].toLowerCase()),z+C[0].length):-1}function N(T,K,z){return I(T,t,K,z)}function F(T,K,z){return I(T,r,K,z)}function U(T,K,z){return I(T,n,K,z)}function H(T){return o[T.getDay()]}function L(T){return a[T.getDay()]}function V(T){return l[T.getMonth()]}function W(T){return u[T.getMonth()]}function fe(T){return i[+(T.getHours()>=12)]}function de(T){return 1+~~(T.getMonth()/3)}function ue(T){return o[T.getUTCDay()]}function Ne(T){return a[T.getUTCDay()]}function Ke(T){return l[T.getUTCMonth()]}function at(T){return u[T.getUTCMonth()]}function ot(T){return i[+(T.getUTCHours()>=12)]}function sn(T){return 1+~~(T.getUTCMonth()/3)}return{format:function(T){var K=b(T+="",A);return K.toString=function(){return T},K},parse:function(T){var K=S(T+="",!1);return K.toString=function(){return T},K},utcFormat:function(T){var K=b(T+="",w);return K.toString=function(){return T},K},utcParse:function(T){var K=S(T+="",!0);return K.toString=function(){return T},K}}}var jf={"-":"",_:" ",0:"0"},Se=/^\s*\d+/,JP=/^%/,eS=/[\\^$*+?|[\]().{}]/g;function X(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function rS(e,t,r){var n=Se.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function nS(e,t,r){var n=Se.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function iS(e,t,r){var n=Se.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function aS(e,t,r){var n=Se.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function oS(e,t,r){var n=Se.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Tf(e,t,r){var n=Se.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Mf(e,t,r){var n=Se.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function uS(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function lS(e,t,r){var n=Se.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function cS(e,t,r){var n=Se.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Df(e,t,r){var n=Se.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function sS(e,t,r){var n=Se.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function $f(e,t,r){var n=Se.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function fS(e,t,r){var n=Se.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function dS(e,t,r){var n=Se.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function vS(e,t,r){var n=Se.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function hS(e,t,r){var n=Se.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function pS(e,t,r){var n=JP.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function mS(e,t,r){var n=Se.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function yS(e,t,r){var n=Se.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function Nf(e,t){return X(e.getDate(),t,2)}function gS(e,t){return X(e.getHours(),t,2)}function bS(e,t){return X(e.getHours()%12||12,t,2)}function xS(e,t){return X(1+ei.count($t(e),e),t,3)}function Xp(e,t){return X(e.getMilliseconds(),t,3)}function wS(e,t){return Xp(e,t)+"000"}function AS(e,t){return X(e.getMonth()+1,t,2)}function OS(e,t){return X(e.getMinutes(),t,2)}function PS(e,t){return X(e.getSeconds(),t,2)}function SS(e){var t=e.getDay();return t===0?7:t}function ES(e,t){return X(Va.count($t(e)-1,e),t,2)}function Gp(e){var t=e.getDay();return t>=4||t===0?qr(e):qr.ceil(e)}function IS(e,t){return e=Gp(e),X(qr.count($t(e),e)+($t(e).getDay()===4),t,2)}function _S(e){return e.getDay()}function CS(e,t){return X(ia.count($t(e)-1,e),t,2)}function kS(e,t){return X(e.getFullYear()%100,t,2)}function jS(e,t){return e=Gp(e),X(e.getFullYear()%100,t,2)}function TS(e,t){return X(e.getFullYear()%1e4,t,4)}function MS(e,t){var r=e.getDay();return e=r>=4||r===0?qr(e):qr.ceil(e),X(e.getFullYear()%1e4,t,4)}function DS(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+X(t/60|0,"0",2)+X(t%60,"0",2)}function Rf(e,t){return X(e.getUTCDate(),t,2)}function $S(e,t){return X(e.getUTCHours(),t,2)}function NS(e,t){return X(e.getUTCHours()%12||12,t,2)}function RS(e,t){return X(1+Ya.count(Nt(e),e),t,3)}function Zp(e,t){return X(e.getUTCMilliseconds(),t,3)}function LS(e,t){return Zp(e,t)+"000"}function BS(e,t){return X(e.getUTCMonth()+1,t,2)}function zS(e,t){return X(e.getUTCMinutes(),t,2)}function FS(e,t){return X(e.getUTCSeconds(),t,2)}function WS(e){var t=e.getUTCDay();return t===0?7:t}function KS(e,t){return X(qa.count(Nt(e)-1,e),t,2)}function Qp(e){var t=e.getUTCDay();return t>=4||t===0?Xr(e):Xr.ceil(e)}function US(e,t){return e=Qp(e),X(Xr.count(Nt(e),e)+(Nt(e).getUTCDay()===4),t,2)}function HS(e){return e.getUTCDay()}function YS(e,t){return X(aa.count(Nt(e)-1,e),t,2)}function VS(e,t){return X(e.getUTCFullYear()%100,t,2)}function qS(e,t){return e=Qp(e),X(e.getUTCFullYear()%100,t,2)}function XS(e,t){return X(e.getUTCFullYear()%1e4,t,4)}function GS(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Xr(e):Xr.ceil(e),X(e.getUTCFullYear()%1e4,t,4)}function ZS(){return"+0000"}function Lf(){return"%"}function Bf(e){return+e}function zf(e){return Math.floor(+e/1e3)}var Dr,Jp,em;QS({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function QS(e){return Dr=QP(e),Jp=Dr.format,Dr.parse,em=Dr.utcFormat,Dr.utcParse,Dr}function JS(e){return new Date(e)}function eE(e){return e instanceof Date?+e:+new Date(+e)}function kl(e,t,r,n,i,a,o,u,l,c){var s=ml(),f=s.invert,d=s.domain,v=c(".%L"),p=c(":%S"),m=c("%I:%M"),y=c("%I %p"),g=c("%a %d"),x=c("%b %d"),A=c("%B"),w=c("%Y");function O(b){return(l(b)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>WO(e,a/n))},r.copy=function(){return im(t).domain(e)},zt.apply(r,arguments)}function Ga(){var e=0,t=.5,r=1,n=1,i,a,o,u,l,c=Re,s,f=!1,d;function v(m){return isNaN(m=+m)?d:(m=.5+((m=+s(m))-a)*(n*m{if(e!=null){var n=e.scale,i=e.type;if(n==="auto")return i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof n=="string")return uE(n)?n:"point"}};function lE(e,t){for(var r=0,n=e.length,i=e[0]t)?r=a+1:n=a}return r}function sm(e,t){if(e){var r=t??e.domain(),n=r.map(a=>{var o;return(o=e(a))!==null&&o!==void 0?o:0}),i=e.range();if(!(r.length===0||i.length<2))return a=>{var o,u,l=lE(n,a);if(l<=0)return r[0];if(l>=r.length)return r[r.length-1];var c=(o=n[l-1])!==null&&o!==void 0?o:0,s=(u=n[l])!==null&&u!==void 0?u:0;return Math.abs(a-c)<=Math.abs(a-s)?r[l-1]:r[l]}}}function cE(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):sm(e,void 0)}function Wf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function oa(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);re.cartesianAxis.xAxis[t],Ft=(e,t)=>{var r=dm(e,t);return r??pe},me={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:pu,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:Un},vm=(e,t)=>e.cartesianAxis.yAxis[t],Wt=(e,t)=>{var r=vm(e,t);return r??me},yE={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},Dl=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??yE},$e=(e,t,r)=>{switch(t){case"xAxis":return Ft(e,r);case"yAxis":return Wt(e,r);case"zAxis":return Dl(e,r);case"angleAxis":return al(e,r);case"radiusAxis":return ol(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},gE=(e,t,r)=>{switch(t){case"xAxis":return Ft(e,r);case"yAxis":return Wt(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},ti=(e,t,r)=>{switch(t){case"xAxis":return Ft(e,r);case"yAxis":return Wt(e,r);case"angleAxis":return al(e,r);case"radiusAxis":return ol(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},hm=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function pm(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var Za=e=>e.graphicalItems.cartesianItems,bE=P([Oe,Wa],pm),mm=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),nn=P([Za,$e,bE],mm,{memoizeOptions:{resultEqualityCheck:Ua}}),ym=P([nn],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Ka)),gm=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),xE=P([nn],gm),bm=e=>e.map(t=>t.data).filter(Boolean).flat(1),wE=P([nn],e=>e.some(t=>!t.data)),xm=P([nn],bm,{memoizeOptions:{resultEqualityCheck:Ua}}),wm=(e,t)=>{var r=t.chartData,n=r===void 0?[]:r,i=t.dataStartIndex,a=t.dataEndIndex;return e.length>0?e:n.slice(i,a+1)},$l=P([xm,Xn],wm),AE=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:se(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(i=>({value:se(i,n)}))):e.map(n=>({value:n})),Am=(e,t,r,n,i,a)=>{var o=n.chartData,u=o===void 0?[]:o,l=n.dataStartIndex,c=n.dataEndIndex,s=AE(e,t,r);if(i&&(t==null?void 0:t.dataKey)!=null&&a.length>0){var f=u.slice(l,c+1),d=f.map(v=>({value:se(v,t.dataKey)})).filter(v=>v.value!=null);return[...d,...s]}return s},ri=P([$l,$e,nn,Xn,wE,xm],Am);function Ur(e){if(Be(e)||e instanceof Date){var t=Number(e);if(G(t))return t}}function Uf(e){if(Array.isArray(e)){var t=[Ur(e[0]),Ur(e[1])];return wt(t)?t:void 0}var r=Ur(e);if(r!=null)return[r,r]}function ft(e){return e.map(Ur).filter(gt)}function OE(e,t){var r=Ur(e),n=Ur(t);return r==null&&n==null?0:r==null?-1:n==null?1:r-n}var PE=P([ri],e=>e==null?void 0:e.map(t=>t.value).sort(OE));function Om(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function SE(e,t,r){if(!r)return[];if(!r.length)return[];var n;if(typeof t=="number"&&!Pt(t))n=t;else if(Array.isArray(t)){var i=ft(t);i.length>0&&(n=Math.max(...i))}return n==null?[]:ft(r.flatMap(a=>{var o=se(e,a.dataKey),u,l;if(Array.isArray(o)){var c=fm(o,2);u=c[0],l=c[1]}else u=l=o;if(!(!G(u)||!G(l)))return[n-u,n+l]}))}var be=e=>{var t=Pe(e),r=tn(e);return ti(e,t,r)},Gr=P([be],e=>e==null?void 0:e.dataKey),EE=P([ym,Xn,be],_p),Pm=(e,t,r,n)=>{var i={},a=t.reduce((o,u)=>{if(u.stackId==null)return o;var l=o[u.stackId];return l==null&&(l=[]),l.push(u),o[u.stackId]=l,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var u=fm(o,2),l=u[0],c=u[1],s=n?[...c].reverse():c,f=s.map(ll);return[l,{stackedData:Jx(e,f,r),graphicalItems:s}]}))},mu=P([EE,ym,La,wp],Pm),Sm=(e,t,r,n)=>{var i=t.dataStartIndex,a=t.dataEndIndex;if(n==null&&r!=="zAxis")return iw(e,i,a)},IE=P([$e],e=>e.allowDataOverflow),Nl=e=>{var t;if(e==null||!("domain"in e))return pu;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=ft(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:pu},Em=P([$e],Nl),Im=P([Em,IE],lp),_E=P([mu,dt,Oe,Im],Sm,{memoizeOptions:{resultEqualityCheck:Gn}}),Rl=e=>e.errorBars,CE=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>Om(r,n)),ua=function(){for(var t=arguments.length,r=new Array(t),n=0;n5&&arguments[5]!==void 0?arguments[5]:[],u,l;if(n.length>0&&n.forEach(c=>{var s,f=c.data!=null?[...c.data]:o,d=(s=i[c.id])===null||s===void 0?void 0:s.filter(v=>Om(a,v));f.forEach(v=>{var p,m=se(v,(p=r.dataKey)!==null&&p!==void 0?p:c.dataKey),y=SE(v,m,d);if(y.length>=2){var g=Math.min(...y),x=Math.max(...y);(u==null||gl)&&(l=x)}var A=Uf(m);A!=null&&(u=u==null?A[0]:Math.min(u,A[0]),l=l==null?A[1]:Math.max(l,A[1]))})}),(r==null?void 0:r.dataKey)!=null&&n.length===0&&t.forEach(c=>{var s=Uf(se(c,r.dataKey));s!=null&&(u=u==null?s[0]:Math.min(u,s[0]),l=l==null?s[1]:Math.max(l,s[1]))}),G(u)&&G(l))return[u,l]},kE=P([$l,$e,xE,Rl,Oe,oO],_m,{memoizeOptions:{resultEqualityCheck:Gn}});function jE(e){var t=e.value;if(Be(t)||t instanceof Date)return t}var TE=(e,t,r)=>{var n=e.map(jE).filter(i=>i!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&Av(n))?up(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},Cm=e=>e.referenceElements.dots,an=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),ME=P([Cm,Oe,Wa],an),km=e=>e.referenceElements.areas,DE=P([km,Oe,Wa],an),jm=e=>e.referenceElements.lines,$E=P([jm,Oe,Wa],an),Tm=(e,t)=>{if(e!=null){var r=ft(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},NE=P(ME,Oe,Tm),Mm=(e,t)=>{if(e!=null){var r=ft(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},RE=P([DE,Oe],Mm);function LE(e){var t;if(e.x!=null)return ft([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:ft(r)}function BE(e){var t;if(e.y!=null)return ft([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:ft(r)}var Dm=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?LE(n):BE(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},zE=P([$E,Oe],Dm),FE=P(NE,zE,RE,(e,t,r)=>ua(e,r,t)),$m=(e,t,r,n,i,a,o,u,l)=>{if(r!=null)return r;var c=o==="vertical"&&u==="xAxis"||o==="horizontal"&&u==="yAxis",s=c?ua(n,a,i):ua(a,i),f=dO(t,s,e.allowDataOverflow);return f??(e.allowDataOverflow&&s==null&&l!=null?l:f)},WE=e=>{if(!(e==null||e.type!=="number"||!("ticks"in e)||e.ticks==null)){var t=ft(e.ticks);if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},KE=P([$e],WE,{memoizeOptions:{resultEqualityCheck:Gn}}),UE=P([$e,Em,Im,_E,kE,FE,Z,Oe,KE],$m,{memoizeOptions:{resultEqualityCheck:Gn}}),HE=[0,1],Nm=(e,t,r,n,i,a,o)=>{if(!((e==null||r==null||r.length===0)&&o===void 0)){var u=e.dataKey,l=e.type,c=Rt(t,a);if(c&&u==null){var s;return up(0,(s=r==null?void 0:r.length)!==null&&s!==void 0?s:0)}return l==="category"?TE(n,e,c):i==="expand"&&!c?HE:o}},Ll=P([$e,Z,$l,ri,La,Oe,UE],Nm),on=P([$e,hm,rl],cm),Rm=(e,t,r)=>{var n=t.niceTicks;if(n!=="none"){var i=Nl(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((n==="snap125"||n==="adaptive")&&t!=null&&t.tickCount&&wt(e)){if(a)return Qs(e,t.tickCount,t.allowDecimals,n);if(t.type==="number")return Js(e,t.tickCount,t.allowDecimals,n)}if(n==="auto"&&r==="linear"&&t!=null&&t.tickCount){if(a&&wt(e))return Qs(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&wt(e))return Js(e,t.tickCount,t.allowDecimals,"adaptive")}}},Bl=P([Ll,ti,on],Rm),Lm=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&wt(t)&&Array.isArray(r)&&r.length>0){var i,a,o=t[0],u=(i=r[0])!==null&&i!==void 0?i:0,l=t[1],c=(a=r[r.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,u),Math.max(l,c)]}return t},YE=P([$e,Ll,Bl,Oe],Lm),VE=P(ri,$e,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(ft(e.map(f=>f.value))).sort((f,d)=>f-d),i=n[0],a=n[n.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var u=0;ui,(e,t,r,n,i)=>{if(!G(e))return 0;var a=t==="vertical"?n.height:n.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=st(r,e*a),u=e*a/2;return u-o-(u-o)/a*o}return 0}),qE=(e,t,r)=>{var n=Ft(e,t);return n==null||typeof n.padding!="string"?0:Bm(e,"xAxis",t,r,n.padding)},XE=(e,t,r)=>{var n=Wt(e,t);return n==null||typeof n.padding!="string"?0:Bm(e,"yAxis",t,r,n.padding)},GE=P(Ft,qE,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var i=e.padding;return typeof i=="string"?{left:t,right:t}:{left:((r=i.left)!==null&&r!==void 0?r:0)+t,right:((n=i.right)!==null&&n!==void 0?n:0)+t}}),ZE=P(Wt,XE,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var i=e.padding;return typeof i=="string"?{top:t,bottom:t}:{top:((r=i.top)!==null&&r!==void 0?r:0)+t,bottom:((n=i.bottom)!==null&&n!==void 0?n:0)+t}}),zm=P([Ae,GE,Na,$a,(e,t,r)=>r],(e,t,r,n,i)=>{var a=n.padding;return i?[a.left,r.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),Fm=P([Ae,Z,ZE,Na,$a,(e,t,r)=>r],(e,t,r,n,i,a)=>{var o=i.padding;return a?[n.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),ni=(e,t,r,n)=>{var i;switch(t){case"xAxis":return zm(e,r,n);case"yAxis":return Fm(e,r,n);case"zAxis":return(i=Dl(e,r))===null||i===void 0?void 0:i.range;case"angleAxis":return Sp(e);case"radiusAxis":return Ep(e,r);default:return}},Wm=P([$e,ni],Ba),QE=P([on,YE],kO),zl=P([$e,on,QE,Wm],Ml),Km=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var i=r.type,a=r.scale,o=Rt(e,n);if(o&&(i==="number"||a!=="auto"))return t.map(u=>u.value)}},Fl=P([Z,ri,ti,Oe],Km),Zr=P([zl],cl);P([zl],cE);P([zl,PE],sm);P([nn,Rl,Oe],CE);function Um(e,t){return e.idt.id?1:0}var Qa=(e,t)=>t,Ja=(e,t,r)=>r,JE=P(Ma,Qa,Ja,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(Um)),eI=P(Da,Qa,Ja,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(Um)),Hm=(e,t)=>{var r=typeof t.height=="number"?t.height:Vu;return{width:e.width,height:r}},tI=(e,t)=>{var r=typeof t.width=="number"?t.width:Un;return{width:r,height:e.height}},Ym=P(Ae,Ft,Hm),rI=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},nI=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},iI=P(Bt,Ae,JE,Qa,Ja,(e,t,r,n,i)=>{var a={},o;return r.forEach(u=>{var l=Hm(t,u);o==null&&(o=rI(t,n,e));var c=n==="top"&&!i||n==="bottom"&&i;a[u.id]=o-Number(c)*l.height,o+=(c?-1:1)*l.height}),a}),aI=P(Lt,Ae,eI,Qa,Ja,(e,t,r,n,i)=>{var a={},o;return r.forEach(u=>{var l=tI(t,u);o==null&&(o=nI(t,n,e));var c=n==="left"&&!i||n==="right"&&i;a[u.id]=o-Number(c)*l.width,o+=(c?-1:1)*l.width}),a}),oI=(e,t)=>{var r=Ft(e,t);if(r!=null)return iI(e,r.orientation,r.mirror)},uI=P([Ae,Ft,oI,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),lI=(e,t)=>{var r=Wt(e,t);if(r!=null)return aI(e,r.orientation,r.mirror)},cI=P([Ae,Wt,lI,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),Vm=P(Ae,Wt,(e,t)=>{var r=typeof t.width=="number"?t.width:Un;return{width:r,height:e.height}}),Hf=(e,t,r)=>{switch(t){case"xAxis":return Ym(e,r).width;case"yAxis":return Vm(e,r).height;default:return}},qm=(e,t,r,n)=>{if(r!=null){var i=r.allowDuplicatedCategory,a=r.type,o=r.dataKey,u=Rt(e,n),l=t.map(s=>s.value),c=l.filter(s=>s!=null);if(o&&u&&a==="category"&&i&&Av(c))return l}},Wl=P([Z,ri,$e,Oe],qm);P([Z,gE,on,Zr,Wl,Fl,ni,Bl,Oe],(e,t,r,n,i,a,o,u,l)=>{if(t!=null){var c=Rt(e,l);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:l,categoricalDomain:a,duplicateDomain:i,isCategorical:c,niceTicks:u,range:o,realScaleType:r,scale:n}}});var sI=(e,t,r,n,i,a,o,u,l)=>{if(!(t==null||n==null)){var c=Rt(e,l),s=t.type,f=t.ticks,d=t.tickCount,v=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,p=s==="category"&&n.bandwidth?n.bandwidth()/v:0;p=l==="angleAxis"&&a!=null&&a.length>=2?Ye(a[0]-a[1])*2*p:p;var m=f||i;return m?m.map((y,g)=>{var x=o?o.indexOf(y):y,A=n.map(x);return G(A)?{index:g,coordinate:A+p,value:y,offset:p}:null}).filter(gt):c&&u?u.map((y,g)=>{var x=n.map(y);return G(x)?{coordinate:x+p,value:y,index:g,offset:p}:null}).filter(gt):n.ticks?n.ticks(d).map((y,g)=>{var x=n.map(y);return G(x)?{coordinate:x+p,value:y,index:g,offset:p}:null}).filter(gt):n.domain().map((y,g)=>{var x=n.map(y);return G(x)?{coordinate:x+p,value:o?o[y]:y,index:g,offset:p}:null}).filter(gt)}},Xm=P([Z,ti,on,Zr,Bl,ni,Wl,Fl,Oe],sI),fI=(e,t,r,n,i,a,o)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var u=Rt(e,o),l=t.tickCount,c=0;return c=o==="angleAxis"&&(n==null?void 0:n.length)>=2?Ye(n[0]-n[1])*2*c:c,u&&a?a.map((s,f)=>{var d=r.map(s);return G(d)?{coordinate:d+c,value:s,index:f,offset:c}:null}).filter(gt):r.ticks?r.ticks(l).map((s,f)=>{var d=r.map(s);return G(d)?{coordinate:d+c,value:s,index:f,offset:c}:null}).filter(gt):r.domain().map((s,f)=>{var d=r.map(s);return G(d)?{coordinate:d+c,value:i?i[s]:s,index:f,offset:c}:null}).filter(gt)}},Zt=P([Z,ti,Zr,ni,Wl,Fl,Oe],fI),Qt=P($e,Zr,(e,t)=>{if(!(e==null||t==null))return oa(oa({},e),{},{scale:t})}),dI=P([$e,on,Ll,Wm],Ml),vI=P([dI],cl);P((e,t,r)=>Dl(e,r),vI,(e,t)=>{if(!(e==null||t==null))return oa(oa({},e),{},{scale:t})});var hI=P([Z,Ma,Da],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),pI=(e,t,r)=>{var n;return(n=e.renderedTicks[t])===null||n===void 0?void 0:n[r]};P([pI],e=>{if(!(!e||e.length===0))return t=>{var r,n=1/0,i=e[0];for(var a of e){var o=Math.abs(a.coordinate-t);oe.options.defaultTooltipEventType,Zm=e=>e.options.validateTooltipEventTypes;function Qm(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function ii(e,t){var r=Gm(e),n=Zm(e);return Qm(t,r,n)}function mI(e){return $(t=>ii(t,e))}var Jm=(e,t)=>{var r,n=Number(t);if(!(Pt(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},yI=e=>e.tooltip.settings,Vt={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},gI={itemInteraction:{click:Vt,hover:Vt},axisInteraction:{click:Vt,hover:Vt},keyboardInteraction:Vt,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},ey=Me({name:"tooltip",initialState:gI,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(q(t.payload))},prepare:re()},replaceTooltipEntrySettings:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,a=Qe(e).tooltipItemPayloads.indexOf(q(n));a>-1&&(e.tooltipItemPayloads[a]=q(i))},prepare:re()},removeTooltipEntrySettings:{reducer(e,t){var r=Qe(e).tooltipItemPayloads.indexOf(q(t.payload));r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:re()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),nt=ey.actions,bI=nt.addTooltipEntrySettings,xI=nt.replaceTooltipEntrySettings,wI=nt.removeTooltipEntrySettings,AI=nt.setTooltipSettingsState,ty=nt.setActiveMouseOverItemIndex,OI=nt.mouseLeaveItem,ry=nt.mouseLeaveChart,PI=nt.setActiveClickItemIndex,ny=nt.setMouseOverAxisIndex,SI=nt.setMouseClickAxisIndex,An=nt.setSyncInteraction,la=nt.setKeyboardInteraction,EI=ey.reducer;function Yf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function bi(e){for(var t=1;t{if(t==null)return Vt;var i=kI(e,t,r);if(i==null)return Vt;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(jI(i)){if(a)return bi(bi({},i),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return bi(bi({},Vt),{},{coordinate:i.coordinate})};function TI(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}function MI(e,t){var r=TI(e),n=t[0],i=t[1];if(r===void 0)return!1;var a=Math.min(n,i),o=Math.max(n,i);return r>=a&&r<=o}function DI(e,t,r){if(r==null||t==null)return!0;var n=se(e,t);return n==null||!wt(r)?!0:MI(n,r)}var Sn=(e,t,r,n)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!G(a))return i;var o=0,u=1/0;t.length>0&&(u=t.length-1);var l=Math.max(o,Math.min(a,u)),c=t[l];return c==null||DI(c,r,n)?String(l):null},ay=(e,t,r,n,i,a,o)=>{if(a!=null){var u=o[0],l=u==null?void 0:u.getPosition(a);if(l!=null)return l;var c=i==null?void 0:i[Number(a)];if(c)switch(r){case"horizontal":return{x:c.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:c.coordinate}}}},oy=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(r==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(n!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(o=>{var u;return((u=o.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},uy=e=>e.options.tooltipPayloadSearcher,un=e=>e.tooltip;function Vf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function qf(e){for(var t=1;te(t)}function Xf(e){if(typeof e=="string")return e}function FI(e){if(!(e==null||typeof e!="object")){var t="name"in e?LI(e.name):void 0,r="unit"in e?BI(e.unit):void 0,n="dataKey"in e?zI(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?Xf(e.color):void 0,o="fill"in e?Xf(e.fill):void 0;return{name:t,unit:r,dataKey:n,payload:i,color:a,fill:o}}}function WI(e,t){return e??t}var ly=(e,t,r,n,i,a,o)=>{if(!(t==null||a==null)){var u=r.chartData,l=r.computedData,c=r.dataStartIndex,s=r.dataEndIndex,f=[];return e.reduce((d,v)=>{var p,m=v.dataDefinedOnItem,y=v.settings,g=WI(m,u),x=Array.isArray(g)?Kh(g,c,s):g,A=(p=y==null?void 0:y.dataKey)!==null&&p!==void 0?p:n,w=y==null?void 0:y.nameKey,O;if(n&&Array.isArray(x)&&!Array.isArray(x[0])&&o==="axis"?O=Ov(x,n,i):O=a(x,t,l,w),Array.isArray(O))O.forEach(S=>{var I,_,j=FI(S),k=j==null?void 0:j.name,E=j==null?void 0:j.dataKey,R=j==null?void 0:j.payload,N=qf(qf({},y),{},{name:k,unit:j==null?void 0:j.unit,color:(I=j==null?void 0:j.color)!==null&&I!==void 0?I:y==null?void 0:y.color,fill:(_=j==null?void 0:j.fill)!==null&&_!==void 0?_:y==null?void 0:y.fill});d.push(Vc({tooltipEntrySettings:N,dataKey:E,payload:R,value:se(R,E),name:k==null?void 0:String(k)}))});else{var b;d.push(Vc({tooltipEntrySettings:y,dataKey:A,payload:O,value:se(O,A),name:(b=se(O,w))!==null&&b!==void 0?b:y==null?void 0:y.name}))}return d},f)}},Kl=P([be,hm,rl],cm),KI=P([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),UI=P([Pe,tn],pm),Cr=P([KI,be,UI],mm,{memoizeOptions:{resultEqualityCheck:Ua}}),HI=P([Cr],e=>e.filter(Ka)),cy=P([Cr],bm,{memoizeOptions:{resultEqualityCheck:Ua}}),YI=P([Cr],e=>e.some(t=>!t.data)),Ar=P([cy,dt],wm),VI=P([HI,dt,be],_p),Ul=P([Ar,be,Cr,dt,YI,cy],Am),sy=P([be],Nl),qI=P([be],e=>e.allowDataOverflow),fy=P([sy,qI],lp),XI=P([Cr],e=>e.filter(Ka)),GI=P([VI,XI,La,wp],Pm),ZI=P([GI,dt,Pe,fy],Sm),QI=P([Cr],gm),JI=P([Ar,be,QI,Rl,Pe,uO],_m,{memoizeOptions:{resultEqualityCheck:Gn}}),e_=P([Cm,Pe,tn],an),t_=P([e_,Pe],Tm),r_=P([km,Pe,tn],an),n_=P([r_,Pe],Mm),i_=P([jm,Pe,tn],an),a_=P([i_,Pe],Dm),o_=P([t_,a_,n_],ua),u_=P([be,sy,fy,ZI,JI,o_,Z,Pe],$m),Qr=P([be,Z,Ar,Ul,La,Pe,u_],Nm),l_=P([Qr,be,Kl],Rm),c_=P([be,Qr,l_,Pe],Lm),dy=e=>{var t=Pe(e),r=tn(e),n=!1;return ni(e,t,r,n)},vy=P([be,dy],Ba),s_=P([be,Kl,c_,vy],Ml),hy=P([s_],cl),f_=P([Z,Ul,be,Pe],qm),d_=P([Z,Ul,be,Pe],Km),v_=(e,t,r,n,i,a,o,u)=>{if(t){var l=t.type,c=Rt(e,u);if(n){var s=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,f=l==="category"&&n.bandwidth?n.bandwidth()/s:0;return f=u==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?Ye(i[0]-i[1])*2*f:f,c&&o?o.map((d,v)=>{var p=n.map(d);return G(p)?{coordinate:p+f,value:d,index:v,offset:f}:null}).filter(gt):n.domain().map((d,v)=>{var p=n.map(d);return G(p)?{coordinate:p+f,value:a?a[d]:d,index:v,offset:f}:null}).filter(gt)}}},Kt=P([Z,be,Kl,hy,dy,f_,d_,Pe],v_),Hl=P([Gm,Zm,yI],(e,t,r)=>Qm(r.shared,e,t)),py=e=>e.tooltip.settings.trigger,Yl=e=>e.tooltip.settings.defaultIndex,ai=P([un,Hl,py,Yl],iy),Or=P([ai,Ar,Gr,Qr],Sn),my=P([Kt,Or],Jm),yy=P([ai],e=>{if(e)return e.dataKey}),h_=P([ai],e=>{if(e)return e.graphicalItemId}),gy=P([un,Hl,py,Yl],oy),p_=P([Lt,Bt,Z,Ae,Kt,Yl,gy],ay),m_=P([ai,p_],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),y_=P([ai],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),g_=P([gy,Or,dt,Gr,my,uy,Hl],ly),b_=P([g_],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function Gf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Zf(e){for(var t=1;t$(be),P_=()=>{var e=O_(),t=$(Kt),r=$(hy);return Yr(!e||!r?void 0:Zf(Zf({},e),{},{scale:r}),t)};function Qf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $r(e){for(var t=1;t{var i=t.find(a=>a&&a.index===r);if(i){if(e==="horizontal")return{x:i.coordinate,y:n.relativeY};if(e==="vertical")return{x:n.relativeX,y:i.coordinate}}return{x:0,y:0}},C_=(e,t,r,n)=>{var i=t.find(c=>c&&c.index===r);if(i){if(e==="centric"){var a=i.coordinate,o=n.radius;return $r($r($r({},n),Ce(n.cx,n.cy,o,a)),{},{angle:a,radius:o})}var u=i.coordinate,l=n.angle;return $r($r($r({},n),Ce(n.cx,n.cy,u,l)),{},{angle:l,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function k_(e,t){var r=e.relativeX,n=e.relativeY;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var by=(e,t,r,n,i)=>{var a,o=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(o<=1||e==null)return 0;if(n==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var u=i[1]-i[0],l=(F,U,H)=>[e,e+u,e-u].some(L=>(H?L>=F:L>F)&&L<=U),c=0;c0?(s=r[c-1])===null||s===void 0?void 0:s.coordinate:(f=r[o-1])===null||f===void 0?void 0:f.coordinate,y=(d=r[c])===null||d===void 0?void 0:d.coordinate,g=c>=o-1?(v=r[0])===null||v===void 0?void 0:v.coordinate:(p=r[c+1])===null||p===void 0?void 0:p.coordinate,x=void 0;if(!(m==null||y==null||g==null))if(Ye(y-m)!==Ye(g-y)){var A=[];if(Ye(g-y)===Ye(i[1]-i[0])){x=g;var w=y+i[1]-i[0];A[0]=Math.min(w,(w+m)/2),A[1]=Math.max(w,(w+m)/2)}else{x=m;var O=g+i[1]-i[0];A[0]=Math.min(y,(O+y)/2),A[1]=Math.max(y,(O+y)/2)}var b=[Math.min(y,(x+y)/2),Math.max(y,(x+y)/2)];if(l(b[0],b[1],!1)||l(A[0],A[1],!0)){var S;return(S=r[c])===null||S===void 0?void 0:S.index}}else{var I=Math.min(m,g),_=Math.max(m,g);if(l((I+y)/2,(_+y)/2,!1)){var j;return(j=r[c])===null||j===void 0?void 0:j.index}}}else if(t)for(var k=0;k(E.coordinate+N.coordinate)/2||k>0&&k(E.coordinate+N.coordinate)/2&&e<=(E.coordinate+R.coordinate)/2)return E.index}}return-1},j_=()=>$(rl),Vl=(e,t)=>t,xy=(e,t,r)=>r,ql=(e,t,r,n)=>n,T_=P(Kt,e=>wa(e,t=>t.coordinate)),Xl=P([un,Vl,xy,ql],iy),Gl=P([Xl,Ar,Gr,Qr],Sn),M_=(e,t,r)=>{if(t!=null){var n=un(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},wy=P([un,Vl,xy,ql],oy),ca=P([Lt,Bt,Z,Ae,Kt,ql,wy],ay),D_=P([Xl,ca],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),Ay=P([Kt,Gl],Jm),$_=P([wy,Gl,dt,Gr,Ay,uy,Vl],ly),N_=P([Xl,Gl],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),R_=(e,t,r,n,i,a,o)=>{if(!(!e||!r||!n||!i)&&k_(e,o)){var u=aw(e,t),l=by(u,a,i,r,n),c=__(t,i,l,e);return{activeIndex:String(l),activeCoordinate:c}}},L_=(e,t,r,n,i,a,o)=>{if(!(!e||!n||!i||!a||!r)){var u=Q1(e,r);if(u){var l=ow(u,t),c=by(l,o,a,n,i),s=C_(t,a,c,u);return{activeIndex:String(c),activeCoordinate:s}}}},B_=(e,t,r,n,i,a,o,u)=>{if(!(!e||!t||!n||!i||!a))return t==="horizontal"||t==="vertical"?R_(e,t,n,i,a,o,u):L_(e,t,r,n,i,a,o)},z_=P(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),F_=P(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(we)),r=Array.from(new Set(t));return r.sort((n,i)=>n-i)},{memoizeOptions:{resultEqualityCheck:CO}});function Jf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ed(e){for(var t=1;ted(ed({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),H_)},V_=new Set(Object.values(we));function q_(e){return V_.has(e)}var Oy=Me({name:"zIndex",initialState:Y_,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:re()},unregisterZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!q_(r)&&delete e.zIndexMap[r])},prepare:re()},registerZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload,n=r.zIndex,i=r.element,a=r.isPanorama;e.zIndexMap[n]?a?e.zIndexMap[n].panoramaElement=q(i):e.zIndexMap[n].element=q(i):e.zIndexMap[n]={consumers:0,element:a?void 0:q(i),panoramaElement:a?q(i):void 0}},prepare:re()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:re()}}}),eo=Oy.actions,X_=eo.registerZIndexPortal,Io=eo.unregisterZIndexPortal,G_=eo.registerZIndexPortalElement,Z_=eo.unregisterZIndexPortalElement,Q_=Oy.reducer;function it(e){var t=e.zIndex,r=e.children,n=Yw(),i=n&&t!==void 0&&t!==0,a=De(),o=h.useRef(void 0),u=h.useRef(new Set),l=ie(),c=$(f=>z_(f,t,a));if(h.useLayoutEffect(()=>{if(!i){var f=u.current;f.forEach(v=>{l(Io({zIndex:v}))}),f.clear(),o.current=void 0;return}if(u.current.has(t)||(l(X_({zIndex:t})),u.current.add(t)),c){o.current=c;var d=u.current;d.forEach(v=>{v!==t&&(l(Io({zIndex:v})),d.delete(v))})}},[l,t,i,c]),h.useLayoutEffect(()=>{var f=u.current;return()=>{f.forEach(d=>{l(Io({zIndex:d}))}),f.clear()}},[l]),!i)return r;var s=c??o.current;return s?mv.createPortal(r,s):null}function yu(){return yu=Object.assign?Object.assign.bind():function(e){for(var t=1;th.useContext(Py),_o={exports:{}},rd;function oC(){return rd||(rd=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(l,c,s){this.fn=l,this.context=c,this.once=s||!1}function a(l,c,s,f,d){if(typeof s!="function")throw new TypeError("The listener must be a function");var v=new i(s,f||l,d),p=r?r+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],v]:l._events[p].push(v):(l._events[p]=v,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var c=[],s,f;if(this._eventsCount===0)return c;for(f in s=this._events)t.call(s,f)&&c.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(s)):c},u.prototype.listeners=function(c){var s=r?r+c:c,f=this._events[s];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,v=f.length,p=new Array(v);d{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Pt(r))return e[r]}},cC={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},Ey=Me({name:"options",initialState:cC,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),sC=Ey.reducer,fC=Ey.actions.createEventEmitter;function dC(e){return e.tooltip.syncInteraction}var vC={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},Iy=Me({name:"chartData",initialState:vC,reducers:{setChartData(e,t){if(e.chartData=q(t.payload),t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var r=t.payload,n=r.startIndex,i=r.endIndex;n!=null&&(e.dataStartIndex=n),i!=null&&(e.dataEndIndex=i)}}}),Zl=Iy.actions,id=Zl.setChartData,hC=Zl.setDataStartEndIndexes;Zl.setComputedData;var pC=Iy.reducer,mC=["x","y"];function ad(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Nr(e){for(var t=1;tl.rootProps.className);h.useEffect(()=>{if(e==null)return Sr;var l=(c,s,f)=>{if(t!==f&&e===c){if(s.payload.active===!1){r(An({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(n==="index"){var d;if(o&&s!==null&&s!==void 0&&(d=s.payload)!==null&&d!==void 0&&d.coordinate&&s.payload.sourceViewBox){var v=s.payload.coordinate,p=v.x,m=v.y,y=xC(v,mC),g=s.payload.sourceViewBox,x=g.x,A=g.y,w=g.width,O=g.height,b=Nr(Nr({},y),{},{x:o.x+(w?(p-x)/w:0)*o.width,y:o.y+(O?(m-A)/O:0)*o.height});r(Nr(Nr({},s),{},{payload:Nr(Nr({},s.payload),{},{coordinate:b})}))}else r(s);return}if(i!=null){var S;if(typeof n=="function"){var I={activeTooltipIndex:s.payload.index==null?void 0:Number(s.payload.index),isTooltipActive:s.payload.active,activeIndex:s.payload.index==null?void 0:Number(s.payload.index),activeLabel:s.payload.label,activeDataKey:s.payload.dataKey,activeCoordinate:s.payload.coordinate},_=n(i,I);S=i[_]}else n==="value"&&(S=i.find(H=>String(H.value)===s.payload.label));var j=s.payload.coordinate;if(j==null||o==null){r(An({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(S==null){r(An({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:s.payload.sourceViewBox,graphicalItemId:void 0}));return}var k=j.x,E=j.y,R=Math.min(k,o.x+o.width),N=Math.min(E,o.y+o.height),F={x:a==="horizontal"?S.coordinate:R,y:a==="horizontal"?N:S.coordinate},U=An({active:s.payload.active,coordinate:F,dataKey:s.payload.dataKey,index:String(S.index),label:s.payload.label,sourceViewBox:s.payload.sourceViewBox,graphicalItemId:s.payload.graphicalItemId});r(U)}}};return Bn.on(gu,l),()=>{Bn.off(gu,l)}},[u,r,t,e,n,i,a,o])}function OC(){var e=$(nl),t=$(il),r=ie();h.useEffect(()=>{if(e==null)return Sr;var n=(i,a,o)=>{t!==o&&e===i&&r(hC(a))};return Bn.on(nd,n),()=>{Bn.off(nd,n)}},[r,t,e])}function PC(){var e=ie();h.useEffect(()=>{e(fC())},[e]),AC(),OC()}function SC(e,t,r,n,i,a){var o=$(p=>M_(p,e,t)),u=$(h_),l=$(il),c=$(nl),s=$(Ap),f=$(dC),d=(f==null?void 0:f.sourceViewBox)!=null,v=Ra();h.useEffect(()=>{if(!d&&c!=null&&l!=null){var p=An({active:a,coordinate:r,dataKey:o,index:i,label:typeof n=="number"?String(n):n,sourceViewBox:v,graphicalItemId:u});Bn.emit(gu,c,p,l)}},[d,r,o,u,i,n,l,c,s,a,v])}function od(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ud(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{S(AI({shared:x,trigger:A,axisId:b,active:i,defaultIndex:I}))},[S,x,A,b,i,I]);var _=Ra(),j=Qh(),k=mI(x),E=(t=$(z=>N_(z,k,A,I)))!==null&&t!==void 0?t:{},R=E.activeIndex,N=E.isActive,F=$(z=>$_(z,k,A,I)),U=$(z=>Ay(z,k,A,I)),H=$(z=>D_(z,k,A,I)),L=F,V=aC(),W=(r=i??N)!==null&&r!==void 0?r:!1,fe=Wb([L,W]),de=CC(fe,2),ue=de[0],Ne=de[1],Ke=k==="axis"?U:void 0;SC(k,A,H,Ke,R,W);var at=O??V;if(at==null||_==null||k==null)return null;var ot=L??cd;W||(ot=cd),c&&ot.length&&(ot=vb(ot.filter(z=>z.value!=null&&(z.hide!==!0||n.includeHidden)),d,DC));var sn=ot.length>0,T=ud(ud({},n),{},{payload:ot,label:Ke,active:W,activeIndex:R,coordinate:H,accessibilityLayer:j}),K=h.createElement(VA,{allowEscapeViewBox:a,animationDuration:o,animationEasing:u,isAnimationActive:s,active:W,coordinate:H,hasPayload:sn,offset:f,position:v,reverseDirection:p,useTranslate3d:m,viewBox:_,wrapperStyle:y,lastBoundingBox:ue,innerRef:Ne,hasPortalFromProps:!!O},$C(l,T));return h.createElement(h.Fragment,null,mv.createPortal(K,at),W&&h.createElement(iC,{cursor:g,tooltipEventType:k,coordinate:H,payload:ot,index:R}))}var _y=e=>null;_y.displayName="Cell";function RC(e,t,r){return(t=LC(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LC(e){var t=BC(e,"string");return typeof t=="symbol"?t:t+""}function BC(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class zC{constructor(t){RC(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function sd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function FC(e){for(var t=1;t{try{var r=document.getElementById(dd);r||(r=document.createElement("span"),r.setAttribute("id",dd),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,YC,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},En=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||qn.isSsr)return{width:0,height:0};if(!Cy.enableCache)return vd(t,r);var n=VC(t,r),i=fd.get(n);if(i)return i;var a=vd(t,r);return fd.set(n,a),a},ky;function sa(e,t){return ZC(e)||GC(e,t)||XC(e,t)||qC()}function qC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XC(e,t){if(e){if(typeof e=="string")return hd(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?hd(e,t):void 0}}function hd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=e.breakAll,n=e.style;try{var i=[];oe(t)||(r?i=t.toString().split(""):i=t.toString().split(Ty));var a=i.map(u=>({word:u,width:En(u,n).width})),o=r?0:En(" ",n).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function Dy(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function yk(e){return oe(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var $y=(e,t,r,n)=>e.reduce((i,a)=>{var o=a.word,u=a.width,l=i[i.length-1];if(l&&u!=null&&(t==null||n||l.width+u+re.reduce((t,r)=>t.width>r.width?t:r),gk="…",wd=(e,t,r,n,i,a,o,u)=>{var l=e.slice(0,t),c=My({breakAll:r,style:n,children:l+gk});if(!c)return[!1,[]];var s=$y(c.wordsWithComputedWidth,a,o,u),f=s.length>i||Ny(s).width>Number(a);return[f,s]},bk=(e,t,r,n,i)=>{var a=e.maxLines,o=e.children,u=e.style,l=e.breakAll,c=D(a),s=String(o),f=$y(t,n,r,i);if(!c||i)return f;var d=f.length>a||Ny(f).width>Number(n);if(!d)return f;for(var v=0,p=s.length-1,m=0,y;v<=p&&m<=s.length-1;){var g=Math.floor((v+p)/2),x=g-1,A=wd(s,x,l,u,a,n,r,i),w=bd(A,2),O=w[0],b=w[1],S=wd(s,g,l,u,a,n,r,i),I=bd(S,1),_=I[0];if(!O&&!_&&(v=g+1),O&&_&&(p=g-1),!O&&_){y=b;break}m++}return y||f},Ad=e=>{var t=oe(e)?[]:e.toString().split(Ty);return[{words:t,width:void 0}]},xk=e=>{var t=e.width,r=e.scaleToFit,n=e.children,i=e.style,a=e.breakAll,o=e.maxLines;if((t||r)&&!qn.isSsr){var u,l,c=My({breakAll:a,children:n,style:i});if(c){var s=c.wordsWithComputedWidth,f=c.spaceWidth;u=s,l=f}else return Ad(n);return bk({breakAll:a,children:n,maxLines:o,style:i},u,l,t,!!r)}return Ad(n)},Ry="#808080",wk={angle:0,breakAll:!1,capHeight:"0.71em",fill:Ry,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Ql=h.forwardRef((e,t)=>{var r=We(e,wk),n=r.x,i=r.y,a=r.lineHeight,o=r.capHeight,u=r.fill,l=r.scaleToFit,c=r.textAnchor,s=r.verticalAnchor,f=gd(r,sk),d=h.useMemo(()=>xk({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:l,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,l,f.style,f.width]),v=f.dx,p=f.dy,m=f.angle,y=f.className,g=f.breakAll,x=gd(f,fk);if(!Be(n)||!Be(i)||d.length===0)return null;var A=Number(n)+(D(v)?v:0),w=Number(i)+(D(p)?p:0);if(!G(A)||!G(w))return null;var O;switch(s){case"start":O=Co("calc(".concat(o,")"));break;case"middle":O=Co("calc(".concat((d.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:O=Co("calc(".concat(d.length-1," * -").concat(a,")"));break}var b=[],S=d[0];if(l&&S!=null){var I=S.width,_=f.width;b.push("scale(".concat(D(_)&&D(I)?_/I:1,")"))}return m&&b.push("rotate(".concat(m,", ").concat(A,", ").concat(w,")")),b.length&&(x.transform=b.join(" ")),h.createElement("text",bu({},Xe(x),{ref:t,x:A,y:w,className:te("recharts-text",y),textAnchor:c,fill:u.includes("url")?Ry:u}),d.map((j,k)=>{var E=j.words.join(g?"":" ");return h.createElement("tspan",{x:A,dy:k===0?O:a,key:"".concat(E,"-").concat(k)},E)}))});Ql.displayName="Text";var Ak=["labelRef"],Ok=["content"];function Od(e,t){if(e==null)return{};var r,n,i=Pk(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n{var t=e.x,r=e.y,n=e.upperWidth,i=e.lowerWidth,a=e.width,o=e.height,u=e.children,l=h.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:i,width:a,height:o}),[t,r,n,i,a,o]);return h.createElement(Ly.Provider,{value:l},u)},zy=()=>{var e=h.useContext(Ly),t=Ra();return e||(t?Mu(t):void 0)},_k=h.createContext(null),Ck=()=>{var e=h.useContext(_k),t=$(Ip);return e||t},kk=e=>{var t=e.value,r=e.formatter,n=oe(e.children)?t:e.children;return typeof r=="function"?r(n):n},to=e=>e!=null&&typeof e=="function",jk=(e,t)=>{var r=Ye(t-e),n=Math.min(Math.abs(t-e),360);return r*n},Tk=(e,t,r,n,i)=>{var a=e.offset,o=e.className,u=i.cx,l=i.cy,c=i.innerRadius,s=i.outerRadius,f=i.startAngle,d=i.endAngle,v=i.clockWise,p=(c+s)/2,m=jk(f,d),y=m>=0?1:-1,g,x;switch(t){case"insideStart":g=f+y*a,x=v;break;case"insideEnd":g=d-y*a,x=!v;break;case"end":g=d+y*a,x=v;break;default:throw new Error("Unsupported position ".concat(t))}x=m<=0?x:!x;var A=Ce(u,l,p,g),w=Ce(u,l,p,g+(x?1:-1)*359),O="M".concat(A.x,",").concat(A.y,` + A`).concat(p,",").concat(p,",0,1,").concat(x?0:1,`, + `).concat(w.x,",").concat(w.y),b=oe(e.id)?_n("recharts-radial-line-"):e.id;return h.createElement("text",It({},n,{dominantBaseline:"central",className:te("recharts-radial-bar-label",o)}),h.createElement("defs",null,h.createElement("path",{id:b,d:O})),h.createElement("textPath",{xlinkHref:"#".concat(b)},r))},Mk=(e,t,r)=>{var n=e.cx,i=e.cy,a=e.innerRadius,o=e.outerRadius,u=e.startAngle,l=e.endAngle,c=(u+l)/2;if(r==="outside"){var s=Ce(n,i,o+t,c),f=s.x,d=s.y;return{x:f,y:d,textAnchor:f>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"end"};var v=(a+o)/2,p=Ce(n,i,v,c),m=p.x,y=p.y;return{x:m,y,textAnchor:"middle",verticalAnchor:"middle"}},zr=e=>e!=null&&"cx"in e&&D(e.cx),Dk={angle:0,offset:5,zIndex:we.label,position:"middle",textBreakAll:!1};function $k(e){if(!zr(e))return e;var t=e.cx,r=e.cy,n=e.outerRadius,i=n*2;return{x:t-n,y:r-n,width:i,upperWidth:i,lowerWidth:i,height:i}}function Yt(e){var t,r,n=We(e,Dk),i=n.viewBox,a=n.parentViewBox,o=n.position,u=n.value,l=n.children,c=n.content,s=n.className,f=s===void 0?"":s,d=n.textBreakAll,v=n.labelRef,p=Ck(),m=zy(),y=o==="center"?m:p??m,g,x,A;i==null?g=y:zr(i)?g=i:g=Mu(i);var w=$k(g);if(!g||oe(u)&&oe(l)&&!h.isValidElement(c)&&typeof c!="function")return null;var O=zr(g)&&(o==="insideStart"||o==="insideEnd"||o==="end");if(zr(g))O||(A=Mk(g,n.offset,n.position));else if(w){var b=d0({viewBox:w,position:o,offset:n.offset,parentViewBox:zr(a)?void 0:a});A=cr(cr({x:b.x,y:b.y,textAnchor:b.horizontalAnchor,verticalAnchor:b.verticalAnchor},b.width!==void 0?{width:b.width}:{}),b.height!==void 0?{height:b.height}:{})}var S=cr(cr(cr(cr({},((t=A)===null||t===void 0?void 0:t.x)!==void 0?{x:A.x}:{}),((r=A)===null||r===void 0?void 0:r.y)!==void 0?{y:A.y}:{}),n),{},{viewBox:g});if(h.isValidElement(c)){S.labelRef;var I=Od(S,Ak);return h.cloneElement(c,I)}if(typeof c=="function"){S.content;var _=Od(S,Ok);if(x=h.createElement(c,_),h.isValidElement(x))return x}else x=kk(n);var j=Xe(n);return O&&zr(g)?Tk(n,o,x,j,g):A==null?null:h.createElement(it,{zIndex:n.zIndex},h.createElement(Ql,It({ref:v,className:te("recharts-label",f)},j,A,{textAnchor:Dy(j.textAnchor)?j.textAnchor:A.textAnchor,breakAll:d}),x))}Yt.displayName="Label";var Nk=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?h.createElement(Yt,It({key:"label-implicit"},n)):Be(e)?h.createElement(Yt,It({key:"label-implicit",value:e},n)):h.isValidElement(e)?e.type===Yt?h.cloneElement(e,cr({key:"label-implicit"},n)):h.createElement(Yt,It({key:"label-implicit",content:e},n)):to(e)?h.createElement(Yt,It({key:"label-implicit",content:e},n)):e&&typeof e=="object"?h.createElement(Yt,It({},e,{key:"label-implicit"},n)):null};function Fy(e){var t=e.label,r=e.labelRef,n=zy();return Nk(t,n,r)||null}var Rk=["valueAccessor"],Lk=["dataKey","clockWise","id","textBreakAll","zIndex"];function fa(){return fa=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(yk(t))return t},Wy=h.createContext(void 0),Ky=Wy.Provider,Uy=h.createContext(void 0);Uy.Provider;function Fk(){return h.useContext(Wy)}function Wk(){return h.useContext(Uy)}function Ci(e){var t=e.valueAccessor,r=t===void 0?zk:t,n=Sd(e,Rk),i=n.dataKey;n.clockWise;var a=n.id,o=n.textBreakAll,u=n.zIndex,l=Sd(n,Lk),c=Fk(),s=Wk(),f=c||s;return!f||!f.length?null:h.createElement(it,{zIndex:u??we.label},h.createElement(Fe,{className:"recharts-label-list"},f.map((d,v)=>{var p,m=oe(i)?r(d,v):se(d.payload,i),y=oe(a)?{}:{id:"".concat(a,"-").concat(v)};return h.createElement(Yt,fa({key:"label-".concat(v)},Xe(d),l,y,{fill:(p=n.fill)!==null&&p!==void 0?p:d.fill,parentViewBox:d.parentViewBox,value:m,textBreakAll:o,viewBox:d.viewBox,index:v,zIndex:0}))})))}Ci.displayName="LabelList";function Hy(e){var t=e.label;return t?t===!0?h.createElement(Ci,{key:"labelList-implicit"}):h.isValidElement(t)||to(t)?h.createElement(Ci,{key:"labelList-implicit",content:t}):typeof t=="object"?h.createElement(Ci,fa({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function xu(){return xu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=e.cx,r=e.cy,n=e.r,i=e.className,a=te("recharts-dot",i);return D(t)&&D(r)&&D(n)?h.createElement("circle",xu({},Ot(e),$u(e),{className:a,cx:t,cy:r,r:n})):null},Kk={radiusAxis:{},angleAxis:{}},Vy=Me({name:"polarAxis",initialState:Kk,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=q(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=q(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),ro=Vy.actions;ro.addRadiusAxis;ro.removeRadiusAxis;ro.addAngleAxis;ro.removeAngleAxis;var Uk=Vy.reducer;function Hk(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var ko={exports:{}},J={};/** + * @license React + * react-is.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ed;function Yk(){if(Ed)return J;Ed=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),s=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),d=Symbol.for("react.view_transition"),v=Symbol.for("react.client.reference");function p(m){if(typeof m=="object"&&m!==null){var y=m.$$typeof;switch(y){case e:switch(m=m.type,m){case r:case i:case n:case l:case c:case d:return m;default:switch(m=m&&m.$$typeof,m){case o:case u:case f:case s:return m;case a:return m;default:return y}}case t:return y}}}return J.ContextConsumer=a,J.ContextProvider=o,J.Element=e,J.ForwardRef=u,J.Fragment=r,J.Lazy=f,J.Memo=s,J.Portal=t,J.Profiler=i,J.StrictMode=n,J.Suspense=l,J.SuspenseList=c,J.isContextConsumer=function(m){return p(m)===a},J.isContextProvider=function(m){return p(m)===o},J.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===e},J.isForwardRef=function(m){return p(m)===u},J.isFragment=function(m){return p(m)===r},J.isLazy=function(m){return p(m)===f},J.isMemo=function(m){return p(m)===s},J.isPortal=function(m){return p(m)===t},J.isProfiler=function(m){return p(m)===i},J.isStrictMode=function(m){return p(m)===n},J.isSuspense=function(m){return p(m)===l},J.isSuspenseList=function(m){return p(m)===c},J.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===r||m===i||m===n||m===l||m===c||typeof m=="object"&&m!==null&&(m.$$typeof===f||m.$$typeof===s||m.$$typeof===o||m.$$typeof===a||m.$$typeof===u||m.$$typeof===v||m.getModuleId!==void 0)},J.typeOf=p,J}var Id;function Vk(){return Id||(Id=1,ko.exports=Yk()),ko.exports}var qk=Vk(),_d=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",Cd=null,jo=null,qy=e=>{if(e===Cd&&Array.isArray(jo))return jo;var t=[];return h.Children.forEach(e,r=>{oe(r)||(qk.isFragment(r)?t=t.concat(qy(r.props.children)):t.push(r))}),jo=t,Cd=e,t};function Xk(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(i=>_d(i)):n=[_d(t)],qy(e).forEach(i=>{var a=Tt(i,"type.displayName")||Tt(i,"type.name");a&&n.indexOf(a)!==-1&&r.push(i)}),r}var Xy=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function kd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function jd(e){for(var t=1;t{var n=ie();return(i,a)=>o=>{e==null||e(i,a,o),n(ty({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:r}))}},Jy=e=>{var t=ie();return(r,n)=>i=>{e==null||e(r,n,i),t(OI())}},eg=(e,t,r)=>{var n=ie();return(i,a)=>o=>{e==null||e(i,a,o),n(PI({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:r}))}};function tg(e){var t=e.tooltipEntrySettings,r=ie(),n=De(),i=h.useRef(null);return h.useLayoutEffect(()=>{n||(i.current===null?r(bI(t)):i.current!==t&&r(xI({prev:i.current,next:t})),i.current=t)},[t,r,n]),h.useLayoutEffect(()=>()=>{i.current&&(r(wI(i.current)),i.current=null)},[r]),null}function rg(e){var t=e.legendPayload,r=ie(),n=De(),i=h.useRef(null);return h.useLayoutEffect(()=>{n||(i.current===null?r(qw(t)):i.current!==t&&r(Xw({prev:i.current,next:t})),i.current=t)},[r,n,t]),h.useLayoutEffect(()=>()=>{i.current&&(r(Gw(i.current)),i.current=null)},[r]),null}function nj(e,t){return uj(e)||oj(e,t)||aj(e,t)||ij()}function ij(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aj(e,t){if(e){if(typeof e=="string")return Td(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Td(e,t):void 0}}function Td(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r2&&arguments[2]!==void 0?arguments[2]:[],n=[];for(var i of r)n.push({status:"removed",prev:i});for(var a=0;ae[Math.floor(a*r)]);return ec(n,t)}function cj(e,t){var r=t.map((n,i)=>e[i]);return ec(r,t)}function sj(e,t){for(var r=new Map,n=0;n{var v=r(f,d);if(v!=null){var p=n.get(v);if(p!==void 0)return i.add(v),p}}),o=[];for(var u of n){var l=nj(u,2),c=l[0],s=l[1];i.has(c)||o.push(s)}return ec(a,t,o)}function dj(e,t,r){return t==null?null:e==null?t.map(n=>({status:"added",next:n})):r===Jl?lj(e,t):r===ng?cj(e,t):fj(e,t,r)}function vj(e,t){var r=h.useRef(e),n=h.useRef(t.current),i=h.useRef(!0);r.current!==e&&(r.current=e,n.current=t.current,i.current=!1);var a=h.useCallback(function(o,u){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(u===0){i.current=!0;return}u===1&&(n.current=o),u>0&&i.current&&l&&(t.current=o)},[t]);return{startValue:n.current,syncStepValue:a}}function hj(e,t){return gj(e)||yj(e,t)||mj(e,t)||pj()}function pj(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mj(e,t){if(e){if(typeof e=="string")return Md(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Md(e,t):void 0}}function Md(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{typeof e=="function"&&e(),a(!0)},[e]),u=h.useCallback(()=>{typeof t=="function"&&t(),a(!1)},[t]);return{isAnimating:i,handleAnimationStart:o,handleAnimationEnd:u}}function ag(e){var t,r=e.animationInput,n=e.animationIdPrefix,i=e.items,a=e.previousItemsRef,o=e.isAnimationActive,u=e.animationBegin,l=e.animationDuration,c=e.animationEasing,s=e.onAnimationStart,f=e.onAnimationEnd,d=e.animationInterpolateFn,v=e.animationMatchBy,p=e.shouldUpdatePreviousRef,m=e.children,y=e.layout,g=ip(r,n),x=vj(g,a),A=(t=x.startValue)!==null&&t!==void 0?t:null,w=dj(A,i,v??Jl);return h.createElement(np,{animationId:g,begin:u,duration:l,isActive:o,easing:c,onAnimationEnd:f,onAnimationStart:s,key:g},O=>{var b=A==null,S=i==null?i:d(w,O,y),I=p?p(O):O>0;return x.syncStepValue(S,O,I),S==null?null:m(S,O,b)})}var To;function bj(e,t){return Oj(e)||Aj(e,t)||wj(e,t)||xj()}function xj(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wj(e,t){if(e){if(typeof e=="string")return Dd(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Dd(e,t):void 0}}function Dd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var e=h.useState(()=>_n("uid-")),t=bj(e,1),r=t[0];return r},Sj=(To=qg.useId)!==null&&To!==void 0?To:Pj;function Ej(e,t){var r=Sj();return t||(e?"".concat(e,"-").concat(r):r)}var Ij=h.createContext(void 0),og=e=>{var t=e.id,r=e.type,n=e.children,i=Ej("recharts-".concat(r),t);return h.createElement(Ij.Provider,{value:i},n(i))},_j={cartesianItems:[],polarItems:[]},ug=Me({name:"graphicalItems",initialState:_j,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(q(t.payload))},prepare:re()},replaceCartesianGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,a=Qe(e).cartesianItems.indexOf(q(n));a>-1&&(e.cartesianItems[a]=q(i))},prepare:re()},removeCartesianGraphicalItem:{reducer(e,t){var r=Qe(e).cartesianItems.indexOf(q(t.payload));r>-1&&e.cartesianItems.splice(r,1)},prepare:re()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(q(t.payload))},prepare:re()},removePolarGraphicalItem:{reducer(e,t){var r=Qe(e).polarItems.indexOf(q(t.payload));r>-1&&e.polarItems.splice(r,1)},prepare:re()},replacePolarGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,a=Qe(e).polarItems.indexOf(q(n));a>-1&&(e.polarItems[a]=q(i))},prepare:re()}}}),ln=ug.actions,Cj=ln.addCartesianGraphicalItem,kj=ln.replaceCartesianGraphicalItem,jj=ln.removeCartesianGraphicalItem;ln.addPolarGraphicalItem;ln.removePolarGraphicalItem;ln.replacePolarGraphicalItem;var Tj=ug.reducer,Mj=e=>{var t=ie(),r=h.useRef(null);return h.useLayoutEffect(()=>{r.current===null?t(Cj(e)):r.current!==e&&t(kj({prev:r.current,next:e})),r.current=e},[t,e]),h.useLayoutEffect(()=>()=>{r.current&&(t(jj(r.current)),r.current=null)},[t]),null},lg=h.memo(Mj),Dj=["points"];function $d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Mo(e){for(var t=1;t{var g,x,A=Mo(Mo(Mo({r:3},o),d),{},{index:y,cx:(g=m.x)!==null&&g!==void 0?g:void 0,cy:(x=m.y)!==null&&x!==void 0?x:void 0,dataKey:a,value:m.value,payload:m.payload,points:t});return h.createElement(zj,{key:"dot-".concat(y),option:r,dotProps:A,className:i})}),p={};return u&&l!=null&&(p.clipPath="url(#clipPath-".concat(f?"":"dots-").concat(l,")")),h.createElement(it,{zIndex:s},h.createElement(Fe,da({className:n},p),v))}function Nd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function wi(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),nT=P([rT,Lt,Bt],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),tc=()=>$(nT),iT=()=>$(b_);function Rd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Do(e){for(var t=1;t{var t=e.point,r=e.childIndex,n=e.mainColor,i=e.activeDot,a=e.dataKey,o=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var u={index:r,dataKey:a,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},l=Do(Do(Do({},u),Fn(i)),$u(i)),c;return h.isValidElement(i)?c=h.cloneElement(i,l):typeof i=="function"?c=i(l):c=h.createElement(Yy,l),h.createElement(Fe,{className:"recharts-active-dot",clipPath:o},c)};function cT(e){var t=e.points,r=e.mainColor,n=e.activeDot,i=e.itemDataKey,a=e.clipPath,o=e.zIndex,u=o===void 0?we.activeDot:o,l=$(Or),c=iT();if(t==null||c==null)return null;var s=t.find(f=>c.includes(f.payload));return oe(s)?null:h.createElement(it,{zIndex:u},h.createElement(lT,{point:s,childIndex:Number(l),mainColor:r,dataKey:i,activeDot:n,clipPath:a}))}function sT(e,t){return hT(e)||vT(e,t)||dT(e,t)||fT()}function fT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dT(e,t){if(e){if(typeof e=="string")return Ld(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ld(e,t):void 0}}function Ld(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var n=r??e;if(!oe(n))return st(n,t,0)},pT=(e,t,r)=>{var n={},i=e.filter(Ka),a=e.filter(c=>c.stackId==null),o=i.reduce((c,s)=>{var f=c[s.stackId];return f==null&&(f=[]),f.push(s),c[s.stackId]=f,c},n),u=Object.entries(o).map(c=>{var s,f=sT(c,2),d=f[0],v=f[1],p=v.map(y=>y.dataKey),m=Bd(t,r,(s=v[0])===null||s===void 0?void 0:s.barSize);return{stackId:d,dataKeys:p,barSize:m}}),l=a.map(c=>{var s=[c.dataKey].filter(d=>d!=null),f=Bd(t,r,c.barSize);return{stackId:void 0,dataKeys:s,barSize:f}});return[...u,...l]};function zd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ai(e){for(var t=1;tx+(A.barSize||0),0);d+=(o-1)*u,d>=r&&(d-=(o-1)*u,u=0),d>=r&&f>0&&(s=!0,f*=.9,d=o*f);var v=Math.round((r-d)/2),p={offset:v-u,size:0};l=n.reduce((x,A)=>{var w,O={stackId:A.stackId,dataKeys:A.dataKeys,position:{offset:p.offset+p.size+u,size:s?f:(w=A.barSize)!==null&&w!==void 0?w:0}},b=[...x,O];return p=O.position,b},c)}else{var m=st(t,r,0,!0);r-2*m-(o-1)*u<=0&&(u=0);var y=(r-2*m-(o-1)*u)/o;y>1&&(y=Math.round(y));var g=G(i)?Math.min(y,i):y;l=n.reduce((x,A,w)=>[...x,{stackId:A.stackId,dataKeys:A.dataKeys,position:{offset:m+(y+u)*w+(y-g)/2,size:g}}],c)}return l}}var xT=(e,t,r,n,i,a,o)=>{var u=oe(o)?t:o,l=bT(r,n,i!==a?i:a,e,u);return i!==a&&l!=null&&(l=l.map(c=>Ai(Ai({},c),{},{position:Ai(Ai({},c.position),{},{offset:c.position.offset-i/2})}))),l},wT=(e,t)=>{var r=ll(t);if(!(!e||r==null||t==null)){var n=t.stackId;if(n!=null){var i=e[n];if(i){var a=i.stackedData;if(a)return a.find(o=>o.key===r)}}}},AT=(e,t)=>{if(!(e==null||t==null)){var r=e.find(n=>n.stackId===t.stackId&&t.dataKey!=null&&n.dataKeys.includes(t.dataKey));if(r!=null)return r.position}};function OT(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&G(e.zIndex)?e.zIndex:t}var PT=e=>{var t=e.chartData,r=ie(),n=De();return h.useEffect(()=>n?()=>{}:(r(id(t)),()=>{r(id(void 0))}),[t,r,n]),null},Fd={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},fg=Me({name:"brush",initialState:Fd,reducers:{setBrushSettings(e,t){return t.payload==null?Fd:t.payload}}});fg.actions.setBrushSettings;var ST=fg.reducer,ET=(e,t)=>{var r=e.x,n=e.y,i=t.x,a=t.y;return{x:Math.min(r,i),y:Math.min(n,a),width:Math.abs(i-r),height:Math.abs(a-n)}};function IT(e){return(e%180+180)%180}var _T=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=IT(i),o=a*Math.PI/180,u=Math.atan(n/r),l=o>u&&o{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=Qe(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=Qe(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(q(t.payload))},removeLine:(e,t)=>{var r=Qe(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),cn=dg.actions;cn.addDot;cn.removeDot;var kT=cn.addArea,jT=cn.removeArea;cn.addLine;cn.removeLine;var TT=dg.reducer;function MT(e,t){return RT(e)||NT(e,t)||$T(e,t)||DT()}function DT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $T(e,t){if(e){if(typeof e=="string")return Wd(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Wd(e,t):void 0}}function Wd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=h.useState("".concat(_n("recharts"),"-clip")),n=MT(r,1),i=n[0],a=tc();if(a==null)return null;var o=a.x,u=a.y,l=a.width,c=a.height;return h.createElement(vg.Provider,{value:i},h.createElement("defs",null,h.createElement("clipPath",{id:i},h.createElement("rect",{x:o,y:u,height:c,width:l}))),t)},BT=()=>h.useContext(vg);class zT{constructor(t){var r=t.x,n=t.y;this.xAxisScale=r,this.yAxisScale=n}map(t,r){var n,i,a=r.position;return{x:(n=this.xAxisScale.map(t.x,{position:a}))!==null&&n!==void 0?n:0,y:(i=this.yAxisScale.map(t.y,{position:a}))!==null&&i!==void 0?i:0}}mapWithFallback(t,r){var n,i,a=r.position,o=r.fallback,u,l;return o==="rangeMin"?u=this.yAxisScale.rangeMin():o==="rangeMax"?u=this.yAxisScale.rangeMax():u=0,o==="rangeMin"?l=this.xAxisScale.rangeMin():o==="rangeMax"?l=this.xAxisScale.rangeMax():l=0,{x:(n=this.xAxisScale.map(t.x,{position:a}))!==null&&n!==void 0?n:l,y:(i=this.yAxisScale.map(t.y,{position:a}))!==null&&i!==void 0?i:u}}isInRange(t){var r=t.x,n=t.y,i=r==null||this.xAxisScale.isInRange(r),a=n==null||this.yAxisScale.isInRange(n);return i&&a}}function Kd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ud(e){for(var t=1;t{var u,l,c,s,f=o.x1,d=o.x2,v=o.y1,p=o.y2;if(i==null||a==null)return null;var m=new zT({x:i,y:a}),y={x:e?(u=i.map(f,{position:"start"}))!==null&&u!==void 0?u:null:i.rangeMin(),y:r?(l=a.map(v,{position:"start"}))!==null&&l!==void 0?l:null:a.rangeMin()},g={x:t?(c=i.map(d,{position:"end"}))!==null&&c!==void 0?c:null:i.rangeMax(),y:n?(s=a.map(p,{position:"end"}))!==null&&s!==void 0?s:null:a.rangeMax()};return o.ifOverflow==="discard"&&(!m.isInRange(y)||!m.isInRange(g))?null:ET(y,g)},HT=(e,t)=>{var r;return h.isValidElement(e)?r=h.cloneElement(e,t):typeof e=="function"?r=e(t):r=h.createElement(Gu,va({},t,{className:"recharts-reference-area-rect"})),r};function YT(e){var t=ie();return h.useEffect(()=>(t(kT(e)),()=>{t(jT(e))})),null}function VT(e){var t=e.x1,r=e.x2,n=e.y1,i=e.y2,a=e.className,o=e.shape,u=e.xAxisId,l=e.yAxisId,c=BT(),s=De(),f=$(w=>Zr(w,"xAxis",u,s)),d=$(w=>Zr(w,"yAxis",l,s));if(f==null||d==null)return null;var v=Be(t),p=Be(r),m=Be(n),y=Be(i);if(!v&&!p&&!m&&!y&&!o)return null;var g=UT(v,p,m,y,f,d,e);if(!g&&!o)return null;var x=e.ifOverflow==="hidden",A=x?"url(#".concat(c,")"):void 0;return h.createElement(it,{zIndex:e.zIndex},h.createElement(Fe,{className:te("recharts-reference-area",a)},HT(o,Ud(Ud({clipPath:A},Xe(e)),g)),g!=null&&h.createElement(By,va({},g,{lowerWidth:g.width,upperWidth:g.width}),h.createElement(Fy,{label:e.label}),e.children)))}var qT={ifOverflow:"discard",xAxisId:0,yAxisId:0,radius:0,fill:"#ccc",label:!1,fillOpacity:.5,stroke:"none",strokeWidth:1,zIndex:we.area};function XT(e){var t=We(e,qT);return h.createElement(h.Fragment,null,h.createElement(YT,{yAxisId:t.yAxisId,xAxisId:t.xAxisId,ifOverflow:t.ifOverflow,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2}),h.createElement(VT,t))}XT.displayName="ReferenceArea";function GT(){}function Hd(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}function ZT(e,t,r){return On(e,t,void 0,void 0,void 0,void 0,r)}function On(e,t,r,n,i,a,o){const u=o(e,t,r,n,i,a);if(u!==void 0)return u;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return In(e,t,a,o)}return In(e,t,a,o)}function In(e,t,r,n){if(Object.is(e,t))return!0;let i=Cn(e),a=Cn(t);if(i==="[object Arguments]"&&(i=Si),a==="[object Arguments]"&&(a=Si),i!==a)return!1;switch(i){case Ru:return e.toString()===t.toString();case Lu:return Pn(e.valueOf(),t.valueOf());case Bu:case Kv:case Wv:return Object.is(e.valueOf(),t.valueOf());case zv:return e.source===t.source&&e.flags===t.flags;case Y0:return e===t}r=r??new Map;const o=r.get(e),u=r.get(t);if(o!=null&&u!=null)return o===t;r.set(e,t),r.set(t,e);try{switch(i){case Uv:if(e.size!==t.size)return!1;for(const[l,c]of e.entries())if(!t.has(l)||!On(c,t.get(l),l,e,t,r,n))return!1;return!0;case Hv:{if(e.size!==t.size)return!1;const l=Array.from(e.values()),c=Array.from(t.values());for(let s=0;sOn(f,v,void 0,e,t,r,n));if(d===-1)return!1;c.splice(d,1)}return!0}case Yv:case Xv:case Gv:case Zv:case Qv:case q0:case Jv:case eh:case th:case X0:case rh:case nh:if(Ho(e)!==Ho(t)||e.length!==t.length)return!1;for(let l=0;le*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function tM(e,t){return hg(e,t+1)}function rM(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,u=t.end,l=0,c=1,s=o,f=function(){var p=n==null?void 0:n[l];if(p===void 0)return{v:hg(n,c)};var m=l,y,g=()=>(y===void 0&&(y=r(p,m)),y),x=p.coordinate,A=l===0||zn(e,x,g,s,u);A||(l=0,s=o,c+=1),A&&(s=x+e*(g()/2+i),l+=c)},d;c<=a.length;)if(d=f(),d)return d.v;return[]}function nM(e,t,r,n,i){var a=(n||[]).slice(),o=a.length;if(o===0)return[];for(var u=t.start,l=t.end,c=1;c<=o;c++){for(var s=(o-1)%c,f=u,d=!0,v=function(){var w=n[m];if(w==null)return 0;var O=m,b,S=()=>(b===void 0&&(b=r(w,O)),b),I=w.coordinate,_=m===s||zn(e,I,S,f,l);if(!_)return d=!1,1;_&&(f=I+e*(S()/2+i))},p,m=s;m(m===void 0&&(m=r(v,d)),m);if(d===o-1){var g=e*(p.coordinate+e*y()/2-l);a[d]=p=je(je({},p),{},{tickCoord:g>0?p.coordinate-g*e:p.coordinate})}else a[d]=p=je(je({},p),{},{tickCoord:p.coordinate});if(p.tickCoord!=null){var x=zn(e,p.tickCoord,y,u,l);x&&(l=p.tickCoord-e*(y()/2+i),a[d]=je(je({},p),{},{isShow:!0}))}},s=o-1;s>=0;s--)c(s);return a}function lM(e,t,r,n,i,a){var o=(n||[]).slice(),u=o.length,l=t.start,c=t.end;if(a){var s=n[u-1];if(s!=null){var f=r(s,u-1),d=e*(s.coordinate+e*f/2-c);if(o[u-1]=s=je(je({},s),{},{tickCoord:d>0?s.coordinate-d*e:s.coordinate}),s.tickCoord!=null){var v=zn(e,s.tickCoord,()=>f,l,c);v&&(c=s.tickCoord-e*(f/2+i),o[u-1]=je(je({},s),{},{isShow:!0}))}}}for(var p=a?u-1:u,m=function(x){var A=o[x];if(A==null)return 1;var w=A,O,b=()=>(O===void 0&&(O=r(A,x)),O);if(x===0){var S=e*(w.coordinate-e*b()/2-l);o[x]=w=je(je({},w),{},{tickCoord:S<0?w.coordinate-S*e:w.coordinate})}else o[x]=w=je(je({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var I=zn(e,w.tickCoord,b,l,c);I&&(l=w.tickCoord+e*(b()/2+i),o[x]=je(je({},w),{},{isShow:!0}))}},y=0;y{var S=typeof c=="function"?c(O.value,b):O.value;return p==="width"?JT(En(S,{fontSize:t,letterSpacing:r}),m,f):En(S,{fontSize:t,letterSpacing:r})[p]},g=i[0],x=i[1],A=i.length>=2&&g!=null&&x!=null?Ye(x.coordinate-g.coordinate):1,w=eM(a,A,p);return l==="equidistantPreserveStart"?rM(A,w,y,i,o):l==="equidistantPreserveEnd"?nM(A,w,y,i,o):(l==="preserveStart"||l==="preserveStartEnd"?v=lM(A,w,y,i,o,l==="preserveStartEnd"):v=uM(A,w,y,i,o),v.filter(O=>O.isShow))}var sM=e=>{var t=e.ticks,r=e.label,n=e.labelGapWithTick,i=n,a=e.tickSize,o=a===void 0?0:a,u=e.tickMargin,l=u===void 0?0:u,c=0;if(t){Array.from(t).forEach(v=>{if(v){var p=v.getBoundingClientRect();p.width>c&&(c=p.width)}});var s=r?r.getBoundingClientRect().width:0,f=o+l,d=c+f+s+(r?i:0);return Math.round(d)}return 0},fM=e=>{var t=e.ticks,r=e.label,n=e.labelGapWithTick,i=n,a=e.tickSize,o=a===void 0?0:a,u=e.tickMargin,l=u===void 0?0:u,c=0;if(t){Array.from(t).forEach(v=>{if(v){var p=v.getBoundingClientRect();p.height>c&&(c=p.height)}});var s=r?r.getBoundingClientRect().height:0,f=o+l,d=c+f+s+(r?i:0);return Math.round(d)}return 0},dM={xAxis:{},yAxis:{}},pg=Me({name:"renderedTicks",initialState:dM,reducers:{setRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,i=r.axisId,a=r.ticks;e[n][i]=q(a)},removeRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,i=r.axisId;delete e[n][i]}}}),mg=pg.actions,vM=mg.setRenderedTicks,hM=mg.removeRenderedTicks,pM=pg.reducer,mM=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function Vd(e,t){return xM(e)||bM(e,t)||gM(e,t)||yM()}function yM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gM(e,t){if(e){if(typeof e=="string")return qd(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qd(e,t):void 0}}function qd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(!(n==null||r==null)){var o=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index})),u=a.current;u!=null&&u.axisId===n&&u.axisType===r&&QT(u.ticks,o)||(a.current={ticks:o,axisId:n,axisType:r},i(vM({ticks:o,axisId:n,axisType:r})))}},[i,t,n,r]),h.useEffect(()=>n==null||r==null?Sr:()=>{i(hM({axisId:n,axisType:r}))},[i,n,r]),null}var TM=h.forwardRef((e,t)=>{var r=e.ticks,n=r===void 0?[]:r,i=e.tick,a=e.tickLine,o=e.stroke,u=e.tickFormatter,l=e.unit,c=e.padding,s=e.tickTextProps,f=e.orientation,d=e.mirror,v=e.x,p=e.y,m=e.width,y=e.height,g=e.tickSize,x=e.tickMargin,A=e.fontSize,w=e.letterSpacing,O=e.getTicksConfig,b=e.events,S=e.axisType,I=e.axisId,_=cM(ce(ce({},O),{},{ticks:n}),A,w),j=Ot(O),k=Fn(i),E=Dy(j.textAnchor)?j.textAnchor:_M(f,d),R=CM(f,d),N={};typeof a=="object"&&(N=a);var F=ce(ce({},j),{},{fill:"none"},N),U=_.map(V=>ce({entry:V},IM(V,v,p,m,y,f,g,d,x))),H=U.map(V=>{var W=V.entry,fe=V.line;return h.createElement(Fe,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(W.value,"-").concat(W.coordinate,"-").concat(W.tickCoord)},a&&h.createElement("line",Pr({},F,fe,{className:te("recharts-cartesian-axis-tick-line",Tt(a,"className"))})))}),L=U.map((V,W)=>{var fe,de,ue=V.entry,Ne=V.tick,Ke=ce(ce(ce(ce({verticalAnchor:R},j),{},{textAnchor:E,stroke:"none",fill:o},Ne),{},{index:W,payload:ue,visibleTicksCount:_.length,tickFormatter:u,padding:c},s),{},{angle:(fe=(de=s==null?void 0:s.angle)!==null&&de!==void 0?de:j.angle)!==null&&fe!==void 0?fe:0}),at=ce(ce({},Ke),k);return h.createElement(Fe,Pr({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(ue.value,"-").concat(ue.coordinate,"-").concat(ue.tickCoord)},Nu(b,ue,W)),i&&h.createElement(kM,{option:i,tickProps:at,value:"".concat(typeof u=="function"?u(ue.value,W):ue.value).concat(l||"")}))});return h.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(S,"-ticks")},h.createElement(jM,{ticks:_,axisId:I,axisType:S}),L.length>0&&h.createElement(it,{zIndex:we.label},h.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(S,"-tick-labels"),ref:t},L)),H.length>0&&h.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(S,"-tick-lines")},H))}),MM=h.forwardRef((e,t)=>{var r=e.axisLine,n=e.width,i=e.height,a=e.className,o=e.hide,u=e.ticks,l=e.axisType,c=e.axisId,s=wM(e,mM),f=h.useState(""),d=Vd(f,2),v=d[0],p=d[1],m=h.useState(""),y=Vd(m,2),g=y[0],x=y[1],A=h.useRef(null);h.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var O;return sM({ticks:A.current,label:(O=e.labelRef)===null||O===void 0?void 0:O.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})},getCalculatedHeight:()=>{var O;return fM({ticks:A.current,label:(O=e.labelRef)===null||O===void 0?void 0:O.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var w=h.useCallback(O=>{if(O){var b=O.getElementsByClassName("recharts-cartesian-axis-tick-value");A.current=b;var S=b[0];if(S){var I=window.getComputedStyle(S),_=I.fontSize,j=I.letterSpacing;(_!==v||j!==g)&&(p(_),x(j))}}},[v,g]);return o||n!=null&&n<=0||i!=null&&i<=0?null:h.createElement(it,{zIndex:e.zIndex},h.createElement(Fe,{className:te("recharts-cartesian-axis",a)},h.createElement(EM,{x:e.x,y:e.y,width:n,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:Ot(e)}),h.createElement(TM,{ref:w,axisType:l,events:s,fontSize:v,getTicksConfig:e,height:e.height,letterSpacing:g,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:u,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:c}),h.createElement(By,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},h.createElement(Fy,{label:e.label,labelRef:e.labelRef}),e.children)))}),rc=h.forwardRef((e,t)=>{var r=We(e,yr);return h.createElement(MM,Pr({},r,{ref:t}))});rc.displayName="CartesianAxis";var DM=["animationElapsedTime","isAnimating","isEntrance","visibleLength","strokeDasharray","connectNulls"];function wu(){return wu=Object.assign?Object.assign.bind():function(e){for(var t=1;tv+p,0);if(!i)return yg(t,e);for(var a=Math.floor(e/i),o=e%i,u=[],l=0,c=0;lo){u=[...n.slice(0,l),o-c];break}}var d=u.length%2===0?[0,t]:[t];return[...BM(n,a),...u,...d].map(v=>"".concat(v,"px")).join(", ")}function FM(e,t,r){if(e){var n="".concat(e).split(/[,\s]+/gim).map(i=>parseFloat(i));return zM(r,t,n)}return yg(t,r)}function WM(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,r=e.strokeDasharray,n=e.connectNulls,i=$M(e,DM),a=n??!1,o;if(t!=null){var u,l=i.pathRef,c=RM((u=l==null?void 0:l.current)!==null&&u!==void 0?u:null);o=FM(r,c,t)}else r!=null&&(o=String(r));return h.createElement(Jh,wu({},i,{connectNulls:a,strokeDasharray:o}))}function KM(e){var t=h.useRef(0),r=h.useRef(0),n=h.useRef(!1),i=h.useRef(e);return i.current!==e&&(t.current=r.current,i.current=e),h.useCallback((a,o)=>{if(n.current)return null;var u=Math.min(_t(t.current+a*o),o);return a>0&&o>0&&(r.current=Math.max(r.current,u),u>=o)?(n.current=!0,null):u},[])}var UM={},gg=Me({name:"errorBars",initialState:UM,reducers:{addErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.errorBar;e[n]||(e[n]=[]),e[n].push(i)},replaceErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.prev,a=r.next;e[n]&&(e[n]=e[n].map(o=>o.dataKey===i.dataKey&&o.direction===i.direction?a:o))},removeErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.errorBar;e[n]&&(e[n]=e[n].filter(a=>a.dataKey!==i.dataKey||a.direction!==i.direction))}}}),nc=gg.actions;nc.addErrorBar;nc.replaceErrorBar;nc.removeErrorBar;var HM=gg.reducer,YM=["children"];function VM(e,t){if(e==null)return{};var r,n,i=qM(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n({x:0,y:0,value:0}),errorBarOffset:0},GM=h.createContext(XM);function bg(e){var t=e.children,r=VM(e,YM);return h.createElement(GM.Provider,{value:r},t)}function ic(e,t){var r,n,i=$(c=>Ft(c,e)),a=$(c=>Wt(c,t)),o=(r=i==null?void 0:i.allowDataOverflow)!==null&&r!==void 0?r:pe.allowDataOverflow,u=(n=a==null?void 0:a.allowDataOverflow)!==null&&n!==void 0?n:me.allowDataOverflow,l=o||u;return{needClip:l,needClipX:o,needClipY:u}}function xg(e){var t=e.xAxisId,r=e.yAxisId,n=e.clipPathId,i=tc(),a=ic(t,r),o=a.needClipX,u=a.needClipY,l=a.needClip,c=$(A=>zm(A,t,!1)),s=$(A=>Fm(A,r,!1));if(!l||!i)return null;var f=i.x,d=i.y,v=i.width,p=i.height,m=o&&c?Math.min(c[0],c[1]):f-v/2,y=u&&s?Math.min(s[0],s[1]):d-p/2,g=o&&c?Math.abs(c[1]-c[0]):v*2,x=u&&s?Math.abs(s[1]-s[0]):p*2;return h.createElement("clipPath",{id:"clipPath-".concat(n)},h.createElement("rect",{x:m,y,width:g,height:x}))}var wg=(e,t,r,n)=>Qt(e,"xAxis",t,n),Ag=(e,t,r,n)=>Zt(e,"xAxis",t,n),Og=(e,t,r,n)=>Qt(e,"yAxis",r,n),Pg=(e,t,r,n)=>Zt(e,"yAxis",r,n),ZM=P([Z,wg,Og,Ag,Pg],(e,t,r,n,i)=>Rt(e,"xAxis")?Yr(t,n,!1):Yr(r,i,!1)),QM=(e,t,r,n,i)=>i;function JM(e){return e.type==="line"}var eD=P([Za,QM],(e,t)=>e.filter(JM).find(r=>r.id===t)),tD=P([Z,wg,Og,Ag,Pg,eD,ZM,Xn],(e,t,r,n,i,a,o,u)=>{var l=u.chartData,c=u.dataStartIndex,s=u.dataEndIndex;if(!(a==null||t==null||r==null||n==null||i==null||n.length===0||i.length===0||o==null||e!=="horizontal"&&e!=="vertical")){var f=a.dataKey,d=a.data,v;if(d!=null&&d.length>0?v=d:v=l==null?void 0:l.slice(c,s+1),v!=null)return OD({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:i,dataKey:f,bandSize:o,displayedData:v})}});function rD(e){var t=Fn(e),r=3,n=2;if(t!=null){var i=t.r,a=t.strokeWidth,o=Number(i),u=Number(a);return(Number.isNaN(o)||o<0)&&(o=r),(Number.isNaN(u)||u<0)&&(u=n),{r:o,strokeWidth:u}}return{r,strokeWidth:n}}var nD=["id"],iD=["type","layout","connectNulls","needClip","shape","strokeDasharray"],aD=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function ha(){return ha=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?t/r:0}var dD=(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(u=>u.status==="removed"?[]:[u.next]);var r=fD(e),n=[];for(var i of e)if(i.status==="matched")n.push(yt(yt({},i.next),{},{x:ve(i.prev.x,i.next.x,t),y:ve(i.prev.y,i.next.y,t)}));else if(i.status==="added")if(i.next.x!=null){var a=i.next.x-r;n.push(yt(yt({},i.next),{},{x:ve(a,i.next.x,t),y:i.next.y}))}else n.push(i.next);else if(i.status==="removed"&&i.prev.x!=null){var o=i.prev.x+r;n.push(yt(yt({},i.prev),{},{x:ve(i.prev.x,o,t),y:i.prev.y}))}return n},oc={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationInterpolateFn:dD,animationMatchBy:Jl,connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",shape:WM,stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:we.line,type:"linear"},vD=e=>{var t=e.dataKey,r=e.name,n=e.stroke,i=e.legendType,a=e.hide;return[{inactive:a,dataKey:t,type:i,color:n,value:Ta(r,t),payload:e}]},hD=h.memo(e=>{var t=e.dataKey,r=e.data,n=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,u=e.hide,l=e.unit,c=e.formatter,s=e.tooltipType,f=e.id,d={dataDefinedOnItem:r,getPosition:Sr,settings:{stroke:n,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Ta(o,t),hide:u,type:s,color:n,unit:l,formatter:c,graphicalItemId:f}};return h.createElement(tg,{tooltipEntrySettings:d})});function pD(e){var t=e.clipPathId,r=e.points,n=e.props,i=n.dot,a=n.dataKey,o=n.needClip;n.id;var u=ac(n,nD),l=Ot(u);return h.createElement(Wj,{points:r,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:l,needClip:o,clipPathId:t})}function mD(e){var t=e.showLabels,r=e.children,n=e.points,i=h.useMemo(()=>n==null?void 0:n.map(a=>{var o,u,l={x:(o=a.x)!==null&&o!==void 0?o:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return yt(yt({},l),{},{value:a.value,payload:a.payload,viewBox:l,parentViewBox:void 0,fill:void 0})}),[n]);return h.createElement(Ky,{value:t?i:void 0},r)}function yD(e){var t=e.clipPathId,r=e.pathRef,n=e.points,i=e.props,a=e.animationElapsedTime,o=e.isAnimating,u=e.isEntrance,l=e.visibleLength,c=i.type,s=i.layout,f=i.connectNulls,d=i.needClip,v=i.shape,p=i.strokeDasharray,m=ac(i,iD),y=yt(yt({},Xe(m)),{},{fill:"none",className:"recharts-line-curve",clipPath:d?"url(#clipPath-".concat(t,")"):void 0,points:n,type:c,layout:s,connectNulls:f,strokeDasharray:p??i.strokeDasharray,pathRef:r,animationElapsedTime:a,isAnimating:o,isEntrance:i.animateNewValues?u:!1,visibleLength:l});return h.createElement(h.Fragment,null,(n==null?void 0:n.length)>1&&h.createElement(Zy,{option:v,DefaultShape:oc.shape,shapeProps:y}),h.createElement(pD,{points:n,clipPathId:t,props:i}))}function gD(e){var t=e.clipPathId,r=e.props,n=e.pathRef,i=e.previousPointsRef,a=r.points,o=r.isAnimationActive,u=r.animationBegin,l=r.animationDuration,c=r.animationEasing,s=r.animationMatchBy,f=r.animationInterpolateFn,d=r.layout,v=sD(n.current),p=ig(r.onAnimationStart,r.onAnimationEnd),m=p.isAnimating,y=p.handleAnimationStart,g=p.handleAnimationEnd,x=!m,A=KM(a),w=h.useCallback(O=>O>0&&v>0,[v]);return h.createElement(mD,{points:a,showLabels:x},r.children,h.createElement(ag,{animationInput:a,animationIdPrefix:"recharts-line-",items:a,previousItemsRef:i,isAnimationActive:o,animationBegin:u,animationDuration:l,animationEasing:c,onAnimationStart:y,onAnimationEnd:g,animationInterpolateFn:f,animationMatchBy:s,shouldUpdatePreviousRef:w,layout:d},(O,b,S)=>{var I=m||b<1,_=I?A(b,v):null;return h.createElement(yD,{props:r,points:O,clipPathId:t,pathRef:n,animationElapsedTime:b,isAnimating:I,isEntrance:S,visibleLength:_})}),h.createElement(Hy,{label:r.label}))}function bD(e){var t=e.clipPathId,r=e.props,n=h.useRef(null),i=h.useRef(null);return h.createElement(gD,{props:r,clipPathId:t,previousPointsRef:n,pathRef:i})}var xD=(e,t)=>{var r,n;return{x:(r=e.x)!==null&&r!==void 0?r:void 0,y:(n=e.y)!==null&&n!==void 0?n:void 0,value:e.value,errorVal:se(e.payload,t)}};class wD extends h.Component{render(){var t=this.props,r=t.hide,n=t.dot,i=t.points,a=t.className,o=t.xAxisId,u=t.yAxisId,l=t.top,c=t.left,s=t.width,f=t.height,d=t.id,v=t.needClip,p=t.zIndex;if(r)return null;var m=te("recharts-line",a),y=d,g=rD(n),x=g.r,A=g.strokeWidth,w=Xy(n),O=x*2+A,b=v?"url(#clipPath-".concat(w?"":"dots-").concat(y,")"):void 0;return h.createElement(it,{zIndex:p},h.createElement(Fe,{className:m},v&&h.createElement("defs",null,h.createElement(xg,{clipPathId:y,xAxisId:o,yAxisId:u}),!w&&h.createElement("clipPath",{id:"clipPath-dots-".concat(y)},h.createElement("rect",{x:c-O/2,y:l-O/2,width:s+O,height:f+O}))),h.createElement(bg,{xAxisId:o,yAxisId:u,data:i,dataPointFormatter:xD,errorBarOffset:0},h.createElement(bD,{props:this.props,clipPathId:y}))),h.createElement(cT,{activeDot:this.props.activeDot,points:i,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:b}))}}function AD(e){var t=We(e,oc),r=t.activeDot,n=t.animateNewValues,i=t.animationBegin,a=t.animationDuration,o=t.animationEasing,u=t.connectNulls,l=t.dot,c=t.hide,s=t.isAnimationActive,f=t.label,d=t.legendType,v=t.xAxisId,p=t.yAxisId,m=t.id,y=ac(t,aD),g=ic(v,p),x=g.needClip,A=tc(),w=Er(),O=De(),b=$(k=>tD(k,v,p,O,m));if(w!=="horizontal"&&w!=="vertical"||b==null||A==null)return null;var S=A.height,I=A.width,_=A.x,j=A.y;return h.createElement(wD,ha({},y,{id:m,connectNulls:u,dot:l,activeDot:r,animateNewValues:n,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:s,hide:c,label:f,legendType:d,xAxisId:v,yAxisId:p,points:b,layout:w,height:S,width:I,left:_,top:j,needClip:x}))}function OD(e){var t=e.layout,r=e.xAxis,n=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,u=e.bandSize,l=e.displayedData;return l.map((c,s)=>{var f=se(c,o);if(t==="horizontal"){var d=Kc({axis:r,ticks:i,bandSize:u,entry:c,index:s}),v=oe(f)?null:n.scale.map(f);return{x:d,y:v??null,value:f,payload:c}}var p=oe(f)?null:r.scale.map(f),m=Kc({axis:n,ticks:a,bandSize:u,entry:c,index:s});return p==null||m==null?null:{x:p,y:m,value:f,payload:c}}).filter(Boolean)}function PD(e){var t=We(e,oc),r=De();return h.createElement(og,{id:t.id,type:"line"},n=>h.createElement(h.Fragment,null,h.createElement(rg,{legendPayload:vD(t)}),h.createElement(hD,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:n}),h.createElement(lg,{type:"line",id:n,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:r}),h.createElement(AD,ha({},t,{id:n}))))}var SD=h.memo(PD,Vn);SD.displayName="Line";function kr(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||n===void 0?void 0:n.xAxisId)!==null&&r!==void 0?r:cg}function jr(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||n===void 0?void 0:n.yAxisId)!==null&&r!==void 0?r:cg}var ED="Invariant failed";function ID(e,t){throw new Error(ED)}var _D=["option"];function CD(e,t){if(e==null)return{};var r,n,i=kD(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n1&&arguments[1]!==void 0?arguments[1]:0;return(n,i)=>{if(D(t))return t;var a=D(n)||oe(n);return a?t(n,i):(a||ID(),r)}},TD=(e,t,r)=>r,MD=(e,t)=>t,oi=P([Za,MD],(e,t)=>e.filter(r=>r.type==="bar").find(r=>r.id===t)),DD=P([oi],e=>e==null?void 0:e.maxBarSize),$D=(e,t,r,n)=>n,ND=P([Z,Za,kr,jr,TD],(e,t,r,n,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===r:a.yAxisId===n).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),RD=(e,t,r)=>{var n=Z(e),i=kr(e,t),a=jr(e,t);if(!(i==null||a==null))return n==="horizontal"?mu(e,"yAxis",a,r):mu(e,"xAxis",i,r)},LD=(e,t)=>{var r=Z(e),n=kr(e,t),i=jr(e,t);if(!(n==null||i==null))return r==="horizontal"?Hf(e,"xAxis",n):Hf(e,"yAxis",i)},BD=P([ND,AO,LD],pT),zD=(e,t,r)=>{var n,i,a=oi(e,t);if(a==null)return 0;var o=kr(e,t),u=jr(e,t);if(o==null||u==null)return 0;var l=Z(e),c=bp(e),s=a.maxBarSize,f=oe(s)?c:s,d,v;return l==="horizontal"?(d=Qt(e,"xAxis",o,r),v=Zt(e,"xAxis",o,r)):(d=Qt(e,"yAxis",u,r),v=Zt(e,"yAxis",u,r)),(n=(i=Yr(d,v,!0))!==null&&i!==void 0?i:f)!==null&&n!==void 0?n:0},Sg=(e,t,r)=>{var n=Z(e),i=kr(e,t),a=jr(e,t);if(!(i==null||a==null)){var o,u;return n==="horizontal"?(o=Qt(e,"xAxis",i,r),u=Zt(e,"xAxis",i,r)):(o=Qt(e,"yAxis",a,r),u=Zt(e,"yAxis",a,r)),Yr(o,u)}},FD=P([BD,bp,wO,xp,zD,Sg,DD],xT),WD=(e,t,r)=>{var n=kr(e,t);if(n!=null)return Qt(e,"xAxis",n,r)},KD=(e,t,r)=>{var n=jr(e,t);if(n!=null)return Qt(e,"yAxis",n,r)},UD=(e,t,r)=>{var n=kr(e,t);if(n!=null)return Zt(e,"xAxis",n,r)},HD=(e,t,r)=>{var n=jr(e,t);if(n!=null)return Zt(e,"yAxis",n,r)},YD=P([FD,oi],AT),VD=P([RD,oi],wT),qD=P([Ae,qu,WD,KD,UD,HD,YD,Z,aO,Sg,VD,oi,$D],(e,t,r,n,i,a,o,u,l,c,s,f,d)=>{var v=l.chartData,p=l.dataStartIndex,m=l.dataEndIndex;if(!(f==null||o==null||t==null||u!=="horizontal"&&u!=="vertical"||r==null||n==null||i==null||a==null||c==null)){var y=f.data,g;if(y!=null&&y.length>0?g=y:g=v==null?void 0:v.slice(p,m+1),g!=null)return I$({layout:u,barSettings:f,pos:o,parentViewBox:t,bandSize:c,xAxis:r,yAxis:n,xAxisTicks:i,yAxisTicks:a,stackedData:s,displayedData:g,offset:e,cells:d,dataStartIndex:p})}}),XD=["index"];function Au(){return Au=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=h.useContext(Eg);if(t!=null)return t.stackId;if(e!=null)return ew(e)},JD=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),e$=e=>{var t=h.useContext(Eg);if(t!=null){var r=t.stackId;return"url(#".concat(JD(r,e),")")}},Ig=e=>{var t=e.index,r=GD(e,XD),n=e$(t);return h.createElement(Fe,Au({className:"recharts-bar-stack-layer",clipPath:n},r))},t$=["onMouseEnter","onMouseLeave","onClick"],r$=["value","background","tooltipPosition"],n$=["id"],i$=["onMouseEnter","onClick","onMouseLeave"];function Zd(e,t){return l$(e)||u$(e,t)||o$(e,t)||a$()}function a$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o$(e,t){if(e){if(typeof e=="string")return Qd(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Qd(e,t):void 0}}function Qd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.dataKey,r=e.name,n=e.fill,i=e.legendType,a=e.hide;return[{inactive:a,dataKey:t,type:i,color:n,value:Ta(r,t),payload:e}]},h$=h.memo(e=>{var t=e.dataKey,r=e.stroke,n=e.strokeWidth,i=e.fill,a=e.name,o=e.hide,u=e.unit,l=e.formatter,c=e.tooltipType,s=e.id,f={dataDefinedOnItem:void 0,getPosition:Sr,settings:{stroke:r,strokeWidth:n,fill:i,dataKey:t,nameKey:void 0,name:Ta(a,t),hide:o,type:c,color:i,unit:u,formatter:l,graphicalItemId:s}};return h.createElement(tg,{tooltipEntrySettings:f})});function p$(e){var t=$(Or),r=e.data,n=e.dataKey,i=e.background,a=e.allOtherBarProps,o=a.onMouseEnter,u=a.onMouseLeave,l=a.onClick,c=pa(a,t$),s=Qy(o,n,a.id),f=Jy(u),d=eg(l,n,a.id);if(!i||r==null)return null;var v=Fn(i);return h.createElement(it,{zIndex:OT(i,we.barBackground)},r.map((p,m)=>{p.value;var y=p.background;p.tooltipPosition;var g=pa(p,r$);if(!y)return null;var x=s(p,p.originalDataIndex),A=f(p,p.originalDataIndex),w=d(p,p.originalDataIndex),O=ye(ye(ye(ye(ye({option:i,isActive:String(p.originalDataIndex)===t},g),{},{fill:"#eee"},y),v),Nu(c,p,m)),{},{onMouseEnter:x,onMouseLeave:A,onClick:w,dataKey:n,index:m,className:"recharts-bar-background-rectangle"});return h.createElement(lc,Jt({key:"background-bar-".concat(m)},O))}))}function m$(e){var t=e.showLabels,r=e.children,n=e.rects,i=n==null?void 0:n.map(a=>{var o={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return ye(ye({},o),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:o,fill:a.fill})});return h.createElement(Ky,{value:t?i:void 0},r)}function y$(e){var t=e.shape,r=e.activeBar,n=e.baseProps,i=e.entry,a=e.index,o=e.dataKey,u=$(Or),l=$(yy),c=r&&String(i.originalDataIndex)===u&&(l==null||o===l),s=u!=null&&(String(i.originalDataIndex)!==u||l!=null&&o!==l),f=h.useState(!1),d=Zd(f,2),v=d[0],p=d[1],m=h.useState(!1),y=Zd(m,2),g=y[0],x=y[1];h.useEffect(()=>{var I;return c?(p(!0),I=requestAnimationFrame(()=>{x(!0)})):(x(!1),s&&p(!1)),()=>{cancelAnimationFrame(I)}},[c,s]);var A=h.useCallback(()=>{c||p(!1)},[c]),w=c&&g,O=c||v,b;c?r===!0?b=t:b=r:b=t;var S=h.createElement(lc,Jt({},n,{name:String(n.name)},i,{isActive:w,option:b,index:a,dataKey:o,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance,onTransitionEnd:A}));return O?h.createElement(it,{zIndex:we.activeBar},h.createElement(Ig,{index:i.originalDataIndex},S)):S}function g$(e){var t=e.shape,r=e.baseProps,n=e.entry,i=e.index,a=e.dataKey;return h.createElement(lc,Jt({},r,{name:String(r.name)},n,{isActive:!1,option:t,index:i,dataKey:a,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance}))}function b$(e){var t,r=e.data,n=e.props,i=e.animationElapsedTime,a=e.isAnimating,o=e.isEntrance,u=(t=Ot(n))!==null&&t!==void 0?t:{},l=u.id,c=pa(u,n$),s=n.shape,f=n.dataKey,d=n.activeBar,v=n.onMouseEnter,p=n.onClick,m=n.onMouseLeave,y=pa(n,i$),g=Qy(v,f,l),x=Jy(m),A=eg(p,f,l);return r?h.createElement(h.Fragment,null,r.map((w,O)=>h.createElement(Ig,Jt({index:w.originalDataIndex,key:"rectangle-".concat(w==null?void 0:w.x,"-").concat(w==null?void 0:w.y,"-").concat(w==null?void 0:w.value,"-").concat(O),className:"recharts-bar-rectangle"},Nu(y,w,O),{onMouseEnter:g(w,w.originalDataIndex),onMouseLeave:x(w,w.originalDataIndex),onClick:A(w,w.originalDataIndex)}),d?h.createElement(y$,{shape:s,activeBar:d,baseProps:c,entry:w,index:O,dataKey:f,animationElapsedTime:i,isAnimating:a,isEntrance:o}):h.createElement(g$,{shape:s,baseProps:c,entry:w,index:O,dataKey:f,animationElapsedTime:i,isAnimating:a,isEntrance:o})))):null}var x$=(e,t,r)=>e==null?[]:t===1?e.flatMap(n=>n.status==="removed"?[]:[n.next]):e.flatMap(n=>{if(n.status==="removed")return r==="horizontal"?[ye(ye({},n.prev),{},{height:ve(n.prev.height,0,t),y:ve(n.prev.y,n.prev.y+n.prev.height,t)})]:[ye(ye({},n.prev),{},{width:ve(n.prev.width,0,t)})];if(n.status==="matched")return[ye(ye({},n.next),{},{x:ve(n.prev.x,n.next.x,t),y:ve(n.prev.y,n.next.y,t),width:ve(n.prev.width,n.next.width,t),height:ve(n.prev.height,n.next.height,t)})];var i=n.next;return r==="horizontal"?[ye(ye({},i),{},{height:ve(0,i.height,t),y:ve(i.stackedBarStart,i.y,t)})]:[ye(ye({},i),{},{width:ve(0,i.width,t),x:ve(i.stackedBarStart,i.x,t)})]});function w$(e){var t=e.props,r=e.previousRectanglesRef,n=t.data,i=t.isAnimationActive,a=t.animationBegin,o=t.animationDuration,u=t.animationEasing,l=t.animationInterpolateFn,c=t.layout,s=ig(t.onAnimationStart,t.onAnimationEnd),f=s.isAnimating,d=s.handleAnimationStart,v=s.handleAnimationEnd;return h.createElement(m$,{showLabels:!f,rects:n},h.createElement(ag,{animationInput:n,animationIdPrefix:"recharts-bar-",items:n,previousItemsRef:r,isAnimationActive:i,animationBegin:a,animationDuration:o,animationEasing:u,onAnimationStart:d,onAnimationEnd:v,animationInterpolateFn:l,animationMatchBy:t.animationMatchBy,layout:c},(p,m,y)=>h.createElement(Fe,null,h.createElement(b$,{props:t,data:p,animationElapsedTime:m,isAnimating:f||m<1,isEntrance:y}))),h.createElement(Hy,{label:t.label}),t.children)}function A$(e){var t=h.useRef(null);return h.createElement(w$,{previousRectanglesRef:t,props:e})}var _g=0,O$=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:se(e,t)}};class P$ extends h.PureComponent{render(){var t=this.props,r=t.hide,n=t.data,i=t.dataKey,a=t.className,o=t.xAxisId,u=t.yAxisId,l=t.needClip,c=t.background,s=t.id;if(r||n==null)return null;var f=te("recharts-bar",a),d=s;return h.createElement(Fe,{className:f,id:s},l&&h.createElement("defs",null,h.createElement(xg,{clipPathId:d,xAxisId:o,yAxisId:u})),h.createElement(Fe,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(d,")"):void 0},h.createElement(p$,{data:n,dataKey:i,background:c,allOtherBarProps:this.props}),h.createElement(A$,this.props)))}}var S$={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",animationInterpolateFn:x$,animationMatchBy:ng,background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:_g,shape:uc,xAxisId:0,yAxisId:0,zIndex:we.bar};function E$(e){var t=e.xAxisId,r=e.yAxisId,n=e.hide,i=e.legendType,a=e.minPointSize,o=e.activeBar,u=e.animationBegin,l=e.animationDuration,c=e.animationEasing,s=e.isAnimationActive,f=ic(t,r),d=f.needClip,v=Er(),p=De(),m=Xk(e.children,_y),y=$(A=>qD(A,e.id,p,m));if(v!=="vertical"&&v!=="horizontal")return null;var g,x=y==null?void 0:y[0];return x==null||x.height==null||x.width==null?g=0:g=v==="vertical"?x.height/2:x.width/2,h.createElement(bg,{xAxisId:t,yAxisId:r,data:y,dataPointFormatter:O$,errorBarOffset:g},h.createElement(P$,Jt({},e,{layout:v,needClip:d,data:y,xAxisId:t,yAxisId:r,hide:n,legendType:i,minPointSize:a,activeBar:o,animationBegin:u,animationDuration:l,animationEasing:c,isAnimationActive:s})))}function I$(e){var t=e.layout,r=e.barSettings,n=r.dataKey,i=r.minPointSize,a=r.hasCustomShape,o=e.pos,u=e.bandSize,l=e.xAxis,c=e.yAxis,s=e.xAxisTicks,f=e.yAxisTicks,d=e.stackedData,v=e.displayedData,p=e.offset,m=e.cells,y=e.parentViewBox,g=e.dataStartIndex,x=t==="horizontal"?c:l,A=d?x.scale.domain():null,w=tw({numericAxis:x}),O=x.scale.map(w);return v.map((b,S)=>{var I,_,j,k,E,R;if(d){var N=d[S+g];if(N==null)return null;I=Xx(N,A)}else I=se(b,n),Array.isArray(I)||(I=[w,I]);var F=jD(i,_g)(I[1],S);if(t==="horizontal"){var U,H=c.scale.map(I[0]),L=c.scale.map(I[1]);if(H==null||L==null)return null;_=Uc({axis:l,ticks:s,bandSize:u,offset:o.offset,entry:b,index:S}),j=(U=L??H)!==null&&U!==void 0?U:void 0,k=o.size;var V=H-L;if(E=Pt(V)?0:V,R={x:_,y:p.top,width:k,height:p.height},Math.abs(F)>0&&Math.abs(E)0&&Math.abs(k)h.createElement(h.Fragment,null,h.createElement(rg,{legendPayload:v$(t)}),h.createElement(h$,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:i}),h.createElement(lg,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:r,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:n,hasCustomShape:t.shape!=null&&t.shape!==uc}),h.createElement(it,{zIndex:t.zIndex},h.createElement(E$,Jt({},t,{id:i})))))}var C$=h.memo(_$,Vn);C$.displayName="Bar";var k$=["domain","range"],j$=["domain","range"];function ev(e,t){if(e==null)return{};var r,n,i=T$(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n{if(o!=null)return nv(nv({},a),{},{type:o})},[a,o]);return h.useLayoutEffect(()=>{u!=null&&(r.current===null?t(Vj(u)):r.current!==u&&t(qj({prev:r.current,next:u})),r.current=u)},[u,t]),h.useLayoutEffect(()=>()=>{r.current&&(t(Xj(r.current)),r.current=null)},[t]),null}var F$=e=>{var t=e.xAxisId,r=e.className,n=e.height,i=e.label,a=h.useRef(null),o=h.useRef(null),u=$(qu),l=De(),c=ie(),s="xAxis",f=$(g=>Xm(g,s,t,l)),d=$(g=>Ym(g,t)),v=$(g=>uI(g,t)),p=$(g=>dm(g,t));if(h.useLayoutEffect(()=>{if(!(n!=="auto"||!d||to(i)||h.isValidElement(i)||p==null)){var g=a.current;if(g){var x=g.getCalculatedHeight();Math.round(d.height)!==Math.round(x)&&c(eT({id:t,height:x}))}}},[f,d,c,i,t,n,p]),d==null||v==null||p==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var m=Pu(e,D$);p.id,p.scale;var y=Pu(p,$$);return h.createElement(rc,Ou({},m,y,{ref:a,labelRef:o,x:v.x,y:v.y,width:d.width,height:d.height,className:te("recharts-".concat(s," ").concat(s),r),viewBox:u,ticks:f,axisType:s,axisId:t}))},W$={allowDataOverflow:pe.allowDataOverflow,allowDecimals:pe.allowDecimals,allowDuplicatedCategory:pe.allowDuplicatedCategory,angle:pe.angle,axisLine:yr.axisLine,height:pe.height,hide:!1,includeHidden:pe.includeHidden,interval:pe.interval,label:!1,minTickGap:pe.minTickGap,mirror:pe.mirror,orientation:pe.orientation,padding:pe.padding,reversed:pe.reversed,scale:pe.scale,tick:pe.tick,tickCount:pe.tickCount,tickLine:yr.tickLine,tickSize:yr.tickSize,type:pe.type,niceTicks:pe.niceTicks,xAxisId:0},K$=e=>{var t=We(e,W$);return h.createElement(h.Fragment,null,h.createElement(z$,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),h.createElement(F$,t))},U$=h.memo(K$,Cg);U$.displayName="XAxis";var H$=["type"],Y$=["dangerouslySetInnerHTML","ticks","scale"],V$=["id","scale"];function Su(){return Su=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(o!=null)return av(av({},a),{},{type:o})},[o,a]);return h.useLayoutEffect(()=>{u!=null&&(r.current===null?t(Gj(u)):r.current!==u&&t(Zj({prev:r.current,next:u})),r.current=u)},[u,t]),h.useLayoutEffect(()=>()=>{r.current&&(t(Qj(r.current)),r.current=null)},[t]),null}function J$(e){var t=e.yAxisId,r=e.className,n=e.width,i=e.label,a=h.useRef(null),o=h.useRef(null),u=$(qu),l=De(),c=ie(),s="yAxis",f=$(g=>Vm(g,t)),d=$(g=>cI(g,t)),v=$(g=>Xm(g,s,t,l)),p=$(g=>vm(g,t));if(h.useLayoutEffect(()=>{if(!(n!=="auto"||!f||to(i)||h.isValidElement(i)||p==null)){var g=a.current;if(g){var x=g.getCalculatedWidth();Math.round(f.width)!==Math.round(x)&&c(Jj({id:t,width:x}))}}},[v,f,c,i,t,n,p]),f==null||d==null||p==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var m=Eu(e,Y$);p.id,p.scale;var y=Eu(p,V$);return h.createElement(rc,Su({},m,y,{ref:a,labelRef:o,x:d.x,y:d.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:te("recharts-".concat(s," ").concat(s),r),viewBox:u,ticks:v,axisType:s,axisId:t}))}var eN={allowDataOverflow:me.allowDataOverflow,allowDecimals:me.allowDecimals,allowDuplicatedCategory:me.allowDuplicatedCategory,angle:me.angle,axisLine:yr.axisLine,hide:!1,includeHidden:me.includeHidden,interval:me.interval,label:!1,minTickGap:me.minTickGap,mirror:me.mirror,orientation:me.orientation,padding:me.padding,reversed:me.reversed,scale:me.scale,tick:me.tick,tickCount:me.tickCount,tickLine:yr.tickLine,tickSize:yr.tickSize,type:me.type,niceTicks:me.niceTicks,width:me.width,yAxisId:0},tN=e=>{var t=We(e,eN);return h.createElement(h.Fragment,null,h.createElement(Q$,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),h.createElement(J$,t))},rN=h.memo(tN,Cg);rN.displayName="YAxis";var nN=(e,t)=>t,cc=P([nN,Z,Ip,Pe,vy,Kt,T_,Ae],B_);function iN(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function sc(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(iN(e)){var i=e.currentTarget.getBBox();r=i.width>0?t.width/i.width:1,n=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;r=a.offsetWidth>0?t.width/a.offsetWidth:1,n=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(u,l)=>({relativeX:Math.round((u-t.left)/r),relativeY:Math.round((l-t.top)/n)});return"touches"in e?Array.from(e.touches).map(u=>o(u.clientX,u.clientY)):o(e.clientX,e.clientY)}var kg=Ge("mouseClick"),jg=Kn();jg.startListening({actionCreator:kg,effect:(e,t)=>{var r=e.payload,n=cc(t.getState(),sc(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(SI({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Iu=Ge("mouseMove"),Tg=Kn(),Rr=null,ir=null,$o=null;Tg.startListening({actionCreator:Iu,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=n.eventSettings,a=i.throttleDelay,o=i.throttledEvents,u=o==="all"||(o==null?void 0:o.includes("mousemove"));Rr!==null&&(cancelAnimationFrame(Rr),Rr=null),ir!==null&&(typeof a!="number"||!u)&&(clearTimeout(ir),ir=null),$o=sc(r);var l=()=>{var c=t.getState(),s=ii(c,c.tooltip.settings.shared);if(!$o){Rr=null,ir=null;return}if(s==="axis"){var f=cc(c,$o);(f==null?void 0:f.activeIndex)!=null?t.dispatch(ny({activeIndex:f.activeIndex,activeDataKey:void 0,activeCoordinate:f.activeCoordinate})):t.dispatch(ry())}Rr=null,ir=null};if(!u){l();return}a==="raf"?Rr=requestAnimationFrame(l):typeof a=="number"&&ir===null&&(ir=setTimeout(l,a))}});function aN(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<>":t}var ov={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},Mg=Me({name:"rootProps",initialState:ov,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:ov.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),oN=Mg.reducer,uN=Mg.actions.updateOptions,lN=null,cN={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},Dg=Me({name:"polarOptions",initialState:lN,reducers:cN});Dg.actions.updatePolarOptions;var sN=Dg.reducer,$g=Ge("keyDown"),Ng=Ge("focus"),Rg=Ge("blur"),no=Kn(),Lr=null,ar=null,Oi=null;no.startListening({actionCreator:$g,effect:(e,t)=>{Oi=e.payload,Lr!==null&&(cancelAnimationFrame(Lr),Lr=null);var r=t.getState(),n=r.eventSettings,i=n.throttleDelay,a=n.throttledEvents,o=a==="all"||a.includes("keydown");ar!==null&&(typeof i!="number"||!o)&&(clearTimeout(ar),ar=null);var u=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var s=l.tooltip.keyboardInteraction,f=Oi;if(f!=="ArrowRight"&&f!=="ArrowLeft"&&f!=="Enter")return;var d=Sn(s,Ar(l),Gr(l),Qr(l)),v=d==null?-1:Number(d),p=!Number.isFinite(v)||v<0,m=Kt(l),y=Ar(l),g=ii(l,l.tooltip.settings.shared);if(f==="Enter"){if(p)return;var x=ca(l,g,"hover",String(s.index));t.dispatch(la({active:!s.active,activeIndex:s.index,activeCoordinate:x}));return}var A=hI(l),w=A==="left-to-right"?1:-1,O=f==="ArrowRight"?1:-1,b;if(p){var S=Gr(l),I=Qr(l),_=O*w,j=F=>({active:!1,index:String(F),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(b=-1,_>0){for(var k=0;k=0;E--)if(Sn(j(E),y,S,I)!=null){b=E;break}if(b<0)return}else{b=v+O*w;var R=(m==null?void 0:m.length)||y.length;if(R===0||b>=R||b<0)return}var N=ca(l,g,"hover",String(b));t.dispatch(la({active:!0,activeIndex:b.toString(),activeCoordinate:N}))}finally{Lr=null,ar=null}};if(!o){u();return}i==="raf"?Lr=requestAnimationFrame(u):typeof i=="number"&&ar===null&&(u(),Oi=null,ar=setTimeout(()=>{Oi?u():(ar=null,Lr=null)},i))}});no.startListening({actionCreator:Ng,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var i=r.tooltip.keyboardInteraction;if(!i.active&&i.index==null){var a="0",o=ii(r,r.tooltip.settings.shared),u=ca(r,o,"hover",String(a));t.dispatch(la({active:!0,activeIndex:a,activeCoordinate:u}))}}}});no.startListening({actionCreator:Rg,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var i=r.tooltip.keyboardInteraction;i.active&&t.dispatch(la({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function Lg(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(r,n)=>{if(n==="currentTarget")return t;var i=Reflect.get(r,n);return typeof i=="function"?i.bind(r):i}})}var Ze=Ge("externalEvent"),Bg=Kn(),Pi=new Map,bn=new Map,No=new Map;Bg.startListening({actionCreator:Ze,effect:(e,t)=>{var r=e.payload,n=r.handler,i=r.reactEvent;if(n!=null){var a=i.type,o=Lg(i);No.set(a,{handler:n,reactEvent:o});var u=Pi.get(a);u!==void 0&&(cancelAnimationFrame(u),Pi.delete(a));var l=t.getState(),c=l.eventSettings,s=c.throttleDelay,f=c.throttledEvents,d=f,v=d==="all"||(d==null?void 0:d.includes(a)),p=bn.get(a);p!==void 0&&(typeof s!="number"||!v)&&(clearTimeout(p),bn.delete(a));var m=()=>{var x=No.get(a);try{if(!x)return;var A=x.handler,w=x.reactEvent,O=t.getState(),b={activeCoordinate:m_(O),activeDataKey:yy(O),activeIndex:Or(O),activeLabel:my(O),activeTooltipIndex:Or(O),isTooltipActive:y_(O)};A&&A(b,w)}finally{Pi.delete(a),bn.delete(a),No.delete(a)}};if(!v){m();return}if(s==="raf"){var y=requestAnimationFrame(m);Pi.set(a,y)}else if(typeof s=="number"){if(!bn.has(a)){m();var g=setTimeout(m,s);bn.set(a,g)}}else m()}}});var fN=P([un],e=>e.tooltipItemPayloads),dN=P([fN,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(a=>a.settings.graphicalItemId===r);if(n!=null){var i=n.getPosition;if(i!=null)return i(t)}}}),zg=Ge("touchMove"),Fg=Kn(),or=null,Ut=null,uv=null,xn=null;Fg.startListening({actionCreator:zg,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){xn=Lg(r);var n=t.getState(),i=n.eventSettings,a=i.throttleDelay,o=i.throttledEvents,u=o==="all"||o.includes("touchmove");or!==null&&(cancelAnimationFrame(or),or=null),Ut!==null&&(typeof a!="number"||!u)&&(clearTimeout(Ut),Ut=null),uv=Array.from(r.touches).map(c=>sc({clientX:c.clientX,clientY:c.clientY,currentTarget:r.currentTarget}));var l=()=>{if(xn!=null){var c=t.getState(),s=ii(c,c.tooltip.settings.shared);if(s==="axis"){var f,d=(f=uv)===null||f===void 0?void 0:f[0];if(d==null){or=null,Ut=null;return}var v=cc(c,d);(v==null?void 0:v.activeIndex)!=null&&t.dispatch(ny({activeIndex:v.activeIndex,activeDataKey:void 0,activeCoordinate:v.activeCoordinate}))}else if(s==="item"){var p,m=xn.touches[0];if(document.elementFromPoint==null||m==null)return;var y=document.elementFromPoint(m.clientX,m.clientY);if(!y||!y.getAttribute)return;var g=y.getAttribute(lw),x=(p=y.getAttribute(cw))!==null&&p!==void 0?p:void 0,A=Cr(c).find(b=>b.id===x);if(g==null||A==null||x==null)return;var w=A.dataKey,O=dN(c,g,x);t.dispatch(ty({activeDataKey:w,activeIndex:g,activeCoordinate:O,activeGraphicalItemId:x}))}or=null,Ut=null}};if(!u){l();return}a==="raf"?or=requestAnimationFrame(l):typeof a=="number"&&Ut===null&&(l(),xn=null,Ut=setTimeout(()=>{xn?l():(Ut=null,or=null)},a))}}});var Wg={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},Kg=Me({name:"eventSettings",initialState:Wg,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=q(t.payload.throttledEvents))}}}),vN=Kg.actions.setEventSettings,hN=Kg.reducer,pN=ph({brush:ST,cartesianAxis:tT,chartData:pC,errorBars:HM,eventSettings:hN,graphicalItems:Tj,layout:Ux,legend:Zw,options:sC,polarAxis:Uk,polarOptions:sN,referenceElements:TT,renderedTicks:pM,rootProps:oN,tooltip:EI,zIndex:Q_}),mN=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return px({reducer:pN,preloadedState:t,middleware:n=>{var i;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([jg.middleware,Tg.middleware,no.middleware,Bg.middleware,Fg.middleware])},enhancers:n=>{var i=n;return typeof n=="function"&&(i=n()),i.concat(kh({type:"raf"}))},devTools:{serialize:{replacer:aN},name:"recharts-".concat(r)}})};function yN(e){var t=e.preloadedState,r=e.children,n=e.reduxStoreName,i=De(),a=h.useRef(null);if(i)return r;a.current==null&&(a.current=mN(t,n));var o=zu;return h.createElement(vA,{context:o,store:a.current},r)}function gN(e){var t=e.layout,r=e.margin,n=ie(),i=De();return h.useEffect(()=>{i||(n(Fx(t)),n(zx(r)))},[n,i,t,r]),null}var bN=h.memo(gN,Vn);function xN(e){var t=ie();return h.useEffect(()=>{t(uN(e))},[t,e]),null}var wN=e=>{var t=ie();return h.useEffect(()=>{t(vN(e))},[t,e]),null},AN=h.memo(wN,Vn);function lv(e){var t=e.zIndex,r=e.isPanorama,n=h.useRef(null),i=ie();return h.useLayoutEffect(()=>(n.current&&i(G_({zIndex:t,element:n.current,isPanorama:r})),()=>{i(Z_({zIndex:t,isPanorama:r}))}),[i,t,r]),h.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function cv(e){var t=e.children,r=e.isPanorama,n=$(F_);if(!n||n.length===0)return t;var i=n.filter(o=>o<0),a=n.filter(o=>o>0);return h.createElement(h.Fragment,null,i.map(o=>h.createElement(lv,{key:o,zIndex:o,isPanorama:r})),t,a.map(o=>h.createElement(lv,{key:o,zIndex:o,isPanorama:r})))}var ON=["children"];function PN(e,t){if(e==null)return{};var r,n,i=SN(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n{var r=Uw(),n=Hw(),i=Qh();if(!Gt(r)||!Gt(n))return null;var a=e.children,o=e.otherAttributes,u=e.title,l=e.desc,c,s;return o!=null&&(typeof o.tabIndex=="number"?c=o.tabIndex:c=i?0:void 0,typeof o.role=="string"?s=o.role:s=i?"application":void 0),h.createElement(bv,ma({},o,{title:u,desc:l,role:s,tabIndex:c,width:r,height:n,style:EN,ref:t}),a)}),_N=e=>{var t=e.children,r=$(Na);if(!r)return null;var n=r.width,i=r.height,a=r.y,o=r.x;return h.createElement(bv,{width:n,height:i,x:o,y:a},t)},sv=h.forwardRef((e,t)=>{var r=e.children,n=PN(e,ON),i=De();return i?h.createElement(_N,null,h.createElement(cv,{isPanorama:!0},r)):h.createElement(IN,ma({ref:t},n),h.createElement(cv,{isPanorama:!1},r))});function CN(e,t){return MN(e)||TN(e,t)||jN(e,t)||kN()}function kN(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jN(e,t){if(e){if(typeof e=="string")return fv(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fv(e,t):void 0}}function fv(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n!=null){var o=n.getBoundingClientRect(),u=o.width/n.offsetWidth;G(u)&&u!==a&&e(Kx(u))}},[n,e,a]),i}function dv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $N(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r(PC(),null);function ga(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var UN=h.forwardRef((e,t)=>{var r,n,i=h.useRef(null),a=h.useState({containerWidth:ga((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:ga((n=e.style)===null||n===void 0?void 0:n.height)}),o=ya(a,2),u=o[0],l=o[1],c=h.useCallback((f,d)=>{l(v=>{var p=Math.round(f),m=Math.round(d);return v.containerWidth===p&&v.containerHeight===m?v:{containerWidth:p,containerHeight:m}})},[]),s=h.useCallback(f=>{if(typeof t=="function"&&t(f),i.current!=null&&(i.current.disconnect(),i.current=null),f!=null&&typeof ResizeObserver<"u"){var d=f.getBoundingClientRect(),v=d.width,p=d.height;c(v,p);var m=g=>{var x=g[0];if(x!=null){var A=x.contentRect,w=A.width,O=A.height;c(w,O)}},y=new ResizeObserver(m);y.observe(f),i.current=y}},[t,c]);return h.useEffect(()=>()=>{var f=i.current;f!=null&&f.disconnect()},[c]),h.createElement(h.Fragment,null,h.createElement(Hn,{width:u.containerWidth,height:u.containerHeight}),h.createElement("div",Xt({ref:s},e)))}),HN=h.forwardRef((e,t)=>{var r=e.width,n=e.height,i=h.useState({containerWidth:ga(r),containerHeight:ga(n)}),a=ya(i,2),o=a[0],u=a[1],l=h.useCallback((s,f)=>{u(d=>{var v=Math.round(s),p=Math.round(f);return d.containerWidth===v&&d.containerHeight===p?d:{containerWidth:v,containerHeight:p}})},[]),c=h.useCallback(s=>{if(typeof t=="function"&&t(s),s!=null){var f=s.getBoundingClientRect(),d=f.width,v=f.height;l(d,v)}},[t,l]);return h.createElement(h.Fragment,null,h.createElement(Hn,{width:o.containerWidth,height:o.containerHeight}),h.createElement("div",Xt({ref:c},e)))}),YN=h.forwardRef((e,t)=>{var r=e.width,n=e.height;return h.createElement(h.Fragment,null,h.createElement(Hn,{width:r,height:n}),h.createElement("div",Xt({ref:t},e)))}),VN=h.forwardRef((e,t)=>{var r=e.width,n=e.height;return typeof r=="string"||typeof n=="string"?h.createElement(HN,Xt({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?h.createElement(YN,Xt({},e,{width:r,height:n,ref:t})):h.createElement(h.Fragment,null,h.createElement(Hn,{width:r,height:n}),h.createElement("div",Xt({ref:t},e)))});function qN(e){return e?UN:VN}var XN=h.forwardRef((e,t)=>{var r=e.children,n=e.className,i=e.height,a=e.onClick,o=e.onContextMenu,u=e.onDoubleClick,l=e.onMouseDown,c=e.onMouseEnter,s=e.onMouseLeave,f=e.onMouseMove,d=e.onMouseUp,v=e.onTouchEnd,p=e.onTouchMove,m=e.onTouchStart,y=e.style,g=e.width,x=e.responsive,A=e.dispatchTouchEvents,w=A===void 0?!0:A,O=h.useRef(null),b=ie(),S=h.useState(null),I=ya(S,2),_=I[0],j=I[1],k=h.useState(null),E=ya(k,2),R=E[0],N=E[1],F=DN(),U=Xu(),H=(U==null?void 0:U.width)>0?U.width:g,L=(U==null?void 0:U.height)>0?U.height:i,V=h.useCallback(B=>{F(B),typeof t=="function"&&t(B),j(B),N(B),B!=null&&(O.current=B)},[F,t,j,N]),W=h.useCallback(B=>{b(kg(B)),b(Ze({handler:a,reactEvent:B}))},[b,a]),fe=h.useCallback(B=>{b(Iu(B)),b(Ze({handler:c,reactEvent:B}))},[b,c]),de=h.useCallback(B=>{b(ry()),b(Ze({handler:s,reactEvent:B}))},[b,s]),ue=h.useCallback(B=>{b(Iu(B)),b(Ze({handler:f,reactEvent:B}))},[b,f]),Ne=h.useCallback(()=>{b(Ng())},[b]),Ke=h.useCallback(()=>{b(Rg())},[b]),at=h.useCallback(B=>{b($g(B.key))},[b]),ot=h.useCallback(B=>{b(Ze({handler:o,reactEvent:B}))},[b,o]),sn=h.useCallback(B=>{b(Ze({handler:u,reactEvent:B}))},[b,u]),T=h.useCallback(B=>{b(Ze({handler:l,reactEvent:B}))},[b,l]),K=h.useCallback(B=>{b(Ze({handler:d,reactEvent:B}))},[b,d]),z=h.useCallback(B=>{b(Ze({handler:m,reactEvent:B}))},[b,m]),C=h.useCallback(B=>{w&&b(zg(B)),b(Ze({handler:p,reactEvent:B}))},[b,w,p]),ke=h.useCallback(B=>{b(Ze({handler:v,reactEvent:B}))},[b,v]),Q=qN(x);return h.createElement(Py.Provider,{value:_},h.createElement(p0.Provider,{value:R},h.createElement(Q,{width:H??(y==null?void 0:y.width),height:L??(y==null?void 0:y.height),className:te("recharts-wrapper",n),style:$N({position:"relative",cursor:"default",width:H,height:L},y),onClick:W,onContextMenu:ot,onDoubleClick:sn,onFocus:Ne,onBlur:Ke,onKeyDown:at,onMouseDown:T,onMouseEnter:fe,onMouseLeave:de,onMouseMove:ue,onMouseUp:K,onTouchEnd:ke,onTouchMove:C,onTouchStart:z,ref:V},h.createElement(KN,null),r)))}),GN=["width","height","responsive","children","className","style","compact","title","desc"];function ZN(e,t){if(e==null)return{};var r,n,i=QN(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n{var r=e.width,n=e.height,i=e.responsive,a=e.children,o=e.className,u=e.style,l=e.compact,c=e.title,s=e.desc,f=ZN(e,GN),d=Ot(f);return l?h.createElement(h.Fragment,null,h.createElement(Hn,{width:r,height:n}),h.createElement(sv,{otherAttributes:d,title:c,desc:s},a)):h.createElement(XN,{className:o,style:u,width:r,height:n,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},h.createElement(sv,{otherAttributes:d,title:c,desc:s,ref:t},h.createElement(LT,null,a)))});function _u(){return _u=Object.assign?Object.assign.bind():function(e){for(var t=1;th.createElement(Ug,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:oR,tooltipPayloadSearcher:Sy,categoricalChartProps:e,ref:t})),uR=["axis","item"],hR=h.forwardRef((e,t)=>h.createElement(Ug,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:uR,tooltipPayloadSearcher:Sy,categoricalChartProps:e,ref:t}));export{hR as B,vR as L,fR as R,dR as T,U$ as X,rN as Y,SD as a,C$ as b,XT as c}; diff --git a/src/gateway/static/dashboard/assets/recharts-C4kRDmvS.js b/src/gateway/static/dashboard/assets/recharts-C4kRDmvS.js deleted file mode 100644 index a2c9359b1..000000000 --- a/src/gateway/static/dashboard/assets/recharts-C4kRDmvS.js +++ /dev/null @@ -1,79 +0,0 @@ -var kg=Object.defineProperty;var Tg=(e,t,r)=>t in e?kg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ii=(e,t,r)=>Tg(e,typeof t!="symbol"?t+"":t,r);import{r as h,c as iv,a as av,g as Mg,R as jg}from"./react-dgEcD0HR.js";import{c as ne,r as Dg}from"./heroui-BI50yK5B.js";var $g=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function Ou(e){if(typeof e!="string")return!1;var t=$g;return t.includes(e)}var Ng=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],Rg=new Set(Ng);function ov(e){return typeof e!="string"?!1:Rg.has(e)}function uv(e){return typeof e=="string"&&e.startsWith("data-")}function wt(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(ov(r)||uv(r))&&(t[r]=e[r]);return t}function Ln(e){if(e==null)return null;if(h.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return wt(t)}return typeof e=="object"&&!Array.isArray(e)?wt(e):null}function Ge(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(ov(r)||uv(r)||Ou(r))&&(t[r]=e[r]);return t}function Lg(e){return e==null?null:h.isValidElement(e)?Ge(e.props):typeof e=="object"&&!Array.isArray(e)?Ge(e):null}var Bg=["children","width","height","viewBox","className","style","title","desc"];function jo(){return jo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.width,i=e.height,a=e.viewBox,o=e.className,u=e.style,l=e.title,c=e.desc,s=zg(e,Bg),f=a||{width:n,height:i,x:0,y:0},d=ne("recharts-surface",o);return h.createElement("svg",jo({},Ge(s),{className:d,width:n,height:i,style:u,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),h.createElement("title",null,l),h.createElement("desc",null,c),r)}),Wg=["children","className"];function Do(){return Do=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.className,i=Ug(e,Wg),a=ne("recharts-layer",n);return h.createElement("g",Do({className:a},Ge(i),{ref:t}),r)});function $o(e){return e==="__proto__"}function cv(e){switch(typeof e){case"number":case"symbol":return!1;case"string":return e.includes(".")||e.includes("[")||e.includes("]")}}function Pu(e){var t;return typeof e=="string"||typeof e=="symbol"?e:Object.is((t=e==null?void 0:e.valueOf)==null?void 0:t.call(e),-0)?"-0":String(e)}function sv(e){if(e==null)return"";if(typeof e=="string")return e;if(Array.isArray(e))return e.map(sv).join(",");const t=String(e);return t==="0"&&Object.is(Number(e),-0)?"-0":t}function Su(e){if(Array.isArray(e))return e.map(Pu);if(typeof e=="symbol")return[e];e=sv(e);const t=[],r=e.length;if(r===0)return t;let n=0,i="",a="",o=!1;for(e.charCodeAt(0)===46&&t.push("");n1&&arguments[1]!==void 0?arguments[1]:Yg,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function Se(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{var u=r[o-1];return typeof u=="string"?i+u+a:u!==void 0?i+It(u)+a:i+a},"")}var We=e=>e===0?0:e>0?1:-1,At=e=>typeof e=="number"&&e!=+e,mr=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,D=e=>(typeof e=="number"||e instanceof Number)&&!At(e),Ot=e=>D(e)||typeof e=="string",Vg=0,Sn=e=>{var t=++Vg;return"".concat(e||"").concat(t)},ut=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!D(t)&&typeof t!="string")return n;var a;if(mr(t)){if(r==null)return n;var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return At(a)&&(a=n),i&&r!=null&&a>r&&(a=r),a},fv=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;nn&&(typeof t=="function"?t(n):Tt(n,t))===r)}var ae=e=>e===null||typeof e>"u",Eu=e=>ae(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function mt(e){return e!=null}function Or(){}function Iu(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}function ac(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function dt(e){for(var t=1;t{var t=e.viewBox,r=e.position,n=e.offset,i=n===void 0?0:n,a=e.parentViewBox,o=Iu(t),u=o.x,l=o.y,c=o.height,s=o.upperWidth,f=o.lowerWidth,d=u,v=u+(s-f)/2,p=(d+v)/2,m=(s+f)/2,y=d+s/2,g=c>=0?1:-1,x=g*i,A=g>0?"end":"start",w=g>0?"start":"end",O=s>=0?1:-1,b=O*i,S=O>0?"end":"start",I=O>0?"start":"end",_=a;if(r==="top"){var T={x:d+s/2,y:l-x,horizontalAnchor:"middle",verticalAnchor:A};return _&&(T.height=Math.max(l-_.y,0),T.width=s),T}if(r==="bottom"){var k={x:v+f/2,y:l+c+x,horizontalAnchor:"middle",verticalAnchor:w};return _&&(k.height=Math.max(_.y+_.height-(l+c),0),k.width=f),k}if(r==="left"){var E={x:p-b,y:l+c/2,horizontalAnchor:S,verticalAnchor:"middle"};return _&&(E.width=Math.max(E.x-_.x,0),E.height=c),E}if(r==="right"){var R={x:p+m+b,y:l+c/2,horizontalAnchor:I,verticalAnchor:"middle"};return _&&(R.width=Math.max(_.x+_.width-R.x,0),R.height=c),R}var $=_?{width:m,height:c}:{};return r==="insideLeft"?dt({x:p+b,y:l+c/2,horizontalAnchor:I,verticalAnchor:"middle"},$):r==="insideRight"?dt({x:p+m-b,y:l+c/2,horizontalAnchor:S,verticalAnchor:"middle"},$):r==="insideTop"?dt({x:d+s/2,y:l+x,horizontalAnchor:"middle",verticalAnchor:w},$):r==="insideBottom"?dt({x:v+f/2,y:l+c-x,horizontalAnchor:"middle",verticalAnchor:A},$):r==="insideTopLeft"?dt({x:d+b,y:l+x,horizontalAnchor:I,verticalAnchor:w},$):r==="insideTopRight"?dt({x:d+s-b,y:l+x,horizontalAnchor:S,verticalAnchor:w},$):r==="insideBottomLeft"?dt({x:v+b,y:l+c-x,horizontalAnchor:I,verticalAnchor:A},$):r==="insideBottomRight"?dt({x:v+f-b,y:l+c-x,horizontalAnchor:S,verticalAnchor:A},$):r&&typeof r=="object"&&(D(r.x)||mr(r.x))&&(D(r.y)||mr(r.y))?dt({x:u+ut(r.x,m),y:l+ut(r.y,c),horizontalAnchor:"end",verticalAnchor:"end"},$):dt({x:y,y:l+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},$)},Qg=["top","left","right","bottom"];function Jg(e){return e==null?!1:typeof e=="object"?!0:Qg.includes(e)}var e0=h.createContext(null);function ue(e){return function(){return e}}const No=Math.PI,Ro=2*No,or=1e-6,t0=Ro-or;function vv(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return vv;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;ior)if(!(Math.abs(f*l-c*s)>or)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let v=n-o,p=i-u,m=l*l+c*c,y=v*v+p*p,g=Math.sqrt(m),x=Math.sqrt(d),A=a*Math.tan((No-Math.acos((m+d-y)/(2*g*x)))/2),w=A/x,O=A/g;Math.abs(w-1)>or&&this._append`L${t+w*s},${r+w*f}`,this._append`A${a},${a},0,0,${+(f*v>s*p)},${this._x1=t+O*l},${this._y1=r+O*c}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),l=n*Math.sin(i),c=t+u,s=r+l,f=1^o,d=o?i-a:a-i;this._x1===null?this._append`M${c},${s}`:(Math.abs(this._x1-c)>or||Math.abs(this._y1-s)>or)&&this._append`L${c},${s}`,n&&(d<0&&(d=d%Ro+Ro),d>t0?this._append`A${n},${n},0,1,${f},${t-u},${r-l}A${n},${n},0,1,${f},${this._x1=c},${this._y1=s}`:d>or&&this._append`A${n},${n},0,${+(d>=No)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function hv(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new n0(t)}function _u(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function pv(e){this._context=e}pv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function ma(e){return new pv(e)}function mv(e){return e[0]}function yv(e){return e[1]}function gv(e,t){var r=ue(!0),n=null,i=ma,a=null,o=hv(u);e=typeof e=="function"?e:e===void 0?mv:ue(e),t=typeof t=="function"?t:t===void 0?yv:ue(t);function u(l){var c,s=(l=_u(l)).length,f,d=!1,v;for(n==null&&(a=i(v=o())),c=0;c<=s;++c)!(c=v;--p)u.point(A[p],w[p]);u.lineEnd(),u.areaEnd()}g&&(A[d]=+e(y,d,f),w[d]=+t(y,d,f),u.point(n?+n(y,d,f):A[d],r?+r(y,d,f):w[d]))}if(x)return u=null,x+""||null}function s(){return gv().defined(i).curve(o).context(a)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:ue(+f),n=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ue(+f),c):e},c.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ue(+f),c):n},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:ue(+f),r=null,c):t},c.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ue(+f),c):t},c.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ue(+f),c):r},c.lineX0=c.lineY0=function(){return s().x(e).y(t)},c.lineY1=function(){return s().x(e).y(r)},c.lineX1=function(){return s().x(n).y(t)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:ue(!!f),c):i},c.curve=function(f){return arguments.length?(o=f,a!=null&&(u=o(a)),c):o},c.context=function(f){return arguments.length?(f==null?a=u=null:u=o(a=f),c):a},c}class bv{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function i0(e){return new bv(e,!0)}function a0(e){return new bv(e,!1)}function _i(){}function Ci(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function xv(e){this._context=e}xv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ci(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ci(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function o0(e){return new xv(e)}function wv(e){this._context=e}wv.prototype={areaStart:_i,areaEnd:_i,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Ci(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function u0(e){return new wv(e)}function Av(e){this._context=e}Av.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Ci(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function l0(e){return new Av(e)}function Ov(e){this._context=e}Ov.prototype={areaStart:_i,areaEnd:_i,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function c0(e){return new Ov(e)}function oc(e){return e<0?-1:1}function uc(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),u=(a*i+o*n)/(n+i);return(oc(a)+oc(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function lc(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function eo(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,u=(a-n)/3;e._context.bezierCurveTo(n+u,i+u*t,a-u,o-u*r,a,o)}function ki(e){this._context=e}ki.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:eo(this,this._t0,lc(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,eo(this,lc(this,r=uc(this,e,t)),r);break;default:eo(this,this._t0,r=uc(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Pv(e){this._context=new Sv(e)}(Pv.prototype=Object.create(ki.prototype)).point=function(e,t){ki.prototype.point.call(this,t,e)};function Sv(e){this._context=e}Sv.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function s0(e){return new ki(e)}function f0(e){return new Pv(e)}function Ev(e){this._context=e}Ev.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=cc(e),i=cc(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function v0(e){return new ya(e,.5)}function h0(e){return new ya(e,0)}function p0(e){return new ya(e,1)}function yr(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,u=a.length;r=0;)r[t]=t;return r}function m0(e,t){return e[t]}function y0(e){const t=[];return t.key=e,t}function g0(){var e=ue([]),t=Lo,r=yr,n=m0;function i(a){var o=Array.from(e.apply(this,arguments),y0),u,l=o.length,c=-1,s;for(const f of a)for(u=0,++c;u0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n"radius"in e&&"startAngle"in e&&"endAngle"in e,Cu=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(h.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{Ou(i)&&typeof r[i]=="function"&&(n[i]=(a=>r[i](r,a)))}),n},A0=(e,t,r)=>n=>(e(t,r,n),null),ku=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var a=e[i];Ou(i)&&typeof a=="function"&&(n||(n={}),n[i]=A0(a,t,r))}),n};function sc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function O0(e){for(var t=1;t(o[u]===void 0&&n[u]!==void 0&&(o[u]=n[u]),o),r);return a}function I0(e,t){const r=new Map;for(let n=0;nObject.prototype.propertyIsEnumerable.call(e,t))}function En(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Cv="[object RegExp]",Tu="[object String]",Mu="[object Number]",ju="[object Boolean]",kv="[object Arguments]",Tv="[object Symbol]",Mv="[object Date]",jv="[object Map]",Dv="[object Set]",$v="[object Array]",T0="[object Function]",Nv="[object ArrayBuffer]",Ai="[object Object]",M0="[object Error]",Rv="[object DataView]",Lv="[object Uint8Array]",Bv="[object Uint8ClampedArray]",zv="[object Uint16Array]",Fv="[object Uint32Array]",j0="[object BigUint64Array]",Wv="[object Int8Array]",Uv="[object Int16Array]",Kv="[object Int32Array]",D0="[object BigInt64Array]",Hv="[object Float32Array]",Yv="[object Float64Array]",fc=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function Fo(e){return typeof fc.Buffer<"u"&&fc.Buffer.isBuffer(e)}function $0(e,t){return cr(e,void 0,e,new Map,t)}function cr(e,t,r,n=new Map,i=void 0){const a=i==null?void 0:i(e,t,r,n);if(a!==void 0)return a;if(Bo(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const o=new Array(e.length);n.set(e,o);for(let u=0;u{}):Wo(e,t,function n(i,a,o,u,l,c){const s=r(i,a,o,u,l,c);return s!==void 0?!!s:Wo(i,a,n,c,!1)},new Map,!0)}function Wo(e,t,r,n,i=!1){if(t===e)return!0;switch(typeof t){case"object":return L0(e,t,r,n);case"function":return Object.keys(t).length>0?Wo(e,{...t},r,n,i):wn(e,t);default:return Vv(e)&&i?typeof t=="string"?t==="":!0:wn(e,t)}}function L0(e,t,r,n){if(t==null)return!0;if(Array.isArray(t))return Xv(e,t,r,n);if(t instanceof Map)return B0(e,t,r,n);if(t instanceof Set)return z0(e,t,r,n);const i=Object.keys(t);if(e==null||Bo(e))return i.length===0;if(i.length===0)return!0;if(n!=null&&n.has(t))return n.get(t)===e;n==null||n.set(t,e);try{for(let a=0;a{})}function F0(e){return e=R0(e),t=>Gv(t,e)}function W0(e,t){return $0(e,(r,n,i,a)=>{if(typeof e=="object"){if(En(e)==="[object Object]"&&typeof e.constructor!="function"){const o={};return a.set(e,o),it(o,e,i,a),o}switch(Object.prototype.toString.call(e)){case Mu:case Tu:case ju:{const o=new e.constructor(e==null?void 0:e.valueOf());return it(o,e),o}case kv:{const o={};return it(o,e),o.length=e.length,o[Symbol.iterator]=e[Symbol.iterator],o}default:return}}})}function U0(e){return W0(e)}const K0=/^(?:0|[1-9]\d*)$/;function Zv(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e=0}function Qv(e){return e!=null&&typeof e!="function"&&X0(e.length)}function G0(e){return typeof e=="object"&&e!==null}function Z0(e){return G0(e)&&Qv(e)}function dc(e,t=_v){return Z0(e)?I0(Array.from(e),_0(q0(t),1)):[]}function Q0(e,t,r){return t===!0?dc(e,r):typeof t=="function"?dc(e,t):e}var to={exports:{}},ro={};/** - * @license React - * use-sync-external-store-shim/with-selector.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var vc;function J0(){if(vc)return ro;vc=1;var e=iv(),t=Dg();function r(c,s){return c===s&&(c!==0||1/c===1/s)||c!==c&&s!==s}var n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,a=e.useRef,o=e.useEffect,u=e.useMemo,l=e.useDebugValue;return ro.useSyncExternalStoreWithSelector=function(c,s,f,d,v){var p=a(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=u(function(){function g(b){if(!x){if(x=!0,A=b,b=d(b),v!==void 0&&m.hasValue){var S=m.value;if(v(S,b))return w=S}return w=b}if(S=w,n(A,b))return S;var I=d(b);return v!==void 0&&v(S,I)?(A=b,S):(A=b,w=I)}var x=!1,A,w,O=f===void 0?null:f;return[function(){return g(s())},O===null?void 0:function(){return g(O())}]},[s,f,d,v]);var y=i(c,p[0],p[1]);return o(function(){m.hasValue=!0,m.value=y},[y]),l(y),y},ro}var hc;function eb(){return hc||(hc=1,to.exports=J0()),to.exports}var tb=eb(),Du=h.createContext(null),rb=e=>e,ce=()=>{var e=h.useContext(Du);return e?e.store.dispatch:rb},Oi=()=>{},nb=()=>Oi,ib=(e,t)=>e===t;function N(e){var t=h.useContext(Du),r=h.useMemo(()=>t?n=>{if(n!=null)return e(n)}:Oi,[t,e]);return tb.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:nb,t?t.store.getState:Oi,t?t.store.getState:Oi,r,ib)}function ab(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ob(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var pc=e=>Array.isArray(e)?e:[e];function ub(e){const t=Array.isArray(e[0])?e[0]:e;return ob(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function lb(e,t){const r=[],{length:n}=e;for(let i=0;itypeof WeakRef>"u"?cb:WeakRef,Jv=sb(),fb=0,mc=1;function oi(){return{s:fb,v:void 0,o:null,p:null}}function db(e){return e instanceof Jv?e.deref():e}function eh(e,t={}){let r=oi();const{resultEqualityCheck:n}=t;let i,a=0;function o(){let u=r;const{length:l}=arguments;for(let f=0,d=l;f{r=oi(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function vb(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let a=0,o=0,u,l={},c=i.pop();typeof c=="object"&&(l=c,c=i.pop()),ab(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const s={...r,...l},{memoize:f,memoizeOptions:d=[],argsMemoize:v=eh,argsMemoizeOptions:p=[]}=s,m=pc(d),y=pc(p),g=ub(i),x=f(function(){return a++,c.apply(null,arguments)},...m),A=v(function(){o++;const O=lb(g,arguments);return u=x.apply(null,O),u},...y);return Object.assign(A,{resultFunc:c,memoizedResultFunc:x,dependencies:g,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:f,argsMemoize:v})};return Object.assign(n,{withTypes:()=>n}),n}var P=vb(eh);function hb(e,t=1){const r=[],n=Math.floor(t),i=(a,o)=>{for(let u=0;u{if(e!==t){const n=yc(e),i=yc(t);if(n===i&&n===0){if(et)return r==="desc"?-1:1}return r==="desc"?i-n:n-i}return 0};function th(e){return typeof e=="symbol"||e instanceof Symbol}const mb=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yb=/^\w*$/;function gb(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||th(e)?!0:typeof e=="string"&&(yb.test(e)||!mb.test(e))||t!=null}function bb(e,t,r,n){if(e==null)return[];r=r,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(r)||(r=r==null?[]:[r]),r=r.map(u=>String(u));const i=(u,l)=>{let c=u;for(let s=0;sl==null||u==null?l:typeof u=="object"&&"key"in u?Object.hasOwn(l,u.key)?l[u.key]:i(l,u.path):typeof u=="function"?u(l):Array.isArray(u)?i(l,u):typeof l=="object"?l[u]:l,o=t.map(u=>(Array.isArray(u)&&u.length===1&&(u=u[0]),u==null||typeof u=="function"||Array.isArray(u)||gb(u)?u:{key:u,path:Su(u)}));return e.map(u=>({original:u,criteria:o.map(l=>a(l,u))})).slice().sort((u,l)=>{for(let c=0;cu.original)}function ga(e,...t){const r=t.length;return r>1&&Uo(e,t[0],t[1])?t=[]:r>2&&Uo(t[0],t[1],t[2])&&(t=[t[0]]),bb(e,hb(t),["asc"])}var rh=e=>e.legend.settings,xb=e=>e.legend.size,wb=e=>e.legend.payload;P([wb,rh],(e,t)=>{var r=t.itemSorter,n=e.flat(1);return r?ga(n,r):n});function Ab(e,t){return Eb(e)||Sb(e,t)||Pb(e,t)||Ob()}function Ob(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pb(e,t){if(e){if(typeof e=="string")return gc(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gc(e,t):void 0}}function gc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rui||Math.abs(e.left-t.left)>ui||Math.abs(e.top-t.top)>ui||Math.abs(e.width-t.width)>ui}function xc(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function Ib(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=h.useState({height:0,left:0,top:0,width:0}),r=Ab(t,2),n=r[0],i=r[1],a=h.useRef(null),o=h.useRef(n);o.current=n;var u=h.useCallback(l=>{if(a.current!=null&&(a.current.disconnect(),a.current=null),l!=null){var c=xc(l);if(bc(c,o.current)&&i(c),typeof ResizeObserver<"u"){var s=new ResizeObserver(()=>{var f=xc(l);bc(f,o.current)&&i(f)});s.observe(l),a.current=s}}},[...e]);return h.useEffect(()=>()=>{var l;(l=a.current)===null||l===void 0||l.disconnect()},[]),[n,u]}function Pe(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var _b=typeof Symbol=="function"&&Symbol.observable||"@@observable",wc=_b,no=()=>Math.random().toString(36).substring(7).split("").join("."),Cb={INIT:`@@redux/INIT${no()}`,REPLACE:`@@redux/REPLACE${no()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${no()}`},Ti=Cb;function $u(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function nh(e,t,r){if(typeof e!="function")throw new Error(Pe(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Pe(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Pe(1));return r(nh)(e,t)}let n=e,i=t,a=new Map,o=a,u=0,l=!1;function c(){o===a&&(o=new Map,a.forEach((y,g)=>{o.set(g,y)}))}function s(){if(l)throw new Error(Pe(3));return i}function f(y){if(typeof y!="function")throw new Error(Pe(4));if(l)throw new Error(Pe(5));let g=!0;c();const x=u++;return o.set(x,y),function(){if(g){if(l)throw new Error(Pe(6));g=!1,c(),o.delete(x),a=null}}}function d(y){if(!$u(y))throw new Error(Pe(7));if(typeof y.type>"u")throw new Error(Pe(8));if(typeof y.type!="string")throw new Error(Pe(17));if(l)throw new Error(Pe(9));try{l=!0,i=n(i,y)}finally{l=!1}return(a=o).forEach(x=>{x()}),y}function v(y){if(typeof y!="function")throw new Error(Pe(10));n=y,d({type:Ti.REPLACE})}function p(){const y=f;return{subscribe(g){if(typeof g!="object"||g===null)throw new Error(Pe(11));function x(){const w=g;w.next&&w.next(s())}return x(),{unsubscribe:y(x)}},[wc](){return this}}}return d({type:Ti.INIT}),{dispatch:d,subscribe:f,getState:s,replaceReducer:v,[wc]:p}}function kb(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Ti.INIT})>"u")throw new Error(Pe(12));if(typeof r(void 0,{type:Ti.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Pe(13))})}function ih(e){const t=Object.keys(e),r={};for(let a=0;a"u")throw u&&u.type,new Error(Pe(14));c[f]=p,l=l||p!==v}return l=l||n.length!==Object.keys(o).length,l?c:o}}function Mi(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Tb(...e){return t=>(r,n)=>{const i=t(r,n);let a=()=>{throw new Error(Pe(15))};const o={getState:i.getState,dispatch:(l,...c)=>a(l,...c)},u=e.map(l=>l(o));return a=Mi(...u)(i.dispatch),{...i,dispatch:a}}}function ah(e){return $u(e)&&"type"in e&&typeof e.type=="string"}var oh=Symbol.for("immer-nothing"),Ac=Symbol.for("immer-draftable"),Te=Symbol.for("immer-state");function at(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ue=Object,Ur=Ue.getPrototypeOf,ji="constructor",ba="prototype",Ko="configurable",Di="enumerable",Pi="writable",In="value",Mt=e=>!!e&&!!e[Te];function Ze(e){var t;return e?uh(e)||wa(e)||!!e[Ac]||!!((t=e[ji])!=null&&t[Ac])||Aa(e)||Oa(e):!1}var Mb=Ue[ba][ji].toString(),Oc=new WeakMap;function uh(e){if(!e||!Nu(e))return!1;const t=Ur(e);if(t===null||t===Ue[ba])return!0;const r=Ue.hasOwnProperty.call(t,ji)&&t[ji];if(r===Object)return!0;if(!Rr(r))return!1;let n=Oc.get(r);return n===void 0&&(n=Function.toString.call(r),Oc.set(r,n)),n===Mb}function xa(e,t,r=!0){Bn(e)===0?(r?Reflect.ownKeys(e):Ue.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function Bn(e){const t=e[Te];return t?t.type_:wa(e)?1:Aa(e)?2:Oa(e)?3:0}var io=(e,t,r=Bn(e))=>r===2?e.has(t):Ue[ba].hasOwnProperty.call(e,t),Ho=(e,t,r=Bn(e))=>r===2?e.get(t):e[t],$i=(e,t,r,n=Bn(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function jb(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var wa=Array.isArray,Aa=e=>e instanceof Map,Oa=e=>e instanceof Set,Nu=e=>typeof e=="object",Rr=e=>typeof e=="function",ao=e=>typeof e=="boolean";function Db(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var St=e=>e.copy_||e.base_,Ru=e=>e.modified_?e.copy_:e.base_;function Yo(e,t){if(Aa(e))return new Map(e);if(Oa(e))return new Set(e);if(wa(e))return Array[ba].slice.call(e);const r=uh(e);if(t===!0||t==="class_only"&&!r){const n=Ue.getOwnPropertyDescriptors(e);delete n[Te];let i=Reflect.ownKeys(n);for(let a=0;a1&&Ue.defineProperties(e,{set:li,add:li,clear:li,delete:li}),Ue.freeze(e),t&&xa(e,(r,n)=>{Lu(n,!0)},!1)),e}function $b(){at(2)}var li={[In]:$b};function Pa(e){return e===null||!Nu(e)?!0:Ue.isFrozen(e)}var Ni="MapSet",Vo="Patches",Pc="ArrayMethods",lh={};function gr(e){const t=lh[e];return t||at(0,e),t}var Sc=e=>!!lh[e],_n,ch=()=>_n,Nb=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Sc(Ni)?gr(Ni):void 0,arrayMethodsPlugin_:Sc(Pc)?gr(Pc):void 0});function Ec(e,t){t&&(e.patchPlugin_=gr(Vo),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function qo(e){Xo(e),e.drafts_.forEach(Rb),e.drafts_=null}function Xo(e){e===_n&&(_n=e.parent_)}var Ic=e=>_n=Nb(_n,e);function Rb(e){const t=e[Te];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function _c(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[Te].modified_&&(qo(t),at(4)),Ze(e)&&(e=Cc(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(r[Te].base_,e,t)}else e=Cc(t,r);return Lb(t,e,!0),qo(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==oh?e:void 0}function Cc(e,t){if(Pa(t))return t;const r=t[Te];if(!r)return Ri(t,e.handledSet_,e);if(!Sa(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);dh(r,e)}return r.copy_}function Lb(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Lu(t,r)}function sh(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Sa=(e,t)=>e.scope_===t,Bb=[];function fh(e,t,r,n){const i=St(e),a=e.type_;if(n!==void 0&&Ho(i,n,a)===t){$i(i,n,r,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;xa(i,(l,c)=>{if(Mt(c)){const s=u.get(c)||[];s.push(l),u.set(c,s)}})}const o=e.draftLocations_.get(t)??Bb;for(const u of o)$i(i,u,r,a)}function zb(e,t,r){e.callbacks_.push(function(i){var u;const a=t;if(!a||!Sa(a,i))return;(u=i.mapSetPlugin_)==null||u.fixSetContents(a);const o=Ru(a);fh(e,a.draft_??a,o,r),dh(a,i)})}function dh(e,t){var n;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((n=e.assigned_)==null?void 0:n.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const a=i.getPath(e);a&&i.generatePatches_(e,a,t)}sh(e)}}function Fb(e,t,r){const{scope_:n}=e;if(Mt(r)){const i=r[Te];Sa(i,n)&&i.callbacks_.push(function(){Si(e);const o=Ru(i);fh(e,r,o,t)})}else Ze(r)&&e.callbacks_.push(function(){const a=St(e);e.type_===3?a.has(r)&&Ri(r,n.handledSet_,n):Ho(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ri(Ho(e.copy_,t,e.type_),n.handledSet_,n)})}function Ri(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||Mt(e)||t.has(e)||!Ze(e)||Pa(e)||(t.add(e),xa(e,(n,i)=>{if(Mt(i)){const a=i[Te];if(Sa(a,r)){const o=Ru(a);$i(e,n,o,e.type_),sh(a)}}else Ze(i)&&Ri(i,t,r)})),e}function Wb(e,t){const r=wa(e),n={type_:r?1:0,scope_:t?t.scope_:ch(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=n,a=Li;r&&(i=[n],a=Cn);const{revoke:o,proxy:u}=Proxy.revocable(i,a);return n.draft_=u,n.revoke_=o,[u,n]}var Li={get(e,t){if(t===Te)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const i=St(e);if(!io(i,t,e.type_))return Kb(e,i,t);const a=i[t];if(e.finalized_||!Ze(a)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&Db(t))return a;if(a===oo(e.base_,t)||Ub(e,t,a)){Si(e);const o=e.type_===1?+t:t,u=Zo(e.scope_,a,e,o);return e.copy_[o]=u}return a},has(e,t){return t in St(e)},ownKeys(e){return Reflect.ownKeys(St(e))},set(e,t,r){const n=vh(St(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=oo(St(e),t),a=i==null?void 0:i[Te];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(jb(r,i)&&(r!==void 0||io(e.base_,t,e.type_)))return!0;Si(e),Go(e)}return e.copy_[t]===r&&(r!==void 0||io(e.copy_,t,e.type_))||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),Fb(e,t,r)),!0},deleteProperty(e,t){return Si(e),oo(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Go(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=St(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Pi]:!0,[Ko]:e.type_!==1||t!=="length",[Di]:n[Di],[In]:r[t]}},defineProperty(){at(11)},getPrototypeOf(e){return Ur(e.base_)},setPrototypeOf(){at(12)}},Cn={};for(let e in Li){let t=Li[e];Cn[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Cn.deleteProperty=function(e,t){return Cn.set.call(this,e,t,void 0)};Cn.set=function(e,t,r){return Li.set.call(this,e[0],t,r,e[0])};function oo(e,t){const r=e[Te];return(r?St(r):e)[t]}function Ub(e,t,r){var n;return e.type_!==1||!e.allIndicesReassigned_||(n=e.assigned_)!=null&&n.get(t)||!Ze(r)||r[Te]?!1:e.baseRefs_.has(r)}function Kb(e,t,r){var i;const n=vh(t,r);return n?In in n?n[In]:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function vh(e,t){if(!(t in e))return;let r=Ur(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ur(r)}}function Go(e){e.modified_||(e.modified_=!0,e.parent_&&Go(e.parent_))}function Si(e){e.copy_||(e.assigned_=new Map,e.copy_=Yo(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Hb=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,r,n)=>{if(Rr(t)&&!Rr(r)){const a=r;r=t;const o=this;return function(l=a,...c){return o.produce(l,s=>r.call(this,s,...c))}}Rr(r)||at(6),n!==void 0&&!Rr(n)&&at(7);let i;if(Ze(t)){const a=Ic(this),o=Zo(a,t,void 0);let u=!0;try{i=r(o),u=!1}finally{u?qo(a):Xo(a)}return Ec(a,n),_c(i,a)}else if(!t||!Nu(t)){if(i=r(t),i===void 0&&(i=t),i===oh&&(i=void 0),this.autoFreeze_&&Lu(i,!0),n){const a=[],o=[];gr(Vo).generateReplacementPatches_(t,i,{patches_:a,inversePatches_:o}),n(a,o)}return i}else at(1,t)},this.produceWithPatches=(t,r)=>{if(Rr(t))return(o,...u)=>this.produceWithPatches(o,l=>t(l,...u));let n,i;return[this.produce(t,r,(o,u)=>{n=o,i=u}),n,i]},ao(e==null?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),ao(e==null?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),ao(e==null?void 0:e.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Ze(e)||at(8),Mt(e)&&(e=qe(e));const t=Ic(this),r=Zo(t,e,void 0);return r[Te].isManual_=!0,Xo(t),r}finishDraft(e,t){const r=e&&e[Te];(!r||!r.isManual_)&&at(9);const{scope_:n}=r;return Ec(n,t),_c(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=gr(Vo).applyPatches_;return Mt(e)?n(e,t):this.produce(e,i=>n(i,t))}};function Zo(e,t,r,n){const[i,a]=Aa(t)?gr(Ni).proxyMap_(t,r):Oa(t)?gr(Ni).proxySet_(t,r):Wb(t,r);return((r==null?void 0:r.scope_)??ch()).drafts_.push(i),a.callbacks_=(r==null?void 0:r.callbacks_)??[],a.key_=n,r&&n!==void 0?zb(r,a,n):a.callbacks_.push(function(l){var s;(s=l.mapSetPlugin_)==null||s.fixSetContents(a);const{patchPlugin_:c}=l;a.modified_&&c&&c.generatePatches_(a,[],l)}),i}function qe(e){return Mt(e)||at(10,e),hh(e)}function hh(e){if(!Ze(e)||Pa(e))return e;const t=e[Te];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Yo(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Yo(e,!0);return xa(r,(i,a)=>{$i(r,i,hh(a))},n),t&&(t.finalized_=!1),r}var Yb=new Hb,ph=Yb.produce,q=e=>e;function mh(e){return({dispatch:r,getState:n})=>i=>a=>typeof a=="function"?a(r,n,e):i(a)}var Vb=mh(),qb=mh,Xb=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Mi:Mi.apply(null,arguments)};function Ye(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(Ke(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>ah(n)&&n.type===e,r}var yh=class gn extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,gn.prototype)}static get[Symbol.species](){return gn}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new gn(...t[0].concat(this)):new gn(...t.concat(this))}};function kc(e){return Ze(e)?ph(e,()=>{}):e}function ci(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function Gb(e){return typeof e=="boolean"}var Zb=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new yh;return r&&(Gb(r)?o.push(Vb):o.push(qb(r.extraArgument))),o},gh="RTK_autoBatch",te=()=>e=>({payload:e,meta:{[gh]:!0}}),Tc=e=>t=>{setTimeout(t,e)},Qb=(e,t)=>r=>{let n=!1;const i=()=>{n||(n=!0,cancelAnimationFrame(a),clearTimeout(o),r())},a=e(i),o=setTimeout(i,t)},bh=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,a=!1,o=!1;const u=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Qb(window.requestAnimationFrame,100):Tc(10):e.type==="callback"?e.queueNotification:Tc(e.timeout),c=()=>{o=!1,a&&(a=!1,u.forEach(s=>s()))};return Object.assign({},n,{subscribe(s){const f=()=>i&&s(),d=n.subscribe(f);return u.add(s),()=>{d(),u.delete(s)}},dispatch(s){var f;try{return i=!((f=s==null?void 0:s.meta)!=null&&f[gh]),a=!i,a&&(o||(o=!0,l(c))),n.dispatch(s)}finally{i=!0}}})},Jb=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new yh(e);return n&&i.push(bh(typeof n=="object"?n:void 0)),i};function ex(e){const t=Zb(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let u;if(typeof r=="function")u=r;else if($u(r))u=ih(r);else throw new Error(Ke(1));let l;typeof n=="function"?l=n(t):l=t();let c=Mi;i&&(c=Xb({trace:!1,...typeof i=="object"&&i}));const s=Tb(...l),f=Jb(s);let d=typeof o=="function"?o(f):f();const v=c(...d);return nh(u,a,v)}function xh(e){const t={},r=[];let n;const i={addCase(a,o){const u=typeof a=="string"?a:a.type;if(!u)throw new Error(Ke(28));if(u in t)throw new Error(Ke(29));return t[u]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&r.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return r.push({matcher:a,reducer:o}),i},addDefaultCase(a){return n=a,i}};return e(i),[t,r,n]}function tx(e){return typeof e=="function"}function rx(e,t){let[r,n,i]=xh(t),a;if(tx(e))a=()=>kc(e());else{const u=kc(e);a=()=>u}function o(u=a(),l){let c=[r[l.type],...n.filter(({matcher:s})=>s(l)).map(({reducer:s})=>s)];return c.filter(s=>!!s).length===0&&(c=[i]),c.reduce((s,f)=>{if(f)if(Mt(s)){const v=f(s,l);return v===void 0?s:v}else{if(Ze(s))return ph(s,d=>f(d,l));{const d=f(s,l);if(d===void 0){if(s===null)return s;throw Error("A case reducer on a non-draftable value must not return undefined")}return d}}return s},u)}return o.getInitialState=a,o}var nx="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",ix=(e=21)=>{let t="",r=e;for(;r--;)t+=nx[Math.random()*64|0];return t},ax=Symbol.for("rtk-slice-createasyncthunk");function ox(e,t){return`${e}/${t}`}function ux({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[ax];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(Ke(11));const u=(typeof i.reducers=="function"?i.reducers(cx()):i.reducers)||{},l=Object.keys(u),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(w,O){const b=typeof w=="string"?w:w.type;if(!b)throw new Error(Ke(12));if(b in c.sliceCaseReducersByType)throw new Error(Ke(13));return c.sliceCaseReducersByType[b]=O,s},addMatcher(w,O){return c.sliceMatchers.push({matcher:w,reducer:O}),s},exposeAction(w,O){return c.actionCreators[w]=O,s},exposeCaseReducer(w,O){return c.sliceCaseReducersByName[w]=O,s}};l.forEach(w=>{const O=u[w],b={reducerName:w,type:ox(a,w),createNotation:typeof i.reducers=="function"};fx(O)?vx(b,O,s,t):sx(b,O,s)});function f(){const[w={},O=[],b=void 0]=typeof i.extraReducers=="function"?xh(i.extraReducers):[i.extraReducers],S={...w,...c.sliceCaseReducersByType};return rx(i.initialState,I=>{for(let _ in S)I.addCase(_,S[_]);for(let _ of c.sliceMatchers)I.addMatcher(_.matcher,_.reducer);for(let _ of O)I.addMatcher(_.matcher,_.reducer);b&&I.addDefaultCase(b)})}const d=w=>w,v=new Map,p=new WeakMap;let m;function y(w,O){return m||(m=f()),m(w,O)}function g(){return m||(m=f()),m.getInitialState()}function x(w,O=!1){function b(I){let _=I[w];return typeof _>"u"&&O&&(_=ci(p,b,g)),_}function S(I=d){const _=ci(v,O,()=>new WeakMap);return ci(_,I,()=>{const T={};for(const[k,E]of Object.entries(i.selectors??{}))T[k]=lx(E,I,()=>ci(p,I,g),O);return T})}return{reducerPath:w,getSelectors:S,get selectors(){return S(b)},selectSlice:b}}const A={name:a,reducer:y,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:g,...x(o),injectInto(w,{reducerPath:O,...b}={}){const S=O??o;return w.inject({reducerPath:S,reducer:y},b),{...A,...x(S,!0)}}};return A}}function lx(e,t,r,n){function i(a,...o){let u=t(a);return typeof u>"u"&&n&&(u=r()),e(u,...o)}return i.unwrapped=e,i}var Me=ux();function cx(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function sx({type:e,reducerName:t,createNotation:r},n,i){let a,o;if("reducer"in n){if(r&&!dx(n))throw new Error(Ke(17));a=n.reducer,o=n.prepare}else a=n;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?Ye(e,o):Ye(e))}function fx(e){return e._reducerDefinitionType==="asyncThunk"}function dx(e){return e._reducerDefinitionType==="reducerWithPrepare"}function vx({type:e,reducerName:t},r,n,i){if(!i)throw new Error(Ke(18));const{payloadCreator:a,fulfilled:o,pending:u,rejected:l,settled:c,options:s}=r,f=i(e,a,s);n.exposeAction(t,f),o&&n.addCase(f.fulfilled,o),u&&n.addCase(f.pending,u),l&&n.addCase(f.rejected,l),c&&n.addMatcher(f.settled,c),n.exposeCaseReducer(t,{fulfilled:o||si,pending:u||si,rejected:l||si,settled:c||si})}function si(){}var hx="task",wh="listener",Ah="completed",Bu="cancelled",px=`task-${Bu}`,mx=`task-${Ah}`,Qo=`${wh}-${Bu}`,yx=`${wh}-${Ah}`,Ea=class{constructor(e){ii(this,"code");ii(this,"name","TaskAbortError");ii(this,"message");this.code=e,this.message=`${hx} ${Bu} (reason: ${e})`}},zu=(e,t)=>{if(typeof e!="function")throw new TypeError(Ke(32))},Bi=()=>{},Oh=(e,t=Bi)=>(e.catch(t),e),Ph=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),vr=e=>{if(e.aborted)throw new Ea(e.reason)};function Sh(e,t){let r=Bi;return new Promise((n,i)=>{const a=()=>i(new Ea(e.reason));if(e.aborted){a();return}r=Ph(e,a),t.finally(()=>r()).then(n,i)}).finally(()=>{r=Bi})}var gx=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof Ea?"cancelled":"rejected",error:r}}finally{t==null||t()}},zi=e=>t=>Oh(Sh(e,t).then(r=>(vr(e),r))),Eh=e=>{const t=zi(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:zr}=Object,Mc={},Ia="listenerMiddleware",bx=(e,t)=>{const r=n=>Ph(e,()=>n.abort(e.reason));return(n,i)=>{zu(n);const a=new AbortController;r(a);const o=gx(async()=>{vr(e),vr(a.signal);const u=await n({pause:zi(a.signal),delay:Eh(a.signal),signal:a.signal});return vr(a.signal),u},()=>a.abort(mx));return i!=null&&i.autoJoin&&t.push(o.catch(Bi)),{result:zi(e)(o),cancel(){a.abort(px)}}}},xx=(e,t)=>{const r=async(n,i)=>{vr(t);let a=()=>{};const u=[new Promise((l,c)=>{let s=e({predicate:n,effect:(f,d)=>{d.unsubscribe(),l([f,d.getState(),d.getOriginalState()])}});a=()=>{s(),c()}})];i!=null&&u.push(new Promise(l=>setTimeout(l,i,null)));try{const l=await Sh(t,Promise.race(u));return vr(t),l}finally{a()}};return((n,i)=>Oh(r(n,i)))},Ih=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:a}=e;if(t)i=Ye(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(!i)throw new Error(Ke(21));return zu(a),{predicate:i,type:t,effect:a}},_h=zr(e=>{const{type:t,predicate:r,effect:n}=Ih(e);return{id:ix(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Ke(22))}}},{withTypes:()=>_h}),jc=(e,t)=>{const{type:r,effect:n,predicate:i}=Ih(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===i)&&a.effect===n)},Jo=e=>{e.pending.forEach(t=>{t.abort(Qo)})},wx=(e,t)=>()=>{for(const r of t.keys())Jo(r);e.clear()},Dc=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},Ch=zr(Ye(`${Ia}/add`),{withTypes:()=>Ch}),Ax=Ye(`${Ia}/removeAll`),kh=zr(Ye(`${Ia}/remove`),{withTypes:()=>kh}),Ox=(...e)=>{console.error(`${Ia}/error`,...e)},zn=(e={})=>{const t=new Map,r=new Map,n=v=>{const p=r.get(v)??0;r.set(v,p+1)},i=v=>{const p=r.get(v)??1;p===1?r.delete(v):r.set(v,p-1)},{extra:a,onError:o=Ox}=e;zu(o);const u=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),p=>{v.unsubscribe(),p!=null&&p.cancelActive&&Jo(v)}),l=(v=>{const p=jc(t,v)??_h(v);return u(p)});zr(l,{withTypes:()=>l});const c=v=>{const p=jc(t,v);return p&&(p.unsubscribe(),v.cancelActive&&Jo(p)),!!p};zr(c,{withTypes:()=>c});const s=async(v,p,m,y)=>{const g=new AbortController,x=xx(l,g.signal),A=[];try{v.pending.add(g),n(v),await Promise.resolve(v.effect(p,zr({},m,{getOriginalState:y,condition:(w,O)=>x(w,O).then(Boolean),take:x,delay:Eh(g.signal),pause:zi(g.signal),extra:a,signal:g.signal,fork:bx(g.signal,A),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((w,O,b)=>{w!==g&&(w.abort(Qo),b.delete(w))})},cancel:()=>{g.abort(Qo),v.pending.delete(g)},throwIfCancelled:()=>{vr(g.signal)}})))}catch(w){w instanceof Ea||Dc(o,w,{raisedBy:"effect"})}finally{await Promise.all(A),g.abort(yx),i(v),v.pending.delete(g)}},f=wx(t,r);return{middleware:v=>p=>m=>{if(!ah(m))return p(m);if(Ch.match(m))return l(m.payload);if(Ax.match(m)){f();return}if(kh.match(m))return c(m.payload);let y=v.getState();const g=()=>{if(y===Mc)throw new Error(Ke(23));return y};let x;try{if(x=p(m),t.size>0){const A=v.getState(),w=Array.from(t.values());for(const O of w){let b=!1;try{b=O.predicate(m,A,y)}catch(S){b=!1,Dc(o,S,{raisedBy:"predicate"})}b&&s(O,m,v,g)}}}finally{y=Mc}return x},startListening:l,stopListening:c,clearListeners:f}};function Ke(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Px={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},Th=Me({name:"chartLayout",initialState:Px,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,n,i,a;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(n=t.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),_a=Th.actions,Sx=_a.setMargin,Ex=_a.setLayout,Ix=_a.setChartSize,_x=_a.setScale,Cx=Th.reducer;function Mh(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function G(e){return Number.isFinite(e)}function Xt(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function $c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ne(e){for(var t=1;t{if(t&&r){var n=r.width,i=r.height,a=t.align,o=t.verticalAlign,u=t.layout,l=t.position,c=t.offset,s=c===void 0?0:c;if(l!=null){if(Jg(l)){if(l==="top"&&D(e.top))return Ne(Ne({},e),{},{top:e.top+(i||0)+s});if(l==="bottom"&&D(e.bottom))return Ne(Ne({},e),{},{bottom:e.bottom+(i||0)+s});if(l==="left"&&D(e.left))return Ne(Ne({},e),{},{left:e.left+(n||0)+s});if(l==="right"&&D(e.right))return Ne(Ne({},e),{},{right:e.right+(n||0)+s})}return e}if((u==="vertical"||u==="horizontal"&&o==="middle")&&a!=="center"&&D(e[a]))return Ne(Ne({},e),{},{[a]:e[a]+(n||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&o!=="middle"&&D(e[o]))return Ne(Ne({},e),{},{[o]:e[o]+(i||0)})}return e},Nt=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",Dx=(e,t)=>{if(!t||t.length!==2||!D(t[0])||!D(t[1]))return e;var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!D(e[0])||e[0]n)&&(i[1]=n),i[0]>n&&(i[0]=n),i[1]{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var i=0;i=0?(c[0]=a,a+=d,c[1]=a):(c[0]=o,o+=d,c[1]=o)}}}},Nx=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var i=0;i=0?(l[0]=a,a+=c,l[1]=a):(l[0]=0,l[1]=0)}}}},Rx={sign:$x,expand:b0,none:yr,silhouette:x0,wiggle:w0,positive:Nx},Lx=(e,t,r)=>{var n,i=(n=Rx[r])!==null&&n!==void 0?n:yr,a=g0().keys(t).value((u,l)=>Number(se(u,l,0))).order(Lo).offset(i),o=a(e);return o.forEach((u,l)=>{u.forEach((c,s)=>{var f=se(e[s],t[l],0);Array.isArray(f)&&f.length===2&&D(f[0])&&D(f[1])&&(c[0]=f[0],c[1]=f[1])})}),o};function Bx(e){return e==null?void 0:String(e)}function Nc(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!ae(i[t.dataKey])){var u=dv(r,"value",i[t.dataKey]);if(u)return u.coordinate+n/2}return r!=null&&r[a]?r[a].coordinate+n/2:null}var l=se(i,ae(o)?t.dataKey:o),c=t.scale.map(l);return D(c)?c:null}var Rc=e=>{var t=e.axis,r=e.ticks,n=e.offset,i=e.bandSize,a=e.entry,o=e.index;if(t.type==="category")return r[o]?r[o].coordinate+n:null;var u=se(a,t.dataKey,t.scale.domain()[o]);if(ae(u))return null;var l=t.scale.map(u);return D(l)?l-i/2+n:null},zx=e=>{var t=e.numericAxis,r=t.scale.domain();if(t.type==="number"){var n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return n<=0&&i>=0?0:i<0?i:n}return r[0]},Fx=e=>{var t=e.flat(2).filter(D);return[Math.min(...t),Math.max(...t)]},Wx=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],Ux=(e,t,r)=>{if(!(e==null||Object.keys(e).length===0))return Wx(Object.keys(e).reduce((n,i)=>{var a=e[i];if(!a)return n;var o=a.stackedData,u=o.reduce((l,c)=>{var s=Mh(c,t,r),f=Fx(s);return!G(f[0])||!G(f[1])?l:[Math.min(l[0],f[0]),Math.max(l[1],f[1])]},[1/0,-1/0]);return[Math.min(u[0],n[0]),Math.max(u[1],n[1])]},[1/0,-1/0]))},Lc=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Bc=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Kr=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var i=ga(t,m=>m.coordinate),a=[],o=0,u=1,l=i.length;ud&&(v=Math.min(p,v));return v===1/0?0:v}return r?void 0:0};function zc(e){var t=e.tooltipEntrySettings,r=e.dataKey,n=e.payload,i=e.value,a=e.name;return Ne(Ne({},t),{},{dataKey:r,payload:n,value:i,name:a})}function Ca(e,t){if(e!=null)return String(e);if(typeof t=="string")return t}var Kx=(e,t)=>{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Hx=(e,t)=>t==="centric"?e.angle:e.radius,Rt=e=>e.layout.width,Lt=e=>e.layout.height,Yx=e=>e.layout.scale,jh=e=>e.layout.margin,ka=P(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Ta=P(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Vx="data-recharts-item-index",qx="data-recharts-item-id",Fn=60,Fu=30;function Fc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fi(e){for(var t=1;te.brush.height;function Jx(e){var t=Ta(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:Fn;return r+i}return r},0)}function ew(e){var t=Ta(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:Fn;return r+i}return r},0)}function tw(e){var t=ka(e);return t.reduce((r,n)=>{if(n.orientation==="top"&&!n.mirror&&!n.hide){var i=typeof n.height=="number"?n.height:Fu;return r+i}return r},0)}function rw(e){var t=ka(e);return t.reduce((r,n)=>{if(n.orientation==="bottom"&&!n.mirror&&!n.hide){var i=typeof n.height=="number"?n.height:Fu;return r+i}return r},0)}var xe=P([Rt,Lt,jh,Qx,Jx,ew,tw,rw,rh,xb],(e,t,r,n,i,a,o,u,l,c)=>{var s={left:(r.left||0)+i,right:(r.right||0)+a},f={top:(r.top||0)+o,bottom:(r.bottom||0)+u},d=fi(fi({},f),s),v=d.bottom;d.bottom+=n,d=jx(d,l,c);var p=e-d.left-d.right,m=t-d.top-d.bottom;return fi(fi({brushBottom:v},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),nw=P(xe,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Dh=P(Rt,Lt,(e,t)=>({x:0,y:0,width:e,height:t})),iw=h.createContext(null),Le=()=>h.useContext(iw)!=null,Ma=e=>e.brush,ja=P([Ma,xe,jh],(e,t,r)=>({height:e.height,x:D(e.x)?e.x:t.left,y:D(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:D(e.width)?e.width:t.width}));function aw(e,t,{signal:r,edges:n}={}){let i,a=null;const o=n!=null&&n.includes("leading"),u=n==null||n.includes("trailing"),l=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},c=()=>{u&&l(),v()};let s=null;const f=()=>{s!=null&&clearTimeout(s),s=setTimeout(()=>{s=null,c()},t)},d=()=>{s!==null&&(clearTimeout(s),s=null)},v=()=>{d(),i=void 0,a=null},p=()=>{l()},m=function(...y){if(r!=null&&r.aborted)return;i=this,a=y;const g=s==null;f(),o&&g&&l()};return m.schedule=f,m.cancel=v,m.flush=p,r==null||r.addEventListener("abort",v,{once:!0}),m}function ow(e,t=0,r={}){typeof r!="object"&&(r={});const{leading:n=!1,trailing:i=!0,maxWait:a}=r,o=Array(2);n&&(o[0]="leading"),i&&(o[1]="trailing");let u,l=null;const c=aw(function(...d){u=e.apply(this,d),l=null},t,{edges:o}),s=function(...d){return a!=null&&(l===null&&(l=Date.now()),Date.now()-l>=a)?(u=e.apply(this,d),l=Date.now(),c.cancel(),c.schedule(),u):(c.apply(this,d),u)},f=()=>(c.flush(),u);return s.cancel=c.cancel,s.flush=f,s}function uw(e,t=0,r={}){const{leading:n=!0,trailing:i=!0}=r;return ow(e,t,{leading:n,maxWait:t,trailing:i})}var Wc=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai[o++]))}},yt={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},$h=(e,t,r)=>{var n=r.width,i=n===void 0?yt.width:n,a=r.height,o=a===void 0?yt.height:a,u=r.aspect,l=r.maxHeight,c=mr(i)?e:Number(i),s=mr(o)?t:Number(o);return u&&u>0&&(c?s=c/u:s&&(c=s*u),l&&s!=null&&s>l&&(s=l)),{calculatedWidth:c,calculatedHeight:s}},lw={width:0,height:0,overflow:"visible"},cw={width:0,overflowX:"visible"},sw={height:0,overflowY:"visible"},fw={},dw=e=>{var t=e.width,r=e.height,n=mr(t),i=mr(r);return n&&i?lw:n?cw:i?sw:fw};function vw(e){var t=e.width,r=e.height,n=e.aspect,i=t,a=r;return i===void 0&&a===void 0?(i=yt.width,a=yt.height):i===void 0?i=n&&n>0?void 0:yt.width:a===void 0&&(a=n&&n>0?void 0:yt.height),{width:i,height:a}}var hw=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function Fi(){return Fi=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r({width:r,height:n}),[r,n]);return Sw(i)?h.createElement(Nh.Provider,{value:i},t):null}var Wu=()=>h.useContext(Nh),Ew=h.forwardRef((e,t)=>{var r=e.aspect,n=e.initialDimension,i=n===void 0?yt.initialDimension:n,a=e.width,o=e.height,u=e.minWidth,l=u===void 0?yt.minWidth:u,c=e.minHeight,s=e.maxHeight,f=e.children,d=e.debounce,v=d===void 0?yt.debounce:d,p=e.id,m=e.className,y=e.onResize,g=e.style,x=g===void 0?{}:g,A=Ow(e,hw),w=h.useRef(null),O=h.useRef();O.current=y,h.useImperativeHandle(t,()=>w.current);var b=h.useState({containerWidth:i.width,containerHeight:i.height}),S=gw(b,2),I=S[0],_=S[1],T=h.useCallback((K,H)=>{_(L=>{var V=Math.round(K),W=Math.round(H);return L.containerWidth===V&&L.containerHeight===W?L:{containerWidth:V,containerHeight:W}})},[]);h.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return Or;var K=fe=>{var de,oe=fe[0];if(oe!=null){var De=oe.contentRect,Be=De.width,rt=De.height;T(Be,rt),(de=O.current)===null||de===void 0||de.call(O,Be,rt)}};v>0&&(K=uw(K,v,{trailing:!0,leading:!1}));var H=new ResizeObserver(K),L=w.current.getBoundingClientRect(),V=L.width,W=L.height;return T(V,W),H.observe(w.current),()=>{H.disconnect()}},[T,v]);var k=I.containerWidth,E=I.containerHeight;Wc(!r||r>0,"The aspect(%s) must be greater than zero.",r);var R=$h(k,E,{width:a,height:o,aspect:r,maxHeight:s}),$=R.calculatedWidth,F=R.calculatedHeight;return Wc(k<0||E<0||$!=null&&$>0||F!=null&&F>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,$,F,a,o,l,c,r),h.createElement("div",Fi({id:p?"".concat(p):void 0,className:ne("recharts-responsive-container",m),style:Kc(Kc({},x),{},{width:a,height:o,minWidth:l,minHeight:c,maxHeight:s}),ref:w},A),h.createElement("div",{style:dw({width:a,height:o})},h.createElement(Rh,{width:$,height:F},f)))}),IN=h.forwardRef((e,t)=>{var r=Wu();if(Xt(r.width)&&Xt(r.height))return e.children;var n=vw({width:e.width,height:e.height,aspect:e.aspect}),i=n.width,a=n.height,o=$h(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight}),u=o.calculatedWidth,l=o.calculatedHeight;return D(u)&&D(l)?h.createElement(Rh,{width:u,height:l},e.children):h.createElement(Ew,Fi({},e,{width:i,height:a,ref:t}))}),Da=()=>{var e,t=Le(),r=N(nw),n=N(ja),i=(e=N(Ma))===null||e===void 0?void 0:e.padding;return!t||!n||!i?r:{width:n.width-i.left-i.right,height:n.height-i.top-i.bottom,x:i.left,y:i.top}},Iw={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},_w=()=>{var e;return(e=N(xe))!==null&&e!==void 0?e:Iw},Cw=()=>N(Rt),kw=()=>N(Lt),Z=e=>e.layout.layoutType,Pr=()=>N(Z),Tw=()=>{var e=Pr();if(e==="horizontal"||e==="vertical")return e},Lh=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Mw=()=>{var e=Pr();return e!==void 0},Wn=e=>{var t=ce(),r=Le(),n=e.width,i=e.height,a=Wu(),o=n,u=i;return a&&(o=a.width>0?a.width:n,u=a.height>0?a.height:i),h.useEffect(()=>{!r&&Xt(o)&&Xt(u)&&t(Ix({width:o,height:u}))},[t,r,o,u]),null},jw={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value",position:void 0,offset:0},size:{width:0,height:0},payload:[]},Bh=Me({name:"legend",initialState:jw,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter,e.settings.position=t.payload.position,e.settings.offset=t.payload.offset},addLegendPayload:{reducer(e,t){e.payload.push(q(t.payload))},prepare:te()},replaceLegendPayload:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,a=qe(e).payload.indexOf(q(n));a>-1&&(e.payload[a]=q(i))},prepare:te()},removeLegendPayload:{reducer(e,t){var r=qe(e).payload.indexOf(q(t.payload));r>-1&&e.payload.splice(r,1)},prepare:te()}}}),Un=Bh.actions;Un.setLegendSize;Un.setLegendSettings;var Dw=Un.addLegendPayload,$w=Un.replaceLegendPayload,Nw=Un.removeLegendPayload,Rw=Bh.reducer,uo={exports:{}},lo={};/** - * @license React - * use-sync-external-store-with-selector.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Yc;function Lw(){if(Yc)return lo;Yc=1;var e=iv();function t(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,u=e.useDebugValue;return lo.useSyncExternalStoreWithSelector=function(l,c,s,f,d){var v=i(null);if(v.current===null){var p={hasValue:!1,value:null};v.current=p}else p=v.current;v=o(function(){function y(O){if(!g){if(g=!0,x=O,O=f(O),d!==void 0&&p.hasValue){var b=p.value;if(d(b,O))return A=b}return A=O}if(b=A,r(x,O))return b;var S=f(O);return d!==void 0&&d(b,S)?(x=O,b):(x=O,A=S)}var g=!1,x,A,w=s===void 0?null:s;return[function(){return y(c())},w===null?void 0:function(){return y(w())}]},[c,s,f,d]);var m=n(l,v[0],v[1]);return a(function(){p.hasValue=!0,p.value=m},[m]),u(m),m},lo}var Vc;function Bw(){return Vc||(Vc=1,uo.exports=Lw()),uo.exports}Bw();function zw(e){e()}function Fw(){let e=null,t=null;return{clear(){e=null,t=null},notify(){zw(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var qc={notify(){},get:()=>[]};function Ww(e,t){let r,n=qc,i=0,a=!1;function o(m){s();const y=n.subscribe(m);let g=!1;return()=>{g||(g=!0,y(),f())}}function u(){n.notify()}function l(){p.onStateChange&&p.onStateChange()}function c(){return a}function s(){i++,r||(r=e.subscribe(l),n=Fw())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=qc)}function d(){a||(a=!0,s())}function v(){a&&(a=!1,f())}const p={addNestedSub:o,notifyNestedSubs:u,handleChangeWrapper:l,isSubscribed:c,trySubscribe:d,tryUnsubscribe:v,getListeners:()=>n};return p}var Uw=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Kw=Uw(),Hw=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Yw=Hw(),Vw=()=>Kw||Yw?h.useLayoutEffect:h.useEffect,qw=Vw();function Xc(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Xw(e,t){if(Xc(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i=0;i{const l=Ww(i);return{store:i,subscription:l,getServerState:n?()=>n:void 0}},[i,n]),o=h.useMemo(()=>i.getState(),[i]);qw(()=>{const{subscription:l}=a;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),o!==i.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[a,o]);const u=r||Zw;return h.createElement(u.Provider,{value:a},t)}var Jw=Qw,eA=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function tA(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Kn(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(eA.has(n)){if(e[n]==null&&t[n]==null)continue;if(!Xw(e[n],t[n]))return!1}else if(!tA(e[n],t[n]))return!1;return!0}function eu(){return eu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.separator,r=t===void 0?kr.separator:t,n=e.contentStyle,i=e.itemStyle,a=e.labelStyle,o=a===void 0?kr.labelStyle:a,u=e.payload,l=e.formatter,c=e.itemSorter,s=e.wrapperClassName,f=e.labelClassName,d=e.label,v=e.labelFormatter,p=e.accessibilityLayer,m=p===void 0?kr.accessibilityLayer:p,y=()=>{if(u&&u.length){var I={padding:0,margin:0},_=fA(u,c),T=_.map((k,E)=>{if(!k||k.type==="none")return null;var R=k.formatter||l||sA,$=k.value,F=k.name,K=$,H=F;if(R){var L=R($,F,k,E,u);if(Array.isArray(L)){var V=aA(L,2);K=V[0],H=V[1]}else if(L!=null)K=L;else return null}var W=ln(ln({},kr.itemStyle),{},{color:k.color||kr.itemStyle.color},i);return h.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(E),style:W},Ot(H)?h.createElement("span",{className:"recharts-tooltip-item-name"},H):null,Ot(H)?h.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,h.createElement("span",{className:"recharts-tooltip-item-value"},K),h.createElement("span",{className:"recharts-tooltip-item-unit"},k.unit||""))});return h.createElement("ul",{className:"recharts-tooltip-item-list",style:I},T)}return null},g=ln(ln({},kr.contentStyle),n),x=ln({margin:0},o),A=!ae(d),w=A?d:"",O=ne("recharts-default-tooltip",s),b=ne("recharts-tooltip-label",f);A&&v&&u!==void 0&&u!==null&&(w=v(d,u));var S=m?{role:"status","aria-live":"assertive"}:{};return h.createElement("div",eu({className:O,style:g},S),h.createElement("p",{className:b,style:x},h.isValidElement(w)?w:"".concat(w)),y())},cn="recharts-tooltip-wrapper",vA={visibility:"hidden"};function hA(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return ne(cn,{["".concat(cn,"-right")]:D(r)&&t&&D(t.x)&&r>=t.x,["".concat(cn,"-left")]:D(r)&&t&&D(t.x)&&r=t.y,["".concat(cn,"-top")]:D(n)&&t&&D(t.y)&&n0?i:0),f=r[n]+i;if(t[n])return o[n]?s:f;var d=l[n];if(d==null)return 0;if(o[n]){var v=s,p=d;return vy?Math.max(s,d):Math.max(f,d)}function pA(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function mA(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTop,i=e.offsetLeft,a=e.position,o=e.reverseDirection,u=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,s,f,d;return u&&u.height>0&&u.width>0&&r?(f=Qc({allowEscapeViewBox:t,coordinate:r,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:u.width,viewBox:c,viewBoxDimension:c.width}),d=Qc({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:a,reverseDirection:o,tooltipDimension:u.height,viewBox:c,viewBoxDimension:c.height}),s=pA({translateX:f,translateY:d,useTranslate3d:l})):s=vA,{cssProperties:s,cssClasses:hA({translateX:f,translateY:d,coordinate:r})}}var yA=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Hn={isSsr:yA()};function gA(e,t){return AA(e)||wA(e,t)||xA(e,t)||bA()}function bA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xA(e,t){if(e){if(typeof e=="string")return Jc(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Jc(e,t):void 0}}function Jc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rHn.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=gA(e,2),r=t[0],n=t[1];return h.useEffect(()=>{if(window.matchMedia){var i=window.matchMedia("(prefers-reduced-motion: reduce)"),a=()=>{n(i.matches)};return i.addEventListener("change",a),()=>{i.removeEventListener("change",a)}}},[]),r}function es(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tr(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),c=EA(l,2),s=c[0],f=c[1];h.useEffect(()=>{var g=x=>{if(x.key==="Escape"){var A,w,O,b;f({dismissed:!0,dismissedAtCoordinate:{x:(A=(w=e.coordinate)===null||w===void 0?void 0:w.x)!==null&&A!==void 0?A:0,y:(O=(b=e.coordinate)===null||b===void 0?void 0:b.y)!==null&&O!==void 0?O:0}})}};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(r=e.coordinate)===null||r===void 0?void 0:r.y]),s.dismissed&&(((n=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)!==s.dismissedAtCoordinate.x||((a=(o=e.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==s.dismissedAtCoordinate.y)&&f(Tr(Tr({},s),{},{dismissed:!1}));var d=mA({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:e.lastBoundingBox,useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),v=d.cssClasses,p=d.cssProperties,m=e.hasPortalFromProps?{}:Tr(Tr({transition:TA({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},p),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),y=Tr(Tr({},m),{},{visibility:!s.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return h.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:v,style:y,ref:e.innerRef},e.children)}var jA=h.memo(MA),Fh=()=>{var e;return(e=N(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function tu(){return tu=Object.assign?Object.assign.bind():function(e){for(var t=1;tG(e.x)&&G(e.y),as=e=>e.base!=null&&Wi(e.base)&&Wi(e),sn=e=>e.x,fn=e=>e.y,RA=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(Eu(e));if((r==="curveMonotone"||r==="curveBump")&&t){var n=is["".concat(r).concat(t==="vertical"?"Y":"X")];if(n)return n}return is[r]||ma},os={connectNulls:!1,type:"linear"},LA=e=>{var t=e.type,r=t===void 0?os.type:t,n=e.points,i=n===void 0?[]:n,a=e.baseLine,o=e.layout,u=e.connectNulls,l=u===void 0?os.connectNulls:u,c=RA(r,o),s=l?i.filter(Wi):i;if(Array.isArray(a)){var f,d=i.map((g,x)=>ns(ns({},g),{},{base:a[x]}));o==="vertical"?f=ai().y(fn).x1(sn).x0(g=>g.base.x):f=ai().x(sn).y1(fn).y0(g=>g.base.y);var v=f.defined(as).curve(c),p=l?d.filter(as):d;return v(p)}var m;o==="vertical"&&D(a)?m=ai().y(fn).x1(sn).x0(a):D(a)?m=ai().x(sn).y1(fn).y0(a):m=gv().x(sn).y(fn);var y=m.defined(Wi).curve(c);return y(s)},Wh=e=>{var t=e.className,r=e.points,n=e.path,i=e.pathRef,a=Pr();if((!r||!r.length)&&!n)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},u=r&&r.length?LA(o):n;return h.createElement("path",tu({},wt(e),Cu(e),{className:ne("recharts-curve",t),d:u===null?void 0:u,ref:i}))},BA=["x","y","top","left","width","height","className"];function ru(){return ru=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(i,"v").concat(n,"M").concat(a,",").concat(t,"h").concat(r),VA=e=>{var t=e.x,r=t===void 0?0:t,n=e.y,i=n===void 0?0:n,a=e.top,o=a===void 0?0:a,u=e.left,l=u===void 0?0:u,c=e.width,s=c===void 0?0:c,f=e.height,d=f===void 0?0:f,v=e.className,p=KA(e,BA),m=zA({x:r,y:i,top:o,left:l,width:s,height:d},p);return!D(r)||!D(i)||!D(s)||!D(d)||!D(o)||!D(l)?null:h.createElement("path",ru({},Ge(m),{className:ne("recharts-cross",v),d:YA(r,i,s,d,o,l)}))};function qA(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-i,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}var Ui=1e-4,Uh=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],Kh=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),ls=(e,t)=>r=>{var n=Uh(e,t);return Kh(n,r)},XA=(e,t)=>r=>{var n=Uh(e,t),i=[...n.map((a,o)=>a*o).slice(1),0];return Kh(i,r)},GA=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var n=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(n==null||n.length!==4)return null;var i=n.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},ZA=function(){for(var t=arguments.length,r=new Array(t),n=0;n{var i=ls(e,r),a=ls(t,n),o=XA(e,r),u=c=>c>1?1:c<0?0:c,l=c=>{for(var s=c>1?1:c,f=s,d=0;d<8;++d){var v=i(f)-s,p=o(f);if(Math.abs(v-s)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,u=o===void 0?16.67:o,l=1,c=[0],s=0,f=0,d=1e4,v=0;v{var x,A,w;if(g<=0)return 0;if(g>=1)return l;var O=g*y,b=Math.floor(O),S=O-b;return((x=c[b])!==null&&x!==void 0?x:0)+(((A=c[b+1])!==null&&A!==void 0?A:0)-((w=c[b])!==null&&w!==void 0?w:0))*S}},e1=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return cs(e);case"spring":return JA();default:if(e.split("(")[0]==="cubic-bezier")return cs(e)}return typeof e=="function"?e:null},t1=(e,t,r)=>{var n,i=a=>{var o=t.tick(a);if(t.getState()==="active"){if(r(t.getInterpolated()),t.getProgress()===1){t.complete(),n=void 0;return}n=e.setTimeout(i,o);return}n=e.setTimeout(i,o)};return n=e.setTimeout(i,0),()=>{var a;return(a=n)===null||a===void 0?void 0:a()}},Hh=h.createContext(t1);Hh.Provider;function r1(e){var t=h.useContext(Hh);return h.useMemo(()=>e??t,[e,t])}function n1(e,t,r){return(t=i1(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i1(e){var t=a1(e,"string");return typeof t=="symbol"?t:t+""}function a1(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ss="init",fs="pending",ds="active",o1="completed";function fo(e){return Math.max(0,e)}class u1{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(t){var r;n1(this,"state",ss),this.animationId=t.animationId,this.onAnimationEnd=t.onAnimationEnd,this.animationDuration=fo(t.animationDuration),this.animationBegin=fo(t.animationBegin),this.progress=0,this.from=t.from,this.to=t.to,this.easing=t.easing,(r=t.onAnimationStart)===null||r===void 0||r.call(t)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(t){if(this.getState()===ss)return this.state=fs,this.beginStartedTime=t,this.animationBegin;if(this.getState()===fs){if(this.beginStartedTime==null)throw new Error;var r=t-this.beginStartedTime;return r>=this.animationBegin?(this.state=ds,this.animationStartedTime=t,this.nextAnimationUpdate(0)):fo(this.animationBegin-r)}if(this.getState()===ds){if(this.animationStartedTime==null)throw new Error;var n=t-this.animationStartedTime;return this.setProgress(n/this.animationDuration),this.nextAnimationUpdate(n)}return 0}setProgress(t){this.progress=Math.min(1,Math.max(0,t))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state==="active"){var t;(t=this.onAnimationEnd)===null||t===void 0||t.call(this)}this.state=o1}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class l1 extends u1{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(ve(this.getFrom(),this.getTo(),this.getProgress()))}}class c1{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),i=null,a=o=>{o-n>=r?t(o):i=requestAnimationFrame(a)};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function s1(e,t){return h1(e)||v1(e,t)||d1(e,t)||f1()}function f1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d1(e,t){if(e){if(typeof e=="string")return vs(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vs(e,t):void 0}}function vs(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{},onAnimationStart:()=>{}},hs=0,vo=1;function Yh(e){var t=Je(e,p1),r=t.animationId,n=t.isActive,i=t.canBegin,a=t.duration,o=t.easing,u=t.begin,l=t.onAnimationEnd,c=t.onAnimationStart,s=t.children,f=zh(),d=n==="auto"?!Hn.isSsr&&!f:n,v=r1(t.animationController),p=h.useState(d?hs:vo),m=s1(p,2),y=m[0],g=m[1];return h.useEffect(()=>{d||g(vo)},[d]),h.useEffect(()=>{var x=e1(o);if(!d||!i||x==null)return Or;var A=new c1,w=new l1({animationId:r,easing:x,animationDuration:a,animationBegin:u,onAnimationStart:c,onAnimationEnd:l,from:hs,to:vo});return v(A,w,g)},[v,r,d,i,a,o,u,c,l]),s(Number(y))}function Vh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=h.useRef(Sn(t)),n=h.useRef(e);return n.current!==e&&(r.current=Sn(t),n.current=e),r.current}var m1=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),y1=(e,t,r)=>e.map(n=>"".concat(m1(n)," ").concat(t,"ms ").concat(r)).join(","),g1=["radius"],b1=["radius"],ps,ms,ys,gs,bs,xs,ws,As,Os,Ps;function Ss(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Es(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var a=It(r),o=It(n),u=Math.min(Math.abs(a)/2,Math.abs(o)/2),l=o>=0?1:-1,c=a>=0?1:-1,s=o>=0&&a>=0||o<0&&a<0?1:0,f;if(u>0&&Array.isArray(i)){for(var d=[0,0,0,0],v=0,p=4;vu?u:y}f=Se(ps||(ps=vt(["M",",",""])),e,t+l*d[0]),d[0]>0&&(f+=Se(ms||(ms=vt(["A ",",",",0,0,",",",",",""])),d[0],d[0],s,e+c*d[0],t)),f+=Se(ys||(ys=vt(["L ",",",""])),e+r-c*d[1],t),d[1]>0&&(f+=Se(gs||(gs=vt(["A ",",",",0,0,",`, - `,",",""])),d[1],d[1],s,e+r,t+l*d[1])),f+=Se(bs||(bs=vt(["L ",",",""])),e+r,t+n-l*d[2]),d[2]>0&&(f+=Se(xs||(xs=vt(["A ",",",",0,0,",`, - `,",",""])),d[2],d[2],s,e+r-c*d[2],t+n)),f+=Se(ws||(ws=vt(["L ",",",""])),e+c*d[3],t+n),d[3]>0&&(f+=Se(As||(As=vt(["A ",",",",0,0,",`, - `,",",""])),d[3],d[3],s,e,t+n-l*d[3])),f+="Z"}else if(u>0&&i===+i&&i>0){var g=Math.min(u,i);f=Se(Os||(Os=vt(["M ",",",` - A `,",",",0,0,",",",",",` - L `,",",` - A `,",",",0,0,",",",",",` - L `,",",` - A `,",",",0,0,",",",",",` - L `,",",` - A `,",",",0,0,",",",","," Z"])),e,t+l*g,g,g,s,e+c*g,t,e+r-c*g,t,g,g,s,e+r,t+l*g,e+r,t+n-l*g,g,g,s,e+r-c*g,t+n,e+c*g,t+n,g,g,s,e,t+n-l*g)}else f=Se(Ps||(Ps=vt(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return f},ks={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},qh=e=>{var t=Je(e,ks),r=h.useRef(null),n=h.useState(-1),i=P1(n,2),a=i[0],o=i[1];h.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var L=r.current.getTotalLength();L&&o(L)}catch{}},[]);var u=t.x,l=t.y,c=t.width,s=t.height,f=t.radius,d=t.className,v=t.animationEasing,p=t.animationDuration,m=t.animationBegin,y=t.isAnimationActive,g=t.isUpdateAnimationActive,x=h.useRef(c),A=h.useRef(s),w=h.useRef(u),O=h.useRef(l),b=h.useMemo(()=>({x:u,y:l,width:c,height:s,radius:f}),[u,l,c,s,f]),S=Vh(b,"rectangle-");if(u!==+u||l!==+l||c!==+c||s!==+s||c===0||s===0)return null;var I=ne("recharts-rectangle",d);if(!g){var _=Ge(t);_.radius;var T=Is(_,g1);return h.createElement("path",Ki({},T,{x:It(u),y:It(l),width:It(c),height:It(s),radius:typeof f=="number"?f:void 0,className:I,d:Cs(u,l,c,s,f)}))}var k=x.current,E=A.current,R=w.current,$=O.current,F="0px ".concat(a===-1?1:a,"px"),K="".concat(a,"px ").concat(a,"px"),H=y1(["strokeDasharray"],p,typeof v=="string"?v:ks.animationEasing);return h.createElement(Yh,{animationId:S,key:S,canBegin:a>0,duration:p,easing:v,isActive:g,begin:m},L=>{var V=ve(k,c,L),W=ve(E,s,L),fe=ve(R,u,L),de=ve($,l,L);r.current&&(x.current=V,A.current=W,w.current=fe,O.current=de);var oe;y?L>0?oe={transition:H,strokeDasharray:K}:oe={strokeDasharray:F}:oe={strokeDasharray:K};var De=Ge(t);De.radius;var Be=Is(De,b1);return h.createElement("path",Ki({},Be,{radius:typeof f=="number"?f:void 0,className:I,d:Cs(fe,de,V,W,f),ref:r,style:Es(Es({},oe),t.style)}))})};function Ts(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ms(e){for(var t=1;te*180/Math.PI,Ie=(e,t,r,n)=>({x:e+Math.cos(-Hi*n)*r,y:t+Math.sin(-Hi*n)*r}),j1=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},D1=(e,t)=>{var r=e.x,n=e.y,i=t.x,a=t.y;return Math.sqrt((r-i)**2+(n-a)**2)},$1=(e,t)=>{var r=e.x,n=e.y,i=t.cx,a=t.cy,o=D1({x:r,y:n},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var u=(r-i)/o,l=Math.acos(u);return n>a&&(l=2*Math.PI-l),{radius:o,angle:M1(l),angleInRadian:l}},N1=e=>{var t=e.startAngle,r=e.endAngle,n=Math.floor(t/360),i=Math.floor(r/360),a=Math.min(n,i);return{startAngle:t-a*360,endAngle:r-a*360}},R1=(e,t)=>{var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return e+o*360},L1=(e,t)=>{var r=e.relativeX,n=e.relativeY,i=$1({x:r,y:n},t),a=i.radius,o=i.angle,u=t.innerRadius,l=t.outerRadius;if(al||a===0)return null;var c=N1(t),s=c.startAngle,f=c.endAngle,d=o,v;if(s<=f){for(;d>f;)d-=360;for(;d=s&&d<=f}else{for(;d>s;)d-=360;for(;d=f&&d<=s}return v?Ms(Ms({},t),{},{radius:a,angle:R1(d,t)}):null};function Xh(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,a=e.endAngle,o=Ie(t,r,n,i),u=Ie(t,r,n,a);return{points:[o,u],cx:t,cy:r,radius:n,startAngle:i,endAngle:a}}var js,Ds,$s,Ns,Rs,Ls,Bs;function nu(){return nu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=We(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},di=e=>{var t=e.cx,r=e.cy,n=e.radius,i=e.angle,a=e.sign,o=e.isExternal,u=e.cornerRadius,l=e.cornerIsExternal,c=u*(o?1:-1)+n,s=Math.asin(u/c)/Hi,f=l?i:i+a*s,d=Ie(t,r,c,f),v=Ie(t,r,n,f),p=l?i-a*s:i,m=Ie(t,r,c*Math.cos(s*Hi),p);return{center:d,circleTangency:v,lineTangency:m,theta:s}},Gh=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,a=e.startAngle,o=e.endAngle,u=B1(a,o),l=a+u,c=Ie(t,r,i,a),s=Ie(t,r,i,l),f=Se(js||(js=sr(["M ",",",` - A `,",",`,0, - `,",",`, - `,",",` - `])),c.x,c.y,i,i,+(Math.abs(u)>180),+(a>l),s.x,s.y);if(n>0){var d=Ie(t,r,n,a),v=Ie(t,r,n,l);f+=Se(Ds||(Ds=sr(["L ",",",` - A `,",",`,0, - `,",",`, - `,","," Z"])),v.x,v.y,n,n,+(Math.abs(u)>180),+(a<=l),d.x,d.y)}else f+=Se($s||($s=sr(["L ",","," Z"])),t,r);return f},z1=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,o=e.forceCornerRadius,u=e.cornerIsExternal,l=e.startAngle,c=e.endAngle,s=We(c-l),f=di({cx:t,cy:r,radius:i,angle:l,sign:s,cornerRadius:a,cornerIsExternal:u}),d=f.circleTangency,v=f.lineTangency,p=f.theta,m=di({cx:t,cy:r,radius:i,angle:c,sign:-s,cornerRadius:a,cornerIsExternal:u}),y=m.circleTangency,g=m.lineTangency,x=m.theta,A=u?Math.abs(l-c):Math.abs(l-c)-p-x;if(A<0)return o?Se(Ns||(Ns=sr(["M ",",",` - a`,",",",0,0,1,",`,0 - a`,",",",0,0,1,",`,0 - `])),v.x,v.y,a,a,a*2,a,a,-a*2):Gh({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:l,endAngle:c});var w=Se(Rs||(Rs=sr(["M ",",",` - A`,",",",0,0,",",",",",` - A`,",",",0,",",",",",",",` - A`,",",",0,0,",",",",",` - `])),v.x,v.y,a,a,+(s<0),d.x,d.y,i,i,+(A>180),+(s<0),y.x,y.y,a,a,+(s<0),g.x,g.y);if(n>0){var O=di({cx:t,cy:r,radius:n,angle:l,sign:s,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),b=O.circleTangency,S=O.lineTangency,I=O.theta,_=di({cx:t,cy:r,radius:n,angle:c,sign:-s,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),T=_.circleTangency,k=_.lineTangency,E=_.theta,R=u?Math.abs(l-c):Math.abs(l-c)-I-E;if(R<0&&a===0)return"".concat(w,"L").concat(t,",").concat(r,"Z");w+=Se(Ls||(Ls=sr(["L",",",` - A`,",",",0,0,",",",",",` - A`,",",",0,",",",",",",",` - A`,",",",0,0,",",",",","Z"])),k.x,k.y,a,a,+(s<0),T.x,T.y,n,n,+(R>180),+(s>0),b.x,b.y,a,a,+(s<0),S.x,S.y)}else w+=Se(Bs||(Bs=sr(["L",",","Z"])),t,r);return w},F1={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},W1=e=>{var t=Je(e,F1),r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,u=t.forceCornerRadius,l=t.cornerIsExternal,c=t.startAngle,s=t.endAngle,f=t.className;if(a0&&Math.abs(c-s)<360?m=z1({cx:r,cy:n,innerRadius:i,outerRadius:a,cornerRadius:Math.min(p,v/2),forceCornerRadius:u,cornerIsExternal:l,startAngle:c,endAngle:s}):m=Gh({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:c,endAngle:s}),h.createElement("path",nu({},Ge(t),{className:d,d:m}))};function U1(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(Iv(t)){if(e==="centric"){var n=t.cx,i=t.cy,a=t.innerRadius,o=t.outerRadius,u=t.angle,l=Ie(n,i,a,u),c=Ie(n,i,o,u);return[{x:l.x,y:l.y},{x:c.x,y:c.y}]}return Xh(t)}}function K1(e){return th(e)?NaN:Number(e)}function ho(e){return e?(e=K1(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function Zh(e,t,r){r&&typeof r!="number"&&Uo(e,t,r)&&(t=r=void 0),e=ho(e),t===void 0?(t=e,e=0):t=ho(t),r=r===void 0?ee.chartData,Uu=P([ct],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Yn=(e,t,r,n)=>n?Uu(e):ct(e),H1=(e,t,r)=>r?Uu(e):ct(e),Y1=P([Yn],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});P([Uu],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});var V1=P([ct],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});function Ku(e,t){return Z1(e)||G1(e,t)||X1(e,t)||q1()}function q1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function X1(e,t){if(e){if(typeof e=="string")return zs(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?zs(e,t):void 0}}function zs(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};j.decimalPlaces=j.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*re;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};j.dividedBy=j.div=function(e){return kt(this,new this.constructor(e))};j.dividedToIntegerBy=j.idiv=function(e){var t=this,r=t.constructor;return ee(kt(t,new r(e),0,1),r.precision)};j.equals=j.eq=function(e){return!this.cmp(e)};j.exponent=function(){return he(this)};j.greaterThan=j.gt=function(e){return this.cmp(e)>0};j.greaterThanOrEqualTo=j.gte=function(e){return this.cmp(e)>=0};j.isInteger=j.isint=function(){return this.e>this.d.length-2};j.isNegative=j.isneg=function(){return this.s<0};j.isPositive=j.ispos=function(){return this.s>0};j.isZero=function(){return this.s===0};j.lessThan=j.lt=function(e){return this.cmp(e)<0};j.lessThanOrEqualTo=j.lte=function(e){return this.cmp(e)<1};j.logarithm=j.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Fe))throw Error(Qe+"NaN");if(r.s<1)throw Error(Qe+(r.s?"NaN":"-Infinity"));return r.eq(Fe)?new n(0):(ie=!1,t=kt(kn(r,a),kn(e,a),a),ie=!0,ee(t,i))};j.minus=j.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?rp(t,e):ep(t,(e.s=-e.s,e))};j.modulo=j.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Qe+"NaN");return r.s?(ie=!1,t=kt(r,e,0,1).times(e),ie=!0,r.minus(t)):ee(new n(r),i)};j.naturalExponential=j.exp=function(){return tp(this)};j.naturalLogarithm=j.ln=function(){return kn(this)};j.negated=j.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};j.plus=j.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ep(t,e):rp(t,(e.s=-e.s,e))};j.precision=j.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(hr+e);if(t=he(i)+1,n=i.d.length-1,r=n*re+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};j.squareRoot=j.sqrt=function(){var e,t,r,n,i,a,o,u=this,l=u.constructor;if(u.s<1){if(!u.s)return new l(0);throw Error(Qe+"NaN")}for(e=he(u),ie=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=gt(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Zr((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(kt(u,a,o+2)).times(.5),gt(a.d).slice(0,o)===(t=gt(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(ee(a,r+1,0),a.times(a).eq(u)){n=a;break}}else if(t!="9999")break;o+=4}return ie=!0,ee(n,r)};j.times=j.mul=function(e){var t,r,n,i,a,o,u,l,c,s=this,f=s.constructor,d=s.d,v=(e=new f(e)).d;if(!s.s||!e.s)return new f(0);for(e.s*=s.s,r=s.e+e.e,l=d.length,c=v.length,l=0;){for(t=0,i=l+n;i>n;)u=a[i]+v[n]*d[i-n-1]+t,a[i--]=u%be|0,t=u/be|0;a[i]=(a[i]+t)%be|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,ie?ee(e,f.precision):e};j.toDecimalPlaces=j.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Pt(e,0,Gr),t===void 0?t=n.rounding:Pt(t,0,8),ee(r,e+he(r)+1,t))};j.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=br(n,!0):(Pt(e,0,Gr),t===void 0?t=i.rounding:Pt(t,0,8),n=ee(new i(n),e+1,t),r=br(n,!0,e+1)),r};j.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?br(i):(Pt(e,0,Gr),t===void 0?t=a.rounding:Pt(t,0,8),n=ee(new a(i),e+he(i)+1,t),r=br(n.abs(),!1,e+he(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};j.toInteger=j.toint=function(){var e=this,t=e.constructor;return ee(new t(e),he(e)+1,t.rounding)};j.toNumber=function(){return+this};j.toPower=j.pow=function(e){var t,r,n,i,a,o,u=this,l=u.constructor,c=12,s=+(e=new l(e));if(!e.s)return new l(Fe);if(u=new l(u),!u.s){if(e.s<1)throw Error(Qe+"Infinity");return u}if(u.eq(Fe))return u;if(n=l.precision,e.eq(Fe))return ee(u,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=u.s,o){if((r=s<0?-s:s)<=Jh){for(i=new l(Fe),t=Math.ceil(n/re+4),ie=!1;r%2&&(i=i.times(u),Us(i.d,t)),r=Zr(r/2),r!==0;)u=u.times(u),Us(u.d,t);return ie=!0,e.s<0?new l(Fe).div(i):ee(i,n)}}else if(a<0)throw Error(Qe+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,ie=!1,i=e.times(kn(u,n+c)),ie=!0,i=tp(i),i.s=a,i};j.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=he(i),n=br(i,r<=a.toExpNeg||r>=a.toExpPos)):(Pt(e,1,Gr),t===void 0?t=a.rounding:Pt(t,0,8),i=ee(new a(i),e,t),r=he(i),n=br(i,e<=r||r<=a.toExpNeg,e)),n};j.toSignificantDigits=j.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Pt(e,1,Gr),t===void 0?t=n.rounding:Pt(t,0,8)),ee(new n(r),e,t)};j.toString=j.valueOf=j.val=j.toJSON=j[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=he(e),r=e.constructor;return br(e,t<=r.toExpNeg||t>=r.toExpPos)};function ep(e,t){var r,n,i,a,o,u,l,c,s=e.constructor,f=s.precision;if(!e.s||!t.s)return t.s||(t=new s(e)),ie?ee(t,f):t;if(l=e.d,c=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,u=c.length):(n=c,i=o,u=l.length),o=Math.ceil(f/re),u=o>u?o+1:u+1,a>u&&(a=u,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(u=l.length,a=c.length,u-a<0&&(a=u,n=c,c=l,l=n),r=0;a;)r=(l[--a]=l[a]+c[a]+r)/be|0,l[a]%=be;for(r&&(l.unshift(r),++i),u=l.length;l[--u]==0;)l.pop();return t.d=l,t.e=i,ie?ee(t,f):t}function Pt(e,t,r){if(e!==~~e||er)throw Error(hr+e)}function gt(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(u=l=0;ui[u]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var u,l,c,s,f,d,v,p,m,y,g,x,A,w,O,b,S,I,_=n.constructor,T=n.s==i.s?1:-1,k=n.d,E=i.d;if(!n.s)return new _(n);if(!i.s)throw Error(Qe+"Division by zero");for(l=n.e-i.e,S=E.length,O=k.length,v=new _(T),p=v.d=[],c=0;E[c]==(k[c]||0);)++c;if(E[c]>(k[c]||0)&&--l,a==null?x=a=_.precision:o?x=a+(he(n)-he(i))+1:x=a,x<0)return new _(0);if(x=x/re+2|0,c=0,S==1)for(s=0,E=E[0],x++;(c1&&(E=e(E,s),k=e(k,s),S=E.length,O=k.length),w=S,m=k.slice(0,S),y=m.length;y=be/2&&++b;do s=0,u=t(E,m,S,y),u<0?(g=m[0],S!=y&&(g=g*be+(m[1]||0)),s=g/b|0,s>1?(s>=be&&(s=be-1),f=e(E,s),d=f.length,y=m.length,u=t(f,m,d,y),u==1&&(s--,r(f,S16)throw Error(Hu+he(e));if(!e.s)return new s(Fe);for(ie=!1,u=f,o=new s(.03125);e.abs().gte(.1);)e=e.times(o),c+=5;for(n=Math.log(ur(2,c))/Math.LN10*2+5|0,u+=n,r=i=a=new s(Fe),s.precision=u;;){if(i=ee(i.times(e),u),r=r.times(++l),o=a.plus(kt(i,r,u)),gt(o.d).slice(0,u)===gt(a.d).slice(0,u)){for(;c--;)a=ee(a.times(a),u);return s.precision=f,t==null?(ie=!0,ee(a,f)):a}a=o}}function he(e){for(var t=e.e*re,r=e.d[0];r>=10;r/=10)t++;return t}function po(e,t,r){if(t>e.LN10.sd())throw ie=!0,r&&(e.precision=r),Error(Qe+"LN10 precision limit exceeded");return ee(new e(e.LN10),t)}function Kt(e){for(var t="";e--;)t+="0";return t}function kn(e,t){var r,n,i,a,o,u,l,c,s,f=1,d=10,v=e,p=v.d,m=v.constructor,y=m.precision;if(v.s<1)throw Error(Qe+(v.s?"NaN":"-Infinity"));if(v.eq(Fe))return new m(0);if(t==null?(ie=!1,c=y):c=t,v.eq(10))return t==null&&(ie=!0),po(m,c);if(c+=d,m.precision=c,r=gt(p),n=r.charAt(0),a=he(v),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(e),r=gt(v.d),n=r.charAt(0),f++;a=he(v),n>1?(v=new m("0."+r),a++):v=new m(n+"."+r.slice(1))}else return l=po(m,c+2,y).times(a+""),v=kn(new m(n+"."+r.slice(1)),c-d).plus(l),m.precision=y,t==null?(ie=!0,ee(v,y)):v;for(u=o=v=kt(v.minus(Fe),v.plus(Fe),c),s=ee(v.times(v),c),i=3;;){if(o=ee(o.times(s),c),l=u.plus(kt(o,new m(i),c)),gt(l.d).slice(0,c)===gt(u.d).slice(0,c))return u=u.times(2),a!==0&&(u=u.plus(po(m,c+2,y).times(a+""))),u=kt(u,new m(f),c),m.precision=y,t==null?(ie=!0,ee(u,y)):u;u=l,i+=2}}function Ws(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Zr(r/re),e.d=[],n=(r+1)%re,r<0&&(n+=re),nYi||e.e<-Yi))throw Error(Hu+r)}else e.s=0,e.e=0,e.d=[0];return e}function ee(e,t,r){var n,i,a,o,u,l,c,s,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=re,i=t,c=f[s=0];else{if(s=Math.ceil((n+1)/re),a=f.length,s>=a)return e;for(c=a=f[s],o=1;a>=10;a/=10)o++;n%=re,i=n-re+o}if(r!==void 0&&(a=ur(10,o-i-1),u=c/a%10|0,l=t<0||f[s+1]!==void 0||c%a,l=r<4?(u||l)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||l||r==6&&(n>0?i>0?c/ur(10,o-i):0:f[s-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return l?(a=he(e),f.length=1,t=t-a-1,f[0]=ur(10,(re-t%re)%re),e.e=Zr(-t/re)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=s,a=1,s--):(f.length=s+1,a=ur(10,re-n),f[s]=i>0?(c/ur(10,o-i)%ur(10,i)|0)*a:0),l)for(;;)if(s==0){(f[0]+=a)==be&&(f[0]=1,++e.e);break}else{if(f[s]+=a,f[s]!=be)break;f[s--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(ie&&(e.e>Yi||e.e<-Yi))throw Error(Hu+he(e));return e}function rp(e,t){var r,n,i,a,o,u,l,c,s,f,d=e.constructor,v=d.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new d(e),ie?ee(t,v):t;if(l=e.d,f=t.d,n=t.e,c=e.e,l=l.slice(),o=c-n,o){for(s=o<0,s?(r=l,o=-o,u=f.length):(r=f,n=c,u=l.length),i=Math.max(Math.ceil(v/re),u)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,u=f.length,s=i0;--i)l[u++]=0;for(i=f.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+Kt(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Kt(-i-1)+a,r&&(n=r-o)>0&&(a+=Kt(n))):i>=o?(a+=Kt(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Kt(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=Kt(n))),e.s<0?"-"+a:a}function Us(e,t){if(e.length>t)return e.length=t,!0}function np(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(hr+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return Ws(o,a.toString())}else if(typeof a!="string")throw Error(hr+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,eO.test(a))Ws(o,a);else throw Error(hr+a)}if(i.prototype=j,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=np,i.config=i.set=tO,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(hr+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(hr+r+": "+n);return this}var Yu=np(J1);Fe=new Yu(1);const Y=Yu;function ip(e){var t;return e===0?t=1:t=Math.floor(new Y(e).abs().log(10).toNumber())+1,t}function ap(e,t,r){for(var n=new Y(e),i=0,a=[];n.lt(t)&&i<1e5;)a.push(n.toNumber()),n=n.add(r),i++;return a}function Tn(e,t){return aO(e)||iO(e,t)||nO(e,t)||rO()}function rO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nO(e,t){if(e){if(typeof e=="string")return Ks(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ks(e,t):void 0}}function Ks(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=Tn(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]},Vu=(e,t,r)=>{if(e.lte(0))return new Y(0);var n=ip(e.toNumber()),i=new Y(10).pow(n),a=e.div(i),o=n!==1?.05:.1,u=new Y(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=u.mul(i);return t?new Y(l.toNumber()):new Y(Math.ceil(l.toNumber()))},up=(e,t,r)=>{var n;if(e.lte(0))return new Y(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new Y(a).abs().log(10).toNumber()),u=new Y(10).pow(o),l=e.div(u).toNumber(),c=i.findIndex(v=>v>=l-1e-10);if(c===-1&&(u=u.mul(10),c=0),c+=r,c>=i.length){var s=Math.floor(c/i.length);c%=i.length,u=u.mul(new Y(10).pow(s))}var f=(n=i[c])!==null&&n!==void 0?n:1,d=new Y(f).mul(u);return t?d:new Y(Math.ceil(d.toNumber()))},oO=(e,t,r)=>{var n=new Y(1),i=new Y(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new Y(10).pow(ip(e)-1),i=new Y(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new Y(Math.floor(e)))}else e===0?i=new Y(Math.floor((t-1)/2)):r||(i=new Y(Math.floor(e)));for(var o=Math.floor((t-1)/2),u=[],l=0;l4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Vu;if(!Number.isFinite((r-t)/(n-1)))return{step:new Y(0),tickMin:new Y(0),tickMax:new Y(0)};var u=o(new Y(r).sub(t).div(n-1),i,a),l;t<=0&&r>=0?l=new Y(0):(l=new Y(t).add(r).div(2),l=l.sub(new Y(l).mod(u)));var c=Math.ceil(l.sub(t).div(u).toNumber()),s=Math.ceil(new Y(r).sub(l).div(u).toNumber()),f=c+s+1;return f>n?lp(t,r,n,i,a+1,o):(f0?s+(n-f):s,c=r>0?c:c+(n-f)),{step:u,tickMin:l.sub(new Y(c).mul(u)),tickMax:l.add(new Y(s).mul(u))})},Hs=function(t){var r=Tn(t,2),n=r[0],i=r[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",l=Math.max(a,2),c=op([n,i]),s=Tn(c,2),f=s[0],d=s[1];if(f===-1/0||d===1/0){var v=d===1/0?[f,...Array(a-1).fill(1/0)]:[...Array(a-1).fill(-1/0),d];return n>i?v.reverse():v}if(f===d)return oO(f,a,o);var p=u==="snap125"?up:Vu,m=lp(f,d,l,o,0,p),y=m.step,g=m.tickMin,x=m.tickMax,A=ap(g,x.add(new Y(.1).mul(y)),y);return n>i?A.reverse():A},Ys=function(t,r){var n=Tn(t,2),i=n[0],a=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",l=op([i,a]),c=Tn(l,2),s=c[0],f=c[1];if(s===-1/0||f===1/0)return[i,a];if(s===f)return[s];var d=u==="snap125"?up:Vu,v=Math.max(r,2),p=d(new Y(f).sub(s).div(v-1),o,0),m=[...ap(new Y(s),new Y(f),p),f];if(o===!1){m=m.map(g=>Math.round(g));var y=m.length-1;y>0&&m[y]===m[y-1]&&(m=m.slice(0,y))}return i>a?m.reverse():m},cp=e=>e.rootProps.maxBarSize,uO=e=>e.rootProps.barGap,sp=e=>e.rootProps.barCategoryGap,lO=e=>e.rootProps.barSize,$a=e=>e.rootProps.stackOffset,fp=e=>e.rootProps.reverseStackOrder,qu=e=>e.options.chartName,Xu=e=>e.rootProps.syncId,dp=e=>e.rootProps.syncMethod,Gu=e=>e.options.eventEmitter,_e={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},rr={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},ht={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Na=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Zu(e,t,r){if(r!=="auto")return r;if(e!=null)return Nt(e,t)?"category":"number"}function Vs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Vi(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},Qu=P([dO,Lh],(e,t)=>{var r;if(e!=null)return e;var n=(r=Zu(t,"angleAxis",qs.type))!==null&&r!==void 0?r:"category";return Vi(Vi({},qs),{},{type:n})}),vO=(e,t)=>e.polarAxis.radiusAxis[t],Ju=P([vO,Lh],(e,t)=>{var r;if(e!=null)return e;var n=(r=Zu(t,"radiusAxis",Xs.type))!==null&&r!==void 0?r:"category";return Vi(Vi({},Xs),{},{type:n})}),Ra=e=>e.polarOptions,el=P([Rt,Lt,xe],j1),vp=P([Ra,el],(e,t)=>{if(e!=null)return ut(e.innerRadius,t,0)}),hp=P([Ra,el],(e,t)=>{if(e!=null)return ut(e.outerRadius,t,t*.8)}),hO=e=>{if(e==null)return[0,0];var t=e.startAngle,r=e.endAngle;return[t,r]},pp=P([Ra],hO);P([Qu,pp],Na);var mp=P([el,vp,hp],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});P([Ju,mp],Na);var yp=P([Z,Ra,vp,hp,Rt,Lt],(e,t,r,n,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var o=t.cx,u=t.cy,l=t.startAngle,c=t.endAngle;return{cx:ut(o,i,i/2),cy:ut(u,a,a/2),innerRadius:r,outerRadius:n,startAngle:l,endAngle:c,clockWise:!1}}}),we=(e,t)=>t,La=(e,t,r)=>r;function tl(e){return e==null?void 0:e.id}function gp(e,t,r){var n=t.chartData,i=n===void 0?[]:n,a=r.allowDuplicatedCategory,o=r.dataKey,u=new Map;return e.forEach(l=>{var c,s=(c=l.data)!==null&&c!==void 0?c:i;if(!(s==null||s.length===0)){var f=tl(l);s.forEach((d,v)=>{var p=o==null||a?v:String(se(d,o,null)),m=se(d,l.dataKey,0),y;u.has(p)?y=u.get(p):y={},Object.assign(y,{[f]:m}),u.set(p,y)})}}),Array.from(u.values())}function Ba(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Vn=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function za(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function pO(e,t){if(e.length===t.length){for(var r=0;r{var t=Z(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Qr=e=>e.tooltip.settings.axisId;function rl(e){if(e!=null){var t=e.ticks,r=e.bandwidth,n=e.range(),i=[Math.min(...n),Math.max(...n)];return{domain:()=>e.domain(),range:(function(a){function o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var o=i[0],u=i[1];return o<=u?a>=o&&a<=u:a>=u&&a<=o},bandwidth:r?()=>r.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,o)=>{var u=e(a);if(u!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var l=e.bandwidth();switch(o.position){case"middle":u+=l/2;break;case"end":u+=l;break}}return u}}}}}var mO=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!bt(t)){for(var r,n,i=0;in)&&(n=a))}return r!==void 0&&n!==void 0?[r,n]:void 0}return t}default:return t}};function Vt(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function yO(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function nl(e){let t,r,n;e.length!==2?(t=Vt,r=(u,l)=>Vt(e(u),l),n=(u,l)=>e(u)-l):(t=e===Vt||e===yO?e:gO,r=e,n=e);function i(u,l,c=0,s=u.length){if(c>>1;r(u[f],l)<0?c=f+1:s=f}while(c>>1;r(u[f],l)<=0?c=f+1:s=f}while(cc&&n(u[f-1],l)>-n(u[f],l)?f-1:f}return{left:i,center:o,right:a}}function gO(){return 0}function bp(e){return e===null?NaN:+e}function*bO(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const xO=nl(Vt),qn=xO.right;nl(bp).center;class Gs extends Map{constructor(t,r=OO){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(Zs(this,t))}has(t){return super.has(Zs(this,t))}set(t,r){return super.set(wO(this,t),r)}delete(t){return super.delete(AO(this,t))}}function Zs({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function wO({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function AO({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function OO(e){return e!==null&&typeof e=="object"?e.valueOf():e}function PO(e=Vt){if(e===Vt)return xp;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function xp(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const SO=Math.sqrt(50),EO=Math.sqrt(10),IO=Math.sqrt(2);function qi(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=SO?10:a>=EO?5:a>=IO?2:1;let u,l,c;return i<0?(c=Math.pow(10,-i)/o,u=Math.round(e*c),l=Math.round(t*c),u/ct&&--l,c=-c):(c=Math.pow(10,i)*o,u=Math.round(e/c),l=Math.round(t/c),u*ct&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const u=a-i+1,l=new Array(u);if(n)if(o<0)for(let c=0;c=n)&&(r=n);return r}function Js(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function wp(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?xp:PO(i);n>r;){if(n-r>600){const l=n-r+1,c=t-r+1,s=Math.log(l),f=.5*Math.exp(2*s/3),d=.5*Math.sqrt(s*f*(l-f)/l)*(c-l/2<0?-1:1),v=Math.max(r,Math.floor(t-c*f/l+d)),p=Math.min(n,Math.floor(t+(l-c)*f/l+d));wp(e,t,v,p,i)}const a=e[t];let o=r,u=n;for(dn(e,r,t),i(e[n],a)>0&&dn(e,r,n);o0;)--u}i(e[r],a)===0?dn(e,r,u):(++u,dn(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function dn(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function _O(e,t,r){if(e=Float64Array.from(bO(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Js(e);if(t>=1)return Qs(e);var n,i=(n-1)*t,a=Math.floor(i),o=Qs(wp(e,a).subarray(0,a+1)),u=Js(e.subarray(a+1));return o+(u-o)*(i-a)}}function CO(e,t,r=bp){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),u=+r(e[a+1],a+1,e);return o+(u-o)*(i-a)}}function kO(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?vi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?vi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=jO.exec(e))?new Re(t[1],t[2],t[3],1):(t=DO.exec(e))?new Re(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=$O.exec(e))?vi(t[1],t[2],t[3],t[4]):(t=NO.exec(e))?vi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=RO.exec(e))?uf(t[1],t[2]/100,t[3]/100,1):(t=LO.exec(e))?uf(t[1],t[2]/100,t[3]/100,t[4]):ef.hasOwnProperty(e)?nf(ef[e]):e==="transparent"?new Re(NaN,NaN,NaN,0):null}function nf(e){return new Re(e>>16&255,e>>8&255,e&255,1)}function vi(e,t,r,n){return n<=0&&(e=t=r=NaN),new Re(e,t,r,n)}function FO(e){return e instanceof Xn||(e=Dn(e)),e?(e=e.rgb(),new Re(e.r,e.g,e.b,e.opacity)):new Re}function lu(e,t,r,n){return arguments.length===1?FO(e):new Re(e,t,r,n??1)}function Re(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}ol(Re,lu,Op(Xn,{brighter(e){return e=e==null?Xi:Math.pow(Xi,e),new Re(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Mn:Math.pow(Mn,e),new Re(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Re(pr(this.r),pr(this.g),pr(this.b),Gi(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:af,formatHex:af,formatHex8:WO,formatRgb:of,toString:of}));function af(){return`#${fr(this.r)}${fr(this.g)}${fr(this.b)}`}function WO(){return`#${fr(this.r)}${fr(this.g)}${fr(this.b)}${fr((isNaN(this.opacity)?1:this.opacity)*255)}`}function of(){const e=Gi(this.opacity);return`${e===1?"rgb(":"rgba("}${pr(this.r)}, ${pr(this.g)}, ${pr(this.b)}${e===1?")":`, ${e})`}`}function Gi(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function pr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function fr(e){return e=pr(e),(e<16?"0":"")+e.toString(16)}function uf(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ot(e,t,r,n)}function Pp(e){if(e instanceof ot)return new ot(e.h,e.s,e.l,e.opacity);if(e instanceof Xn||(e=Dn(e)),!e)return new ot;if(e instanceof ot)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,u=a-i,l=(a+i)/2;return u?(t===a?o=(r-n)/u+(r0&&l<1?0:o,new ot(o,u,l,e.opacity)}function UO(e,t,r,n){return arguments.length===1?Pp(e):new ot(e,t,r,n??1)}function ot(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}ol(ot,UO,Op(Xn,{brighter(e){return e=e==null?Xi:Math.pow(Xi,e),new ot(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Mn:Math.pow(Mn,e),new ot(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Re(mo(e>=240?e-240:e+120,i,n),mo(e,i,n),mo(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new ot(lf(this.h),hi(this.s),hi(this.l),Gi(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Gi(this.opacity);return`${e===1?"hsl(":"hsla("}${lf(this.h)}, ${hi(this.s)*100}%, ${hi(this.l)*100}%${e===1?")":`, ${e})`}`}}));function lf(e){return e=(e||0)%360,e<0?e+360:e}function hi(e){return Math.max(0,Math.min(1,e||0))}function mo(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const ul=e=>()=>e;function KO(e,t){return function(r){return e+r*t}}function HO(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function YO(e){return(e=+e)==1?Sp:function(t,r){return r-t?HO(t,r,e):ul(isNaN(t)?r:t)}}function Sp(e,t){var r=t-e;return r?KO(e,r):ul(isNaN(e)?t:e)}const cf=(function e(t){var r=YO(t);function n(i,a){var o=r((i=lu(i)).r,(a=lu(a)).r),u=r(i.g,a.g),l=r(i.b,a.b),c=Sp(i.opacity,a.opacity);return function(s){return i.r=o(s),i.g=u(s),i.b=l(s),i.opacity=c(s),i+""}}return n.gamma=e,n})(1);function VO(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),u[o]?u[o]+=a:u[++o]=a),(n=n[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,l.push({i:o,x:Zi(n,i)})),r=yo.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function iP(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?aP:iP,l=c=null,f}function f(d){return d==null||isNaN(d=+d)?a:(l||(l=u(e.map(n),t,r)))(n(o(d)))}return f.invert=function(d){return o(i((c||(c=u(t,e.map(n),Zi)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,Qi),s()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),s()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),r=ll,s()},f.clamp=function(d){return arguments.length?(o=d?!0:$e,s()):o!==$e},f.interpolate=function(d){return arguments.length?(r=d,s()):r},f.unknown=function(d){return arguments.length?(a=d,f):a},function(d,v){return n=d,i=v,s()}}function cl(){return Fa()($e,$e)}function oP(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Ji(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Hr(e){return e=Ji(Math.abs(e)),e?e[1]:NaN}function uP(e,t){return function(r,n){for(var i=r.length,a=[],o=0,u=e[0],l=0;i>0&&u>0&&(l+u+1>n&&(u=Math.max(1,n-l)),a.push(r.substring(i-=u,i+u)),!((l+=u+1)>n));)u=e[o=(o+1)%e.length];return a.reverse().join(t)}}function lP(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var cP=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $n(e){if(!(t=cP.exec(e)))throw new Error("invalid format: "+e);var t;return new sl({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}$n.prototype=sl.prototype;function sl(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}sl.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function sP(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var ea;function fP(e,t){var r=Ji(e,t);if(!r)return ea=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(ea=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Ji(e,Math.max(0,t+a-1))[0]}function ff(e,t){var r=Ji(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const df={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:oP,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ff(e*100,t),r:ff,s:fP,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function vf(e){return e}var hf=Array.prototype.map,pf=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function dP(e){var t=e.grouping===void 0||e.thousands===void 0?vf:uP(hf.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?vf:lP(hf.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(f,d){f=$n(f);var v=f.fill,p=f.align,m=f.sign,y=f.symbol,g=f.zero,x=f.width,A=f.comma,w=f.precision,O=f.trim,b=f.type;b==="n"?(A=!0,b="g"):df[b]||(w===void 0&&(w=12),O=!0,b="g"),(g||v==="0"&&p==="=")&&(g=!0,v="0",p="=");var S=(d&&d.prefix!==void 0?d.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),I=(y==="$"?n:/[%p]/.test(b)?o:"")+(d&&d.suffix!==void 0?d.suffix:""),_=df[b],T=/[defgprs%]/.test(b);w=w===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w));function k(E){var R=S,$=I,F,K,H;if(b==="c")$=_(E)+$,E="";else{E=+E;var L=E<0||1/E<0;if(E=isNaN(E)?l:_(Math.abs(E),w),O&&(E=sP(E)),L&&+E==0&&m!=="+"&&(L=!1),R=(L?m==="("?m:u:m==="-"||m==="("?"":m)+R,$=(b==="s"&&!isNaN(E)&&ea!==void 0?pf[8+ea/3]:"")+$+(L&&m==="("?")":""),T){for(F=-1,K=E.length;++FH||H>57){$=(H===46?i+E.slice(F+1):E.slice(F))+$,E=E.slice(0,F);break}}}A&&!g&&(E=t(E,1/0));var V=R.length+E.length+$.length,W=V>1)+R+E+$+W.slice(V);break;default:E=W+R+E+$;break}return a(E)}return k.toString=function(){return f+""},k}function s(f,d){var v=Math.max(-8,Math.min(8,Math.floor(Hr(d)/3)))*3,p=Math.pow(10,-v),m=c((f=$n(f),f.type="f",f),{suffix:pf[8+v/3]});return function(y){return m(p*y)}}return{format:c,formatPrefix:s}}var pi,fl,Ep;vP({thousands:",",grouping:[3],currency:["$",""]});function vP(e){return pi=dP(e),fl=pi.format,Ep=pi.formatPrefix,pi}function hP(e){return Math.max(0,-Hr(Math.abs(e)))}function pP(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Hr(t)/3)))*3-Hr(Math.abs(e)))}function mP(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Hr(t)-Hr(e))+1}function Ip(e,t,r,n){var i=ou(e,t,r),a;switch(n=$n(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=pP(i,o))&&(n.precision=a),Ep(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=mP(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=hP(i))&&(n.precision=a-(n.type==="%")*2);break}}return fl(n)}function Jt(e){var t=e.domain;return e.ticks=function(r){var n=t();return iu(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return Ip(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],u=n[a],l,c,s=10;for(u0;){if(c=au(o,u,r),c===l)return n[i]=o,n[a]=u,t(n);if(c>0)o=Math.floor(o/c)*c,u=Math.ceil(u/c)*c;else if(c<0)o=Math.ceil(o*c)/c,u=Math.floor(u*c)/c;else break;l=c}return e},e}function _p(){var e=cl();return e.copy=function(){return Gn(e,_p())},et.apply(e,arguments),Jt(e)}function Cp(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Qi),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Cp(e).unknown(t)},e=arguments.length?Array.from(e,Qi):[0,1],Jt(r)}function kp(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function wP(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function gf(e){return(t,r)=>-e(-t,r)}function dl(e){const t=e(mf,yf),r=t.domain;let n=10,i,a;function o(){return i=wP(n),a=xP(n),r()[0]<0?(i=gf(i),a=gf(a),e(yP,gP)):e(mf,yf),t}return t.base=function(u){return arguments.length?(n=+u,o()):n},t.domain=function(u){return arguments.length?(r(u),o()):r()},t.ticks=u=>{const l=r();let c=l[0],s=l[l.length-1];const f=s0){for(;d<=v;++d)for(p=1;ps)break;g.push(m)}}else for(;d<=v;++d)for(p=n-1;p>=1;--p)if(m=d>0?p/a(-d):p*a(d),!(ms)break;g.push(m)}g.length*2{if(u==null&&(u=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=$n(l)).precision==null&&(l.trim=!0),l=fl(l)),u===1/0)return l;const c=Math.max(1,n*u/t.ticks().length);return s=>{let f=s/a(Math.round(i(s)));return f*nr(kp(r(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function Tp(){const e=dl(Fa()).domain([1,10]);return e.copy=()=>Gn(e,Tp()).base(e.base()),et.apply(e,arguments),e}function bf(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function xf(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function vl(e){var t=1,r=e(bf(t),xf(t));return r.constant=function(n){return arguments.length?e(bf(t=+n),xf(t)):t},Jt(r)}function Mp(){var e=vl(Fa());return e.copy=function(){return Gn(e,Mp()).constant(e.constant())},et.apply(e,arguments)}function wf(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function AP(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function OP(e){return e<0?-e*e:e*e}function hl(e){var t=e($e,$e),r=1;function n(){return r===1?e($e,$e):r===.5?e(AP,OP):e(wf(r),wf(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Jt(t)}function pl(){var e=hl(Fa());return e.copy=function(){return Gn(e,pl()).exponent(e.exponent())},et.apply(e,arguments),e}function PP(){return pl.apply(null,arguments).exponent(.5)}function Af(e){return Math.sign(e)*e*e}function SP(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function jp(){var e=cl(),t=[0,1],r=!1,n;function i(a){var o=SP(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(Af(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,Qi)).map(Af)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return jp(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},et.apply(i,arguments),Jt(i)}function Dp(){var e=[],t=[],r=[],n;function i(){var o=0,u=Math.max(1,t.length);for(r=new Array(u-1);++o0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[c-1],n[c]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return $p().domain([e,t]).range(i).unknown(a)},et.apply(Jt(o),arguments)}function Np(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[qn(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Np().domain(e).range(t).unknown(r)},et.apply(i,arguments)}const go=new Date,bo=new Date;function ye(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),u=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,u)=>{const l=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a0))return l;let c;do l.push(c=new Date(+a)),t(a,u),e(a);while(cye(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!a(o););else for(;--u>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(go.setTime(+a),bo.setTime(+o),e(go),e(bo),Math.floor(r(go,bo))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const ta=ye(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ta.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ye(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):ta);ta.range;const _t=1e3,Xe=_t*60,Ct=Xe*60,jt=Ct*24,ml=jt*7,Of=jt*30,xo=jt*365,dr=ye(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*_t)},(e,t)=>(t-e)/_t,e=>e.getUTCSeconds());dr.range;const yl=ye(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*_t)},(e,t)=>{e.setTime(+e+t*Xe)},(e,t)=>(t-e)/Xe,e=>e.getMinutes());yl.range;const gl=ye(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Xe)},(e,t)=>(t-e)/Xe,e=>e.getUTCMinutes());gl.range;const bl=ye(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*_t-e.getMinutes()*Xe)},(e,t)=>{e.setTime(+e+t*Ct)},(e,t)=>(t-e)/Ct,e=>e.getHours());bl.range;const xl=ye(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ct)},(e,t)=>(t-e)/Ct,e=>e.getUTCHours());xl.range;const Zn=ye(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Xe)/jt,e=>e.getDate()-1);Zn.range;const Wa=ye(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/jt,e=>e.getUTCDate()-1);Wa.range;const Rp=ye(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/jt,e=>Math.floor(e/jt));Rp.range;function Sr(e){return ye(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Xe)/ml)}const Ua=Sr(0),ra=Sr(1),EP=Sr(2),IP=Sr(3),Yr=Sr(4),_P=Sr(5),CP=Sr(6);Ua.range;ra.range;EP.range;IP.range;Yr.range;_P.range;CP.range;function Er(e){return ye(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/ml)}const Ka=Er(0),na=Er(1),kP=Er(2),TP=Er(3),Vr=Er(4),MP=Er(5),jP=Er(6);Ka.range;na.range;kP.range;TP.range;Vr.range;MP.range;jP.range;const wl=ye(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());wl.range;const Al=ye(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Al.range;const Dt=ye(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Dt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ye(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Dt.range;const $t=ye(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());$t.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ye(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});$t.range;function Lp(e,t,r,n,i,a){const o=[[dr,1,_t],[dr,5,5*_t],[dr,15,15*_t],[dr,30,30*_t],[a,1,Xe],[a,5,5*Xe],[a,15,15*Xe],[a,30,30*Xe],[i,1,Ct],[i,3,3*Ct],[i,6,6*Ct],[i,12,12*Ct],[n,1,jt],[n,2,2*jt],[r,1,ml],[t,1,Of],[t,3,3*Of],[e,1,xo]];function u(c,s,f){const d=sy).right(o,d);if(v===o.length)return e.every(ou(c/xo,s/xo,f));if(v===0)return ta.every(Math.max(ou(c,s,f),1));const[p,m]=o[d/o[v-1][2]53)return null;"w"in C||(C.w=1),"Z"in C?(Q=Ao(vn(C.y,0,1)),B=Q.getUTCDay(),Q=B>4||B===0?na.ceil(Q):na(Q),Q=Wa.offset(Q,(C.V-1)*7),C.y=Q.getUTCFullYear(),C.m=Q.getUTCMonth(),C.d=Q.getUTCDate()+(C.w+6)%7):(Q=wo(vn(C.y,0,1)),B=Q.getDay(),Q=B>4||B===0?ra.ceil(Q):ra(Q),Q=Zn.offset(Q,(C.V-1)*7),C.y=Q.getFullYear(),C.m=Q.getMonth(),C.d=Q.getDate()+(C.w+6)%7)}else("W"in C||"U"in C)&&("w"in C||(C.w="u"in C?C.u%7:"W"in C?1:0),B="Z"in C?Ao(vn(C.y,0,1)).getUTCDay():wo(vn(C.y,0,1)).getDay(),C.m=0,C.d="W"in C?(C.w+6)%7+C.W*7-(B+5)%7:C.w+C.U*7-(B+6)%7);return"Z"in C?(C.H+=C.Z/100|0,C.M+=C.Z%100,Ao(C)):wo(C)}}function I(M,U,z,C){for(var Ce=0,Q=U.length,B=z.length,ze,tr;Ce=B)return-1;if(ze=U.charCodeAt(Ce++),ze===37){if(ze=U.charAt(Ce++),tr=O[ze in Pf?U.charAt(Ce++):ze],!tr||(C=tr(M,z,C))<0)return-1}else if(ze!=z.charCodeAt(C++))return-1}return C}function _(M,U,z){var C=c.exec(U.slice(z));return C?(M.p=s.get(C[0].toLowerCase()),z+C[0].length):-1}function T(M,U,z){var C=v.exec(U.slice(z));return C?(M.w=p.get(C[0].toLowerCase()),z+C[0].length):-1}function k(M,U,z){var C=f.exec(U.slice(z));return C?(M.w=d.get(C[0].toLowerCase()),z+C[0].length):-1}function E(M,U,z){var C=g.exec(U.slice(z));return C?(M.m=x.get(C[0].toLowerCase()),z+C[0].length):-1}function R(M,U,z){var C=m.exec(U.slice(z));return C?(M.m=y.get(C[0].toLowerCase()),z+C[0].length):-1}function $(M,U,z){return I(M,t,U,z)}function F(M,U,z){return I(M,r,U,z)}function K(M,U,z){return I(M,n,U,z)}function H(M){return o[M.getDay()]}function L(M){return a[M.getDay()]}function V(M){return l[M.getMonth()]}function W(M){return u[M.getMonth()]}function fe(M){return i[+(M.getHours()>=12)]}function de(M){return 1+~~(M.getMonth()/3)}function oe(M){return o[M.getUTCDay()]}function De(M){return a[M.getUTCDay()]}function Be(M){return l[M.getUTCMonth()]}function rt(M){return u[M.getUTCMonth()]}function nt(M){return i[+(M.getUTCHours()>=12)]}function un(M){return 1+~~(M.getUTCMonth()/3)}return{format:function(M){var U=b(M+="",A);return U.toString=function(){return M},U},parse:function(M){var U=S(M+="",!1);return U.toString=function(){return M},U},utcFormat:function(M){var U=b(M+="",w);return U.toString=function(){return M},U},utcParse:function(M){var U=S(M+="",!0);return U.toString=function(){return M},U}}}var Pf={"-":"",_:" ",0:"0"},Oe=/^\s*\d+/,BP=/^%/,zP=/[\\^$*+?|[\]().{}]/g;function X(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function WP(e,t,r){var n=Oe.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function UP(e,t,r){var n=Oe.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function KP(e,t,r){var n=Oe.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function HP(e,t,r){var n=Oe.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function YP(e,t,r){var n=Oe.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Sf(e,t,r){var n=Oe.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Ef(e,t,r){var n=Oe.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function VP(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function qP(e,t,r){var n=Oe.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function XP(e,t,r){var n=Oe.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function If(e,t,r){var n=Oe.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function GP(e,t,r){var n=Oe.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function _f(e,t,r){var n=Oe.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function ZP(e,t,r){var n=Oe.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function QP(e,t,r){var n=Oe.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function JP(e,t,r){var n=Oe.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function eS(e,t,r){var n=Oe.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function tS(e,t,r){var n=BP.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function rS(e,t,r){var n=Oe.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function nS(e,t,r){var n=Oe.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function Cf(e,t){return X(e.getDate(),t,2)}function iS(e,t){return X(e.getHours(),t,2)}function aS(e,t){return X(e.getHours()%12||12,t,2)}function oS(e,t){return X(1+Zn.count(Dt(e),e),t,3)}function Bp(e,t){return X(e.getMilliseconds(),t,3)}function uS(e,t){return Bp(e,t)+"000"}function lS(e,t){return X(e.getMonth()+1,t,2)}function cS(e,t){return X(e.getMinutes(),t,2)}function sS(e,t){return X(e.getSeconds(),t,2)}function fS(e){var t=e.getDay();return t===0?7:t}function dS(e,t){return X(Ua.count(Dt(e)-1,e),t,2)}function zp(e){var t=e.getDay();return t>=4||t===0?Yr(e):Yr.ceil(e)}function vS(e,t){return e=zp(e),X(Yr.count(Dt(e),e)+(Dt(e).getDay()===4),t,2)}function hS(e){return e.getDay()}function pS(e,t){return X(ra.count(Dt(e)-1,e),t,2)}function mS(e,t){return X(e.getFullYear()%100,t,2)}function yS(e,t){return e=zp(e),X(e.getFullYear()%100,t,2)}function gS(e,t){return X(e.getFullYear()%1e4,t,4)}function bS(e,t){var r=e.getDay();return e=r>=4||r===0?Yr(e):Yr.ceil(e),X(e.getFullYear()%1e4,t,4)}function xS(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+X(t/60|0,"0",2)+X(t%60,"0",2)}function kf(e,t){return X(e.getUTCDate(),t,2)}function wS(e,t){return X(e.getUTCHours(),t,2)}function AS(e,t){return X(e.getUTCHours()%12||12,t,2)}function OS(e,t){return X(1+Wa.count($t(e),e),t,3)}function Fp(e,t){return X(e.getUTCMilliseconds(),t,3)}function PS(e,t){return Fp(e,t)+"000"}function SS(e,t){return X(e.getUTCMonth()+1,t,2)}function ES(e,t){return X(e.getUTCMinutes(),t,2)}function IS(e,t){return X(e.getUTCSeconds(),t,2)}function _S(e){var t=e.getUTCDay();return t===0?7:t}function CS(e,t){return X(Ka.count($t(e)-1,e),t,2)}function Wp(e){var t=e.getUTCDay();return t>=4||t===0?Vr(e):Vr.ceil(e)}function kS(e,t){return e=Wp(e),X(Vr.count($t(e),e)+($t(e).getUTCDay()===4),t,2)}function TS(e){return e.getUTCDay()}function MS(e,t){return X(na.count($t(e)-1,e),t,2)}function jS(e,t){return X(e.getUTCFullYear()%100,t,2)}function DS(e,t){return e=Wp(e),X(e.getUTCFullYear()%100,t,2)}function $S(e,t){return X(e.getUTCFullYear()%1e4,t,4)}function NS(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Vr(e):Vr.ceil(e),X(e.getUTCFullYear()%1e4,t,4)}function RS(){return"+0000"}function Tf(){return"%"}function Mf(e){return+e}function jf(e){return Math.floor(+e/1e3)}var Mr,Up,Kp;LS({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function LS(e){return Mr=LP(e),Up=Mr.format,Mr.parse,Kp=Mr.utcFormat,Mr.utcParse,Mr}function BS(e){return new Date(e)}function zS(e){return e instanceof Date?+e:+new Date(+e)}function Ol(e,t,r,n,i,a,o,u,l,c){var s=cl(),f=s.invert,d=s.domain,v=c(".%L"),p=c(":%S"),m=c("%I:%M"),y=c("%I %p"),g=c("%a %d"),x=c("%b %d"),A=c("%B"),w=c("%Y");function O(b){return(l(b)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>_O(e,a/n))},r.copy=function(){return qp(t).domain(e)},Bt.apply(r,arguments)}function Ya(){var e=0,t=.5,r=1,n=1,i,a,o,u,l,c=$e,s,f=!1,d;function v(m){return isNaN(m=+m)?d:(m=.5+((m=+s(m))-a)*(n*m{if(e!=null){var n=e.scale,i=e.type;if(n==="auto")return i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof n=="string")return VS(n)?n:"point"}};function qS(e,t){for(var r=0,n=e.length,i=e[0]t)?r=a+1:n=a}return r}function em(e,t){if(e){var r=t??e.domain(),n=r.map(a=>{var o;return(o=e(a))!==null&&o!==void 0?o:0}),i=e.range();if(!(r.length===0||i.length<2))return a=>{var o,u,l=qS(n,a);if(l<=0)return r[0];if(l>=r.length)return r[r.length-1];var c=(o=n[l-1])!==null&&o!==void 0?o:0,s=(u=n[l])!==null&&u!==void 0?u:0;return Math.abs(a-c)<=Math.abs(a-s)?r[l-1]:r[l]}}}function XS(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):em(e,void 0)}function $f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ia(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);re.cartesianAxis.xAxis[t],zt=(e,t)=>{var r=rm(e,t);return r??pe},nm={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:fu,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:Fn},nE=(e,t)=>e.cartesianAxis.yAxis[t],Ft=(e,t)=>{var r=nE(e,t);return r??nm},iE={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},Il=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??iE},je=(e,t,r)=>{switch(t){case"xAxis":return zt(e,r);case"yAxis":return Ft(e,r);case"zAxis":return Il(e,r);case"angleAxis":return Qu(e,r);case"radiusAxis":return Ju(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},aE=(e,t,r)=>{switch(t){case"xAxis":return zt(e,r);case"yAxis":return Ft(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},Qn=(e,t,r)=>{switch(t){case"xAxis":return zt(e,r);case"yAxis":return Ft(e,r);case"angleAxis":return Qu(e,r);case"radiusAxis":return Ju(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},im=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function am(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var Va=e=>e.graphicalItems.cartesianItems,oE=P([we,La],am),om=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),en=P([Va,je,oE],om,{memoizeOptions:{resultEqualityCheck:za}}),um=P([en],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Ba)),lm=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),uE=P([en],lm),cm=e=>e.map(t=>t.data).filter(Boolean).flat(1),lE=P([en],e=>e.some(t=>!t.data)),sm=P([en],cm,{memoizeOptions:{resultEqualityCheck:za}}),fm=(e,t)=>{var r=t.chartData,n=r===void 0?[]:r,i=t.dataStartIndex,a=t.dataEndIndex;return e.length>0?e:n.slice(i,a+1)},_l=P([sm,Yn],fm),cE=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:se(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(i=>({value:se(i,n)}))):e.map(n=>({value:n})),dm=(e,t,r,n,i,a)=>{var o=n.chartData,u=o===void 0?[]:o,l=n.dataStartIndex,c=n.dataEndIndex,s=cE(e,t,r);if(i&&(t==null?void 0:t.dataKey)!=null&&a.length>0){var f=u.slice(l,c+1),d=f.map(v=>({value:se(v,t.dataKey)})).filter(v=>v.value!=null);return[...d,...s]}return s},Jn=P([_l,je,en,Yn,lE,sm],dm);function Wr(e){if(Ot(e)||e instanceof Date){var t=Number(e);if(G(t))return t}}function Rf(e){if(Array.isArray(e)){var t=[Wr(e[0]),Wr(e[1])];return bt(t)?t:void 0}var r=Wr(e);if(r!=null)return[r,r]}function lt(e){return e.map(Wr).filter(mt)}function sE(e,t){var r=Wr(e),n=Wr(t);return r==null&&n==null?0:r==null?-1:n==null?1:r-n}var fE=P([Jn],e=>e==null?void 0:e.map(t=>t.value).sort(sE));function vm(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function dE(e,t,r){if(!r)return[];if(!r.length)return[];var n;if(typeof t=="number"&&!At(t))n=t;else if(Array.isArray(t)){var i=lt(t);i.length>0&&(n=Math.max(...i))}return n==null?[]:lt(r.flatMap(a=>{var o=se(e,a.dataKey),u,l;if(Array.isArray(o)){var c=tm(o,2);u=c[0],l=c[1]}else u=l=o;if(!(!G(u)||!G(l)))return[n-u,n+l]}))}var ge=e=>{var t=Ae(e),r=Qr(e);return Qn(e,t,r)},qr=P([ge],e=>e==null?void 0:e.dataKey),vE=P([um,Yn,ge],gp),hm=(e,t,r,n)=>{var i={},a=t.reduce((o,u)=>{if(u.stackId==null)return o;var l=o[u.stackId];return l==null&&(l=[]),l.push(u),o[u.stackId]=l,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var u=tm(o,2),l=u[0],c=u[1],s=n?[...c].reverse():c,f=s.map(tl);return[l,{stackedData:Lx(e,f,r),graphicalItems:s}]}))},du=P([vE,um,$a,fp],hm),pm=(e,t,r,n)=>{var i=t.dataStartIndex,a=t.dataEndIndex;if(n==null&&r!=="zAxis")return Ux(e,i,a)},hE=P([je],e=>e.allowDataOverflow),Cl=e=>{var t;if(e==null||!("domain"in e))return fu;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=lt(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:fu},mm=P([je],Cl),ym=P([mm,hE],Qh),pE=P([du,ct,we,ym],pm,{memoizeOptions:{resultEqualityCheck:Vn}}),kl=e=>e.errorBars,mE=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>vm(r,n)),aa=function(){for(var t=arguments.length,r=new Array(t),n=0;n5&&arguments[5]!==void 0?arguments[5]:[],u,l;if(n.length>0&&n.forEach(c=>{var s,f=c.data!=null?[...c.data]:o,d=(s=i[c.id])===null||s===void 0?void 0:s.filter(v=>vm(a,v));f.forEach(v=>{var p,m=se(v,(p=r.dataKey)!==null&&p!==void 0?p:c.dataKey),y=dE(v,m,d);if(y.length>=2){var g=Math.min(...y),x=Math.max(...y);(u==null||gl)&&(l=x)}var A=Rf(m);A!=null&&(u=u==null?A[0]:Math.min(u,A[0]),l=l==null?A[1]:Math.max(l,A[1]))})}),(r==null?void 0:r.dataKey)!=null&&n.length===0&&t.forEach(c=>{var s=Rf(se(c,r.dataKey));s!=null&&(u=u==null?s[0]:Math.min(u,s[0]),l=l==null?s[1]:Math.max(l,s[1]))}),G(u)&&G(l))return[u,l]},yE=P([_l,je,uE,kl,we,Y1],gm,{memoizeOptions:{resultEqualityCheck:Vn}});function gE(e){var t=e.value;if(Ot(t)||t instanceof Date)return t}var bE=(e,t,r)=>{var n=e.map(gE).filter(i=>i!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&fv(n))?Zh(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},bm=e=>e.referenceElements.dots,tn=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),xE=P([bm,we,La],tn),xm=e=>e.referenceElements.areas,wE=P([xm,we,La],tn),wm=e=>e.referenceElements.lines,AE=P([wm,we,La],tn),Am=(e,t)=>{if(e!=null){var r=lt(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},OE=P(xE,we,Am),Om=(e,t)=>{if(e!=null){var r=lt(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},PE=P([wE,we],Om);function SE(e){var t;if(e.x!=null)return lt([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:lt(r)}function EE(e){var t;if(e.y!=null)return lt([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:lt(r)}var Pm=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?SE(n):EE(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},IE=P([AE,we],Pm),_E=P(OE,IE,PE,(e,t,r)=>aa(e,r,t)),Sm=(e,t,r,n,i,a,o,u,l)=>{if(r!=null)return r;var c=o==="vertical"&&u==="xAxis"||o==="horizontal"&&u==="yAxis",s=c?aa(n,a,i):aa(a,i),f=Q1(t,s,e.allowDataOverflow);return f??(e.allowDataOverflow&&s==null&&l!=null?l:f)},CE=e=>{if(!(e==null||e.type!=="number"||!("ticks"in e)||e.ticks==null)){var t=lt(e.ticks);if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},kE=P([je],CE,{memoizeOptions:{resultEqualityCheck:Vn}}),TE=P([je,mm,ym,pE,yE,_E,Z,we,kE],Sm,{memoizeOptions:{resultEqualityCheck:Vn}}),ME=[0,1],Em=(e,t,r,n,i,a,o)=>{if(!((e==null||r==null||r.length===0)&&o===void 0)){var u=e.dataKey,l=e.type,c=Nt(t,a);if(c&&u==null){var s;return Zh(0,(s=r==null?void 0:r.length)!==null&&s!==void 0?s:0)}return l==="category"?bE(n,e,c):i==="expand"&&!c?ME:o}},Tl=P([je,Z,_l,Jn,$a,we,TE],Em),rn=P([je,im,qu],Jp),Im=(e,t,r)=>{var n=t.niceTicks;if(n!=="none"){var i=Cl(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((n==="snap125"||n==="adaptive")&&t!=null&&t.tickCount&&bt(e)){if(a)return Hs(e,t.tickCount,t.allowDecimals,n);if(t.type==="number")return Ys(e,t.tickCount,t.allowDecimals,n)}if(n==="auto"&&r==="linear"&&t!=null&&t.tickCount){if(a&&bt(e))return Hs(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&bt(e))return Ys(e,t.tickCount,t.allowDecimals,"adaptive")}}},Ml=P([Tl,Qn,rn],Im),_m=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&bt(t)&&Array.isArray(r)&&r.length>0){var i,a,o=t[0],u=(i=r[0])!==null&&i!==void 0?i:0,l=t[1],c=(a=r[r.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,u),Math.max(l,c)]}return t},jE=P([je,Tl,Ml,we],_m),DE=P(Jn,je,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(lt(e.map(f=>f.value))).sort((f,d)=>f-d),i=n[0],a=n[n.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var u=0;ui,(e,t,r,n,i)=>{if(!G(e))return 0;var a=t==="vertical"?n.height:n.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=ut(r,e*a),u=e*a/2;return u-o-(u-o)/a*o}return 0}),$E=(e,t,r)=>{var n=zt(e,t);return n==null||typeof n.padding!="string"?0:Cm(e,"xAxis",t,r,n.padding)},NE=(e,t,r)=>{var n=Ft(e,t);return n==null||typeof n.padding!="string"?0:Cm(e,"yAxis",t,r,n.padding)},RE=P(zt,$E,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var i=e.padding;return typeof i=="string"?{left:t,right:t}:{left:((r=i.left)!==null&&r!==void 0?r:0)+t,right:((n=i.right)!==null&&n!==void 0?n:0)+t}}),LE=P(Ft,NE,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var i=e.padding;return typeof i=="string"?{top:t,bottom:t}:{top:((r=i.top)!==null&&r!==void 0?r:0)+t,bottom:((n=i.bottom)!==null&&n!==void 0?n:0)+t}}),km=P([xe,RE,ja,Ma,(e,t,r)=>r],(e,t,r,n,i)=>{var a=n.padding;return i?[a.left,r.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),Tm=P([xe,Z,LE,ja,Ma,(e,t,r)=>r],(e,t,r,n,i,a)=>{var o=i.padding;return a?[n.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),ei=(e,t,r,n)=>{var i;switch(t){case"xAxis":return km(e,r,n);case"yAxis":return Tm(e,r,n);case"zAxis":return(i=Il(e,r))===null||i===void 0?void 0:i.range;case"angleAxis":return pp(e);case"radiusAxis":return mp(e,r);default:return}},Mm=P([je,ei],Na),BE=P([rn,jE],mO),jl=P([je,rn,BE,Mm],El),jm=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var i=r.type,a=r.scale,o=Nt(e,n);if(o&&(i==="number"||a!=="auto"))return t.map(u=>u.value)}},Dl=P([Z,Jn,Qn,we],jm),qa=P([jl],rl);P([jl],XS);P([jl,fE],em);P([en,kl,we],mE);function Dm(e,t){return e.idt.id?1:0}var Xa=(e,t)=>t,Ga=(e,t,r)=>r,zE=P(ka,Xa,Ga,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(Dm)),FE=P(Ta,Xa,Ga,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(Dm)),$m=(e,t)=>{var r=typeof t.height=="number"?t.height:Fu;return{width:e.width,height:r}},WE=(e,t)=>{var r=typeof t.width=="number"?t.width:Fn;return{width:r,height:e.height}},Nm=P(xe,zt,$m),UE=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},KE=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},HE=P(Lt,xe,zE,Xa,Ga,(e,t,r,n,i)=>{var a={},o;return r.forEach(u=>{var l=$m(t,u);o==null&&(o=UE(t,n,e));var c=n==="top"&&!i||n==="bottom"&&i;a[u.id]=o-Number(c)*l.height,o+=(c?-1:1)*l.height}),a}),YE=P(Rt,xe,FE,Xa,Ga,(e,t,r,n,i)=>{var a={},o;return r.forEach(u=>{var l=WE(t,u);o==null&&(o=KE(t,n,e));var c=n==="left"&&!i||n==="right"&&i;a[u.id]=o-Number(c)*l.width,o+=(c?-1:1)*l.width}),a}),VE=(e,t)=>{var r=zt(e,t);if(r!=null)return HE(e,r.orientation,r.mirror)},qE=P([xe,zt,VE,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),XE=(e,t)=>{var r=Ft(e,t);if(r!=null)return YE(e,r.orientation,r.mirror)};P([xe,Ft,XE,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}});var GE=P(xe,Ft,(e,t)=>{var r=typeof t.width=="number"?t.width:Fn;return{width:r,height:e.height}}),Lf=(e,t,r)=>{switch(t){case"xAxis":return Nm(e,r).width;case"yAxis":return GE(e,r).height;default:return}},Rm=(e,t,r,n)=>{if(r!=null){var i=r.allowDuplicatedCategory,a=r.type,o=r.dataKey,u=Nt(e,n),l=t.map(s=>s.value),c=l.filter(s=>s!=null);if(o&&u&&a==="category"&&i&&fv(c))return l}},$l=P([Z,Jn,je,we],Rm);P([Z,aE,rn,qa,$l,Dl,ei,Ml,we],(e,t,r,n,i,a,o,u,l)=>{if(t!=null){var c=Nt(e,l);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:l,categoricalDomain:a,duplicateDomain:i,isCategorical:c,niceTicks:u,range:o,realScaleType:r,scale:n}}});var ZE=(e,t,r,n,i,a,o,u,l)=>{if(!(t==null||n==null)){var c=Nt(e,l),s=t.type,f=t.ticks,d=t.tickCount,v=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,p=s==="category"&&n.bandwidth?n.bandwidth()/v:0;p=l==="angleAxis"&&a!=null&&a.length>=2?We(a[0]-a[1])*2*p:p;var m=f||i;return m?m.map((y,g)=>{var x=o?o.indexOf(y):y,A=n.map(x);return G(A)?{index:g,coordinate:A+p,value:y,offset:p}:null}).filter(mt):c&&u?u.map((y,g)=>{var x=n.map(y);return G(x)?{coordinate:x+p,value:y,index:g,offset:p}:null}).filter(mt):n.ticks?n.ticks(d).map((y,g)=>{var x=n.map(y);return G(x)?{coordinate:x+p,value:y,index:g,offset:p}:null}).filter(mt):n.domain().map((y,g)=>{var x=n.map(y);return G(x)?{coordinate:x+p,value:o?o[y]:y,index:g,offset:p}:null}).filter(mt)}},QE=P([Z,Qn,rn,qa,Ml,ei,$l,Dl,we],ZE),JE=(e,t,r,n,i,a,o)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var u=Nt(e,o),l=t.tickCount,c=0;return c=o==="angleAxis"&&(n==null?void 0:n.length)>=2?We(n[0]-n[1])*2*c:c,u&&a?a.map((s,f)=>{var d=r.map(s);return G(d)?{coordinate:d+c,value:s,index:f,offset:c}:null}).filter(mt):r.ticks?r.ticks(l).map((s,f)=>{var d=r.map(s);return G(d)?{coordinate:d+c,value:s,index:f,offset:c}:null}).filter(mt):r.domain().map((s,f)=>{var d=r.map(s);return G(d)?{coordinate:d+c,value:i?i[s]:s,index:f,offset:c}:null}).filter(mt)}},Gt=P([Z,Qn,qa,ei,$l,Dl,we],JE),Zt=P(je,qa,(e,t)=>{if(!(e==null||t==null))return ia(ia({},e),{},{scale:t})}),eI=P([je,rn,Tl,Mm],El),tI=P([eI],rl);P((e,t,r)=>Il(e,r),tI,(e,t)=>{if(!(e==null||t==null))return ia(ia({},e),{},{scale:t})});var rI=P([Z,ka,Ta],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),nI=(e,t,r)=>{var n;return(n=e.renderedTicks[t])===null||n===void 0?void 0:n[r]};P([nI],e=>{if(!(!e||e.length===0))return t=>{var r,n=1/0,i=e[0];for(var a of e){var o=Math.abs(a.coordinate-t);oe.options.defaultTooltipEventType,Bm=e=>e.options.validateTooltipEventTypes;function zm(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function ti(e,t){var r=Lm(e),n=Bm(e);return zm(t,r,n)}function iI(e){return N(t=>ti(t,e))}var Fm=(e,t)=>{var r,n=Number(t);if(!(At(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},aI=e=>e.tooltip.settings,Yt={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},oI={itemInteraction:{click:Yt,hover:Yt},axisInteraction:{click:Yt,hover:Yt},keyboardInteraction:Yt,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},Wm=Me({name:"tooltip",initialState:oI,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(q(t.payload))},prepare:te()},replaceTooltipEntrySettings:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,a=qe(e).tooltipItemPayloads.indexOf(q(n));a>-1&&(e.tooltipItemPayloads[a]=q(i))},prepare:te()},removeTooltipEntrySettings:{reducer(e,t){var r=qe(e).tooltipItemPayloads.indexOf(q(t.payload));r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:te()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),tt=Wm.actions,uI=tt.addTooltipEntrySettings,lI=tt.replaceTooltipEntrySettings,cI=tt.removeTooltipEntrySettings,sI=tt.setTooltipSettingsState,Um=tt.setActiveMouseOverItemIndex,fI=tt.mouseLeaveItem,Km=tt.mouseLeaveChart,dI=tt.setActiveClickItemIndex,Hm=tt.setMouseOverAxisIndex,vI=tt.setMouseClickAxisIndex,bn=tt.setSyncInteraction,oa=tt.setKeyboardInteraction,hI=Wm.reducer;function Bf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function mi(e){for(var t=1;t{if(t==null)return Yt;var i=gI(e,t,r);if(i==null)return Yt;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(bI(i)){if(a)return mi(mi({},i),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return mi(mi({},Yt),{},{coordinate:i.coordinate})};function xI(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}function wI(e,t){var r=xI(e),n=t[0],i=t[1];if(r===void 0)return!1;var a=Math.min(n,i),o=Math.max(n,i);return r>=a&&r<=o}function AI(e,t,r){if(r==null||t==null)return!0;var n=se(e,t);return n==null||!bt(r)?!0:wI(n,r)}var An=(e,t,r,n)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!G(a))return i;var o=0,u=1/0;t.length>0&&(u=t.length-1);var l=Math.max(o,Math.min(a,u)),c=t[l];return c==null||AI(c,r,n)?String(l):null},Vm=(e,t,r,n,i,a,o)=>{if(a!=null){var u=o[0],l=u==null?void 0:u.getPosition(a);if(l!=null)return l;var c=i==null?void 0:i[Number(a)];if(c)switch(r){case"horizontal":return{x:c.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:c.coordinate}}}},qm=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(r==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(n!=null||e.keyboardInteraction.active)){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(o=>{var u;return((u=o.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},Xm=e=>e.options.tooltipPayloadSearcher,nn=e=>e.tooltip;function zf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ff(e){for(var t=1;te(t)}function Wf(e){if(typeof e=="string")return e}function CI(e){if(!(e==null||typeof e!="object")){var t="name"in e?EI(e.name):void 0,r="unit"in e?II(e.unit):void 0,n="dataKey"in e?_I(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?Wf(e.color):void 0,o="fill"in e?Wf(e.fill):void 0;return{name:t,unit:r,dataKey:n,payload:i,color:a,fill:o}}}function kI(e,t){return e??t}var Gm=(e,t,r,n,i,a,o)=>{if(!(t==null||a==null)){var u=r.chartData,l=r.computedData,c=r.dataStartIndex,s=r.dataEndIndex,f=[];return e.reduce((d,v)=>{var p,m=v.dataDefinedOnItem,y=v.settings,g=kI(m,u),x=Array.isArray(g)?Mh(g,c,s):g,A=(p=y==null?void 0:y.dataKey)!==null&&p!==void 0?p:n,w=y==null?void 0:y.nameKey,O;if(n&&Array.isArray(x)&&!Array.isArray(x[0])&&o==="axis"?O=dv(x,n,i):O=a(x,t,l,w),Array.isArray(O))O.forEach(S=>{var I,_,T=CI(S),k=T==null?void 0:T.name,E=T==null?void 0:T.dataKey,R=T==null?void 0:T.payload,$=Ff(Ff({},y),{},{name:k,unit:T==null?void 0:T.unit,color:(I=T==null?void 0:T.color)!==null&&I!==void 0?I:y==null?void 0:y.color,fill:(_=T==null?void 0:T.fill)!==null&&_!==void 0?_:y==null?void 0:y.fill});d.push(zc({tooltipEntrySettings:$,dataKey:E,payload:R,value:se(R,E),name:k==null?void 0:String(k)}))});else{var b;d.push(zc({tooltipEntrySettings:y,dataKey:A,payload:O,value:se(O,A),name:(b=se(O,w))!==null&&b!==void 0?b:y==null?void 0:y.name}))}return d},f)}},Nl=P([ge,im,qu],Jp),TI=P([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),MI=P([Ae,Qr],am),Ir=P([TI,ge,MI],om,{memoizeOptions:{resultEqualityCheck:za}}),jI=P([Ir],e=>e.filter(Ba)),Zm=P([Ir],cm,{memoizeOptions:{resultEqualityCheck:za}}),DI=P([Ir],e=>e.some(t=>!t.data)),xr=P([Zm,ct],fm),$I=P([jI,ct,ge],gp),Rl=P([xr,ge,Ir,ct,DI,Zm],dm),Qm=P([ge],Cl),NI=P([ge],e=>e.allowDataOverflow),Jm=P([Qm,NI],Qh),RI=P([Ir],e=>e.filter(Ba)),LI=P([$I,RI,$a,fp],hm),BI=P([LI,ct,Ae,Jm],pm),zI=P([Ir],lm),FI=P([xr,ge,zI,kl,Ae,V1],gm,{memoizeOptions:{resultEqualityCheck:Vn}}),WI=P([bm,Ae,Qr],tn),UI=P([WI,Ae],Am),KI=P([xm,Ae,Qr],tn),HI=P([KI,Ae],Om),YI=P([wm,Ae,Qr],tn),VI=P([YI,Ae],Pm),qI=P([UI,VI,HI],aa),XI=P([ge,Qm,Jm,BI,FI,qI,Z,Ae],Sm),Xr=P([ge,Z,xr,Rl,$a,Ae,XI],Em),GI=P([Xr,ge,Nl],Im),ZI=P([ge,Xr,GI,Ae],_m),ey=e=>{var t=Ae(e),r=Qr(e),n=!1;return ei(e,t,r,n)},ty=P([ge,ey],Na),QI=P([ge,Nl,ZI,ty],El),ry=P([QI],rl),JI=P([Z,Rl,ge,Ae],Rm),e_=P([Z,Rl,ge,Ae],jm),t_=(e,t,r,n,i,a,o,u)=>{if(t){var l=t.type,c=Nt(e,u);if(n){var s=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,f=l==="category"&&n.bandwidth?n.bandwidth()/s:0;return f=u==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?We(i[0]-i[1])*2*f:f,c&&o?o.map((d,v)=>{var p=n.map(d);return G(p)?{coordinate:p+f,value:d,index:v,offset:f}:null}).filter(mt):n.domain().map((d,v)=>{var p=n.map(d);return G(p)?{coordinate:p+f,value:a?a[d]:d,index:v,offset:f}:null}).filter(mt)}}},Wt=P([Z,ge,Nl,ry,ey,JI,e_,Ae],t_),Ll=P([Lm,Bm,aI],(e,t,r)=>zm(r.shared,e,t)),ny=e=>e.tooltip.settings.trigger,Bl=e=>e.tooltip.settings.defaultIndex,ri=P([nn,Ll,ny,Bl],Ym),wr=P([ri,xr,qr,Xr],An),iy=P([Wt,wr],Fm),ay=P([ri],e=>{if(e)return e.dataKey}),r_=P([ri],e=>{if(e)return e.graphicalItemId}),oy=P([nn,Ll,ny,Bl],qm),n_=P([Rt,Lt,Z,xe,Wt,Bl,oy],Vm),i_=P([ri,n_],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),a_=P([ri],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),o_=P([oy,wr,ct,qr,iy,Xm,Ll],Gm),u_=P([o_],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function Uf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Kf(e){for(var t=1;tN(ge),d_=()=>{var e=f_(),t=N(Wt),r=N(ry);return Kr(!e||!r?void 0:Kf(Kf({},e),{},{scale:r}),t)};function Hf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function jr(e){for(var t=1;t{var i=t.find(a=>a&&a.index===r);if(i){if(e==="horizontal")return{x:i.coordinate,y:n.relativeY};if(e==="vertical")return{x:n.relativeX,y:i.coordinate}}return{x:0,y:0}},y_=(e,t,r,n)=>{var i=t.find(c=>c&&c.index===r);if(i){if(e==="centric"){var a=i.coordinate,o=n.radius;return jr(jr(jr({},n),Ie(n.cx,n.cy,o,a)),{},{angle:a,radius:o})}var u=i.coordinate,l=n.angle;return jr(jr(jr({},n),Ie(n.cx,n.cy,u,l)),{},{angle:l,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function g_(e,t){var r=e.relativeX,n=e.relativeY;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var uy=(e,t,r,n,i)=>{var a,o=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(o<=1||e==null)return 0;if(n==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var u=i[1]-i[0],l=(F,K,H)=>[e,e+u,e-u].some(L=>(H?L>=F:L>F)&&L<=K),c=0;c0?(s=r[c-1])===null||s===void 0?void 0:s.coordinate:(f=r[o-1])===null||f===void 0?void 0:f.coordinate,y=(d=r[c])===null||d===void 0?void 0:d.coordinate,g=c>=o-1?(v=r[0])===null||v===void 0?void 0:v.coordinate:(p=r[c+1])===null||p===void 0?void 0:p.coordinate,x=void 0;if(!(m==null||y==null||g==null))if(We(y-m)!==We(g-y)){var A=[];if(We(g-y)===We(i[1]-i[0])){x=g;var w=y+i[1]-i[0];A[0]=Math.min(w,(w+m)/2),A[1]=Math.max(w,(w+m)/2)}else{x=m;var O=g+i[1]-i[0];A[0]=Math.min(y,(O+y)/2),A[1]=Math.max(y,(O+y)/2)}var b=[Math.min(y,(x+y)/2),Math.max(y,(x+y)/2)];if(l(b[0],b[1],!1)||l(A[0],A[1],!0)){var S;return(S=r[c])===null||S===void 0?void 0:S.index}}else{var I=Math.min(m,g),_=Math.max(m,g);if(l((I+y)/2,(_+y)/2,!1)){var T;return(T=r[c])===null||T===void 0?void 0:T.index}}}else if(t)for(var k=0;k(E.coordinate+$.coordinate)/2||k>0&&k(E.coordinate+$.coordinate)/2&&e<=(E.coordinate+R.coordinate)/2)return E.index}}return-1},b_=()=>N(qu),zl=(e,t)=>t,ly=(e,t,r)=>r,Fl=(e,t,r,n)=>n,x_=P(Wt,e=>ga(e,t=>t.coordinate)),Wl=P([nn,zl,ly,Fl],Ym),Ul=P([Wl,xr,qr,Xr],An),w_=(e,t,r)=>{if(t!=null){var n=nn(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},cy=P([nn,zl,ly,Fl],qm),ua=P([Rt,Lt,Z,xe,Wt,Fl,cy],Vm),A_=P([Wl,ua],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),sy=P([Wt,Ul],Fm),O_=P([cy,Ul,ct,qr,sy,Xm,zl],Gm),P_=P([Wl,Ul],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),S_=(e,t,r,n,i,a,o)=>{if(!(!e||!r||!n||!i)&&g_(e,o)){var u=Kx(e,t),l=uy(u,a,i,r,n),c=m_(t,i,l,e);return{activeIndex:String(l),activeCoordinate:c}}},E_=(e,t,r,n,i,a,o)=>{if(!(!e||!n||!i||!a||!r)){var u=L1(e,r);if(u){var l=Hx(u,t),c=uy(l,o,a,n,i),s=y_(t,a,c,u);return{activeIndex:String(c),activeCoordinate:s}}}},I_=(e,t,r,n,i,a,o,u)=>{if(!(!e||!t||!n||!i||!a))return t==="horizontal"||t==="vertical"?S_(e,t,n,i,a,o,u):E_(e,t,r,n,i,a,o)},__=P(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),C_=P(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(_e)),r=Array.from(new Set(t));return r.sort((n,i)=>n-i)},{memoizeOptions:{resultEqualityCheck:pO}});function Yf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Vf(e){for(var t=1;tVf(Vf({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),j_)},$_=new Set(Object.values(_e));function N_(e){return $_.has(e)}var fy=Me({name:"zIndex",initialState:D_,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:te()},unregisterZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!N_(r)&&delete e.zIndexMap[r])},prepare:te()},registerZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload,n=r.zIndex,i=r.element,a=r.isPanorama;e.zIndexMap[n]?a?e.zIndexMap[n].panoramaElement=q(i):e.zIndexMap[n].element=q(i):e.zIndexMap[n]={consumers:0,element:a?void 0:q(i),panoramaElement:a?q(i):void 0}},prepare:te()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:te()}}}),Za=fy.actions,R_=Za.registerZIndexPortal,Oo=Za.unregisterZIndexPortal,L_=Za.registerZIndexPortalElement,B_=Za.unregisterZIndexPortalElement,z_=fy.reducer;function st(e){var t=e.zIndex,r=e.children,n=Mw(),i=n&&t!==void 0&&t!==0,a=Le(),o=h.useRef(void 0),u=h.useRef(new Set),l=ce(),c=N(f=>__(f,t,a));if(h.useLayoutEffect(()=>{if(!i){var f=u.current;f.forEach(v=>{l(Oo({zIndex:v}))}),f.clear(),o.current=void 0;return}if(u.current.has(t)||(l(R_({zIndex:t})),u.current.add(t)),c){o.current=c;var d=u.current;d.forEach(v=>{v!==t&&(l(Oo({zIndex:v})),d.delete(v))})}},[l,t,i,c]),h.useLayoutEffect(()=>{var f=u.current;return()=>{f.forEach(d=>{l(Oo({zIndex:d}))}),f.clear()}},[l]),!i)return r;var s=c??o.current;return s?av.createPortal(r,s):null}function vu(){return vu=Object.assign?Object.assign.bind():function(e){for(var t=1;th.useContext(dy),Po={exports:{}},Xf;function q_(){return Xf||(Xf=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(l,c,s){this.fn=l,this.context=c,this.once=s||!1}function a(l,c,s,f,d){if(typeof s!="function")throw new TypeError("The listener must be a function");var v=new i(s,f||l,d),p=r?r+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],v]:l._events[p].push(v):(l._events[p]=v,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var c=[],s,f;if(this._eventsCount===0)return c;for(f in s=this._events)t.call(s,f)&&c.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(s)):c},u.prototype.listeners=function(c){var s=r?r+c:c,f=this._events[s];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,v=f.length,p=new Array(v);d{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!At(r))return e[r]}},Z_={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},hy=Me({name:"options",initialState:Z_,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Q_=hy.reducer,J_=hy.actions.createEventEmitter;function eC(e){return e.tooltip.syncInteraction}var tC={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},py=Me({name:"chartData",initialState:tC,reducers:{setChartData(e,t){if(e.chartData=q(t.payload),t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var r=t.payload,n=r.startIndex,i=r.endIndex;n!=null&&(e.dataStartIndex=n),i!=null&&(e.dataEndIndex=i)}}}),Kl=py.actions,Zf=Kl.setChartData,rC=Kl.setDataStartEndIndexes;Kl.setComputedData;var nC=py.reducer,iC=["x","y"];function Qf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Dr(e){for(var t=1;tl.rootProps.className);h.useEffect(()=>{if(e==null)return Or;var l=(c,s,f)=>{if(t!==f&&e===c){if(s.payload.active===!1){r(bn({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(n==="index"){var d;if(o&&s!==null&&s!==void 0&&(d=s.payload)!==null&&d!==void 0&&d.coordinate&&s.payload.sourceViewBox){var v=s.payload.coordinate,p=v.x,m=v.y,y=lC(v,iC),g=s.payload.sourceViewBox,x=g.x,A=g.y,w=g.width,O=g.height,b=Dr(Dr({},y),{},{x:o.x+(w?(p-x)/w:0)*o.width,y:o.y+(O?(m-A)/O:0)*o.height});r(Dr(Dr({},s),{},{payload:Dr(Dr({},s.payload),{},{coordinate:b})}))}else r(s);return}if(i!=null){var S;if(typeof n=="function"){var I={activeTooltipIndex:s.payload.index==null?void 0:Number(s.payload.index),isTooltipActive:s.payload.active,activeIndex:s.payload.index==null?void 0:Number(s.payload.index),activeLabel:s.payload.label,activeDataKey:s.payload.dataKey,activeCoordinate:s.payload.coordinate},_=n(i,I);S=i[_]}else n==="value"&&(S=i.find(H=>String(H.value)===s.payload.label));var T=s.payload.coordinate;if(T==null||o==null){r(bn({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(S==null){r(bn({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:s.payload.sourceViewBox,graphicalItemId:void 0}));return}var k=T.x,E=T.y,R=Math.min(k,o.x+o.width),$=Math.min(E,o.y+o.height),F={x:a==="horizontal"?S.coordinate:R,y:a==="horizontal"?$:S.coordinate},K=bn({active:s.payload.active,coordinate:F,dataKey:s.payload.dataKey,index:String(S.index),label:s.payload.label,sourceViewBox:s.payload.sourceViewBox,graphicalItemId:s.payload.graphicalItemId});r(K)}}};return Nn.on(hu,l),()=>{Nn.off(hu,l)}},[u,r,t,e,n,i,a,o])}function fC(){var e=N(Xu),t=N(Gu),r=ce();h.useEffect(()=>{if(e==null)return Or;var n=(i,a,o)=>{t!==o&&e===i&&r(rC(a))};return Nn.on(Gf,n),()=>{Nn.off(Gf,n)}},[r,t,e])}function dC(){var e=ce();h.useEffect(()=>{e(J_())},[e]),sC(),fC()}function vC(e,t,r,n,i,a){var o=N(p=>w_(p,e,t)),u=N(r_),l=N(Gu),c=N(Xu),s=N(dp),f=N(eC),d=(f==null?void 0:f.sourceViewBox)!=null,v=Da();h.useEffect(()=>{if(!d&&c!=null&&l!=null){var p=bn({active:a,coordinate:r,dataKey:o,index:i,label:typeof n=="number"?String(n):n,sourceViewBox:v,graphicalItemId:u});Nn.emit(hu,c,p,l)}},[d,r,o,u,i,n,l,c,s,a,v])}function Jf(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ed(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{S(sI({shared:x,trigger:A,axisId:b,active:i,defaultIndex:I}))},[S,x,A,b,i,I]);var _=Da(),T=Fh(),k=iI(x),E=(t=N(z=>P_(z,k,A,I)))!==null&&t!==void 0?t:{},R=E.activeIndex,$=E.isActive,F=N(z=>O_(z,k,A,I)),K=N(z=>sy(z,k,A,I)),H=N(z=>A_(z,k,A,I)),L=F,V=V_(),W=(r=i??$)!==null&&r!==void 0?r:!1,fe=Ib([L,W]),de=yC(fe,2),oe=de[0],De=de[1],Be=k==="axis"?K:void 0;vC(k,A,H,Be,R,W);var rt=O??V;if(rt==null||_==null||k==null)return null;var nt=L??rd;W||(nt=rd),c&&nt.length&&(nt=Q0(nt.filter(z=>z.value!=null&&(z.hide!==!0||n.includeHidden)),d,AC));var un=nt.length>0,M=ed(ed({},n),{},{payload:nt,label:Be,active:W,activeIndex:R,coordinate:H,accessibilityLayer:T}),U=h.createElement(jA,{allowEscapeViewBox:a,animationDuration:o,animationEasing:u,isAnimationActive:s,active:W,coordinate:H,hasPayload:un,offset:f,position:v,reverseDirection:p,useTranslate3d:m,viewBox:_,wrapperStyle:y,lastBoundingBox:oe,innerRef:De,hasPortalFromProps:!!O},OC(l,M));return h.createElement(h.Fragment,null,av.createPortal(U,rt),W&&h.createElement(Y_,{cursor:g,tooltipEventType:k,coordinate:H,payload:nt,index:R}))}var my=e=>null;my.displayName="Cell";function SC(e,t,r){return(t=EC(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EC(e){var t=IC(e,"string");return typeof t=="symbol"?t:t+""}function IC(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class _C{constructor(t){SC(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function nd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function CC(e){for(var t=1;t{try{var r=document.getElementById(ad);r||(r=document.createElement("span"),r.setAttribute("id",ad),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,DC,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},On=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Hn.isSsr)return{width:0,height:0};if(!yy.enableCache)return od(t,r);var n=$C(t,r),i=id.get(n);if(i)return i;var a=od(t,r);return id.set(n,a),a},gy;function la(e,t){return BC(e)||LC(e,t)||RC(e,t)||NC()}function NC(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RC(e,t){if(e){if(typeof e=="string")return ud(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ud(e,t):void 0}}function ud(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=e.breakAll,n=e.style;try{var i=[];ae(t)||(r?i=t.toString().split(""):i=t.toString().split(xy));var a=i.map(u=>({word:u,width:On(u,n).width})),o=r?0:On(" ",n).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function Ay(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function ak(e){return ae(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var Oy=(e,t,r,n)=>e.reduce((i,a)=>{var o=a.word,u=a.width,l=i[i.length-1];if(l&&u!=null&&(t==null||n||l.width+u+re.reduce((t,r)=>t.width>r.width?t:r),ok="…",hd=(e,t,r,n,i,a,o,u)=>{var l=e.slice(0,t),c=wy({breakAll:r,style:n,children:l+ok});if(!c)return[!1,[]];var s=Oy(c.wordsWithComputedWidth,a,o,u),f=s.length>i||Py(s).width>Number(a);return[f,s]},uk=(e,t,r,n,i)=>{var a=e.maxLines,o=e.children,u=e.style,l=e.breakAll,c=D(a),s=String(o),f=Oy(t,n,r,i);if(!c||i)return f;var d=f.length>a||Py(f).width>Number(n);if(!d)return f;for(var v=0,p=s.length-1,m=0,y;v<=p&&m<=s.length-1;){var g=Math.floor((v+p)/2),x=g-1,A=hd(s,x,l,u,a,n,r,i),w=dd(A,2),O=w[0],b=w[1],S=hd(s,g,l,u,a,n,r,i),I=dd(S,1),_=I[0];if(!O&&!_&&(v=g+1),O&&_&&(p=g-1),!O&&_){y=b;break}m++}return y||f},pd=e=>{var t=ae(e)?[]:e.toString().split(xy);return[{words:t,width:void 0}]},lk=e=>{var t=e.width,r=e.scaleToFit,n=e.children,i=e.style,a=e.breakAll,o=e.maxLines;if((t||r)&&!Hn.isSsr){var u,l,c=wy({breakAll:a,children:n,style:i});if(c){var s=c.wordsWithComputedWidth,f=c.spaceWidth;u=s,l=f}else return pd(n);return uk({breakAll:a,children:n,maxLines:o,style:i},u,l,t,!!r)}return pd(n)},Sy="#808080",ck={angle:0,breakAll:!1,capHeight:"0.71em",fill:Sy,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Hl=h.forwardRef((e,t)=>{var r=Je(e,ck),n=r.x,i=r.y,a=r.lineHeight,o=r.capHeight,u=r.fill,l=r.scaleToFit,c=r.textAnchor,s=r.verticalAnchor,f=fd(r,QC),d=h.useMemo(()=>lk({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:l,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,l,f.style,f.width]),v=f.dx,p=f.dy,m=f.angle,y=f.className,g=f.breakAll,x=fd(f,JC);if(!Ot(n)||!Ot(i)||d.length===0)return null;var A=Number(n)+(D(v)?v:0),w=Number(i)+(D(p)?p:0);if(!G(A)||!G(w))return null;var O;switch(s){case"start":O=So("calc(".concat(o,")"));break;case"middle":O=So("calc(".concat((d.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:O=So("calc(".concat(d.length-1," * -").concat(a,")"));break}var b=[],S=d[0];if(l&&S!=null){var I=S.width,_=f.width;b.push("scale(".concat(D(_)&&D(I)?_/I:1,")"))}return m&&b.push("rotate(".concat(m,", ").concat(A,", ").concat(w,")")),b.length&&(x.transform=b.join(" ")),h.createElement("text",pu({},Ge(x),{ref:t,x:A,y:w,className:ne("recharts-text",y),textAnchor:c,fill:u.includes("url")?Sy:u}),d.map((T,k)=>{var E=T.words.join(g?"":" ");return h.createElement("tspan",{x:A,dy:k===0?O:a,key:"".concat(E,"-").concat(k)},E)}))});Hl.displayName="Text";var sk=["labelRef"],fk=["content"];function md(e,t){if(e==null)return{};var r,n,i=dk(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n{var t=e.x,r=e.y,n=e.upperWidth,i=e.lowerWidth,a=e.width,o=e.height,u=e.children,l=h.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:i,width:a,height:o}),[t,r,n,i,a,o]);return h.createElement(Ey.Provider,{value:l},u)},Iy=()=>{var e=h.useContext(Ey),t=Da();return e||(t?Iu(t):void 0)},yk=h.createContext(null),gk=()=>{var e=h.useContext(yk),t=N(yp);return e||t},bk=e=>{var t=e.value,r=e.formatter,n=ae(e.children)?t:e.children;return typeof r=="function"?r(n):n},Yl=e=>e!=null&&typeof e=="function",xk=(e,t)=>{var r=We(t-e),n=Math.min(Math.abs(t-e),360);return r*n},wk=(e,t,r,n,i)=>{var a=e.offset,o=e.className,u=i.cx,l=i.cy,c=i.innerRadius,s=i.outerRadius,f=i.startAngle,d=i.endAngle,v=i.clockWise,p=(c+s)/2,m=xk(f,d),y=m>=0?1:-1,g,x;switch(t){case"insideStart":g=f+y*a,x=v;break;case"insideEnd":g=d-y*a,x=!v;break;case"end":g=d+y*a,x=v;break;default:throw new Error("Unsupported position ".concat(t))}x=m<=0?x:!x;var A=Ie(u,l,p,g),w=Ie(u,l,p,g+(x?1:-1)*359),O="M".concat(A.x,",").concat(A.y,` - A`).concat(p,",").concat(p,",0,1,").concat(x?0:1,`, - `).concat(w.x,",").concat(w.y),b=ae(e.id)?Sn("recharts-radial-line-"):e.id;return h.createElement("text",Et({},n,{dominantBaseline:"central",className:ne("recharts-radial-bar-label",o)}),h.createElement("defs",null,h.createElement("path",{id:b,d:O})),h.createElement("textPath",{xlinkHref:"#".concat(b)},r))},Ak=(e,t,r)=>{var n=e.cx,i=e.cy,a=e.innerRadius,o=e.outerRadius,u=e.startAngle,l=e.endAngle,c=(u+l)/2;if(r==="outside"){var s=Ie(n,i,o+t,c),f=s.x,d=s.y;return{x:f,y:d,textAnchor:f>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"end"};var v=(a+o)/2,p=Ie(n,i,v,c),m=p.x,y=p.y;return{x:m,y,textAnchor:"middle",verticalAnchor:"middle"}},Lr=e=>e!=null&&"cx"in e&&D(e.cx),Ok={angle:0,offset:5,zIndex:_e.label,position:"middle",textBreakAll:!1};function Pk(e){if(!Lr(e))return e;var t=e.cx,r=e.cy,n=e.outerRadius,i=n*2;return{x:t-n,y:r-n,width:i,upperWidth:i,lowerWidth:i,height:i}}function Ht(e){var t,r,n=Je(e,Ok),i=n.viewBox,a=n.parentViewBox,o=n.position,u=n.value,l=n.children,c=n.content,s=n.className,f=s===void 0?"":s,d=n.textBreakAll,v=n.labelRef,p=gk(),m=Iy(),y=o==="center"?m:p??m,g,x,A;i==null?g=y:Lr(i)?g=i:g=Iu(i);var w=Pk(g);if(!g||ae(u)&&ae(l)&&!h.isValidElement(c)&&typeof c!="function")return null;var O=Lr(g)&&(o==="insideStart"||o==="insideEnd"||o==="end");if(Lr(g))O||(A=Ak(g,n.offset,n.position));else if(w){var b=Zg({viewBox:w,position:o,offset:n.offset,parentViewBox:Lr(a)?void 0:a});A=lr(lr({x:b.x,y:b.y,textAnchor:b.horizontalAnchor,verticalAnchor:b.verticalAnchor},b.width!==void 0?{width:b.width}:{}),b.height!==void 0?{height:b.height}:{})}var S=lr(lr(lr(lr({},((t=A)===null||t===void 0?void 0:t.x)!==void 0?{x:A.x}:{}),((r=A)===null||r===void 0?void 0:r.y)!==void 0?{y:A.y}:{}),n),{},{viewBox:g});if(h.isValidElement(c)){S.labelRef;var I=md(S,sk);return h.cloneElement(c,I)}if(typeof c=="function"){S.content;var _=md(S,fk);if(x=h.createElement(c,_),h.isValidElement(x))return x}else x=bk(n);var T=Ge(n);return O&&Lr(g)?wk(n,o,x,T,g):A==null?null:h.createElement(st,{zIndex:n.zIndex},h.createElement(Hl,Et({ref:v,className:ne("recharts-label",f)},T,A,{textAnchor:Ay(T.textAnchor)?T.textAnchor:A.textAnchor,breakAll:d}),x))}Ht.displayName="Label";var Sk=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?h.createElement(Ht,Et({key:"label-implicit"},n)):Ot(e)?h.createElement(Ht,Et({key:"label-implicit",value:e},n)):h.isValidElement(e)?e.type===Ht?h.cloneElement(e,lr({key:"label-implicit"},n)):h.createElement(Ht,Et({key:"label-implicit",content:e},n)):Yl(e)?h.createElement(Ht,Et({key:"label-implicit",content:e},n)):e&&typeof e=="object"?h.createElement(Ht,Et({},e,{key:"label-implicit"},n)):null};function Ek(e){var t=e.label,r=e.labelRef,n=Iy();return Sk(t,n,r)||null}var Ik=["valueAccessor"],_k=["dataKey","clockWise","id","textBreakAll","zIndex"];function ca(){return ca=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(ak(t))return t},_y=h.createContext(void 0),Cy=_y.Provider,ky=h.createContext(void 0);ky.Provider;function Tk(){return h.useContext(_y)}function Mk(){return h.useContext(ky)}function Ei(e){var t=e.valueAccessor,r=t===void 0?kk:t,n=gd(e,Ik),i=n.dataKey;n.clockWise;var a=n.id,o=n.textBreakAll,u=n.zIndex,l=gd(n,_k),c=Tk(),s=Mk(),f=c||s;return!f||!f.length?null:h.createElement(st,{zIndex:u??_e.label},h.createElement(He,{className:"recharts-label-list"},f.map((d,v)=>{var p,m=ae(i)?r(d,v):se(d.payload,i),y=ae(a)?{}:{id:"".concat(a,"-").concat(v)};return h.createElement(Ht,ca({key:"label-".concat(v)},Ge(d),l,y,{fill:(p=n.fill)!==null&&p!==void 0?p:d.fill,parentViewBox:d.parentViewBox,value:m,textBreakAll:o,viewBox:d.viewBox,index:v,zIndex:0}))})))}Ei.displayName="LabelList";function Ty(e){var t=e.label;return t?t===!0?h.createElement(Ei,{key:"labelList-implicit"}):h.isValidElement(t)||Yl(t)?h.createElement(Ei,{key:"labelList-implicit",content:t}):typeof t=="object"?h.createElement(Ei,ca({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function mu(){return mu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=e.cx,r=e.cy,n=e.r,i=e.className,a=ne("recharts-dot",i);return D(t)&&D(r)&&D(n)?h.createElement("circle",mu({},wt(e),Cu(e),{className:a,cx:t,cy:r,r:n})):null},jk={radiusAxis:{},angleAxis:{}},jy=Me({name:"polarAxis",initialState:jk,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=q(t.payload)},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=q(t.payload)},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),Qa=jy.actions;Qa.addRadiusAxis;Qa.removeRadiusAxis;Qa.addAngleAxis;Qa.removeAngleAxis;var Dk=jy.reducer;function $k(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var Eo={exports:{}},J={};/** - * @license React - * react-is.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var bd;function Nk(){if(bd)return J;bd=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),s=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),d=Symbol.for("react.view_transition"),v=Symbol.for("react.client.reference");function p(m){if(typeof m=="object"&&m!==null){var y=m.$$typeof;switch(y){case e:switch(m=m.type,m){case r:case i:case n:case l:case c:case d:return m;default:switch(m=m&&m.$$typeof,m){case o:case u:case f:case s:return m;case a:return m;default:return y}}case t:return y}}}return J.ContextConsumer=a,J.ContextProvider=o,J.Element=e,J.ForwardRef=u,J.Fragment=r,J.Lazy=f,J.Memo=s,J.Portal=t,J.Profiler=i,J.StrictMode=n,J.Suspense=l,J.SuspenseList=c,J.isContextConsumer=function(m){return p(m)===a},J.isContextProvider=function(m){return p(m)===o},J.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===e},J.isForwardRef=function(m){return p(m)===u},J.isFragment=function(m){return p(m)===r},J.isLazy=function(m){return p(m)===f},J.isMemo=function(m){return p(m)===s},J.isPortal=function(m){return p(m)===t},J.isProfiler=function(m){return p(m)===i},J.isStrictMode=function(m){return p(m)===n},J.isSuspense=function(m){return p(m)===l},J.isSuspenseList=function(m){return p(m)===c},J.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===r||m===i||m===n||m===l||m===c||typeof m=="object"&&m!==null&&(m.$$typeof===f||m.$$typeof===s||m.$$typeof===o||m.$$typeof===a||m.$$typeof===u||m.$$typeof===v||m.getModuleId!==void 0)},J.typeOf=p,J}var xd;function Rk(){return xd||(xd=1,Eo.exports=Nk()),Eo.exports}var Lk=Rk(),wd=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",Ad=null,Io=null,Dy=e=>{if(e===Ad&&Array.isArray(Io))return Io;var t=[];return h.Children.forEach(e,r=>{ae(r)||(Lk.isFragment(r)?t=t.concat(Dy(r.props.children)):t.push(r))}),Io=t,Ad=e,t};function Bk(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(i=>wd(i)):n=[wd(t)],Dy(e).forEach(i=>{var a=Tt(i,"type.displayName")||Tt(i,"type.name");a&&n.indexOf(a)!==-1&&r.push(i)}),r}var $y=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function Od(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pd(e){for(var t=1;t{var n=ce();return(i,a)=>o=>{e==null||e(i,a,o),n(Um({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:r}))}},By=e=>{var t=ce();return(r,n)=>i=>{e==null||e(r,n,i),t(fI())}},zy=(e,t,r)=>{var n=ce();return(i,a)=>o=>{e==null||e(i,a,o),n(dI({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:r}))}};function Fy(e){var t=e.tooltipEntrySettings,r=ce(),n=Le(),i=h.useRef(null);return h.useLayoutEffect(()=>{n||(i.current===null?r(uI(t)):i.current!==t&&r(lI({prev:i.current,next:t})),i.current=t)},[t,r,n]),h.useLayoutEffect(()=>()=>{i.current&&(r(cI(i.current)),i.current=null)},[r]),null}function Wy(e){var t=e.legendPayload,r=ce(),n=Le(),i=h.useRef(null);return h.useLayoutEffect(()=>{n||(i.current===null?r(Dw(t)):i.current!==t&&r($w({prev:i.current,next:t})),i.current=t)},[r,n,t]),h.useLayoutEffect(()=>()=>{i.current&&(r(Nw(i.current)),i.current=null)},[r]),null}function Vk(e,t){return Zk(e)||Gk(e,t)||Xk(e,t)||qk()}function qk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xk(e,t){if(e){if(typeof e=="string")return Sd(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Sd(e,t):void 0}}function Sd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r2&&arguments[2]!==void 0?arguments[2]:[],n=[];for(var i of r)n.push({status:"removed",prev:i});for(var a=0;ae[Math.floor(a*r)]);return ql(n,t)}function Jk(e,t){var r=t.map((n,i)=>e[i]);return ql(r,t)}function eT(e,t){for(var r=new Map,n=0;n{var v=r(f,d);if(v!=null){var p=n.get(v);if(p!==void 0)return i.add(v),p}}),o=[];for(var u of n){var l=Vk(u,2),c=l[0],s=l[1];i.has(c)||o.push(s)}return ql(a,t,o)}function rT(e,t,r){return t==null?null:e==null?t.map(n=>({status:"added",next:n})):r===Vl?Qk(e,t):r===Uy?Jk(e,t):tT(e,t,r)}function nT(e,t){var r=h.useRef(e),n=h.useRef(t.current),i=h.useRef(!0);r.current!==e&&(r.current=e,n.current=t.current,i.current=!1);var a=h.useCallback(function(o,u){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(u===0){i.current=!0;return}u===1&&(n.current=o),u>0&&i.current&&l&&(t.current=o)},[t]);return{startValue:n.current,syncStepValue:a}}function iT(e,t){return lT(e)||uT(e,t)||oT(e,t)||aT()}function aT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oT(e,t){if(e){if(typeof e=="string")return Ed(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ed(e,t):void 0}}function Ed(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{typeof e=="function"&&e(),a(!0)},[e]),u=h.useCallback(()=>{typeof t=="function"&&t(),a(!1)},[t]);return{isAnimating:i,handleAnimationStart:o,handleAnimationEnd:u}}function Hy(e){var t,r=e.animationInput,n=e.animationIdPrefix,i=e.items,a=e.previousItemsRef,o=e.isAnimationActive,u=e.animationBegin,l=e.animationDuration,c=e.animationEasing,s=e.onAnimationStart,f=e.onAnimationEnd,d=e.animationInterpolateFn,v=e.animationMatchBy,p=e.shouldUpdatePreviousRef,m=e.children,y=e.layout,g=Vh(r,n),x=nT(g,a),A=(t=x.startValue)!==null&&t!==void 0?t:null,w=rT(A,i,v??Vl);return h.createElement(Yh,{animationId:g,begin:u,duration:l,isActive:o,easing:c,onAnimationEnd:f,onAnimationStart:s,key:g},O=>{var b=A==null,S=i==null?i:d(w,O,y),I=p?p(O):O>0;return x.syncStepValue(S,O,I),S==null?null:m(S,O,b)})}var _o;function cT(e,t){return vT(e)||dT(e,t)||fT(e,t)||sT()}function sT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fT(e,t){if(e){if(typeof e=="string")return Id(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Id(e,t):void 0}}function Id(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var e=h.useState(()=>Sn("uid-")),t=cT(e,1),r=t[0];return r},pT=(_o=jg.useId)!==null&&_o!==void 0?_o:hT;function mT(e,t){var r=pT();return t||(e?"".concat(e,"-").concat(r):r)}var yT=h.createContext(void 0),Yy=e=>{var t=e.id,r=e.type,n=e.children,i=mT("recharts-".concat(r),t);return h.createElement(yT.Provider,{value:i},n(i))},gT={cartesianItems:[],polarItems:[]},Vy=Me({name:"graphicalItems",initialState:gT,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(q(t.payload))},prepare:te()},replaceCartesianGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,a=qe(e).cartesianItems.indexOf(q(n));a>-1&&(e.cartesianItems[a]=q(i))},prepare:te()},removeCartesianGraphicalItem:{reducer(e,t){var r=qe(e).cartesianItems.indexOf(q(t.payload));r>-1&&e.cartesianItems.splice(r,1)},prepare:te()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(q(t.payload))},prepare:te()},removePolarGraphicalItem:{reducer(e,t){var r=qe(e).polarItems.indexOf(q(t.payload));r>-1&&e.polarItems.splice(r,1)},prepare:te()},replacePolarGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,a=qe(e).polarItems.indexOf(q(n));a>-1&&(e.polarItems[a]=q(i))},prepare:te()}}}),an=Vy.actions,bT=an.addCartesianGraphicalItem,xT=an.replaceCartesianGraphicalItem,wT=an.removeCartesianGraphicalItem;an.addPolarGraphicalItem;an.removePolarGraphicalItem;an.replacePolarGraphicalItem;var AT=Vy.reducer,OT=e=>{var t=ce(),r=h.useRef(null);return h.useLayoutEffect(()=>{r.current===null?t(bT(e)):r.current!==e&&t(xT({prev:r.current,next:e})),r.current=e},[t,e]),h.useLayoutEffect(()=>()=>{r.current&&(t(wT(r.current)),r.current=null)},[t]),null},qy=h.memo(OT),PT=["points"];function _d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Co(e){for(var t=1;t{var g,x,A=Co(Co(Co({r:3},o),d),{},{index:y,cx:(g=m.x)!==null&&g!==void 0?g:void 0,cy:(x=m.y)!==null&&x!==void 0?x:void 0,dataKey:a,value:m.value,payload:m.payload,points:t});return h.createElement(kT,{key:"dot-".concat(y),option:r,dotProps:A,className:i})}),p={};return u&&l!=null&&(p.clipPath="url(#clipPath-".concat(f?"":"dots-").concat(l,")")),h.createElement(st,{zIndex:s},h.createElement(He,sa({className:n},p),v))}function Cd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function gi(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),UT=P([WT,Rt,Lt],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),Xl=()=>N(UT),KT=()=>N(u_);function kd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ko(e){for(var t=1;t{var t=e.point,r=e.childIndex,n=e.mainColor,i=e.activeDot,a=e.dataKey,o=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var u={index:r,dataKey:a,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},l=ko(ko(ko({},u),Ln(i)),Cu(i)),c;return h.isValidElement(i)?c=h.cloneElement(i,l):typeof i=="function"?c=i(l):c=h.createElement(My,l),h.createElement(He,{className:"recharts-active-dot",clipPath:o},c)};function XT(e){var t=e.points,r=e.mainColor,n=e.activeDot,i=e.itemDataKey,a=e.clipPath,o=e.zIndex,u=o===void 0?_e.activeDot:o,l=N(wr),c=KT();if(t==null||c==null)return null;var s=t.find(f=>c.includes(f.payload));return ae(s)?null:h.createElement(st,{zIndex:u},h.createElement(qT,{point:s,childIndex:Number(l),mainColor:r,dataKey:i,activeDot:n,clipPath:a}))}function GT(e,t){return eM(e)||JT(e,t)||QT(e,t)||ZT()}function ZT(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QT(e,t){if(e){if(typeof e=="string")return Td(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Td(e,t):void 0}}function Td(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var n=r??e;if(!ae(n))return ut(n,t,0)},tM=(e,t,r)=>{var n={},i=e.filter(Ba),a=e.filter(c=>c.stackId==null),o=i.reduce((c,s)=>{var f=c[s.stackId];return f==null&&(f=[]),f.push(s),c[s.stackId]=f,c},n),u=Object.entries(o).map(c=>{var s,f=GT(c,2),d=f[0],v=f[1],p=v.map(y=>y.dataKey),m=Md(t,r,(s=v[0])===null||s===void 0?void 0:s.barSize);return{stackId:d,dataKeys:p,barSize:m}}),l=a.map(c=>{var s=[c.dataKey].filter(d=>d!=null),f=Md(t,r,c.barSize);return{stackId:void 0,dataKeys:s,barSize:f}});return[...u,...l]};function jd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function bi(e){for(var t=1;tx+(A.barSize||0),0);d+=(o-1)*u,d>=r&&(d-=(o-1)*u,u=0),d>=r&&f>0&&(s=!0,f*=.9,d=o*f);var v=Math.round((r-d)/2),p={offset:v-u,size:0};l=n.reduce((x,A)=>{var w,O={stackId:A.stackId,dataKeys:A.dataKeys,position:{offset:p.offset+p.size+u,size:s?f:(w=A.barSize)!==null&&w!==void 0?w:0}},b=[...x,O];return p=O.position,b},c)}else{var m=ut(t,r,0,!0);r-2*m-(o-1)*u<=0&&(u=0);var y=(r-2*m-(o-1)*u)/o;y>1&&(y=Math.round(y));var g=G(i)?Math.min(y,i):y;l=n.reduce((x,A,w)=>[...x,{stackId:A.stackId,dataKeys:A.dataKeys,position:{offset:m+(y+u)*w+(y-g)/2,size:g}}],c)}return l}}var oM=(e,t,r,n,i,a,o)=>{var u=ae(o)?t:o,l=aM(r,n,i!==a?i:a,e,u);return i!==a&&l!=null&&(l=l.map(c=>bi(bi({},c),{},{position:bi(bi({},c.position),{},{offset:c.position.offset-i/2})}))),l},uM=(e,t)=>{var r=tl(t);if(!(!e||r==null||t==null)){var n=t.stackId;if(n!=null){var i=e[n];if(i){var a=i.stackedData;if(a)return a.find(o=>o.key===r)}}}},lM=(e,t)=>{if(!(e==null||t==null)){var r=e.find(n=>n.stackId===t.stackId&&t.dataKey!=null&&n.dataKeys.includes(t.dataKey));if(r!=null)return r.position}};function cM(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&G(e.zIndex)?e.zIndex:t}var sM=e=>{var t=e.chartData,r=ce(),n=Le();return h.useEffect(()=>n?()=>{}:(r(Zf(t)),()=>{r(Zf(void 0))}),[t,r,n]),null},Dd={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},Zy=Me({name:"brush",initialState:Dd,reducers:{setBrushSettings(e,t){return t.payload==null?Dd:t.payload}}});Zy.actions.setBrushSettings;var fM=Zy.reducer;function dM(e){return(e%180+180)%180}var vM=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=dM(i),o=a*Math.PI/180,u=Math.atan(n/r),l=o>u&&o{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=qe(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=qe(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(q(t.payload))},removeLine:(e,t)=>{var r=qe(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),on=Qy.actions;on.addDot;on.removeDot;on.addArea;on.removeArea;on.addLine;on.removeLine;var pM=Qy.reducer;function mM(e,t){return xM(e)||bM(e,t)||gM(e,t)||yM()}function yM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gM(e,t){if(e){if(typeof e=="string")return $d(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$d(e,t):void 0}}function $d(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=h.useState("".concat(Sn("recharts"),"-clip")),n=mM(r,1),i=n[0],a=Xl();if(a==null)return null;var o=a.x,u=a.y,l=a.width,c=a.height;return h.createElement(wM.Provider,{value:i},h.createElement("defs",null,h.createElement("clipPath",{id:i},h.createElement("rect",{x:o,y:u,height:c,width:l}))),t)};function OM(){}function Nd(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}function PM(e,t,r){return xn(e,t,void 0,void 0,void 0,void 0,r)}function xn(e,t,r,n,i,a,o){const u=o(e,t,r,n,i,a);if(u!==void 0)return u;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return Pn(e,t,a,o)}return Pn(e,t,a,o)}function Pn(e,t,r,n){if(Object.is(e,t))return!0;let i=En(e),a=En(t);if(i==="[object Arguments]"&&(i=Ai),a==="[object Arguments]"&&(a=Ai),i!==a)return!1;switch(i){case Tu:return e.toString()===t.toString();case Mu:return wn(e.valueOf(),t.valueOf());case ju:case Mv:case Tv:return Object.is(e.valueOf(),t.valueOf());case Cv:return e.source===t.source&&e.flags===t.flags;case T0:return e===t}r=r??new Map;const o=r.get(e),u=r.get(t);if(o!=null&&u!=null)return o===t;r.set(e,t),r.set(t,e);try{switch(i){case jv:if(e.size!==t.size)return!1;for(const[l,c]of e.entries())if(!t.has(l)||!xn(c,t.get(l),l,e,t,r,n))return!1;return!0;case Dv:{if(e.size!==t.size)return!1;const l=Array.from(e.values()),c=Array.from(t.values());for(let s=0;sxn(f,v,void 0,e,t,r,n));if(d===-1)return!1;c.splice(d,1)}return!0}case $v:case Lv:case Bv:case zv:case Fv:case j0:case Wv:case Uv:case Kv:case D0:case Hv:case Yv:if(Fo(e)!==Fo(t)||e.length!==t.length)return!1;for(let l=0;le*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function _M(e,t){return Jy(e,t+1)}function CM(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,u=t.end,l=0,c=1,s=o,f=function(){var p=n==null?void 0:n[l];if(p===void 0)return{v:Jy(n,c)};var m=l,y,g=()=>(y===void 0&&(y=r(p,m)),y),x=p.coordinate,A=l===0||Rn(e,x,g,s,u);A||(l=0,s=o,c+=1),A&&(s=x+e*(g()/2+i),l+=c)},d;c<=a.length;)if(d=f(),d)return d.v;return[]}function kM(e,t,r,n,i){var a=(n||[]).slice(),o=a.length;if(o===0)return[];for(var u=t.start,l=t.end,c=1;c<=o;c++){for(var s=(o-1)%c,f=u,d=!0,v=function(){var w=n[m];if(w==null)return 0;var O=m,b,S=()=>(b===void 0&&(b=r(w,O)),b),I=w.coordinate,_=m===s||Rn(e,I,S,f,l);if(!_)return d=!1,1;_&&(f=I+e*(S()/2+i))},p,m=s;m(m===void 0&&(m=r(v,d)),m);if(d===o-1){var g=e*(p.coordinate+e*y()/2-l);a[d]=p=ke(ke({},p),{},{tickCoord:g>0?p.coordinate-g*e:p.coordinate})}else a[d]=p=ke(ke({},p),{},{tickCoord:p.coordinate});if(p.tickCoord!=null){var x=Rn(e,p.tickCoord,y,u,l);x&&(l=p.tickCoord-e*(y()/2+i),a[d]=ke(ke({},p),{},{isShow:!0}))}},s=o-1;s>=0;s--)c(s);return a}function $M(e,t,r,n,i,a){var o=(n||[]).slice(),u=o.length,l=t.start,c=t.end;if(a){var s=n[u-1];if(s!=null){var f=r(s,u-1),d=e*(s.coordinate+e*f/2-c);if(o[u-1]=s=ke(ke({},s),{},{tickCoord:d>0?s.coordinate-d*e:s.coordinate}),s.tickCoord!=null){var v=Rn(e,s.tickCoord,()=>f,l,c);v&&(c=s.tickCoord-e*(f/2+i),o[u-1]=ke(ke({},s),{},{isShow:!0}))}}}for(var p=a?u-1:u,m=function(x){var A=o[x];if(A==null)return 1;var w=A,O,b=()=>(O===void 0&&(O=r(A,x)),O);if(x===0){var S=e*(w.coordinate-e*b()/2-l);o[x]=w=ke(ke({},w),{},{tickCoord:S<0?w.coordinate-S*e:w.coordinate})}else o[x]=w=ke(ke({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var I=Rn(e,w.tickCoord,b,l,c);I&&(l=w.tickCoord+e*(b()/2+i),o[x]=ke(ke({},w),{},{isShow:!0}))}},y=0;y{var S=typeof c=="function"?c(O.value,b):O.value;return p==="width"?EM(On(S,{fontSize:t,letterSpacing:r}),m,f):On(S,{fontSize:t,letterSpacing:r})[p]},g=i[0],x=i[1],A=i.length>=2&&g!=null&&x!=null?We(x.coordinate-g.coordinate):1,w=IM(a,A,p);return l==="equidistantPreserveStart"?CM(A,w,y,i,o):l==="equidistantPreserveEnd"?kM(A,w,y,i,o):(l==="preserveStart"||l==="preserveStartEnd"?v=$M(A,w,y,i,o,l==="preserveStartEnd"):v=DM(A,w,y,i,o),v.filter(O=>O.isShow))}var RM=e=>{var t=e.ticks,r=e.label,n=e.labelGapWithTick,i=n,a=e.tickSize,o=a===void 0?0:a,u=e.tickMargin,l=u===void 0?0:u,c=0;if(t){Array.from(t).forEach(v=>{if(v){var p=v.getBoundingClientRect();p.width>c&&(c=p.width)}});var s=r?r.getBoundingClientRect().width:0,f=o+l,d=c+f+s+(r?i:0);return Math.round(d)}return 0},LM=e=>{var t=e.ticks,r=e.label,n=e.labelGapWithTick,i=n,a=e.tickSize,o=a===void 0?0:a,u=e.tickMargin,l=u===void 0?0:u,c=0;if(t){Array.from(t).forEach(v=>{if(v){var p=v.getBoundingClientRect();p.height>c&&(c=p.height)}});var s=r?r.getBoundingClientRect().height:0,f=o+l,d=c+f+s+(r?i:0);return Math.round(d)}return 0},BM={xAxis:{},yAxis:{}},eg=Me({name:"renderedTicks",initialState:BM,reducers:{setRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,i=r.axisId,a=r.ticks;e[n][i]=q(a)},removeRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,i=r.axisId;delete e[n][i]}}}),tg=eg.actions,zM=tg.setRenderedTicks,FM=tg.removeRenderedTicks,WM=eg.reducer,UM=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function Ld(e,t){return VM(e)||YM(e,t)||HM(e,t)||KM()}function KM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HM(e,t){if(e){if(typeof e=="string")return Bd(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Bd(e,t):void 0}}function Bd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(!(n==null||r==null)){var o=t.map(l=>({value:l.value,coordinate:l.coordinate,offset:l.offset,index:l.index})),u=a.current;u!=null&&u.axisId===n&&u.axisType===r&&SM(u.ticks,o)||(a.current={ticks:o,axisId:n,axisType:r},i(zM({ticks:o,axisId:n,axisType:r})))}},[i,t,n,r]),h.useEffect(()=>n==null||r==null?Or:()=>{i(FM({axisId:n,axisType:r}))},[i,n,r]),null}var aj=h.forwardRef((e,t)=>{var r=e.ticks,n=r===void 0?[]:r,i=e.tick,a=e.tickLine,o=e.stroke,u=e.tickFormatter,l=e.unit,c=e.padding,s=e.tickTextProps,f=e.orientation,d=e.mirror,v=e.x,p=e.y,m=e.width,y=e.height,g=e.tickSize,x=e.tickMargin,A=e.fontSize,w=e.letterSpacing,O=e.getTicksConfig,b=e.events,S=e.axisType,I=e.axisId,_=NM(le(le({},O),{},{ticks:n}),A,w),T=wt(O),k=Ln(i),E=Ay(T.textAnchor)?T.textAnchor:tj(f,d),R=rj(f,d),$={};typeof a=="object"&&($=a);var F=le(le({},T),{},{fill:"none"},$),K=_.map(V=>le({entry:V},ej(V,v,p,m,y,f,g,d,x))),H=K.map(V=>{var W=V.entry,fe=V.line;return h.createElement(He,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(W.value,"-").concat(W.coordinate,"-").concat(W.tickCoord)},a&&h.createElement("line",Ar({},F,fe,{className:ne("recharts-cartesian-axis-tick-line",Tt(a,"className"))})))}),L=K.map((V,W)=>{var fe,de,oe=V.entry,De=V.tick,Be=le(le(le(le({verticalAnchor:R},T),{},{textAnchor:E,stroke:"none",fill:o},De),{},{index:W,payload:oe,visibleTicksCount:_.length,tickFormatter:u,padding:c},s),{},{angle:(fe=(de=s==null?void 0:s.angle)!==null&&de!==void 0?de:T.angle)!==null&&fe!==void 0?fe:0}),rt=le(le({},Be),k);return h.createElement(He,Ar({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(oe.value,"-").concat(oe.coordinate,"-").concat(oe.tickCoord)},ku(b,oe,W)),i&&h.createElement(nj,{option:i,tickProps:rt,value:"".concat(typeof u=="function"?u(oe.value,W):oe.value).concat(l||"")}))});return h.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(S,"-ticks")},h.createElement(ij,{ticks:_,axisId:I,axisType:S}),L.length>0&&h.createElement(st,{zIndex:_e.label},h.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(S,"-tick-labels"),ref:t},L)),H.length>0&&h.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(S,"-tick-lines")},H))}),oj=h.forwardRef((e,t)=>{var r=e.axisLine,n=e.width,i=e.height,a=e.className,o=e.hide,u=e.ticks,l=e.axisType,c=e.axisId,s=qM(e,UM),f=h.useState(""),d=Ld(f,2),v=d[0],p=d[1],m=h.useState(""),y=Ld(m,2),g=y[0],x=y[1],A=h.useRef(null);h.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var O;return RM({ticks:A.current,label:(O=e.labelRef)===null||O===void 0?void 0:O.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})},getCalculatedHeight:()=>{var O;return LM({ticks:A.current,label:(O=e.labelRef)===null||O===void 0?void 0:O.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var w=h.useCallback(O=>{if(O){var b=O.getElementsByClassName("recharts-cartesian-axis-tick-value");A.current=b;var S=b[0];if(S){var I=window.getComputedStyle(S),_=I.fontSize,T=I.letterSpacing;(_!==v||T!==g)&&(p(_),x(T))}}},[v,g]);return o||n!=null&&n<=0||i!=null&&i<=0?null:h.createElement(st,{zIndex:e.zIndex},h.createElement(He,{className:ne("recharts-cartesian-axis",a)},h.createElement(JM,{x:e.x,y:e.y,width:n,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:wt(e)}),h.createElement(aj,{ref:w,axisType:l,events:s,fontSize:v,getTicksConfig:e,height:e.height,letterSpacing:g,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:u,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:c}),h.createElement(mk,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},h.createElement(Ek,{label:e.label,labelRef:e.labelRef}),e.children)))}),rg=h.forwardRef((e,t)=>{var r=Je(e,Ii);return h.createElement(oj,Ar({},r,{ref:t}))});rg.displayName="CartesianAxis";var uj=["animationElapsedTime","isAnimating","isEntrance","visibleLength","strokeDasharray","connectNulls"];function yu(){return yu=Object.assign?Object.assign.bind():function(e){for(var t=1;tv+p,0);if(!i)return ng(t,e);for(var a=Math.floor(e/i),o=e%i,u=[],l=0,c=0;lo){u=[...n.slice(0,l),o-c];break}}var d=u.length%2===0?[0,t]:[t];return[...dj(n,a),...u,...d].map(v=>"".concat(v,"px")).join(", ")}function hj(e,t,r){if(e){var n="".concat(e).split(/[,\s]+/gim).map(i=>parseFloat(i));return vj(r,t,n)}return ng(t,r)}function pj(e){e.animationElapsedTime,e.isAnimating,e.isEntrance;var t=e.visibleLength,r=e.strokeDasharray,n=e.connectNulls,i=lj(e,uj),a=n??!1,o;if(t!=null){var u,l=i.pathRef,c=sj((u=l==null?void 0:l.current)!==null&&u!==void 0?u:null);o=hj(r,c,t)}else r!=null&&(o=String(r));return h.createElement(Wh,yu({},i,{connectNulls:a,strokeDasharray:o}))}function mj(e){var t=h.useRef(0),r=h.useRef(0),n=h.useRef(!1),i=h.useRef(e);return i.current!==e&&(t.current=r.current,i.current=e),h.useCallback((a,o)=>{if(n.current)return null;var u=Math.min(It(t.current+a*o),o);return a>0&&o>0&&(r.current=Math.max(r.current,u),u>=o)?(n.current=!0,null):u},[])}var yj={},ig=Me({name:"errorBars",initialState:yj,reducers:{addErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.errorBar;e[n]||(e[n]=[]),e[n].push(i)},replaceErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.prev,a=r.next;e[n]&&(e[n]=e[n].map(o=>o.dataKey===i.dataKey&&o.direction===i.direction?a:o))},removeErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.errorBar;e[n]&&(e[n]=e[n].filter(a=>a.dataKey!==i.dataKey||a.direction!==i.direction))}}}),Gl=ig.actions;Gl.addErrorBar;Gl.replaceErrorBar;Gl.removeErrorBar;var gj=ig.reducer,bj=["children"];function xj(e,t){if(e==null)return{};var r,n,i=wj(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n({x:0,y:0,value:0}),errorBarOffset:0},Oj=h.createContext(Aj);function ag(e){var t=e.children,r=xj(e,bj);return h.createElement(Oj.Provider,{value:r},t)}function Zl(e,t){var r,n,i=N(c=>zt(c,e)),a=N(c=>Ft(c,t)),o=(r=i==null?void 0:i.allowDataOverflow)!==null&&r!==void 0?r:pe.allowDataOverflow,u=(n=a==null?void 0:a.allowDataOverflow)!==null&&n!==void 0?n:nm.allowDataOverflow,l=o||u;return{needClip:l,needClipX:o,needClipY:u}}function og(e){var t=e.xAxisId,r=e.yAxisId,n=e.clipPathId,i=Xl(),a=Zl(t,r),o=a.needClipX,u=a.needClipY,l=a.needClip,c=N(A=>km(A,t,!1)),s=N(A=>Tm(A,r,!1));if(!l||!i)return null;var f=i.x,d=i.y,v=i.width,p=i.height,m=o&&c?Math.min(c[0],c[1]):f-v/2,y=u&&s?Math.min(s[0],s[1]):d-p/2,g=o&&c?Math.abs(c[1]-c[0]):v*2,x=u&&s?Math.abs(s[1]-s[0]):p*2;return h.createElement("clipPath",{id:"clipPath-".concat(n)},h.createElement("rect",{x:m,y,width:g,height:x}))}var ug=(e,t,r,n)=>Zt(e,"xAxis",t,n),lg=(e,t,r,n)=>Gt(e,"xAxis",t,n),cg=(e,t,r,n)=>Zt(e,"yAxis",r,n),sg=(e,t,r,n)=>Gt(e,"yAxis",r,n),Pj=P([Z,ug,cg,lg,sg],(e,t,r,n,i)=>Nt(e,"xAxis")?Kr(t,n,!1):Kr(r,i,!1)),Sj=(e,t,r,n,i)=>i;function Ej(e){return e.type==="line"}var Ij=P([Va,Sj],(e,t)=>e.filter(Ej).find(r=>r.id===t)),_j=P([Z,ug,cg,lg,sg,Ij,Pj,Yn],(e,t,r,n,i,a,o,u)=>{var l=u.chartData,c=u.dataStartIndex,s=u.dataEndIndex;if(!(a==null||t==null||r==null||n==null||i==null||n.length===0||i.length===0||o==null||e!=="horizontal"&&e!=="vertical")){var f=a.dataKey,d=a.data,v;if(d!=null&&d.length>0?v=d:v=l==null?void 0:l.slice(c,s+1),v!=null)return Gj({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:i,dataKey:f,bandSize:o,displayedData:v})}});function Cj(e){var t=Ln(e),r=3,n=2;if(t!=null){var i=t.r,a=t.strokeWidth,o=Number(i),u=Number(a);return(Number.isNaN(o)||o<0)&&(o=r),(Number.isNaN(u)||u<0)&&(u=n),{r:o,strokeWidth:u}}return{r,strokeWidth:n}}var kj=["id"],Tj=["type","layout","connectNulls","needClip","shape","strokeDasharray"],Mj=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function fa(){return fa=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?t/r:0}var Bj=(e,t)=>{if(e==null)return[];if(t===1)return e.flatMap(u=>u.status==="removed"?[]:[u.next]);var r=Lj(e),n=[];for(var i of e)if(i.status==="matched")n.push(pt(pt({},i.next),{},{x:ve(i.prev.x,i.next.x,t),y:ve(i.prev.y,i.next.y,t)}));else if(i.status==="added")if(i.next.x!=null){var a=i.next.x-r;n.push(pt(pt({},i.next),{},{x:ve(a,i.next.x,t),y:i.next.y}))}else n.push(i.next);else if(i.status==="removed"&&i.prev.x!=null){var o=i.prev.x+r;n.push(pt(pt({},i.prev),{},{x:ve(i.prev.x,o,t),y:i.prev.y}))}return n},Jl={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationInterpolateFn:Bj,animationMatchBy:Vl,connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",shape:pj,stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:_e.line,type:"linear"},zj=e=>{var t=e.dataKey,r=e.name,n=e.stroke,i=e.legendType,a=e.hide;return[{inactive:a,dataKey:t,type:i,color:n,value:Ca(r,t),payload:e}]},Fj=h.memo(e=>{var t=e.dataKey,r=e.data,n=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,u=e.hide,l=e.unit,c=e.formatter,s=e.tooltipType,f=e.id,d={dataDefinedOnItem:r,getPosition:Or,settings:{stroke:n,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Ca(o,t),hide:u,type:s,color:n,unit:l,formatter:c,graphicalItemId:f}};return h.createElement(Fy,{tooltipEntrySettings:d})});function Wj(e){var t=e.clipPathId,r=e.points,n=e.props,i=n.dot,a=n.dataKey,o=n.needClip;n.id;var u=Ql(n,kj),l=wt(u);return h.createElement(MT,{points:r,dot:i,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:a,baseProps:l,needClip:o,clipPathId:t})}function Uj(e){var t=e.showLabels,r=e.children,n=e.points,i=h.useMemo(()=>n==null?void 0:n.map(a=>{var o,u,l={x:(o=a.x)!==null&&o!==void 0?o:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return pt(pt({},l),{},{value:a.value,payload:a.payload,viewBox:l,parentViewBox:void 0,fill:void 0})}),[n]);return h.createElement(Cy,{value:t?i:void 0},r)}function Kj(e){var t=e.clipPathId,r=e.pathRef,n=e.points,i=e.props,a=e.animationElapsedTime,o=e.isAnimating,u=e.isEntrance,l=e.visibleLength,c=i.type,s=i.layout,f=i.connectNulls,d=i.needClip,v=i.shape,p=i.strokeDasharray,m=Ql(i,Tj),y=pt(pt({},Ge(m)),{},{fill:"none",className:"recharts-line-curve",clipPath:d?"url(#clipPath-".concat(t,")"):void 0,points:n,type:c,layout:s,connectNulls:f,strokeDasharray:p??i.strokeDasharray,pathRef:r,animationElapsedTime:a,isAnimating:o,isEntrance:i.animateNewValues?u:!1,visibleLength:l});return h.createElement(h.Fragment,null,(n==null?void 0:n.length)>1&&h.createElement(Ry,{option:v,DefaultShape:Jl.shape,shapeProps:y}),h.createElement(Wj,{points:n,clipPathId:t,props:i}))}function Hj(e){var t=e.clipPathId,r=e.props,n=e.pathRef,i=e.previousPointsRef,a=r.points,o=r.isAnimationActive,u=r.animationBegin,l=r.animationDuration,c=r.animationEasing,s=r.animationMatchBy,f=r.animationInterpolateFn,d=r.layout,v=Rj(n.current),p=Ky(r.onAnimationStart,r.onAnimationEnd),m=p.isAnimating,y=p.handleAnimationStart,g=p.handleAnimationEnd,x=!m,A=mj(a),w=h.useCallback(O=>O>0&&v>0,[v]);return h.createElement(Uj,{points:a,showLabels:x},r.children,h.createElement(Hy,{animationInput:a,animationIdPrefix:"recharts-line-",items:a,previousItemsRef:i,isAnimationActive:o,animationBegin:u,animationDuration:l,animationEasing:c,onAnimationStart:y,onAnimationEnd:g,animationInterpolateFn:f,animationMatchBy:s,shouldUpdatePreviousRef:w,layout:d},(O,b,S)=>{var I=m||b<1,_=I?A(b,v):null;return h.createElement(Kj,{props:r,points:O,clipPathId:t,pathRef:n,animationElapsedTime:b,isAnimating:I,isEntrance:S,visibleLength:_})}),h.createElement(Ty,{label:r.label}))}function Yj(e){var t=e.clipPathId,r=e.props,n=h.useRef(null),i=h.useRef(null);return h.createElement(Hj,{props:r,clipPathId:t,previousPointsRef:n,pathRef:i})}var Vj=(e,t)=>{var r,n;return{x:(r=e.x)!==null&&r!==void 0?r:void 0,y:(n=e.y)!==null&&n!==void 0?n:void 0,value:e.value,errorVal:se(e.payload,t)}};class qj extends h.Component{render(){var t=this.props,r=t.hide,n=t.dot,i=t.points,a=t.className,o=t.xAxisId,u=t.yAxisId,l=t.top,c=t.left,s=t.width,f=t.height,d=t.id,v=t.needClip,p=t.zIndex;if(r)return null;var m=ne("recharts-line",a),y=d,g=Cj(n),x=g.r,A=g.strokeWidth,w=$y(n),O=x*2+A,b=v?"url(#clipPath-".concat(w?"":"dots-").concat(y,")"):void 0;return h.createElement(st,{zIndex:p},h.createElement(He,{className:m},v&&h.createElement("defs",null,h.createElement(og,{clipPathId:y,xAxisId:o,yAxisId:u}),!w&&h.createElement("clipPath",{id:"clipPath-dots-".concat(y)},h.createElement("rect",{x:c-O/2,y:l-O/2,width:s+O,height:f+O}))),h.createElement(ag,{xAxisId:o,yAxisId:u,data:i,dataPointFormatter:Vj,errorBarOffset:0},h.createElement(Yj,{props:this.props,clipPathId:y}))),h.createElement(XT,{activeDot:this.props.activeDot,points:i,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:b}))}}function Xj(e){var t=Je(e,Jl),r=t.activeDot,n=t.animateNewValues,i=t.animationBegin,a=t.animationDuration,o=t.animationEasing,u=t.connectNulls,l=t.dot,c=t.hide,s=t.isAnimationActive,f=t.label,d=t.legendType,v=t.xAxisId,p=t.yAxisId,m=t.id,y=Ql(t,Mj),g=Zl(v,p),x=g.needClip,A=Xl(),w=Pr(),O=Le(),b=N(k=>_j(k,v,p,O,m));if(w!=="horizontal"&&w!=="vertical"||b==null||A==null)return null;var S=A.height,I=A.width,_=A.x,T=A.y;return h.createElement(qj,fa({},y,{id:m,connectNulls:u,dot:l,activeDot:r,animateNewValues:n,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:s,hide:c,label:f,legendType:d,xAxisId:v,yAxisId:p,points:b,layout:w,height:S,width:I,left:_,top:T,needClip:x}))}function Gj(e){var t=e.layout,r=e.xAxis,n=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,u=e.bandSize,l=e.displayedData;return l.map((c,s)=>{var f=se(c,o);if(t==="horizontal"){var d=Nc({axis:r,ticks:i,bandSize:u,entry:c,index:s}),v=ae(f)?null:n.scale.map(f);return{x:d,y:v??null,value:f,payload:c}}var p=ae(f)?null:r.scale.map(f),m=Nc({axis:n,ticks:a,bandSize:u,entry:c,index:s});return p==null||m==null?null:{x:p,y:m,value:f,payload:c}}).filter(Boolean)}function Zj(e){var t=Je(e,Jl),r=Le();return h.createElement(Yy,{id:t.id,type:"line"},n=>h.createElement(h.Fragment,null,h.createElement(Wy,{legendPayload:zj(t)}),h.createElement(Fj,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:n}),h.createElement(qy,{type:"line",id:n,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:r}),h.createElement(Xj,fa({},t,{id:n}))))}var Qj=h.memo(Zj,Kn);Qj.displayName="Line";function _r(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||n===void 0?void 0:n.xAxisId)!==null&&r!==void 0?r:Xy}function Cr(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||n===void 0?void 0:n.yAxisId)!==null&&r!==void 0?r:Xy}var Jj="Invariant failed";function eD(e,t){throw new Error(Jj)}var tD=["option"];function rD(e,t){if(e==null)return{};var r,n,i=nD(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n1&&arguments[1]!==void 0?arguments[1]:0;return(n,i)=>{if(D(t))return t;var a=D(n)||ae(n);return a?t(n,i):(a||eD(),r)}},aD=(e,t,r)=>r,oD=(e,t)=>t,ni=P([Va,oD],(e,t)=>e.filter(r=>r.type==="bar").find(r=>r.id===t)),uD=P([ni],e=>e==null?void 0:e.maxBarSize),lD=(e,t,r,n)=>n,cD=P([Z,Va,_r,Cr,aD],(e,t,r,n,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===r:a.yAxisId===n).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),sD=(e,t,r)=>{var n=Z(e),i=_r(e,t),a=Cr(e,t);if(!(i==null||a==null))return n==="horizontal"?du(e,"yAxis",a,r):du(e,"xAxis",i,r)},fD=(e,t)=>{var r=Z(e),n=_r(e,t),i=Cr(e,t);if(!(n==null||i==null))return r==="horizontal"?Lf(e,"xAxis",n):Lf(e,"yAxis",i)},dD=P([cD,lO,fD],tM),vD=(e,t,r)=>{var n,i,a=ni(e,t);if(a==null)return 0;var o=_r(e,t),u=Cr(e,t);if(o==null||u==null)return 0;var l=Z(e),c=cp(e),s=a.maxBarSize,f=ae(s)?c:s,d,v;return l==="horizontal"?(d=Zt(e,"xAxis",o,r),v=Gt(e,"xAxis",o,r)):(d=Zt(e,"yAxis",u,r),v=Gt(e,"yAxis",u,r)),(n=(i=Kr(d,v,!0))!==null&&i!==void 0?i:f)!==null&&n!==void 0?n:0},fg=(e,t,r)=>{var n=Z(e),i=_r(e,t),a=Cr(e,t);if(!(i==null||a==null)){var o,u;return n==="horizontal"?(o=Zt(e,"xAxis",i,r),u=Gt(e,"xAxis",i,r)):(o=Zt(e,"yAxis",a,r),u=Gt(e,"yAxis",a,r)),Kr(o,u)}},hD=P([dD,cp,uO,sp,vD,fg,uD],oM),pD=(e,t,r)=>{var n=_r(e,t);if(n!=null)return Zt(e,"xAxis",n,r)},mD=(e,t,r)=>{var n=Cr(e,t);if(n!=null)return Zt(e,"yAxis",n,r)},yD=(e,t,r)=>{var n=_r(e,t);if(n!=null)return Gt(e,"xAxis",n,r)},gD=(e,t,r)=>{var n=Cr(e,t);if(n!=null)return Gt(e,"yAxis",n,r)},bD=P([hD,ni],lM),xD=P([sD,ni],uM),wD=P([xe,Dh,pD,mD,yD,gD,bD,Z,H1,fg,xD,ni,lD],(e,t,r,n,i,a,o,u,l,c,s,f,d)=>{var v=l.chartData,p=l.dataStartIndex,m=l.dataEndIndex;if(!(f==null||o==null||t==null||u!=="horizontal"&&u!=="vertical"||r==null||n==null||i==null||a==null||c==null)){var y=f.data,g;if(y!=null&&y.length>0?g=y:g=v==null?void 0:v.slice(p,m+1),g!=null)return e$({layout:u,barSettings:f,pos:o,parentViewBox:t,bandSize:c,xAxis:r,yAxis:n,xAxisTicks:i,yAxisTicks:a,stackedData:s,displayedData:g,offset:e,cells:d,dataStartIndex:p})}}),AD=["index"];function gu(){return gu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=h.useContext(dg);if(t!=null)return t.stackId;if(e!=null)return Bx(e)},ED=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),ID=e=>{var t=h.useContext(dg);if(t!=null){var r=t.stackId;return"url(#".concat(ED(r,e),")")}},vg=e=>{var t=e.index,r=OD(e,AD),n=ID(t);return h.createElement(He,gu({className:"recharts-bar-stack-layer",clipPath:n},r))},_D=["onMouseEnter","onMouseLeave","onClick"],CD=["value","background","tooltipPosition"],kD=["id"],TD=["onMouseEnter","onClick","onMouseLeave"];function Wd(e,t){return $D(e)||DD(e,t)||jD(e,t)||MD()}function MD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jD(e,t){if(e){if(typeof e=="string")return Ud(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ud(e,t):void 0}}function Ud(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.dataKey,r=e.name,n=e.fill,i=e.legendType,a=e.hide;return[{inactive:a,dataKey:t,type:i,color:n,value:Ca(r,t),payload:e}]},FD=h.memo(e=>{var t=e.dataKey,r=e.stroke,n=e.strokeWidth,i=e.fill,a=e.name,o=e.hide,u=e.unit,l=e.formatter,c=e.tooltipType,s=e.id,f={dataDefinedOnItem:void 0,getPosition:Or,settings:{stroke:r,strokeWidth:n,fill:i,dataKey:t,nameKey:void 0,name:Ca(a,t),hide:o,type:c,color:i,unit:u,formatter:l,graphicalItemId:s}};return h.createElement(Fy,{tooltipEntrySettings:f})});function WD(e){var t=N(wr),r=e.data,n=e.dataKey,i=e.background,a=e.allOtherBarProps,o=a.onMouseEnter,u=a.onMouseLeave,l=a.onClick,c=da(a,_D),s=Ly(o,n,a.id),f=By(u),d=zy(l,n,a.id);if(!i||r==null)return null;var v=Ln(i);return h.createElement(st,{zIndex:cM(i,_e.barBackground)},r.map((p,m)=>{p.value;var y=p.background;p.tooltipPosition;var g=da(p,CD);if(!y)return null;var x=s(p,p.originalDataIndex),A=f(p,p.originalDataIndex),w=d(p,p.originalDataIndex),O=me(me(me(me(me({option:i,isActive:String(p.originalDataIndex)===t},g),{},{fill:"#eee"},y),v),ku(c,p,m)),{},{onMouseEnter:x,onMouseLeave:A,onClick:w,dataKey:n,index:m,className:"recharts-bar-background-rectangle"});return h.createElement(tc,Qt({key:"background-bar-".concat(m)},O))}))}function UD(e){var t=e.showLabels,r=e.children,n=e.rects,i=n==null?void 0:n.map(a=>{var o={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return me(me({},o),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:o,fill:a.fill})});return h.createElement(Cy,{value:t?i:void 0},r)}function KD(e){var t=e.shape,r=e.activeBar,n=e.baseProps,i=e.entry,a=e.index,o=e.dataKey,u=N(wr),l=N(ay),c=r&&String(i.originalDataIndex)===u&&(l==null||o===l),s=u!=null&&(String(i.originalDataIndex)!==u||l!=null&&o!==l),f=h.useState(!1),d=Wd(f,2),v=d[0],p=d[1],m=h.useState(!1),y=Wd(m,2),g=y[0],x=y[1];h.useEffect(()=>{var I;return c?(p(!0),I=requestAnimationFrame(()=>{x(!0)})):(x(!1),s&&p(!1)),()=>{cancelAnimationFrame(I)}},[c,s]);var A=h.useCallback(()=>{c||p(!1)},[c]),w=c&&g,O=c||v,b;c?r===!0?b=t:b=r:b=t;var S=h.createElement(tc,Qt({},n,{name:String(n.name)},i,{isActive:w,option:b,index:a,dataKey:o,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance,onTransitionEnd:A}));return O?h.createElement(st,{zIndex:_e.activeBar},h.createElement(vg,{index:i.originalDataIndex},S)):S}function HD(e){var t=e.shape,r=e.baseProps,n=e.entry,i=e.index,a=e.dataKey;return h.createElement(tc,Qt({},r,{name:String(r.name)},n,{isActive:!1,option:t,index:i,dataKey:a,animationElapsedTime:e.animationElapsedTime,isAnimating:e.isAnimating,isEntrance:e.isEntrance}))}function YD(e){var t,r=e.data,n=e.props,i=e.animationElapsedTime,a=e.isAnimating,o=e.isEntrance,u=(t=wt(n))!==null&&t!==void 0?t:{},l=u.id,c=da(u,kD),s=n.shape,f=n.dataKey,d=n.activeBar,v=n.onMouseEnter,p=n.onClick,m=n.onMouseLeave,y=da(n,TD),g=Ly(v,f,l),x=By(m),A=zy(p,f,l);return r?h.createElement(h.Fragment,null,r.map((w,O)=>h.createElement(vg,Qt({index:w.originalDataIndex,key:"rectangle-".concat(w==null?void 0:w.x,"-").concat(w==null?void 0:w.y,"-").concat(w==null?void 0:w.value,"-").concat(O),className:"recharts-bar-rectangle"},ku(y,w,O),{onMouseEnter:g(w,w.originalDataIndex),onMouseLeave:x(w,w.originalDataIndex),onClick:A(w,w.originalDataIndex)}),d?h.createElement(KD,{shape:s,activeBar:d,baseProps:c,entry:w,index:O,dataKey:f,animationElapsedTime:i,isAnimating:a,isEntrance:o}):h.createElement(HD,{shape:s,baseProps:c,entry:w,index:O,dataKey:f,animationElapsedTime:i,isAnimating:a,isEntrance:o})))):null}var VD=(e,t,r)=>e==null?[]:t===1?e.flatMap(n=>n.status==="removed"?[]:[n.next]):e.flatMap(n=>{if(n.status==="removed")return r==="horizontal"?[me(me({},n.prev),{},{height:ve(n.prev.height,0,t),y:ve(n.prev.y,n.prev.y+n.prev.height,t)})]:[me(me({},n.prev),{},{width:ve(n.prev.width,0,t)})];if(n.status==="matched")return[me(me({},n.next),{},{x:ve(n.prev.x,n.next.x,t),y:ve(n.prev.y,n.next.y,t),width:ve(n.prev.width,n.next.width,t),height:ve(n.prev.height,n.next.height,t)})];var i=n.next;return r==="horizontal"?[me(me({},i),{},{height:ve(0,i.height,t),y:ve(i.stackedBarStart,i.y,t)})]:[me(me({},i),{},{width:ve(0,i.width,t),x:ve(i.stackedBarStart,i.x,t)})]});function qD(e){var t=e.props,r=e.previousRectanglesRef,n=t.data,i=t.isAnimationActive,a=t.animationBegin,o=t.animationDuration,u=t.animationEasing,l=t.animationInterpolateFn,c=t.layout,s=Ky(t.onAnimationStart,t.onAnimationEnd),f=s.isAnimating,d=s.handleAnimationStart,v=s.handleAnimationEnd;return h.createElement(UD,{showLabels:!f,rects:n},h.createElement(Hy,{animationInput:n,animationIdPrefix:"recharts-bar-",items:n,previousItemsRef:r,isAnimationActive:i,animationBegin:a,animationDuration:o,animationEasing:u,onAnimationStart:d,onAnimationEnd:v,animationInterpolateFn:l,animationMatchBy:t.animationMatchBy,layout:c},(p,m,y)=>h.createElement(He,null,h.createElement(YD,{props:t,data:p,animationElapsedTime:m,isAnimating:f||m<1,isEntrance:y}))),h.createElement(Ty,{label:t.label}),t.children)}function XD(e){var t=h.useRef(null);return h.createElement(qD,{previousRectanglesRef:t,props:e})}var hg=0,GD=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:se(e,t)}};class ZD extends h.PureComponent{render(){var t=this.props,r=t.hide,n=t.data,i=t.dataKey,a=t.className,o=t.xAxisId,u=t.yAxisId,l=t.needClip,c=t.background,s=t.id;if(r||n==null)return null;var f=ne("recharts-bar",a),d=s;return h.createElement(He,{className:f,id:s},l&&h.createElement("defs",null,h.createElement(og,{clipPathId:d,xAxisId:o,yAxisId:u})),h.createElement(He,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(d,")"):void 0},h.createElement(WD,{data:n,dataKey:i,background:c,allOtherBarProps:this.props}),h.createElement(XD,this.props)))}}var QD={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",animationInterpolateFn:VD,animationMatchBy:Uy,background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:hg,shape:ec,xAxisId:0,yAxisId:0,zIndex:_e.bar};function JD(e){var t=e.xAxisId,r=e.yAxisId,n=e.hide,i=e.legendType,a=e.minPointSize,o=e.activeBar,u=e.animationBegin,l=e.animationDuration,c=e.animationEasing,s=e.isAnimationActive,f=Zl(t,r),d=f.needClip,v=Pr(),p=Le(),m=Bk(e.children,my),y=N(A=>wD(A,e.id,p,m));if(v!=="vertical"&&v!=="horizontal")return null;var g,x=y==null?void 0:y[0];return x==null||x.height==null||x.width==null?g=0:g=v==="vertical"?x.height/2:x.width/2,h.createElement(ag,{xAxisId:t,yAxisId:r,data:y,dataPointFormatter:GD,errorBarOffset:g},h.createElement(ZD,Qt({},e,{layout:v,needClip:d,data:y,xAxisId:t,yAxisId:r,hide:n,legendType:i,minPointSize:a,activeBar:o,animationBegin:u,animationDuration:l,animationEasing:c,isAnimationActive:s})))}function e$(e){var t=e.layout,r=e.barSettings,n=r.dataKey,i=r.minPointSize,a=r.hasCustomShape,o=e.pos,u=e.bandSize,l=e.xAxis,c=e.yAxis,s=e.xAxisTicks,f=e.yAxisTicks,d=e.stackedData,v=e.displayedData,p=e.offset,m=e.cells,y=e.parentViewBox,g=e.dataStartIndex,x=t==="horizontal"?c:l,A=d?x.scale.domain():null,w=zx({numericAxis:x}),O=x.scale.map(w);return v.map((b,S)=>{var I,_,T,k,E,R;if(d){var $=d[S+g];if($==null)return null;I=Dx($,A)}else I=se(b,n),Array.isArray(I)||(I=[w,I]);var F=iD(i,hg)(I[1],S);if(t==="horizontal"){var K,H=c.scale.map(I[0]),L=c.scale.map(I[1]);if(H==null||L==null)return null;_=Rc({axis:l,ticks:s,bandSize:u,offset:o.offset,entry:b,index:S}),T=(K=L??H)!==null&&K!==void 0?K:void 0,k=o.size;var V=H-L;if(E=At(V)?0:V,R={x:_,y:p.top,width:k,height:p.height},Math.abs(F)>0&&Math.abs(E)0&&Math.abs(k)h.createElement(h.Fragment,null,h.createElement(Wy,{legendPayload:zD(t)}),h.createElement(FD,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:i}),h.createElement(qy,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:r,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:n,hasCustomShape:t.shape!=null&&t.shape!==ec}),h.createElement(st,{zIndex:t.zIndex},h.createElement(JD,Qt({},t,{id:i})))))}var r$=h.memo(t$,Kn);r$.displayName="Bar";var n$=["domain","range"],i$=["domain","range"];function Hd(e,t){if(e==null)return{};var r,n,i=a$(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n{if(o!=null)return qd(qd({},a),{},{type:o})},[a,o]);return h.useLayoutEffect(()=>{u!=null&&(r.current===null?t(RT(u)):r.current!==u&&t(LT({prev:r.current,next:u})),r.current=u)},[u,t]),h.useLayoutEffect(()=>()=>{r.current&&(t(BT(r.current)),r.current=null)},[t]),null}var p$=e=>{var t=e.xAxisId,r=e.className,n=e.height,i=e.label,a=h.useRef(null),o=h.useRef(null),u=N(Dh),l=Le(),c=ce(),s="xAxis",f=N(g=>QE(g,s,t,l)),d=N(g=>Nm(g,t)),v=N(g=>qE(g,t)),p=N(g=>rm(g,t));if(h.useLayoutEffect(()=>{if(!(n!=="auto"||!d||Yl(i)||h.isValidElement(i)||p==null)){var g=a.current;if(g){var x=g.getCalculatedHeight();Math.round(d.height)!==Math.round(x)&&c(zT({id:t,height:x}))}}},[f,d,c,i,t,n,p]),d==null||v==null||p==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var m=xu(e,l$);p.id,p.scale;var y=xu(p,c$);return h.createElement(rg,bu({},m,y,{ref:a,labelRef:o,x:v.x,y:v.y,width:d.width,height:d.height,className:ne("recharts-".concat(s," ").concat(s),r),viewBox:u,ticks:f,axisType:s,axisId:t}))},m$={allowDataOverflow:pe.allowDataOverflow,allowDecimals:pe.allowDecimals,allowDuplicatedCategory:pe.allowDuplicatedCategory,angle:pe.angle,axisLine:Ii.axisLine,height:pe.height,hide:!1,includeHidden:pe.includeHidden,interval:pe.interval,label:!1,minTickGap:pe.minTickGap,mirror:pe.mirror,orientation:pe.orientation,padding:pe.padding,reversed:pe.reversed,scale:pe.scale,tick:pe.tick,tickCount:pe.tickCount,tickLine:Ii.tickLine,tickSize:Ii.tickSize,type:pe.type,niceTicks:pe.niceTicks,xAxisId:0},y$=e=>{var t=Je(e,m$);return h.createElement(h.Fragment,null,h.createElement(h$,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),h.createElement(p$,t))},g$=h.memo(y$,o$);g$.displayName="XAxis";var b$=(e,t)=>t,rc=P([b$,Z,yp,Ae,ty,Wt,x_,xe],I_);function x$(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function nc(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(x$(e)){var i=e.currentTarget.getBBox();r=i.width>0?t.width/i.width:1,n=i.height>0?t.height/i.height:1}else{var a=e.currentTarget;r=a.offsetWidth>0?t.width/a.offsetWidth:1,n=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(u,l)=>({relativeX:Math.round((u-t.left)/r),relativeY:Math.round((l-t.top)/n)});return"touches"in e?Array.from(e.touches).map(u=>o(u.clientX,u.clientY)):o(e.clientX,e.clientY)}var pg=Ye("mouseClick"),mg=zn();mg.startListening({actionCreator:pg,effect:(e,t)=>{var r=e.payload,n=rc(t.getState(),nc(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(vI({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var wu=Ye("mouseMove"),yg=zn(),$r=null,nr=null,To=null;yg.startListening({actionCreator:wu,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=n.eventSettings,a=i.throttleDelay,o=i.throttledEvents,u=o==="all"||(o==null?void 0:o.includes("mousemove"));$r!==null&&(cancelAnimationFrame($r),$r=null),nr!==null&&(typeof a!="number"||!u)&&(clearTimeout(nr),nr=null),To=nc(r);var l=()=>{var c=t.getState(),s=ti(c,c.tooltip.settings.shared);if(!To){$r=null,nr=null;return}if(s==="axis"){var f=rc(c,To);(f==null?void 0:f.activeIndex)!=null?t.dispatch(Hm({activeIndex:f.activeIndex,activeDataKey:void 0,activeCoordinate:f.activeCoordinate})):t.dispatch(Km())}$r=null,nr=null};if(!u){l();return}a==="raf"?$r=requestAnimationFrame(l):typeof a=="number"&&nr===null&&(nr=setTimeout(l,a))}});function w$(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<>":t}var Xd={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},gg=Me({name:"rootProps",initialState:Xd,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:Xd.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),A$=gg.reducer,O$=gg.actions.updateOptions,P$=null,S$={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},bg=Me({name:"polarOptions",initialState:P$,reducers:S$});bg.actions.updatePolarOptions;var E$=bg.reducer,xg=Ye("keyDown"),wg=Ye("focus"),Ag=Ye("blur"),Ja=zn(),Nr=null,ir=null,xi=null;Ja.startListening({actionCreator:xg,effect:(e,t)=>{xi=e.payload,Nr!==null&&(cancelAnimationFrame(Nr),Nr=null);var r=t.getState(),n=r.eventSettings,i=n.throttleDelay,a=n.throttledEvents,o=a==="all"||a.includes("keydown");ir!==null&&(typeof i!="number"||!o)&&(clearTimeout(ir),ir=null);var u=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var s=l.tooltip.keyboardInteraction,f=xi;if(f!=="ArrowRight"&&f!=="ArrowLeft"&&f!=="Enter")return;var d=An(s,xr(l),qr(l),Xr(l)),v=d==null?-1:Number(d),p=!Number.isFinite(v)||v<0,m=Wt(l),y=xr(l),g=ti(l,l.tooltip.settings.shared);if(f==="Enter"){if(p)return;var x=ua(l,g,"hover",String(s.index));t.dispatch(oa({active:!s.active,activeIndex:s.index,activeCoordinate:x}));return}var A=rI(l),w=A==="left-to-right"?1:-1,O=f==="ArrowRight"?1:-1,b;if(p){var S=qr(l),I=Xr(l),_=O*w,T=F=>({active:!1,index:String(F),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(b=-1,_>0){for(var k=0;k=0;E--)if(An(T(E),y,S,I)!=null){b=E;break}if(b<0)return}else{b=v+O*w;var R=(m==null?void 0:m.length)||y.length;if(R===0||b>=R||b<0)return}var $=ua(l,g,"hover",String(b));t.dispatch(oa({active:!0,activeIndex:b.toString(),activeCoordinate:$}))}finally{Nr=null,ir=null}};if(!o){u();return}i==="raf"?Nr=requestAnimationFrame(u):typeof i=="number"&&ir===null&&(u(),xi=null,ir=setTimeout(()=>{xi?u():(ir=null,Nr=null)},i))}});Ja.startListening({actionCreator:wg,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var i=r.tooltip.keyboardInteraction;if(!i.active&&i.index==null){var a="0",o=ti(r,r.tooltip.settings.shared),u=ua(r,o,"hover",String(a));t.dispatch(oa({active:!0,activeIndex:a,activeCoordinate:u}))}}}});Ja.startListening({actionCreator:Ag,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var i=r.tooltip.keyboardInteraction;i.active&&t.dispatch(oa({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function Og(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(r,n)=>{if(n==="currentTarget")return t;var i=Reflect.get(r,n);return typeof i=="function"?i.bind(r):i}})}var Ve=Ye("externalEvent"),Pg=zn(),wi=new Map,mn=new Map,Mo=new Map;Pg.startListening({actionCreator:Ve,effect:(e,t)=>{var r=e.payload,n=r.handler,i=r.reactEvent;if(n!=null){var a=i.type,o=Og(i);Mo.set(a,{handler:n,reactEvent:o});var u=wi.get(a);u!==void 0&&(cancelAnimationFrame(u),wi.delete(a));var l=t.getState(),c=l.eventSettings,s=c.throttleDelay,f=c.throttledEvents,d=f,v=d==="all"||(d==null?void 0:d.includes(a)),p=mn.get(a);p!==void 0&&(typeof s!="number"||!v)&&(clearTimeout(p),mn.delete(a));var m=()=>{var x=Mo.get(a);try{if(!x)return;var A=x.handler,w=x.reactEvent,O=t.getState(),b={activeCoordinate:i_(O),activeDataKey:ay(O),activeIndex:wr(O),activeLabel:iy(O),activeTooltipIndex:wr(O),isTooltipActive:a_(O)};A&&A(b,w)}finally{wi.delete(a),mn.delete(a),Mo.delete(a)}};if(!v){m();return}if(s==="raf"){var y=requestAnimationFrame(m);wi.set(a,y)}else if(typeof s=="number"){if(!mn.has(a)){m();var g=setTimeout(m,s);mn.set(a,g)}}else m()}}});var I$=P([nn],e=>e.tooltipItemPayloads),_$=P([I$,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(a=>a.settings.graphicalItemId===r);if(n!=null){var i=n.getPosition;if(i!=null)return i(t)}}}),Sg=Ye("touchMove"),Eg=zn(),ar=null,Ut=null,Gd=null,yn=null;Eg.startListening({actionCreator:Sg,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){yn=Og(r);var n=t.getState(),i=n.eventSettings,a=i.throttleDelay,o=i.throttledEvents,u=o==="all"||o.includes("touchmove");ar!==null&&(cancelAnimationFrame(ar),ar=null),Ut!==null&&(typeof a!="number"||!u)&&(clearTimeout(Ut),Ut=null),Gd=Array.from(r.touches).map(c=>nc({clientX:c.clientX,clientY:c.clientY,currentTarget:r.currentTarget}));var l=()=>{if(yn!=null){var c=t.getState(),s=ti(c,c.tooltip.settings.shared);if(s==="axis"){var f,d=(f=Gd)===null||f===void 0?void 0:f[0];if(d==null){ar=null,Ut=null;return}var v=rc(c,d);(v==null?void 0:v.activeIndex)!=null&&t.dispatch(Hm({activeIndex:v.activeIndex,activeDataKey:void 0,activeCoordinate:v.activeCoordinate}))}else if(s==="item"){var p,m=yn.touches[0];if(document.elementFromPoint==null||m==null)return;var y=document.elementFromPoint(m.clientX,m.clientY);if(!y||!y.getAttribute)return;var g=y.getAttribute(Vx),x=(p=y.getAttribute(qx))!==null&&p!==void 0?p:void 0,A=Ir(c).find(b=>b.id===x);if(g==null||A==null||x==null)return;var w=A.dataKey,O=_$(c,g,x);t.dispatch(Um({activeDataKey:w,activeIndex:g,activeCoordinate:O,activeGraphicalItemId:x}))}ar=null,Ut=null}};if(!u){l();return}a==="raf"?ar=requestAnimationFrame(l):typeof a=="number"&&Ut===null&&(l(),yn=null,Ut=setTimeout(()=>{yn?l():(Ut=null,ar=null)},a))}}});var Ig={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},_g=Me({name:"eventSettings",initialState:Ig,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=q(t.payload.throttledEvents))}}}),C$=_g.actions.setEventSettings,k$=_g.reducer,T$=ih({brush:fM,cartesianAxis:FT,chartData:nC,errorBars:gj,eventSettings:k$,graphicalItems:AT,layout:Cx,legend:Rw,options:Q_,polarAxis:Dk,polarOptions:E$,referenceElements:pM,renderedTicks:WM,rootProps:A$,tooltip:hI,zIndex:z_}),M$=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return ex({reducer:T$,preloadedState:t,middleware:n=>{var i;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([mg.middleware,yg.middleware,Ja.middleware,Pg.middleware,Eg.middleware])},enhancers:n=>{var i=n;return typeof n=="function"&&(i=n()),i.concat(bh({type:"raf"}))},devTools:{serialize:{replacer:w$},name:"recharts-".concat(r)}})};function j$(e){var t=e.preloadedState,r=e.children,n=e.reduxStoreName,i=Le(),a=h.useRef(null);if(i)return r;a.current==null&&(a.current=M$(t,n));var o=Du;return h.createElement(Jw,{context:o,store:a.current},r)}function D$(e){var t=e.layout,r=e.margin,n=ce(),i=Le();return h.useEffect(()=>{i||(n(Ex(t)),n(Sx(r)))},[n,i,t,r]),null}var $$=h.memo(D$,Kn);function N$(e){var t=ce();return h.useEffect(()=>{t(O$(e))},[t,e]),null}var R$=e=>{var t=ce();return h.useEffect(()=>{t(C$(e))},[t,e]),null},L$=h.memo(R$,Kn);function Zd(e){var t=e.zIndex,r=e.isPanorama,n=h.useRef(null),i=ce();return h.useLayoutEffect(()=>(n.current&&i(L_({zIndex:t,element:n.current,isPanorama:r})),()=>{i(B_({zIndex:t,isPanorama:r}))}),[i,t,r]),h.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function Qd(e){var t=e.children,r=e.isPanorama,n=N(C_);if(!n||n.length===0)return t;var i=n.filter(o=>o<0),a=n.filter(o=>o>0);return h.createElement(h.Fragment,null,i.map(o=>h.createElement(Zd,{key:o,zIndex:o,isPanorama:r})),t,a.map(o=>h.createElement(Zd,{key:o,zIndex:o,isPanorama:r})))}var B$=["children"];function z$(e,t){if(e==null)return{};var r,n,i=F$(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n{var r=Cw(),n=kw(),i=Fh();if(!Xt(r)||!Xt(n))return null;var a=e.children,o=e.otherAttributes,u=e.title,l=e.desc,c,s;return o!=null&&(typeof o.tabIndex=="number"?c=o.tabIndex:c=i?0:void 0,typeof o.role=="string"?s=o.role:s=i?"application":void 0),h.createElement(lv,va({},o,{title:u,desc:l,role:s,tabIndex:c,width:r,height:n,style:W$,ref:t}),a)}),K$=e=>{var t=e.children,r=N(ja);if(!r)return null;var n=r.width,i=r.height,a=r.y,o=r.x;return h.createElement(lv,{width:n,height:i,x:o,y:a},t)},Jd=h.forwardRef((e,t)=>{var r=e.children,n=z$(e,B$),i=Le();return i?h.createElement(K$,null,h.createElement(Qd,{isPanorama:!0},r)):h.createElement(U$,va({ref:t},n),h.createElement(Qd,{isPanorama:!1},r))});function H$(e,t){return X$(e)||q$(e,t)||V$(e,t)||Y$()}function Y$(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V$(e,t){if(e){if(typeof e=="string")return ev(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ev(e,t):void 0}}function ev(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n!=null){var o=n.getBoundingClientRect(),u=o.width/n.offsetWidth;G(u)&&u!==a&&e(_x(u))}},[n,e,a]),i}function tv(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Z$(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r(dC(),null);function pa(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var oN=h.forwardRef((e,t)=>{var r,n,i=h.useRef(null),a=h.useState({containerWidth:pa((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:pa((n=e.style)===null||n===void 0?void 0:n.height)}),o=ha(a,2),u=o[0],l=o[1],c=h.useCallback((f,d)=>{l(v=>{var p=Math.round(f),m=Math.round(d);return v.containerWidth===p&&v.containerHeight===m?v:{containerWidth:p,containerHeight:m}})},[]),s=h.useCallback(f=>{if(typeof t=="function"&&t(f),i.current!=null&&(i.current.disconnect(),i.current=null),f!=null&&typeof ResizeObserver<"u"){var d=f.getBoundingClientRect(),v=d.width,p=d.height;c(v,p);var m=g=>{var x=g[0];if(x!=null){var A=x.contentRect,w=A.width,O=A.height;c(w,O)}},y=new ResizeObserver(m);y.observe(f),i.current=y}},[t,c]);return h.useEffect(()=>()=>{var f=i.current;f!=null&&f.disconnect()},[c]),h.createElement(h.Fragment,null,h.createElement(Wn,{width:u.containerWidth,height:u.containerHeight}),h.createElement("div",qt({ref:s},e)))}),uN=h.forwardRef((e,t)=>{var r=e.width,n=e.height,i=h.useState({containerWidth:pa(r),containerHeight:pa(n)}),a=ha(i,2),o=a[0],u=a[1],l=h.useCallback((s,f)=>{u(d=>{var v=Math.round(s),p=Math.round(f);return d.containerWidth===v&&d.containerHeight===p?d:{containerWidth:v,containerHeight:p}})},[]),c=h.useCallback(s=>{if(typeof t=="function"&&t(s),s!=null){var f=s.getBoundingClientRect(),d=f.width,v=f.height;l(d,v)}},[t,l]);return h.createElement(h.Fragment,null,h.createElement(Wn,{width:o.containerWidth,height:o.containerHeight}),h.createElement("div",qt({ref:c},e)))}),lN=h.forwardRef((e,t)=>{var r=e.width,n=e.height;return h.createElement(h.Fragment,null,h.createElement(Wn,{width:r,height:n}),h.createElement("div",qt({ref:t},e)))}),cN=h.forwardRef((e,t)=>{var r=e.width,n=e.height;return typeof r=="string"||typeof n=="string"?h.createElement(uN,qt({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?h.createElement(lN,qt({},e,{width:r,height:n,ref:t})):h.createElement(h.Fragment,null,h.createElement(Wn,{width:r,height:n}),h.createElement("div",qt({ref:t},e)))});function sN(e){return e?oN:cN}var fN=h.forwardRef((e,t)=>{var r=e.children,n=e.className,i=e.height,a=e.onClick,o=e.onContextMenu,u=e.onDoubleClick,l=e.onMouseDown,c=e.onMouseEnter,s=e.onMouseLeave,f=e.onMouseMove,d=e.onMouseUp,v=e.onTouchEnd,p=e.onTouchMove,m=e.onTouchStart,y=e.style,g=e.width,x=e.responsive,A=e.dispatchTouchEvents,w=A===void 0?!0:A,O=h.useRef(null),b=ce(),S=h.useState(null),I=ha(S,2),_=I[0],T=I[1],k=h.useState(null),E=ha(k,2),R=E[0],$=E[1],F=G$(),K=Wu(),H=(K==null?void 0:K.width)>0?K.width:g,L=(K==null?void 0:K.height)>0?K.height:i,V=h.useCallback(B=>{F(B),typeof t=="function"&&t(B),T(B),$(B),B!=null&&(O.current=B)},[F,t,T,$]),W=h.useCallback(B=>{b(pg(B)),b(Ve({handler:a,reactEvent:B}))},[b,a]),fe=h.useCallback(B=>{b(wu(B)),b(Ve({handler:c,reactEvent:B}))},[b,c]),de=h.useCallback(B=>{b(Km()),b(Ve({handler:s,reactEvent:B}))},[b,s]),oe=h.useCallback(B=>{b(wu(B)),b(Ve({handler:f,reactEvent:B}))},[b,f]),De=h.useCallback(()=>{b(wg())},[b]),Be=h.useCallback(()=>{b(Ag())},[b]),rt=h.useCallback(B=>{b(xg(B.key))},[b]),nt=h.useCallback(B=>{b(Ve({handler:o,reactEvent:B}))},[b,o]),un=h.useCallback(B=>{b(Ve({handler:u,reactEvent:B}))},[b,u]),M=h.useCallback(B=>{b(Ve({handler:l,reactEvent:B}))},[b,l]),U=h.useCallback(B=>{b(Ve({handler:d,reactEvent:B}))},[b,d]),z=h.useCallback(B=>{b(Ve({handler:m,reactEvent:B}))},[b,m]),C=h.useCallback(B=>{w&&b(Sg(B)),b(Ve({handler:p,reactEvent:B}))},[b,w,p]),Ce=h.useCallback(B=>{b(Ve({handler:v,reactEvent:B}))},[b,v]),Q=sN(x);return h.createElement(dy.Provider,{value:_},h.createElement(e0.Provider,{value:R},h.createElement(Q,{width:H??(y==null?void 0:y.width),height:L??(y==null?void 0:y.height),className:ne("recharts-wrapper",n),style:Z$({position:"relative",cursor:"default",width:H,height:L},y),onClick:W,onContextMenu:nt,onDoubleClick:un,onFocus:De,onBlur:Be,onKeyDown:rt,onMouseDown:M,onMouseEnter:fe,onMouseLeave:de,onMouseMove:oe,onMouseUp:U,onTouchEnd:Ce,onTouchMove:C,onTouchStart:z,ref:V},h.createElement(aN,null),r)))}),dN=["width","height","responsive","children","className","style","compact","title","desc"];function vN(e,t){if(e==null)return{};var r,n,i=hN(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n{var r=e.width,n=e.height,i=e.responsive,a=e.children,o=e.className,u=e.style,l=e.compact,c=e.title,s=e.desc,f=vN(e,dN),d=wt(f);return l?h.createElement(h.Fragment,null,h.createElement(Wn,{width:r,height:n}),h.createElement(Jd,{otherAttributes:d,title:c,desc:s},a)):h.createElement(fN,{className:o,style:u,width:r,height:n,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},h.createElement(Jd,{otherAttributes:d,title:c,desc:s,ref:t},h.createElement(AM,null,a)))});function Au(){return Au=Object.assign?Object.assign.bind():function(e){for(var t=1;th.createElement(Cg,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:AN,tooltipPayloadSearcher:vy,categoricalChartProps:e,ref:t})),ON=["axis","item"],kN=h.forwardRef((e,t)=>h.createElement(Cg,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:ON,tooltipPayloadSearcher:vy,categoricalChartProps:e,ref:t}));export{kN as B,CN as L,IN as R,_N as T,g$ as X,r$ as a,Qj as b}; diff --git a/src/gateway/static/dashboard/assets/tableSelection-9hV37uhu.js b/src/gateway/static/dashboard/assets/tableSelection-CojkFPwd.js similarity index 95% rename from src/gateway/static/dashboard/assets/tableSelection-9hV37uhu.js rename to src/gateway/static/dashboard/assets/tableSelection-CojkFPwd.js index 1a2018511..b005b598f 100644 --- a/src/gateway/static/dashboard/assets/tableSelection-9hV37uhu.js +++ b/src/gateway/static/dashboard/assets/tableSelection-CojkFPwd.js @@ -1 +1 @@ -import{j as s}from"./tanstack-query-1t81HyiD.js";import{B as u}from"./heroui-BI50yK5B.js";import{r as l}from"./react-dgEcD0HR.js";function f({selectedCount:t,allMatching:e,matchingTotal:a,canSelectAllMatching:r,onSelectAllMatching:n,onClear:o,children:c}){const i=e?`All ${(a??t).toLocaleString()} matching rows selected`:`${t.toLocaleString()} selected`;return s.jsxs("div",{role:"toolbar","aria-label":"Bulk actions",className:"otari-bulk-bar fixed bottom-4 left-1/2 z-40 flex w-[calc(100%-2rem)] max-w-3xl -translate-x-1/2 flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-brand)] bg-[var(--otari-surface)] px-4 py-2.5 shadow-lg",children:[s.jsx("span",{className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:i}),!e&&r&&a!=null?s.jsxs(u,{size:"sm",variant:"ghost",onPress:n,children:["Select all ",a.toLocaleString()," matching this filter"]}):null,s.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[c,s.jsx(u,{size:"sm",variant:"ghost",onPress:o,children:"Clear"})]})]})}function b(){const[t,e]=l.useState(()=>new Set),[a,r]=l.useState(!1),n=l.useCallback(i=>{e(i),r(!1)},[]),o=l.useCallback(()=>{e(new Set),r(!1)},[]),c=l.useCallback(()=>r(!0),[]);return{selectedKeys:t,onSelectionChange:n,allMatching:a,enableAllMatching:c,clear:o}}function h(t,e){return t==="all"?e:e.filter(a=>t.has(a))}export{f as B,h as r,b as u}; +import{j as s}from"./tanstack-query-1t81HyiD.js";import{B as u}from"./heroui-DZj66Arc.js";import{r as l}from"./react-dgEcD0HR.js";function f({selectedCount:t,allMatching:e,matchingTotal:a,canSelectAllMatching:r,onSelectAllMatching:n,onClear:o,children:c}){const i=e?`All ${(a??t).toLocaleString()} matching rows selected`:`${t.toLocaleString()} selected`;return s.jsxs("div",{role:"toolbar","aria-label":"Bulk actions",className:"otari-bulk-bar fixed bottom-4 left-1/2 z-40 flex w-[calc(100%-2rem)] max-w-3xl -translate-x-1/2 flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-brand)] bg-[var(--otari-surface)] px-4 py-2.5 shadow-lg",children:[s.jsx("span",{className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:i}),!e&&r&&a!=null?s.jsxs(u,{size:"sm",variant:"ghost",onPress:n,children:["Select all ",a.toLocaleString()," matching this filter"]}):null,s.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-2",children:[c,s.jsx(u,{size:"sm",variant:"ghost",onPress:o,children:"Clear"})]})]})}function b(){const[t,e]=l.useState(()=>new Set),[a,r]=l.useState(!1),n=l.useCallback(i=>{e(i),r(!1)},[]),o=l.useCallback(()=>{e(new Set),r(!1)},[]),c=l.useCallback(()=>r(!0),[]);return{selectedKeys:t,onSelectionChange:n,allMatching:a,enableAllMatching:c,clear:o}}function h(t,e){return t==="all"?e:e.filter(a=>t.has(a))}export{f as B,h as r,b as u}; diff --git a/src/gateway/static/dashboard/index.html b/src/gateway/static/dashboard/index.html index b64713493..8dba6676c 100644 --- a/src/gateway/static/dashboard/index.html +++ b/src/gateway/static/dashboard/index.html @@ -19,11 +19,11 @@ insets to sit out of the way. --> Otari Dashboard - + - - + +
diff --git a/tests/integration/test_usage_summary.py b/tests/integration/test_usage_summary.py index 5df725406..a4be46df1 100644 --- a/tests/integration/test_usage_summary.py +++ b/tests/integration/test_usage_summary.py @@ -35,7 +35,12 @@ def _make_log( timestamp: datetime, api_key_id: str | None = None, model: str = "gpt-4", + prompt_tokens: int | None = 10, + completion_tokens: int | None = 5, total_tokens: int | None = 15, + cache_read_tokens: int | None = None, + cache_write_tokens: int | None = None, + billing_meters: dict[str, int] | None = None, cost: float | None = 0.01, status: str = "success", latency_ms: int | None = None, @@ -51,9 +56,12 @@ def _make_log( model=model, provider="openai", endpoint="/v1/chat/completions", - prompt_tokens=10, - completion_tokens=5, + prompt_tokens=prompt_tokens, + completion_tokens=completion_tokens, total_tokens=total_tokens, + cache_read_tokens=cache_read_tokens, + cache_write_tokens=cache_write_tokens, + billing_meters=billing_meters, cost=cost, status=status, error_message="boom" if status == "error" else None, @@ -83,6 +91,7 @@ def test_summary_empty_range_is_all_zero(client: TestClient, master_key_header: "error_count": 0, "avg_latency_ms": None, "unpriced_requests": 0, + "billed_input_tokens": 0, } assert body["by_model"] == [] assert body["by_user"] == [] @@ -321,3 +330,183 @@ def test_csv_export_guards_formula_injection( injected = [r for r in rows if r[0] == "model" and "cmd" in r[1]][0] # The dangerous leading '=' is neutralized with a leading quote. assert injected[1].startswith("'=") + + +# --------------------------------------------------------------------------- +# Billed token composition (series + totals + breakdowns) and /series grouping. +# --------------------------------------------------------------------------- + +SERIES_PATH = "/v1/usage/series" + + +def test_series_composition_prefers_meters_and_falls_back( + client: TestClient, master_key_header: dict[str, str], db_session: Session +) -> None: + ts = datetime(2025, 3, 1, 10, 30, tzinfo=UTC) + # Additive-convention row, normalized by its meters: prompt excludes the + # cache buckets, so billed input (900) far exceeds prompt_tokens (100). + _make_log( + db_session, + user_id="comp", + timestamp=ts, + prompt_tokens=100, + completion_tokens=50, + total_tokens=150, + cache_read_tokens=700, + cache_write_tokens=100, + billing_meters={ + "total_input_tokens": 900, + "fresh_input_tokens": 100, + "cache_read_tokens": 700, + "cache_write_tokens": 100, + "cache_write_1h_tokens": 0, + "completion_tokens": 50, + }, + ) + # Meterless row: falls back to the raw columns under the subset convention + # (billed input = prompt_tokens as stored). + _make_log( + db_session, + user_id="comp", + timestamp=ts, + prompt_tokens=200, + completion_tokens=30, + total_tokens=230, + cache_read_tokens=120, + status="error", + ) + db_session.commit() + + body = client.get( + SUMMARY_PATH, + headers=master_key_header, + params={"user_id": "comp", "start_date": "2025-03-01T00:00:00Z", "end_date": "2025-03-02T00:00:00Z"}, + ).json() + + assert body["totals"]["billed_input_tokens"] == 900 + 200 + [point] = [p for p in body["series"] if p["requests"]] + assert point["input_tokens"] == 1100 + assert point["cache_read_tokens"] == 700 + 120 + assert point["cache_write_tokens"] == 100 + assert point["output_tokens"] == 80 + assert point["errors"] == 1 + # The raw provider total is untouched by the composition fields. + assert point["tokens"] == 150 + 230 + + # Breakdowns report the same billed quantity (input + output). + [model_row] = body["by_model"] + assert model_row["tokens"] == 1100 + 80 + + +def test_grouped_series_requires_master_key_and_group_by(client: TestClient) -> None: + assert client.get(SERIES_PATH).status_code == 401 + + +def test_grouped_series_rejects_unknown_group_by(client: TestClient, master_key_header: dict[str, str]) -> None: + assert client.get(SERIES_PATH, headers=master_key_header, params={"group_by": "provider"}).status_code == 422 + # group_by is required. + assert client.get(SERIES_PATH, headers=master_key_header).status_code == 422 + + +def test_grouped_series_by_model_reconciles( + client: TestClient, master_key_header: dict[str, str], db_session: Session +) -> None: + day1 = datetime(2025, 4, 1, 9, 0, tzinfo=UTC) + day2 = datetime(2025, 4, 2, 9, 0, tzinfo=UTC) + _make_log(db_session, user_id="grp", timestamp=day1, model="gpt-4", cost=0.30, total_tokens=15) + _make_log(db_session, user_id="grp", timestamp=day1, model="claude", cost=0.10, total_tokens=15) + _make_log(db_session, user_id="grp", timestamp=day2, model="gpt-4", cost=0.20, total_tokens=15) + db_session.commit() + + body = client.get( + SERIES_PATH, + headers=master_key_header, + params={ + "group_by": "model", + "user_id": "grp", + "start_date": "2025-04-01T00:00:00Z", + "end_date": "2025-04-03T00:00:00Z", + }, + ).json() + + assert body["group_by"] == "model" + assert [g["key"] for g in body["groups"]] == ["gpt-4", "claude"] + + # Sparse points, canonical UTC buckets, sorted by bucket. + buckets = [p["bucket_start"] for p in body["points"]] + assert buckets == sorted(buckets) + assert set(buckets) == {"2025-04-01T00:00:00Z", "2025-04-02T00:00:00Z"} + + day1_points = {p["key"]: p for p in body["points"] if p["bucket_start"] == "2025-04-01T00:00:00Z"} + assert day1_points["gpt-4"]["cost"] == pytest.approx(0.30) + assert day1_points["claude"]["cost"] == pytest.approx(0.10) + # Billed tokens per (bucket, group): meterless rows fall back to prompt+output. + assert day1_points["gpt-4"]["tokens"] == 15 + + # The stack reconciles with the window totals. + assert sum(p["cost"] for p in body["points"]) == pytest.approx(0.60) + assert sum(p["requests"] for p in body["points"]) == 3 + + +def test_grouped_series_folds_past_top_n_and_null_groups( + client: TestClient, master_key_header: dict[str, str], db_session: Session +) -> None: + ts = datetime(2025, 5, 1, 12, 0, tzinfo=UTC) + # 10 models, descending spend, one request each: 8 named + 2 folded. + for idx in range(10): + _make_log(db_session, user_id="topn", timestamp=ts, model=f"m{idx}", cost=1.0 - idx * 0.05, total_tokens=15) + db_session.commit() + + body = client.get( + SERIES_PATH, + headers=master_key_header, + params={ + "group_by": "model", + "user_id": "topn", + "start_date": "2025-05-01T00:00:00Z", + "end_date": "2025-05-02T00:00:00Z", + }, + ).json() + + named = [g for g in body["groups"] if not g["is_other"]] + fold = [g for g in body["groups"] if g["is_other"]] + assert len(named) == 8 + assert len(fold) == 1 + assert fold[0]["requests"] == 2 + + other_points = [p for p in body["points"] if p["is_other"]] + assert sum(p["requests"] for p in other_points) == 2 + assert sum(p["cost"] for p in other_points) == pytest.approx(0.60 + 0.55) + # Every named point carries its own key; the fold rows have key None. + assert all(p["key"] is None for p in other_points) + assert sum(p["requests"] for p in body["points"]) == 10 + + +def test_grouped_series_null_group_key_survives_when_in_top_n( + client: TestClient, master_key_header: dict[str, str], db_session: Session +) -> None: + ts = datetime(2025, 6, 1, 12, 0, tzinfo=UTC) + # api_key_id is NULL on both rows: the NULL group ranks in the top N and must + # come back as a real key=None group (not the fold). + _make_log(db_session, user_id="nullg", timestamp=ts, cost=0.10, total_tokens=15) + _make_log(db_session, user_id="nullg", timestamp=ts, cost=0.20, total_tokens=15) + db_session.commit() + + body = client.get( + SERIES_PATH, + headers=master_key_header, + params={ + "group_by": "api_key_id", + "user_id": "nullg", + "start_date": "2025-06-01T00:00:00Z", + "end_date": "2025-06-02T00:00:00Z", + }, + ).json() + + assert [g["key"] for g in body["groups"]] == [None] + assert body["groups"][0]["is_other"] is False + [point] = body["points"] + assert point["key"] is None + assert point["is_other"] is False + assert point["requests"] == 2 + assert point["cost"] == pytest.approx(0.30) diff --git a/web/src/api/hooks.ts b/web/src/api/hooks.ts index 2beb49c3a..380ed09f5 100644 --- a/web/src/api/hooks.ts +++ b/web/src/api/hooks.ts @@ -41,6 +41,8 @@ import type { UsageDeleteResult, UsageEntry, UsageFilters, + UsageGroupBy, + UsageGroupedSeries, UsageMutationSelection, UsageSetPriceRequest, UsageSetPriceResult, @@ -772,3 +774,26 @@ export function useUsageSummary(filters: UsageFilters, bucket: UsageBucket, enab staleTime: 30_000, }); } + +// A per-group time series for the stacked analytics chart (top groups by spend +// plus an "other" fold). Only fetched while a group-by dimension is active, so +// the ungrouped view costs nothing extra. Caching mirrors useUsageSummary. +export function useUsageGroupedSeries( + filters: UsageFilters, + bucket: UsageBucket, + groupBy: UsageGroupBy | null, + enabled = true, +) { + return useQuery({ + queryKey: [USAGE, "series", filters, bucket, groupBy], + queryFn: () => { + const params = usageParams(filters); + params.set("bucket", bucket); + params.set("group_by", groupBy as string); + return apiFetch(`/v1/usage/series?${params.toString()}`); + }, + enabled: enabled && groupBy !== null, + placeholderData: keepPreviousData, + staleTime: 30_000, + }); +} diff --git a/web/src/api/types.ts b/web/src/api/types.ts index 085f90374..7ecd2d027 100644 --- a/web/src/api/types.ts +++ b/web/src/api/types.ts @@ -499,6 +499,10 @@ export interface UsageTotals { // Requests with no configured price (cost is null), e.g. imported usage for an // unpriced model, so a $0 total is not read as free. unpriced_requests?: number; + // Billed input tokens (fresh input plus both cache buckets), normalized via + // each row's billing meters, so cache hit rate (cache_read / billed_input) is + // meaningful across providers. Optional: postdates the other totals. + billed_input_tokens?: number; } // One breakdown row (a model, a user, or an API key). `key` is null both for the @@ -512,12 +516,21 @@ export interface UsageGroupRow { is_other: boolean; } -// One time bucket. `bucket_start` is canonical ISO-8601 UTC (`...Z`). +// One time bucket. `bucket_start` is canonical ISO-8601 UTC (`...Z`). `tokens` +// stays the raw provider-reported total; the composition fields are the billed +// view (input_tokens includes both cache buckets), so fresh input derives as +// max(0, input - cache_read - cache_write). All optional: they postdate the +// original series shape, and a `vite dev` session can face an older gateway. export interface UsageSeriesPoint { bucket_start: string; cost: number; tokens: number; requests: number; + errors?: number; + input_tokens?: number; + cache_read_tokens?: number; + cache_write_tokens?: number; + output_tokens?: number; } // Aggregated spend/volume for the Usage & analytics page. `start_date`/`end_date` @@ -537,6 +550,32 @@ export interface UsageSummary { series: UsageSeriesPoint[]; } +// Dimensions the grouped series endpoint can split by. +export type UsageGroupBy = "model" | "user_id" | "api_key_id" | "source"; + +// One (time bucket, group) cell of a grouped series. `key`/`is_other` follow the +// UsageGroupRow convention; `tokens` is the billed total (input incl. cache, +// plus output), matching the ungrouped composition fields. +export interface UsageGroupedSeriesPoint { + bucket_start: string; + key: string | null; + is_other: boolean; + cost: number; + tokens: number; + requests: number; +} + +// A per-group time series (from /v1/usage/series) for the stacked charts. +// `groups` ranks the window's top groups by spend, in stack/legend order. +export interface UsageGroupedSeries { + start_date: string; + end_date: string; + bucket: UsageBucket; + group_by: UsageGroupBy; + groups: UsageGroupRow[]; + points: UsageGroupedSeriesPoint[]; +} + // One per-user budget reset event (the spend that was cleared and when the next // reset is due). Surfaced as the budget's reset history. export interface BudgetResetLog { diff --git a/web/src/components/ActivityTimeline.test.tsx b/web/src/components/ActivityTimeline.test.tsx index ead6b9d77..9425cae94 100644 --- a/web/src/components/ActivityTimeline.test.tsx +++ b/web/src/components/ActivityTimeline.test.tsx @@ -67,26 +67,30 @@ describe("ActivityTimeline", () => { expect(screen.getByText(/No activity in this range/)).toBeInTheDocument(); }); - it("renders a dual-thumb range slider positioned on the active window", () => { + it("renders a brush-selectable chart (drag-to-zoom), not edge thumbs", () => { renderTimeline(); - // Window covers the whole 3-bucket series: thumbs sit at the extremes of the - // fractional bucket scale [0, 3]. Queried by their edge labels so the pan - // strip (also role="slider") is excluded; DOM order is start then end. - const thumbs = screen.getAllByRole("slider", { name: /^Window/ }); - expect(thumbs).toHaveLength(2); - expect(thumbs[0]).toHaveValue("0"); - expect(thumbs[1]).toHaveValue("3"); + // The old dual-thumb slider is gone; time selection is a drag across the + // plot (the crosshair cursor is its affordance), like every mainstream + // metrics tool. + expect(screen.queryByRole("slider", { name: /^Window/ })).not.toBeInTheDocument(); + expect(document.querySelector(".cursor-crosshair")).not.toBeNull(); }); - it("positions the thumbs on a sub-window", () => { + it("legends the error split when the window has failures", () => { renderTimeline({ - // Jul 11 only (one bucket of the three). - windowStart: "2026-07-11T00:00:00.000Z", - windowEnd: "2026-07-12T00:00:00.000Z", + series: [ + { bucketStart: "2026-07-10T00:00:00Z", requests: 12, errors: 3 }, + { bucketStart: "2026-07-11T00:00:00Z", requests: 40, errors: 0 }, + { bucketStart: "2026-07-12T00:00:00Z", requests: 8 }, + ], }); - const thumbs = screen.getAllByRole("slider", { name: /^Window/ }); - expect(thumbs[0]).toHaveValue("1"); - expect(thumbs[1]).toHaveValue("2"); + expect(screen.getByText("Succeeded")).toBeInTheDocument(); + expect(screen.getByText("Failed")).toBeInTheDocument(); + }); + + it("keeps a single calm series when nothing failed", () => { + renderTimeline(); + expect(screen.queryByText("Failed")).not.toBeInTheDocument(); }); it("promotes to the next larger preset when zooming out at the full extent", async () => { @@ -114,9 +118,9 @@ describe("ActivityTimeline", () => { windowEnd: "2026-07-13T00:00:00.000Z", }); await user.click(screen.getByRole("button", { name: "Zoom out" })); - // One bucket doubles to two, centered, then snaps outward to whole buckets: - // Jul 11 .. Jul 14 (exclusive). - expect(onSelectRange).toHaveBeenCalledWith("2026-07-11T00:00:00.000Z", "2026-07-14T00:00:00.000Z"); + // One bucket doubles to two, centered on whole buckets: Jul 12 .. Jul 14 + // (exclusive). + expect(onSelectRange).toHaveBeenCalledWith("2026-07-12T00:00:00.000Z", "2026-07-14T00:00:00.000Z"); }); it("offers Reset only when zoomed, and it restores the full extent", async () => { @@ -143,17 +147,6 @@ describe("ActivityTimeline", () => { expect(onPreset).toHaveBeenCalledWith(expect.objectContaining({ key: "7d" })); }); - it("moves an edge by one whole bucket per arrow key", async () => { - const user = userEvent.setup(); - const { onSelectRange } = renderTimeline(); - // Focus the end thumb and nudge it left: the full 3-bucket window narrows to - // the first two buckets (arrows are rerouted to whole-bucket steps; the - // slider's own 0.1-bucket step would be snapped back by the commit). - screen.getByRole("slider", { name: /Window end/ }).focus(); - await user.keyboard("{ArrowLeft}"); - expect(onSelectRange).toHaveBeenCalledWith("2026-07-10T00:00:00.000Z", "2026-07-12T00:00:00.000Z"); - }); - it("pans the window by whole buckets from the keyboard", async () => { const user = userEvent.setup(); const series = [ @@ -195,7 +188,7 @@ describe("ActivityTimeline", () => { expect(onSelectRange).toHaveBeenCalledWith("2026-07-12T00:00:00.000Z", "2026-07-14T00:00:00.000Z"); }); - it("reports the reachable pan range on the strip, not the full extent", () => { + it("reports the reachable pan range on the rail, not the full extent", () => { // A one-bucket window in the three-bucket series: the left edge can only travel // 0..(n - span) = 0..2, and currently sits at bucket 1. renderTimeline({ @@ -206,14 +199,10 @@ describe("ActivityTimeline", () => { expect(pan).toHaveAttribute("aria-valuemin", "0"); expect(pan).toHaveAttribute("aria-valuemax", "2"); expect(pan).toHaveAttribute("aria-valuenow", "1"); - expect(pan).toHaveAttribute("aria-disabled", "false"); }); - it("announces the pan strip disabled at the full extent", () => { - // Full-window default: nothing to pan, but the control stays in the tab order. + it("renders no pan rail at the full extent (nothing to pan)", () => { renderTimeline(); - const pan = screen.getByRole("slider", { name: "Pan the selected window" }); - expect(pan).toHaveAttribute("aria-disabled", "true"); - expect(pan).toHaveAttribute("tabindex", "0"); + expect(screen.queryByRole("slider", { name: "Pan the selected window" })).not.toBeInTheDocument(); }); }); diff --git a/web/src/components/ActivityTimeline.tsx b/web/src/components/ActivityTimeline.tsx index cb328af1c..04601485a 100644 --- a/web/src/components/ActivityTimeline.tsx +++ b/web/src/components/ActivityTimeline.tsx @@ -1,31 +1,28 @@ import { Button, Spinner } from "@heroui/react"; -import { useEffect, useRef, useState } from "react"; +import { useRef, useState } from "react"; import type { ReactNode } from "react"; -import { Slider as RacSlider, SliderThumb as RacSliderThumb, SliderTrack as RacSliderTrack } from "react-aria-components"; -import { Bar, BarChart, ResponsiveContainer, Tooltip, XAxis } from "recharts"; import type { UsageBucket } from "@/api/types"; +import { ChartLegend, TrendChart, type SeriesDef, type StackedPoint } from "@/components/charts"; import { bucketDurationMs, bucketIndexRange, formatWindowLabel, rangeFromBuckets, type RangePreset } from "@/lib/timeRange"; // A request-volume histogram that doubles as the time-range selector for the -// Usage and Activity pages (the pattern CloudWatch Logs Insights, Kibana, and -// Grafana/Loki use for log exploration). Presets set the *extent* the chart -// spans; the selection lives on the chart itself: full-height handles at the -// window edges zoom, a slim strip along the axis pans, regions outside the -// window dim in place, and −/+ buttons step the zoom (zooming out past the -// extent promotes to the next larger preset, so a wrong default is one tap -// away from a wider view). The tiles and log below follow the selection. -// -// Smoothness: the handles are react-aria slider thumbs (unstyled primitives, -// the same machinery HeroUI wraps), so they are pointer-captured and glide at -// 0.1-bucket steps. Drag feedback is CSS-positioned shades; the recharts tree -// never re-renders mid-drag, and the window commits once, on release, snapped -// outward to whole buckets. Buckets are UTC-aligned, so the selection lines up -// with the bars and the caption reads in UTC. +// Activity page (the context strip pattern CloudWatch Logs Insights, Kibana, +// and Grafana Loki use for log exploration). Presets set the *extent* the strip +// spans; **dragging across the chart selects the window** (the standard +// interaction everywhere from Grafana to the OpenAI usage dashboard), regions +// outside the window dim in place, and −/+ buttons step the zoom (zooming out +// past the extent promotes to the next larger preset, so a wrong default is one +// tap away from a wider view). Failed requests render as a red segment on top +// of each bar, so dropped traffic is visible right on the strip. A slim rail +// under the chart pans the zoomed window (pointer drag or arrow keys) without +// resizing it. Buckets are UTC-aligned, so the selection lines up with the bars +// and the caption reads in UTC. export interface TimelinePoint { bucketStart: string; requests: number; + errors?: number; } interface ActivityTimelineProps { @@ -41,7 +38,7 @@ interface ActivityTimelineProps { onSelectFull: () => void; series: TimelinePoint[]; bucket: UsageBucket; - // The active window (server-echoed): positions the handles and drives the caption. + // The active window (server-echoed): positions the dimming and drives the caption. windowStart?: string; windowEnd?: string; loading?: boolean; @@ -49,14 +46,6 @@ interface ActivityTimelineProps { action?: ReactNode; } -const BRAND = "var(--otari-brand)"; -// Slider positions per bucket: fine enough to glide, coarse enough that arrow -// keys still move perceptibly (PageUp/Down jumps a whole bucket). -const STEPS_PER_BUCKET = 10; -// The pan strip's height: it overlays the x-axis band at the chart's bottom, so -// it never sits over the bars and their hover tooltips. -const PAN_STRIP_PX = 22; - function formatTick(iso: string, bucket: UsageBucket): string { const d = new Date(iso); if (Number.isNaN(d.getTime())) return iso; @@ -65,50 +54,9 @@ function formatTick(iso: string, bucket: UsageBucket): string { : d.toLocaleDateString(undefined, { month: "short", day: "numeric", timeZone: "UTC" }); } -function TimelineTooltip({ - active, - label, - payload, - bucket, -}: { - active?: boolean; - label?: string; - payload?: readonly { value?: number | string }[]; - bucket: UsageBucket; -}) { - const value = payload?.[0]?.value; - if (!active || typeof value !== "number" || typeof label !== "string") return null; - return ( -
-
{formatTick(label, bucket)} · UTC
-
{value.toLocaleString()} requests
-
- ); -} - -// A window-edge handle: a full-height grab bar with a centered grip pill, laid -// over the chart at the thumb's position. react-aria positions it with inline -// `left: X%` plus `transform: translate(-50%, -50%)`, so `top-1/2` is the whole -// centering recipe: adding Tailwind translate utilities (a separate `translate` -// property) would stack with that inline transform and shift the bar off the -// chart. -const THUMB_CLASS = "group top-1/2 h-full w-3 cursor-ew-resize outline-none"; - -// The thumbs' accessible names double as the routing key for the wrapper's -// arrow-key intercept below. -const THUMB_LABELS = ["Window start", "Window end"] as const; - -function EdgeHandle({ index }: { index: 0 | 1 }) { - return ( - - - - - ); -} +const SUCCESS_SERIES: SeriesDef = { key: "success", label: "Succeeded", color: "var(--otari-brand)" }; +const ERROR_SERIES: SeriesDef = { key: "errors", label: "Failed", color: "var(--otari-danger)" }; +const PLAIN_SERIES: SeriesDef = { key: "requests", label: "Requests", color: "var(--otari-brand)" }; export function ActivityTimeline({ presets, @@ -125,51 +73,49 @@ export function ActivityTimeline({ action, }: ActivityTimelineProps) { const starts = series.map((p) => p.bucketStart); - const data = series.map((p) => ({ x: p.bucketStart, requests: p.requests })); const n = series.length; const label = formatWindowLabel(windowStart, windowEnd); - // Selection in fractional bucket units over [0, n]. Local state so a drag - // updates every frame; synced from the active window only while not dragging - // (the commit round-trips through the parent and must not fight the pointer). - const windowToRange = (): [number, number] => { - if (n === 0) return [0, 1]; - const { startIndex, endIndex } = bucketIndexRange(starts, windowStart, windowEnd); - return [startIndex, endIndex + 1]; - }; - const [sel, setSelState] = useState<[number, number]>(windowToRange); - // Mirror of `sel` for pointer handlers: a pointerup can fire before the last - // pointermove's setState has re-rendered, and committing from the (stale) - // closure value could snap to a different bucket than the one on screen. - const selRef = useRef(sel); - const setSel = (next: [number, number]) => { - selRef.current = next; - setSelState(next); + // Errors stack only when the window actually has any, so the everyday strip + // stays a single calm series and red keeps its "something failed" meaning. + const hasErrors = series.some((p) => (p.errors ?? 0) > 0); + const chartSeries = hasErrors ? [SUCCESS_SERIES, ERROR_SERIES] : [PLAIN_SERIES]; + const data: StackedPoint[] = series.map((p): StackedPoint => { + const errors = Math.min(p.errors ?? 0, p.requests); + return hasErrors + ? { x: p.bucketStart, success: p.requests - errors, errors } + : { x: p.bucketStart, requests: p.requests }; + }); + + // The active window as inclusive bucket indices of the extent series. The pan + // rail keeps a local copy only while a drag is in flight (live feedback); + // otherwise the props are the single source of truth. + const windowIdx = n > 0 ? bucketIndexRange(starts, windowStart, windowEnd) : { startIndex: 0, endIndex: 0 }; + const [panSel, setPanSel] = useState<{ startIndex: number; endIndex: number } | null>(null); + // Ref mirror for the pointer handlers: pointerup can fire before the last + // pointermove's setState has re-rendered, and committing from the stale + // closure would pan to the previous position. + const panSelRef = useRef(panSel); + const setPan = (next: { startIndex: number; endIndex: number } | null) => { + panSelRef.current = next; + setPanSel(next); }; - const dragging = useRef(false); - useEffect(() => { - if (!dragging.current) setSel(windowToRange()); - // starts is derived from series each render; resync on the window bounds and - // on the extent itself (length plus its first/last bucket), not the fresh - // array identity. The endpoints catch a series that rolls forward while the - // bound strings and length stay identical, which would otherwise strand the - // thumbs on stale positions. - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [windowStart, windowEnd, n, starts[0], starts[n - 1]]); + const sel = panSel ?? windowIdx; + const span = sel.endIndex - sel.startIndex + 1; + const atFullExtent = sel.startIndex === 0 && sel.endIndex >= n - 1; + const zoomed = n > 0 && !atFullExtent; - const commit = ([lo, hi]: [number, number]) => { - dragging.current = false; + // Commit an inclusive bucket range: the full extent falls back to the rolling + // preset window; anything narrower resolves to absolute instants. + const commit = (startIndex: number, endIndex: number) => { if (n === 0) return; - // Snap outward to whole buckets so the selection always covers what was - // touched, and keep at least one bucket selected. - const startIndex = Math.max(0, Math.min(n - 1, Math.floor(lo + 1e-6))); - const endIndex = Math.max(startIndex, Math.min(n - 1, Math.ceil(hi - 1e-6) - 1)); - if (startIndex === 0 && endIndex === n - 1) { + const lo = Math.max(0, Math.min(startIndex, endIndex)); + const hi = Math.min(n - 1, Math.max(startIndex, endIndex)); + if (lo === 0 && hi === n - 1) { onSelectFull(); - setSel([0, n]); return; } - const range = rangeFromBuckets(starts, startIndex, endIndex, bucket); + const range = rangeFromBuckets(starts, lo, hi, bucket); if (range) onSelectRange(range.startIso, range.endIso); }; @@ -184,25 +130,13 @@ export function ActivityTimeline({ extentIndex >= 0 ? presets[extentIndex + 1] : presets.find((p) => p.seconds === null || (extentSeconds !== null && p.seconds > extentSeconds)); - const [lo, hi] = sel; - const atFullExtent = lo <= 0.01 && hi >= n - 0.01; const applySpan = (newSpan: number) => { - const span = Math.max(1, Math.min(n, newSpan)); - const center = (lo + hi) / 2; - let nlo = center - span / 2; - let nhi = center + span / 2; - if (nlo < 0) { - nhi -= nlo; - nlo = 0; - } - if (nhi > n) { - nlo -= nhi - n; - nhi = n; - } - const next: [number, number] = [Math.max(0, nlo), Math.min(n, nhi)]; - setSel(next); - commit(next); + const target = Math.max(1, Math.min(n, Math.round(newSpan))); + const center = (sel.startIndex + sel.endIndex + 1) / 2; + let lo = Math.round(center - target / 2); + lo = Math.max(0, Math.min(n - target, lo)); + commit(lo, lo + target - 1); }; const zoomOut = () => { @@ -210,75 +144,22 @@ export function ActivityTimeline({ if (largerPreset) onPreset(largerPreset); return; } - applySpan((hi - lo) * 2); - }; - const zoomIn = () => applySpan((hi - lo) / 2); - - // Arrow keys on a handle move that edge by one whole bucket. Intercepted in - // the capture phase on the wrapper below (before react-aria's own handler, - // which is unconditional): the slider's built-in arrow step is the fine - // pointer step (0.1 bucket), which the bucket-snapping commit would undo, - // making arrows a silent no-op. PageUp/Down, Home, and End stay react-aria's. - const stepEdge = (index: number, deltaBuckets: number) => { - const [slo, shi] = selRef.current; - const next: [number, number] = - index === 0 - ? [Math.max(0, Math.min(shi - 1, Math.round(slo) + deltaBuckets)), shi] - : [slo, Math.min(n, Math.max(slo + 1, Math.round(shi) + deltaBuckets))]; - setSel(next); - commit(next); - }; - - const onSliderKeyDownCapture = (event: React.KeyboardEvent) => { - const delta = - event.key === "ArrowRight" || event.key === "ArrowUp" - ? 1 - : event.key === "ArrowLeft" || event.key === "ArrowDown" - ? -1 - : 0; - if (delta === 0) return; - const which = (event.target as HTMLElement).getAttribute?.("aria-label"); - const index = THUMB_LABELS.indexOf(which as (typeof THUMB_LABELS)[number]); - if (index < 0) return; - event.preventDefault(); - event.stopPropagation(); - stepEdge(index, delta); + applySpan(span * 2); }; + const zoomIn = () => applySpan(span / 2); - // Pan: dragging the axis strip slides the whole window. Plain pointer capture; - // commits on release like the handles do. - const areaRef = useRef(null); - const pan = useRef<{ x: number; sel: [number, number] } | null>(null); - const onPanMove = (event: React.PointerEvent) => { - if (!pan.current || !areaRef.current) return; - const width = areaRef.current.getBoundingClientRect().width; - if (width <= 0) return; - const dx = ((event.clientX - pan.current.x) / width) * n; - const span = pan.current.sel[1] - pan.current.sel[0]; - const plo = Math.max(0, Math.min(n - span, pan.current.sel[0] + dx)); - setSel([plo, plo + span]); - }; + // Pan rail: slides the zoomed window without resizing it. Pointer drags with + // capture and commits on release; arrow keys step one bucket, PageUp/Down a + // whole window, Home/End to the extent edges. + const railRef = useRef(null); + const panStart = useRef<{ x: number; startIndex: number } | null>(null); - // Keyboard pan: slide the whole window by whole buckets without resizing it, so - // a keyboard user can reach a mid-extent window with one control instead of - // stepping both edges in turn. Commits like the pointer pan does; a clamped - // pan (already against an edge) is a silent no-op. Mirrors the axis strip below. - const panBy = (deltaBuckets: number) => { - const [slo, shi] = selRef.current; - const span = shi - slo; - const plo = Math.max(0, Math.min(n - span, Math.round(slo) + deltaBuckets)); - const next: [number, number] = [plo, plo + span]; - setSel(next); - commit(next); + const panTo = (startIndex: number): { startIndex: number; endIndex: number } => { + const lo = Math.max(0, Math.min(n - span, startIndex)); + return { startIndex: lo, endIndex: lo + span - 1 }; }; const onPanKeyDown = (event: React.KeyboardEvent) => { - if (atFullExtent) return; - // Read the span from the live ref, the same source `panBy` reads its start - // from: holding Page Up/Down repeats before the re-render lands, so deriving - // the page size from render-state `hi - lo` would pan by a stale span. - const [slo, shi] = selRef.current; - const span = Math.max(1, Math.round(shi - slo)); const delta = event.key === "ArrowRight" || event.key === "ArrowUp" ? 1 @@ -295,18 +176,33 @@ export function ActivityTimeline({ : 0; if (delta === 0) return; event.preventDefault(); - panBy(delta); + const next = panTo(sel.startIndex + delta); + if (next.startIndex !== sel.startIndex) commit(next.startIndex, next.endIndex); + }; + + const onPanMove = (event: React.PointerEvent) => { + if (!panStart.current || !railRef.current) return; + const width = railRef.current.getBoundingClientRect().width; + if (width <= 0) return; + const dx = Math.round(((event.clientX - panStart.current.x) / width) * n); + setPan(panTo(panStart.current.startIndex + dx)); }; - const loPct = n ? (Math.min(lo, hi) / n) * 100 : 0; - const hiPct = n ? (Math.max(lo, hi) / n) * 100 : 100; - const zoomed = !atFullExtent; + const endPan = (event: React.PointerEvent) => { + if (event.currentTarget.hasPointerCapture(event.pointerId)) { + event.currentTarget.releasePointerCapture(event.pointerId); + } + panStart.current = null; + const committed = panSelRef.current; + setPan(null); + if (committed && committed.startIndex !== windowIdx.startIndex) { + commit(committed.startIndex, committed.endIndex); + } + }; - // Pan-strip ARIA. Its value is the window's *left edge*, which can only travel - // up to `n - span`, so the reachable max is that, not `n`. - const panSpan = Math.max(1, Math.round(hi - lo)); - const panMax = Math.max(0, n - panSpan); - const panNow = Math.min(Math.max(0, Math.round(Math.min(lo, hi))), panMax); + const loPct = n ? (sel.startIndex / n) * 100 : 0; + const hiPct = n ? ((sel.endIndex + 1) / n) * 100 : 100; + const panMax = Math.max(0, n - span); return (
@@ -329,13 +225,14 @@ export function ActivityTimeline({
- - Requests / {bucket === "hour" ? "hour" : "day"} + + + Requests / {bucket === "hour" ? "hour" : "day"} + +
- - drag the edges to zoom · the bottom strip to pan - + drag across the chart to zoom {zoomed ? ( - ) : null} @@ -370,113 +267,45 @@ export function ActivityTimeline({ No activity in this range.
) : ( -
-
- - - formatTick(iso, bucket)} - tick={{ fontSize: 10, fill: "var(--otari-muted)" }} - /> - } - /> - - - -
- - {/* Out-of-window shades: pure CSS feedback that tracks the handles - live without touching the recharts tree. pointer-events-none so - the bars' hover tooltip keeps working. */} - {zoomed ? ( - <> -
+
+ value.toLocaleString()} + formatXTick={(iso) => formatTick(iso, bucket)} + ariaLabel={ariaLabel} + height={90} + onSelectRange={commit} + window={zoomed || panSel ? sel : null} + /> + {/* Pan rail: a minimap-style scrollbar for the zoomed window. Only + rendered while zoomed (at the full extent there is nothing to + pan), so it never takes space or a tab stop otherwise. */} + {zoomed || panSel ? ( +
{ + event.preventDefault(); + panStart.current = { x: event.clientX, startIndex: sel.startIndex }; + setPan({ ...sel }); + event.currentTarget.setPointerCapture(event.pointerId); + }} + onPointerMove={onPanMove} + onPointerUp={endPan} + onPointerCancel={endPan} /> - +
) : null} - - {/* Pan strip along the axis band: slides the window without resizing - it. Sits below the bars, so plot-area tooltips are unaffected. It - is a single-value slider (the window's left edge, in buckets) so a - keyboard user gets a real pan control; it stays in the tab order at - the full extent but is announced disabled there, since a full-extent - window has nothing to pan. */} -
{ - event.stopPropagation(); - event.preventDefault(); - dragging.current = true; - pan.current = { x: event.clientX, sel: [Math.min(lo, hi), Math.max(lo, hi)] }; - event.currentTarget.setPointerCapture(event.pointerId); - }} - onPointerMove={onPanMove} - onPointerUp={(event) => { - event.currentTarget.releasePointerCapture(event.pointerId); - pan.current = null; - commit(selRef.current); - }} - onPointerCancel={(event) => { - if (event.currentTarget.hasPointerCapture(event.pointerId)) { - event.currentTarget.releasePointerCapture(event.pointerId); - } - pan.current = null; - commit(selRef.current); - }} - /> - - {/* The selection handles, overlaid on the chart. The slider itself is - pointer-transparent (so bars stay hoverable and a stray click - cannot jump a handle); only the handles take the pointer. The - wrapper's capture-phase keydown reroutes arrow keys to whole- - bucket steps before react-aria's fine-step handler sees them. */} -
- { - dragging.current = true; - if (Array.isArray(value) && value.length === 2) setSel([value[0], value[1]]); - }} - onChangeEnd={(value) => { - if (Array.isArray(value) && value.length === 2) commit([value[0], value[1]]); - }} - className="pointer-events-none h-full w-full" - > - - - - - -
)}
diff --git a/web/src/components/charts.test.tsx b/web/src/components/charts.test.tsx index eefe0a04d..3c4722d87 100644 --- a/web/src/components/charts.test.tsx +++ b/web/src/components/charts.test.tsx @@ -1,17 +1,24 @@ import { render, screen } from "@testing-library/react"; -import { describe, expect, it } from "vitest"; +import { describe, expect, it, vi } from "vitest"; -import { BarTrendChart, ChartTooltip, Sparkline } from "@/components/charts"; +import { ChartLegend, ChartTooltip, Sparkline, TrendChart, type SeriesDef } from "@/components/charts"; -describe("charts", () => { +const COST_SERIES: SeriesDef[] = [{ key: "cost", label: "Cost", color: "var(--otari-brand)" }]; +const STACK_SERIES: SeriesDef[] = [ + { key: "success", label: "Succeeded", color: "var(--otari-brand)" }, + { key: "errors", label: "Failed", color: "var(--otari-danger)" }, +]; + +describe("TrendChart", () => { it("renders a single-series recharts bar chart with one bar per point", () => { const { container } = render( - `$${v}`} + series={COST_SERIES} + formatValue={(v: number) => `$${v}`} ariaLabel="cost per day" />, ); @@ -24,6 +31,45 @@ describe("charts", () => { expect(container.querySelectorAll(".recharts-bar-rectangle")).toHaveLength(2); }); + it("renders one stacked rectangle per non-zero (series, point)", () => { + const { container } = render( + String(v)} + ariaLabel="requests per day" + />, + ); + // The zero-height error segment on the second bucket draws nothing. + expect(container.querySelectorAll(".recharts-bar-rectangle")).toHaveLength(3); + }); + + it("is only brush-selectable when a handler and 2+ buckets exist", () => { + const onSelect = vi.fn(); + const { container, rerender } = render( + , + ); + expect(container.querySelector(".cursor-crosshair")).not.toBeNull(); + rerender( + , + ); + expect(container.querySelector(".cursor-crosshair")).toBeNull(); + }); +}); + +describe("Sparkline", () => { it("renders a recharts sparkline line for KPI tiles", () => { const { container } = render(); @@ -32,6 +78,19 @@ describe("charts", () => { }); }); +describe("ChartLegend", () => { + it("labels every series of a multi-series chart", () => { + render(); + expect(screen.getByText("Succeeded")).toBeInTheDocument(); + expect(screen.getByText("Failed")).toBeInTheDocument(); + }); + + it("renders nothing for a single series (the title names it)", () => { + const { container } = render(); + expect(container).toBeEmptyDOMElement(); + }); +}); + describe("ChartTooltip", () => { const fmt = (v: number) => `$${v.toFixed(2)}`; @@ -54,4 +113,25 @@ describe("ChartTooltip", () => { const { container: nonNumeric } = render(); expect(nonNumeric).toBeEmptyDOMElement(); }); + + it("lists per-series rows, hides zero rows, and totals a stack", () => { + render( + iso.slice(0, 10)} + payload={[ + { value: 10, name: "Succeeded", color: "#111" }, + { value: 0, name: "Failed", color: "#222" }, + ]} + formatValue={(v) => String(v)} + showTotal + />, + ); + expect(screen.getByText("2025-07-20")).toBeInTheDocument(); + expect(screen.getByText("Succeeded")).toBeInTheDocument(); + // The zero series row is hidden in a stack; the total still sums all rows. + expect(screen.queryByText("Failed")).toBeNull(); + expect(screen.getByText("Total")).toBeInTheDocument(); + }); }); diff --git a/web/src/components/charts.tsx b/web/src/components/charts.tsx index a840eb916..16186e668 100644 --- a/web/src/components/charts.tsx +++ b/web/src/components/charts.tsx @@ -1,14 +1,29 @@ +import { useRef, useState } from "react"; import type { ReactNode } from "react"; -import { Bar, BarChart, Line, LineChart, ResponsiveContainer, Tooltip, XAxis } from "recharts"; +import { Bar, BarChart, Line, LineChart, ReferenceArea, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts"; // Shared chart primitives for the dashboard, built on recharts. Pages compose -// these instead of hand-rolling SVG, so tooltips, responsive sizing, and axis -// handling come from one place. Every chart here is single-series and single -// color (the brand token): nothing is encoded by hue alone, and the surrounding -// data tables / captions stay the accessible source of truth. +// these instead of hand-rolling SVG, so tooltips, responsive sizing, axis +// handling, and the drag-to-select interaction come from one place. Identity is +// never encoded by hue alone: every multi-series chart renders a legend, and +// the surrounding tables / captions stay the accessible source of truth. const BRAND = "var(--otari-brand)"; +// One series of a (possibly stacked) trend chart. `color` is a CSS color, +// normally one of the fixed `--otari-cat-*` palette slots (validated for CVD +// separation and surface contrast in globals.css) or a semantic token like +// `--otari-danger`. Assign palette slots in fixed order, never cycled. +export interface SeriesDef { + key: string; + label: string; + color: string; +} + +// One x-axis bucket. `x` is the bucket identity (ISO instant for time series); +// series values live under their `SeriesDef.key`. +export type StackedPoint = { x: string } & Record; + // One point in a single-series trend: an x-axis/tooltip label and its value. export interface ChartPoint { label: string; @@ -16,62 +31,239 @@ export interface ChartPoint { } // Tooltip body. recharts clones this element and injects `active`, `payload`, -// and `label` at render time, so only `formatValue` is passed by the caller. -// Exported for direct branch testing (active/inactive, the zero-value case, and -// the non-number guard) since recharts hover is impractical to drive in jsdom. +// and `label` at render time, so only the format props are passed by the +// caller. For a single series it shows one value row; for a stack it shows one +// row per non-zero series (marker + label + value) plus a total. Exported for +// direct branch testing since recharts hover is impractical to drive in jsdom. export function ChartTooltip({ active, label, payload, formatValue, + formatLabel, + showTotal = false, }: { active?: boolean; label?: ReactNode; // recharts types a datum's value as `number | string`; guard before formatting. - payload?: readonly { value?: number | string }[]; + payload?: readonly { value?: number | string; name?: ReactNode; color?: string }[]; formatValue: (value: number) => string; + formatLabel?: (label: string) => string; + showTotal?: boolean; }) { - const value = payload?.[0]?.value; - if (!active || typeof value !== "number") { + const rows = (payload ?? []).filter((entry) => typeof entry.value === "number"); + if (!active || rows.length === 0) { return null; } + const heading = typeof label === "string" && formatLabel ? formatLabel(label) : label; + // A stack hides its zero series (the row list stays scannable); a single + // series keeps its zero row so hovering an empty bucket still reads a value. + const visible = rows.length > 1 ? rows.filter((entry) => (entry.value as number) > 0) : rows; + const total = rows.reduce((sum, entry) => sum + (entry.value as number), 0); + return ( +
+
{heading}
+
+ {visible.map((entry, index) => ( +
+ + {rows.length > 1 ? ( + + ) : null} + {entry.name} + + + {formatValue(entry.value as number)} + +
+ ))} +
+ {showTotal && rows.length > 1 ? ( +
+ Total + {formatValue(total)} +
+ ) : null} +
+ ); +} + +// Legend chips for a multi-series chart: marker + label in text ink (identity +// rides the marker, never colored text). Single-series charts render no legend; +// their title names the series. +export function ChartLegend({ series }: { series: SeriesDef[] }) { + if (series.length < 2) return null; return ( -
-
{label}
-
{formatValue(value)}
+
+ {series.map((s) => ( + + + {s.label} + + ))}
); } -// A single-series bar chart of one metric over time. Responsive width, fixed -// height; the y-axis is omitted (the caller's caption carries the peak) and the -// x-axis auto-thins its ticks so labels never collide. The tooltip shows the -// formatted value for the hovered bucket. -export function BarTrendChart({ +// The payload recharts hands to chart-level mouse handlers; only the active +// bucket index is consumed. It can arrive as a number or numeric string. +interface ChartMouseState { + activeTooltipIndex?: number | string | null; +} + +function toIndex(state: ChartMouseState | null | undefined): number | null { + const raw = state?.activeTooltipIndex; + const index = typeof raw === "string" ? Number(raw) : raw; + return typeof index === "number" && Number.isFinite(index) ? index : null; +} + +// A single-or-stacked bar trend over time with the industry-standard time +// selection: press and drag across the plot to select a bucket range (a live +// highlight tracks the pointer via recharts' own event coordinates, so axis +// margins never need pixel math), release to commit. A drag that never leaves +// its starting bucket is treated as a click and ignored, so hovering and +// clicking never zoom by accident. Releasing outside the plot commits the +// selection dragged so far. +// +// The y-axis is optional (the compact Activity strip omits it; the caller's +// caption carries the peak); stacked segments get a hairline surface stroke so +// adjacent fills always show their boundary. `window` dims buckets outside the +// active sub-window in place, which is how the Activity strip shows a zoomed +// selection inside its full extent. +export function TrendChart({ data, + series, formatValue, + formatXTick, ariaLabel, height = 200, + showYAxis = false, + showTotal, + onSelectRange, + window: windowRange, }: { - data: ChartPoint[]; + data: StackedPoint[]; + series: SeriesDef[]; formatValue: (value: number) => string; + formatXTick?: (x: string) => string; ariaLabel: string; height?: number; + showYAxis?: boolean; + showTotal?: boolean; + onSelectRange?: (startIndex: number, endIndex: number) => void; + window?: { startIndex: number; endIndex: number } | null; }) { + const [drag, setDrag] = useState<{ start: number; end: number } | null>(null); + // Mirror for the commit handlers: mouseup can fire before the last + // mousemove's setState has re-rendered, and committing from the stale closure + // would snap to the previous bucket. + const dragRef = useRef(drag); + const setDragBoth = (next: { start: number; end: number } | null) => { + dragRef.current = next; + setDrag(next); + }; + + const commit = () => { + const range = dragRef.current; + setDragBoth(null); + if (!range || !onSelectRange || range.start === range.end) return; + onSelectRange(Math.min(range.start, range.end), Math.max(range.start, range.end)); + }; + + const selectable = Boolean(onSelectRange) && data.length > 1; + const dimmed = + windowRange && (windowRange.startIndex > 0 || windowRange.endIndex < data.length - 1) ? windowRange : null; + return ( -
+
- + { + if (!selectable) return; + const index = toIndex(state); + if (index !== null) setDragBoth({ start: index, end: index }); + }} + onMouseMove={(state) => { + const index = toIndex(state); + if (dragRef.current && index !== null) setDragBoth({ ...dragRef.current, end: index }); + }} + onMouseUp={commit} + onMouseLeave={commit} + > - } /> - + {showYAxis ? ( + formatValue(value)} + tick={{ fontSize: 10, fill: "var(--otari-muted)" }} + /> + ) : null} + } + /> + {series.map((s) => ( + 1 ? 1 : 0} + // Rounded data-ends only when nothing stacks on top; rounding + // every stacked segment would fake gaps inside a column. + radius={series.length > 1 ? 0 : [2, 2, 0, 0]} + isAnimationActive={false} + /> + ))} + {/* Out-of-window dimming (start side, then end side), under the drag + highlight. ReferenceArea x-bounds are category values, so the + shading stays glued to its buckets across resizes. */} + {dimmed && dimmed.startIndex > 0 ? ( + + ) : null} + {dimmed && dimmed.endIndex < data.length - 1 ? ( + + ) : null} + {drag && drag.start !== drag.end ? ( + + ) : null}
diff --git a/web/src/pages/ActivityPage.tsx b/web/src/pages/ActivityPage.tsx index d63efcf7e..8102a1063 100644 --- a/web/src/pages/ActivityPage.tsx +++ b/web/src/pages/ActivityPage.tsx @@ -536,6 +536,9 @@ export function ActivityPage() { const timelineSeries = (contextSummary.data?.series ?? []).map((p) => ({ bucketStart: p.bucket_start, requests: p.requests, + // Failed requests render as a red segment on the strip, so dropped traffic + // shows up while browsing, not only after filtering to status=error. + errors: p.errors ?? 0, })); const rows = usage.data ?? []; diff --git a/web/src/pages/UsagePage.test.tsx b/web/src/pages/UsagePage.test.tsx index baa2b1ec5..463211bb8 100644 --- a/web/src/pages/UsagePage.test.tsx +++ b/web/src/pages/UsagePage.test.tsx @@ -52,6 +52,22 @@ function mockApi(body: UsageSummary | null) { if (url.includes("/v1/usage/summary")) { return jsonResponse(body ?? summary()); } + if (url.includes("/v1/usage/series")) { + return jsonResponse({ + start_date: "2026-06-21T00:00:00Z", + end_date: "2026-07-21T00:00:00Z", + bucket: "day", + group_by: "model", + groups: [ + { key: "gpt-5.6", cost: 820, tokens: 8_000_000, requests: 42_000, is_other: false }, + { key: null, cost: 420.5, tokens: 4_400_000, requests: 42_000, is_other: true }, + ], + points: [ + { bucket_start: "2026-07-19T00:00:00Z", key: "gpt-5.6", is_other: false, cost: 400, tokens: 4_000_000, requests: 28_000 }, + { bucket_start: "2026-07-20T00:00:00Z", key: null, is_other: true, cost: 420.5, tokens: 4_400_000, requests: 42_000 }, + ], + }); + } if (url.includes("/v1/users")) { return jsonResponse([{ user_id: "alice", alias: "Alice" }]); } @@ -142,16 +158,90 @@ describe("UsagePage", () => { }); }); - it("shows cache read and write totals as tiles", async () => { + it("shows the cache story as a hit rate with read/write volumes", async () => { const base = summary(); - mockApi(summary({ totals: { ...base.totals, cache_read_tokens: 5_100_000, cache_write_tokens: 2_700_000 } })); + mockApi( + summary({ + totals: { + ...base.totals, + cache_read_tokens: 5_100_000, + cache_write_tokens: 2_700_000, + billed_input_tokens: 10_200_000, + }, + }), + ); renderPage(); // Await a value (loads after the query resolves), not the static label. - expect(await screen.findByText("5.1M")).toBeInTheDocument(); - expect(screen.getByText("2.7M")).toBeInTheDocument(); + // 5.1M reads over 10.2M billed input tokens = a 50.0% hit rate. + expect(await screen.findByText("50.0%")).toBeInTheDocument(); + expect(screen.getByText("Cache hit rate")).toBeInTheDocument(); + expect(screen.getByText(/5\.1M read · 2\.7M written/)).toBeInTheDocument(); + }); + + it("shows no hit rate when the billed input breakdown is unavailable", async () => { + // An older gateway (vite dev against a stale build) omits billed_input_tokens. + mockApi(summary()); + renderPage(); + + await screen.findByText("$1,240.50"); + const tile = screen.getByText("Cache hit rate").closest("div")!; + expect(within(tile).getByText("—")).toBeInTheDocument(); + }); + + it("groups the chart by a dimension via the grouped series endpoint", async () => { + const user = userEvent.setup(); + const fetchMock = mockApi(summary()); + renderPage(); + await screen.findByText("$1,240.50"); + + await user.selectOptions(screen.getByRole("combobox", { name: "Group by" }), "model"); + + // The stack's legend comes from the grouped response: the top group plus + // the reconciling fold, which always reads "Other". + expect(await screen.findByText("Other")).toBeInTheDocument(); + const calls = fetchMock.mock.calls.map(([u]) => String(u)); + expect(calls.some((u) => u.includes("/v1/usage/series") && u.includes("group_by=model"))).toBe(true); + }); + + it("stacks the billed token composition on the Tokens metric", async () => { + const user = userEvent.setup(); + const base = summary(); + mockApi( + summary({ + series: base.series.map((p) => ({ + ...p, + input_tokens: 3_000_000, + cache_read_tokens: 2_000_000, + cache_write_tokens: 500_000, + output_tokens: 400_000, + })), + }), + ); + renderPage(); + await screen.findByText("$1,240.50"); + + await user.click(screen.getByRole("button", { name: "Tokens" })); + + // The four billed buckets are legended: the same encoding as the Activity + // page's per-row token bar. + expect(await screen.findByText("Fresh input")).toBeInTheDocument(); expect(screen.getByText("Cache read")).toBeInTheDocument(); expect(screen.getByText("Cache write")).toBeInTheDocument(); + expect(screen.getByText("Output")).toBeInTheDocument(); + }); + + it("splits requests into succeeded and failed when the window has errors", async () => { + const user = userEvent.setup(); + const base = summary(); + mockApi(summary({ series: base.series.map((p) => ({ ...p, errors: 100 })) })); + renderPage(); + await screen.findByText("$1,240.50"); + + await user.click(screen.getByRole("button", { name: "Requests" })); + + expect(await screen.findByText("Failed")).toBeInTheDocument(); + expect(screen.getByText("Succeeded")).toBeInTheDocument(); }); it("queries the previous period with a bounded end_date for deltas", async () => { @@ -217,15 +307,17 @@ describe("UsagePage", () => { const user = userEvent.setup(); mockApi(summary()); renderPage(); - await screen.findByText("alice"); + await screen.findByText("gpt-5.6"); - // Filter by a model, then drill into a user row. The model constraint must - // survive the navigation, not be dropped in favor of only the clicked user. + // Filter by a model, then drill into a user row (on the User breakdown + // tab). The model constraint must survive the navigation, not be dropped + // in favor of only the clicked user. const modelInput = screen.getByRole("combobox", { name: "Model" }); await user.click(modelInput); await user.type(modelInput, "gpt"); await user.click(await screen.findByRole("option", { name: /gpt-5.6/ })); + await user.click(screen.getByRole("button", { name: "User" })); const row = (await screen.findByText("alice")).closest("tr")!; await user.click(row); @@ -330,60 +422,20 @@ describe("UsagePage", () => { expect(await screen.findByText(/No usage yet/)).toBeInTheDocument(); }); - it("bulk-deletes imported rows from the Individual requests list", async () => { - const importedRow = { - id: "imp-1", - user_id: "alice", - api_key_id: null, - timestamp: new Date().toISOString(), - model: "claude-sonnet-5", - provider: "anthropic", - endpoint: "external", - prompt_tokens: 100, - completion_tokens: 50, - total_tokens: 150, - cache_read_tokens: null, - cache_write_tokens: null, - cache_write_1h_tokens: null, - billing_meters: null, - pricing_breakdown: null, - cost: null, - status: "success", - error_message: null, - latency_ms: 120, - source: "claude_code", - source_label: null, - counts_toward_budget: false, - }; - const calls: { url: string; method: string; body: string | undefined }[] = []; - vi.spyOn(globalThis, "fetch").mockImplementation(async (input, init) => { - const url = String(input); - const method = (init?.method ?? "GET").toUpperCase(); - calls.push({ url, method, body: typeof init?.body === "string" ? init.body : undefined }); - if (url.endsWith("/v1/usage") && method === "DELETE") return jsonResponse({ deleted: 1 }); - if (url.includes("/v1/usage/summary")) return jsonResponse(summary()); - if (url.includes("/v1/usage/count")) return jsonResponse({ total: 1 }); - if (url.includes("/v1/users")) return jsonResponse([{ user_id: "alice", alias: "Alice" }]); - if (url.includes("/v1/keys")) return jsonResponse([]); - if (url.includes("/v1/usage")) return jsonResponse([importedRow]); - return jsonResponse([]); - }); + it("hands the current view off to the Activity log instead of duplicating its table", async () => { const user = userEvent.setup(); + mockApi(summary()); renderPage(); + await screen.findByText("$1,240.50"); - const row = (await screen.findByText("claude-sonnet-5")).closest("tr")!; - await user.click(within(row).getByRole("checkbox")); - - const bar = (await screen.findByText("1 selected")).closest("div")!; - await user.click(within(bar).getByRole("button", { name: "Delete" })); - const dialog = await screen.findByRole("alertdialog"); - await user.click(within(dialog).getByRole("button", { name: "Delete" })); + // The per-request table (and its bulk actions) lives on the Activity page; + // Usage carries the whole current view across instead of a second copy. + expect(screen.queryByText("Individual requests")).not.toBeInTheDocument(); + await user.click(screen.getByRole("button", { name: "Open activity log" })); - await vi.waitFor(() => { - const del = calls.find((c) => c.url.endsWith("/v1/usage") && c.method === "DELETE"); - expect(del).toBeTruthy(); - expect(del!.body).toContain("imp-1"); - }); + const loc = screen.getByRole("status", { name: "Current location" }).textContent ?? ""; + expect(loc.startsWith("/activity")).toBe(true); + expect(loc).toContain("start_date="); }); it("keeps the filter pickers behind an 'Add filter' toggle", async () => { diff --git a/web/src/pages/UsagePage.tsx b/web/src/pages/UsagePage.tsx index 3519f2b56..136a53038 100644 --- a/web/src/pages/UsagePage.tsx +++ b/web/src/pages/UsagePage.tsx @@ -1,36 +1,39 @@ import { Button, Spinner } from "@heroui/react"; -import { useEffect, useMemo, useRef, useState } from "react"; +import { useMemo, useState } from "react"; import { useNavigate } from "react-router-dom"; -import { - useDeleteUsage, - useKeys, - useSetUsagePrice, - useUsageCount, - useUsageLogs, - useUsageSummary, - useUsers, -} from "@/api/hooks"; +import { useKeys, useUsageGroupedSeries, useUsageSummary, useUsers } from "@/api/hooks"; import type { UsageBucket, - UsageEntry, UsageFilters, + UsageGroupBy, UsageGroupRow, - UsageMutationSelection, UsageSeriesPoint, } from "@/api/types"; -import { ActivityTimeline } from "@/components/ActivityTimeline"; -import { BulkActionBar } from "@/components/BulkActionBar"; -import { BarTrendChart, Sparkline } from "@/components/charts"; -import { ConfirmDialog } from "@/components/ConfirmDialog"; +import { ChartLegend, Sparkline, TrendChart, type SeriesDef, type StackedPoint } from "@/components/charts"; import { DataTable, type DataTableColumn } from "@/components/DataTable"; import { FilterChips, type FilterChip } from "@/components/FilterChips"; -import { SetPriceDialog, type ManualRates } from "@/components/SetPriceDialog"; -import { TablePagination } from "@/components/TablePagination"; -import { DeltaHint, EmptyState, ErrorBanner, FilterComboBox, PageHeader, RefreshButton, StatCard } from "@/components/ui"; +import { + DeltaHint, + EmptyState, + ErrorBanner, + FilterComboBox, + FilterSelect, + PageHeader, + RefreshButton, + StatCard, +} from "@/components/ui"; import { deltaFraction, formatPct, formatTokens, formatUsd } from "@/lib/format"; -import { resolveSelectedIds, useTableSelection } from "@/lib/tableSelection"; -import { bucketForWindow, findPreset, isoAgo, type RangePreset, USAGE_DEFAULT_KEY, USAGE_PRESETS } from "@/lib/timeRange"; +import { + bucketForWindow, + findPreset, + formatWindowLabel, + isoAgo, + rangeFromBuckets, + type RangePreset, + USAGE_DEFAULT_KEY, + USAGE_PRESETS, +} from "@/lib/timeRange"; // ---------- formatting ---------- @@ -48,43 +51,106 @@ function formatLatency(ms: number | null): string { return `${(ms / 1000).toFixed(2)} s`; } -// ---------- filter option sets ---------- +function formatBucketLabel(iso: string, bucket: UsageBucket): string { + const d = new Date(iso); + if (Number.isNaN(d.getTime())) return iso; + if (bucket === "hour") { + return d.toLocaleTimeString(undefined, { hour: "2-digit", minute: "2-digit", timeZone: "UTC" }); + } + return d.toLocaleDateString(undefined, { month: "short", day: "numeric", timeZone: "UTC" }); +} + +// ---------- window presets ---------- // // The time presets and window math live in `@/lib/timeRange` and are shared -// with the Activity page via the ActivityTimeline selector. +// with the Activity page. 30d default: a spend investigation is usually monthly. -// 30d: a spend investigation is usually monthly. const DEFAULT_PRESET = findPreset(USAGE_PRESETS, USAGE_DEFAULT_KEY) as RangePreset; const TABLE_TOP_N = 15; -// ---------- breakdown table ---------- +// ---------- the analytics chart: metric × group-by ---------- +// +// The model every major usage dashboard converged on (OpenAI's usage page, +// the Anthropic console, Grafana-style tooling): one main time-series chart, a +// metric selector, and a group-by dimension that splits the series into stacked +// bars. Ungrouped views use the richest encoding each metric has: tokens stack +// their billed composition (the same encoding as the Activity token bar), +// requests split success/error. Dragging across the chart zooms the window. + +type ChartMetric = "cost" | "tokens" | "requests"; + +const METRIC_TABS: { key: ChartMetric; label: string }[] = [ + { key: "cost", label: "Cost" }, + { key: "tokens", label: "Tokens" }, + { key: "requests", label: "Requests" }, +]; + +const GROUP_OPTIONS: { value: "" | UsageGroupBy; label: string }[] = [ + { value: "", label: "None" }, + { value: "model", label: "Model" }, + { value: "user_id", label: "User" }, + { value: "api_key_id", label: "API key" }, + { value: "source", label: "Source" }, +]; + +// Billed token composition, bottom-up: input side first (fresh, then the two +// cache buckets), then output. One hue at four lightnesses — the same encoding, +// same order, and same tokens as the Activity page's per-row bar, so the two +// surfaces read as one system. +const COMPOSITION_SERIES: SeriesDef[] = [ + { key: "fresh", label: "Fresh input", color: "var(--otari-ink)" }, + { key: "cache_read", label: "Cache read", color: "var(--otari-brand)" }, + { key: "cache_write", label: "Cache write", color: "var(--otari-brand-soft)" }, + { key: "output", label: "Output", color: "var(--otari-brand-dark)" }, +]; + +const REQUEST_SERIES: SeriesDef[] = [ + { key: "success", label: "Succeeded", color: "var(--otari-brand)" }, + { key: "errors", label: "Failed", color: "var(--otari-danger)" }, +]; + +// The fixed categorical palette for grouped series (validated in globals.css); +// slot order is the CVD-safety mechanism, so groups take slots in server rank +// order and the fold always wears the neutral. +const CAT_COLORS = [ + "var(--otari-cat-1)", + "var(--otari-cat-2)", + "var(--otari-cat-3)", + "var(--otari-cat-4)", + "var(--otari-cat-5)", + "var(--otari-cat-6)", + "var(--otari-cat-7)", + "var(--otari-cat-8)", +]; +const OTHER_COLOR = "var(--otari-cat-other)"; + +function metricFormatter(metric: ChartMetric): (value: number) => string { + return metric === "cost" ? formatUsd : metric === "tokens" ? formatTokens : formatCount; +} + +// ---------- breakdown table (tabbed by dimension) ---------- interface BreakdownProps { - title: string; + dimensionLabel: string; rows: UsageGroupRow[]; totalCost: number; emptyLabel: string; - // Turns a row key into the Activity-page filter to drill into (model vs user). + // Maps a row key to a human label (e.g. API key id -> key name). + labelFor?: (key: string) => string; + // Turns a row key into the Activity-page filter to drill into. onDrill: (key: string) => void; loading: boolean; } -// One breakdown (by model / by user). Rows are spend-ranked with an inline -// share-of-total bar; clicking a named row drills into the Activity log filtered -// to that dimension. The synthesized "other" fold row (null key) is shown but not +// One breakdown dimension. Rows are spend-ranked with an inline share-of-total +// bar; clicking a named row drills into the Activity log filtered to that +// dimension. The synthesized "other" fold row (null key) is shown but not // clickable, so the visible spend still reconciles with the total-spend tile. const OTHER_KEY = "__other__"; const UNKNOWN_KEY = "__unknown__"; -function BreakdownTable({ - title, - rows, - totalCost, - emptyLabel, - onDrill, - loading, -}: BreakdownProps) { +function BreakdownTable({ dimensionLabel, rows, totalCost, emptyLabel, labelFor, onDrill, loading }: BreakdownProps) { const [showAll, setShowAll] = useState(false); const visible = showAll ? rows : rows.slice(0, TABLE_TOP_N); const hidden = rows.length - visible.length; @@ -96,7 +162,7 @@ function BreakdownTable({ const columns: DataTableColumn[] = [ { id: "name", - header: title.replace("Spend by ", ""), + header: dimensionLabel, isRowHeader: true, cell: (row) => { const share = totalCost > 0 ? row.cost / totalCost : 0; @@ -107,7 +173,7 @@ function BreakdownTable({ ? `Other (${row.requests.toLocaleString()} req)` : row.key === null ? "(unknown)" - : row.key} + : (labelFor?.(row.key) ?? row.key)} {formatCount(row.requests)} }, + { id: "tokens", header: "Tokens", align: "end", cell: (row) => {formatTokens(row.tokens)} }, { id: "spend", header: "Spend", align: "end", cell: (row) => {formatUsd(row.cost)} }, ]; return (
-

{title}

({ - label: formatBucketLabel(point.bucket_start, bucket), - value: metricValue(point, metric), - })); - const peak = points.length ? Math.max(...points.map((p) => p.value)) : 0; - return { points, peak, count: series.length }; -} - -// ---------- individual requests (raw rows under the breakdowns) ---------- - -const REQUESTS_PAGE_SIZE = 50; - -function requestTimeAgo(iso: string): string { - const then = new Date(iso).getTime(); - if (Number.isNaN(then)) return iso; - const secs = Math.max(0, Math.round((Date.now() - then) / 1000)); - if (secs < 60) return `${secs}s ago`; - const mins = Math.round(secs / 60); - if (mins < 60) return `${mins}m ago`; - const hours = Math.round(mins / 60); - if (hours < 24) return `${hours}h ago`; - return `${Math.round(hours / 24)}d ago`; -} - -function RequestStatusPill({ status }: { status: string }) { - return ( - - {status} - - ); -} - -// Column definitions and the row-key getter live at module scope so their -// identity is stable across renders: DataTable caches rendered rows on them, -// and a new array each render would rebuild every row on each selection click. -const REQUEST_COLUMNS: DataTableColumn[] = [ - { - id: "time", - header: "Time", - isRowHeader: true, - cell: (e) => ( - - {requestTimeAgo(e.timestamp)} - - ), - }, - { id: "model", header: "Model", cell: (e) => {e.model} }, - { id: "user", header: "User", cell: (e) => {e.user_id ?? "—"} }, - { id: "tokens", header: "Tokens", align: "end", cell: (e) => (e.total_tokens === null ? "—" : e.total_tokens.toLocaleString()) }, - { id: "cost", header: "Cost", align: "end", cell: (e) => (e.cost === null ? "—" : formatUsd(e.cost)) }, - { id: "status", header: "Status", cell: (e) => }, -]; - -const getRequestRowKey = (e: UsageEntry): string => e.id; - -// The raw usage rows for the current filter window, paginated, with selection -// and the imported-row bulk actions (Delete, Set price). Only imported rows are -// selectable; enforced gateway rows are disabled so bulk ops never touch them. -function UsageRequests({ filters, anyFilter }: { filters: UsageFilters; anyFilter: boolean }) { - const [page, setPage] = useState(0); - const [pageSize, setPageSize] = useState(REQUESTS_PAGE_SIZE); - const selection = useTableSelection(); - const deleteUsage = useDeleteUsage(); - const setPrice = useSetUsagePrice(); - const [deleteOpen, setDeleteOpen] = useState(false); - const [priceOpen, setPriceOpen] = useState(false); - - const filtersKey = JSON.stringify(filters); - const prevFiltersKey = useRef(filtersKey); - useEffect(() => { - if (prevFiltersKey.current !== filtersKey) { - prevFiltersKey.current = filtersKey; - setPage(0); - selection.clear(); - } - }, [filtersKey, selection]); - - const usage = useUsageLogs(filters, page, pageSize); - const count = useUsageCount(filters); - const rows = usage.data ?? []; - const totalIsExact = count.isSuccess && !count.isPlaceholderData; - const total = totalIsExact ? (count.data?.total ?? 0) : null; - - const selectableKeys = rows.filter((r) => !r.counts_toward_budget).map((r) => r.id); - const disabledKeys = rows.filter((r) => r.counts_toward_budget).map((r) => r.id); - const selectedIds = resolveSelectedIds(selection.selectedKeys, selectableKeys); - const pageSelectedCount = selectedIds.length; - const hasSelection = selection.allMatching || pageSelectedCount > 0; - - const importedFilters = useMemo(() => ({ ...filters, counts_toward_budget: false }), [filters]); - const importedCount = useUsageCount(importedFilters, hasSelection); - const matchingTotal = importedCount.isSuccess ? (importedCount.data?.total ?? null) : null; - const allPageSelected = selectableKeys.length > 0 && pageSelectedCount === selectableKeys.length; - const canSelectAllMatching = allPageSelected && matchingTotal != null && matchingTotal > pageSelectedCount; - const effectiveCount = selection.allMatching ? (matchingTotal ?? pageSelectedCount) : pageSelectedCount; - - const selectionBody = (): UsageMutationSelection => - selection.allMatching - ? { - by_filter: true, - model: filters.model, - user_id: filters.user_id, - api_key_id: filters.api_key_id, - start_date: filters.start_date, - end_date: filters.end_date, - priced: filters.priced, - } - : { ids: selectedIds }; - - const onDeleteConfirm = () => - deleteUsage.mutate(selectionBody(), { - onSuccess: () => { - setDeleteOpen(false); - selection.clear(); - }, - }); - - const onSetPrice = (rates: ManualRates) => - setPrice.mutate( - { ...selectionBody(), ...rates }, - { - onSuccess: () => { - setPriceOpen(false); - selection.clear(); - }, - }, - ); - - return ( -
-

Individual requests

- - - {hasSelection ? ( - - - - - ) : null} - - - - { - setPageSize(size); - setPage(0); - }} - isFetching={usage.isFetching} - hasNextFallback={rows.length === pageSize} - /> - - - - -
- ); -} - // ---------- page ---------- export function UsagePage() { @@ -407,9 +232,9 @@ export function UsagePage() { // not recompute "now" and churn the query key. Re-anchored on preset change // and on refresh. Usage presets are all bounded, so this is always set. const [startDate, setStartDate] = useState(() => isoAgo(DEFAULT_PRESET.seconds ?? 0)); - // Custom range: an explicit UTC-bucket window selected on the timeline - // (handles, pan, or step zoom). When active it overrides the preset window. - // The selection always yields both bounds, so there is no half-filled window. + // Custom range: an explicit UTC-bucket window selected by dragging across the + // analytics chart. When active it overrides the preset window. The selection + // always yields both bounds, so there is no half-filled window. const [customMode, setCustomMode] = useState(false); const [customStart, setCustomStart] = useState(); const [customEnd, setCustomEnd] = useState(); @@ -417,6 +242,7 @@ export function UsagePage() { const [userFilter, setUserFilter] = useState(""); const [apiKeyFilter, setApiKeyFilter] = useState(""); const [metric, setMetric] = useState("cost"); + const [groupBy, setGroupBy] = useState<"" | UsageGroupBy>(""); const winStart = customMode ? customStart : startDate; const winEnd = customMode ? customEnd : undefined; @@ -440,7 +266,7 @@ export function UsagePage() { ); // The immediately-preceding window of equal length, for period-over-period - // deltas. Every preset is now bounded, so a comparison always exists. + // deltas. Every preset is bounded, so a comparison always exists. const previousFilters: UsageFilters | null = useMemo(() => { if (customMode) { if (!winStart || !winEnd) return null; @@ -459,25 +285,8 @@ export function UsagePage() { const summary = useUsageSummary(filters, bucket); const previous = useUsageSummary(previousFilters ?? filters, bucket, previousFilters !== null); - - // The timeline histogram spans the whole preset *extent* (independent of the - // brushed sub-window), so the brush always has context to zoom back out into. - // When the brush is full this is the same query as `summary` (deduped); a - // sub-window makes them diverge by one query. - const contextFilters: UsageFilters = useMemo( - () => ({ - start_date: startDate, - model: modelFilter.trim() || undefined, - user_id: userFilter || undefined, - api_key_id: apiKeyFilter || undefined, - }), - [startDate, modelFilter, userFilter, apiKeyFilter], - ); - const contextSummary = useUsageSummary(contextFilters, preset.bucket); - const timelineSeries = (contextSummary.data?.series ?? []).map((p) => ({ - bucketStart: p.bucket_start, - requests: p.requests, - })); + // The per-group stack, fetched only while a dimension is selected. + const grouped = useUsageGroupedSeries(filters, bucket, groupBy || null); const data = summary.data; const totals = data?.totals; @@ -501,6 +310,7 @@ export function UsagePage() { value: k.id, label: k.key_name ?? `${k.id.slice(0, 8)}…`, })); + const keyLabel = (id: string) => keyOptions.find((o) => o.value === id)?.label ?? id; // Keep a selected-but-not-in-list model visible (e.g. seeded from elsewhere). const modelOptionList = ( modelFilter && !modelOptions.includes(modelFilter) ? [modelFilter, ...modelOptions] : modelOptions @@ -512,8 +322,8 @@ export function UsagePage() { const timeFiltered = customMode || preset.key !== USAGE_DEFAULT_KEY; const anyFilter = Boolean(modelFilter.trim() || userFilter || apiKeyFilter || timeFiltered); - // Active entity filters as removable chips (time is driven by the timeline, so - // it is not a chip). Values show the human label where one exists. + // Active entity filters as removable chips (time is driven by the presets and + // the chart selection, so it is not a chip). Values show the human label. const labelFor = (options: { value: string; label: string }[], value: string) => options.find((o) => o.value === value)?.label ?? value; const clearEntityFilters = () => { @@ -553,18 +363,20 @@ export function UsagePage() { // Refetch every window-scoped query, not just the headline summary: in custom // mode the query keys do not change, so anything left out would silently stay - // on cached data after an explicit refresh. `previous` is guarded because - // refetch() ignores `enabled` and would fire a pointless request. + // on cached data after an explicit refresh. The conditional queries are + // guarded because refetch() ignores `enabled` and would fire pointlessly. const refresh = () => { if (!customMode) { setStartDate(isoAgo(preset.seconds ?? 0)); } void summary.refetch(); - void contextSummary.refetch(); void modelSuggest.refetch(); if (previousFilters !== null) { void previous.refetch(); } + if (groupBy) { + void grouped.refetch(); + } }; // Drill from a breakdown row into the Activity log, pre-filtering on the picked @@ -582,38 +394,214 @@ export function UsagePage() { const errorRate = totals && totals.request_count > 0 ? totals.error_count / totals.request_count : 0; - // The bucketed series is already on the wire; reuse it for tile sparklines. A - // single point has no trend to draw, so sparklines only appear with 2+ buckets. + // ---------- derived analytics ---------- + const series = data?.series ?? []; const hasTrend = series.length > 1; - const trend = trendData(series, metric, bucket); + + // Billed token view: input (incl. cache) + output, with the raw provider total + // as the fallback when the composition fields are absent (an older gateway + // behind `vite dev`). Cache hit rate = reads / billed input. + const billedInput = totals?.billed_input_tokens; + const billedTotal = + totals === undefined ? null : billedInput !== undefined ? billedInput + totals.completion_tokens : totals.total_tokens; + const prevBilledTotal = + prevTotals === undefined + ? null + : prevTotals.billed_input_tokens !== undefined + ? prevTotals.billed_input_tokens + prevTotals.completion_tokens + : prevTotals.total_tokens; + const cacheHitRate = billedInput !== undefined && billedInput > 0 && totals ? totals.cache_read_tokens / billedInput : null; + const prevCacheHitRate = + prevTotals?.billed_input_tokens !== undefined && prevTotals.billed_input_tokens > 0 + ? prevTotals.cache_read_tokens / prevTotals.billed_input_tokens + : undefined; + + const pointBilled = (p: UsageSeriesPoint) => + p.input_tokens !== undefined ? p.input_tokens + (p.output_tokens ?? 0) : p.tokens; + const hasComposition = series.some((p) => (p.input_tokens ?? 0) > 0); + const hasErrors = series.some((p) => (p.errors ?? 0) > 0); + + // The main chart's series + data for the current metric × group-by. All the + // pivoting happens here so the chart component stays dumb. + const chart = useMemo((): { series: SeriesDef[]; data: StackedPoint[] } => { + const buckets = series.map((p) => p.bucket_start); + if (groupBy) { + const g = grouped.data; + if (!g) return { series: [], data: [] }; + const defs = g.groups.map((row, index) => ({ + key: `g${index}`, + label: row.is_other + ? "Other" + : row.key === null + ? "(unknown)" + : groupBy === "api_key_id" + ? keyLabel(row.key) + : row.key, + color: row.is_other ? OTHER_COLOR : CAT_COLORS[index % CAT_COLORS.length], + })); + const seriesKey = new Map(g.groups.map((row, index) => [`${row.is_other}|${row.key}`, `g${index}`])); + const byBucket = new Map( + buckets.map((b) => [b, { x: b, ...Object.fromEntries(defs.map((d) => [d.key, 0])) }]), + ); + for (const point of g.points) { + const key = seriesKey.get(`${point.is_other}|${point.key}`); + const row = byBucket.get(point.bucket_start); + if (!key || !row) continue; + row[key] = metric === "cost" ? point.cost : metric === "tokens" ? point.tokens : point.requests; + } + return { series: defs, data: [...byBucket.values()] }; + } + if (metric === "tokens" && hasComposition) { + return { + series: COMPOSITION_SERIES, + data: series.map((p) => { + const input = p.input_tokens ?? 0; + const read = p.cache_read_tokens ?? 0; + const write = p.cache_write_tokens ?? 0; + return { + x: p.bucket_start, + fresh: Math.max(0, input - read - write), + cache_read: read, + cache_write: write, + output: p.output_tokens ?? 0, + }; + }), + }; + } + if (metric === "requests" && hasErrors) { + return { + series: REQUEST_SERIES, + data: series.map((p) => { + const errors = Math.min(p.errors ?? 0, p.requests); + return { x: p.bucket_start, success: p.requests - errors, errors }; + }), + }; + } + const single: SeriesDef = { + key: metric, + label: METRIC_TABS.find((t) => t.key === metric)?.label ?? metric, + color: "var(--otari-brand)", + }; + return { + series: [single], + data: series.map((p) => ({ + x: p.bucket_start, + [metric]: metric === "cost" ? p.cost : metric === "tokens" ? pointBilled(p) : p.requests, + })), + }; + // keyLabel is derived from query data; keys.data is the stable input. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [series, groupBy, grouped.data, metric, hasComposition, hasErrors, keys.data]); + + const formatValue = metricFormatter(metric); + const chartLoading = summary.isLoading || (Boolean(groupBy) && grouped.isLoading); + const peak = chart.data.length + ? Math.max( + ...chart.data.map((row) => chart.series.reduce((sum, s) => sum + (typeof row[s.key] === "number" ? (row[s.key] as number) : 0), 0)), + ) + : 0; + + // Dragging across the chart zooms into the selected buckets (the same + // interaction as the Activity strip and every mainstream metrics tool). + const chartBuckets = series.map((p) => p.bucket_start); + const onChartSelect = (startIndex: number, endIndex: number) => { + const range = rangeFromBuckets(chartBuckets, startIndex, endIndex, bucket); + if (range) pickCustom(range.startIso, range.endIso); + }; + + // ---------- breakdown dimensions ---------- + + const dimensions = [ + { + key: "model", + label: "Model", + rows: data?.by_model ?? [], + labelFor: undefined as ((key: string) => string) | undefined, + drill: (key: string) => drillTo({ model: key, user_id: userFilter || undefined, api_key_id: apiKeyFilter || undefined }), + }, + { + key: "user", + label: "User", + rows: data?.by_user ?? [], + labelFor: undefined as ((key: string) => string) | undefined, + drill: (key: string) => + drillTo({ user_id: key, model: modelFilter.trim() || undefined, api_key_id: apiKeyFilter || undefined }), + }, + { + key: "api_key", + label: "API key", + rows: data?.by_api_key ?? [], + labelFor: keyLabel as ((key: string) => string) | undefined, + drill: (key: string) => + drillTo({ api_key_id: key, model: modelFilter.trim() || undefined, user_id: userFilter || undefined }), + }, + { + key: "source", + label: "Source", + rows: data?.by_source ?? [], + labelFor: undefined as ((key: string) => string) | undefined, + drill: (key: string) => + drillTo({ + source: key, + model: modelFilter.trim() || undefined, + user_id: userFilter || undefined, + api_key_id: apiKeyFilter || undefined, + }), + }, + ] as const; + const [dimension, setDimension] = useState<(typeof dimensions)[number]["key"]>("model"); + const activeDimension = dimensions.find((d) => d.key === dimension) ?? dimensions[0]; return (
+ // Hand the whole current view (window + entity filters) to the + // Activity log, which owns the per-request table and its bulk + // actions; keeping a second copy of that table here only split + // the feature across two pages. + drillTo({ + model: modelFilter.trim() || undefined, + user_id: userFilter || undefined, + api_key_id: apiKeyFilter || undefined, + }) + } + > + Open activity log + + } /> - + - {/* Filters: the timeline picks the window; chips carry entity filters. The - refresh control rides the timeline's preset row to save vertical space. */} + {/* Window row: presets anchor the rolling window; dragging on the chart + below selects an explicit sub-window. Chips carry entity filters. */}
- pickPreset(preset)} - series={timelineSeries} - bucket={preset.bucket} - windowStart={effectiveStart} - windowEnd={effectiveEnd} - loading={contextSummary.isLoading} - ariaLabel="Usage request volume over the selected window" - action={} - /> +
+ {USAGE_PRESETS.map((p) => ( + + ))} +
+ + Showing {formatWindowLabel(effectiveStart, effectiveEnd)} · UTC + + +
+
@@ -628,11 +616,10 @@ export function UsagePage() { /> ) : ( <> - {/* Tiles. A responsive grid, matching OverviewPage: StatCard is - flex-1/min-w-0 (sized by its track), so a wrapping flex row lets - all seven tiles shrink onto one unusable line on phones instead - of wrapping. */} -
+ {/* KPI tiles. Cache tells one story (hit rate + volumes) instead of + three raw counters; tokens are the billed total, matching the + chart's composition and the Activity page. */} +
: null} - chart={hasTrend ? p.tokens)} ariaLabel="Token usage trend over the selected window" /> : undefined} - /> - + billedTotal !== null ? ( + ) : null } + chart={ + hasTrend ? ( + + ) : undefined + } /> + + {cacheHitRate !== null && prevCacheHitRate !== undefined ? ( + <> + + {" · "} + + ) : null} + {formatTokens(totals.cache_read_tokens)} read · {formatTokens(totals.cache_write_tokens)} written + ) : null } - /> - + (p.input_tokens ?? 0) > 0 ? (p.cache_read_tokens ?? 0) / (p.input_tokens ?? 1) : 0, + )} + ariaLabel="Cache hit rate trend over the selected window" /> - ) : null + ) : undefined } />
- {/* Breakdowns: the answer to "where is my money going?", above the trend. */} -
- - drillTo({ model: key, user_id: userFilter || undefined, api_key_id: apiKeyFilter || undefined }) - } - loading={summary.isLoading} - /> - - drillTo({ - user_id: key, - model: modelFilter.trim() || undefined, - api_key_id: apiKeyFilter || undefined, - }) - } - loading={summary.isLoading} - /> -
- - {/* Raw rows for the same window, with the imported-row bulk actions. */} - - - {/* Trend */} + {/* The analytics chart: metric × group-by, brushable. */}
-
-

Over time

+
{METRIC_TABS.map((tab) => (
+
+ {customMode ? ( + + ) : null} + {summary.isFetching || (groupBy && grouped.isFetching) ? : null} + setGroupBy(value as "" | UsageGroupBy)} + options={GROUP_OPTIONS.map((o) => ({ value: o.value, label: o.value ? `By ${o.label.toLowerCase()}` : "No grouping" }))} + />
- {summary.isLoading ? ( -
+ + {chartLoading ? ( +
- ) : series.length === 0 ? ( -
+ ) : chart.data.length === 0 ? ( +
No data in this range.
) : (
- formatMetric(value, metric)} - ariaLabel={`${metric} per ${bucket}`} + formatBucketLabel(iso, bucket)} + ariaLabel={`${metric} per ${bucket}${groupBy ? `, grouped by ${groupBy}` : ""}`} + height={260} + showYAxis + showTotal + onSelectRange={onChartSelect} />
- {formatMetric(trend.peak, metric)} peak · {trend.count} {bucket === "hour" ? "hours" : "days"} (times - in UTC) + {formatValue(peak)} peak · {chart.data.length} {bucket === "hour" ? "hours" : "days"} (times in UTC) · + drag across the chart to zoom
)}
+ + {/* Breakdowns: the answer to "where is my money going?", one dimension + at a time, mirroring the chart's group-by choices. */} +
+
+

Spend by {activeDimension.label.toLowerCase()}

+
+ {dimensions.map((d) => ( + + ))} +
+
+ +
+ )}
diff --git a/web/src/styles/globals.css b/web/src/styles/globals.css index d968442e1..5aabbc42d 100644 --- a/web/src/styles/globals.css +++ b/web/src/styles/globals.css @@ -24,6 +24,25 @@ --otari-line: #dbe5e8; --otari-surface: #ffffff; --otari-bg: #f6f9fa; + /* Categorical chart palette for grouped series (top-8 + other), slot 1 first. + Not hand-picked: generated in OKLCH around the brand hue and validated with + the data-viz palette checker on the white chart surface (lightness band, + chroma floor, adjacent-pair CVD separation >= 8, normal-vision floor >= 15, + contrast >= 3:1). Assign slots in this fixed order, never cycled; the ninth + and later groups fold into "other", which wears the neutral below. */ + --otari-cat-1: #08899f; + --otari-cat-2: #b76522; + --otari-cat-3: #8560ac; + --otari-cat-4: #47a34e; + --otari-cat-5: #9d486c; + --otari-cat-6: #0871c1; + --otari-cat-7: #a9912b; + --otari-cat-8: #a64450; + --otari-cat-other: #8b969b; + /* Error fill for status-stacked charts (the red of the status triad at chart + strength: red-600, 4.0:1 on the white surface). Reserved for error marks, + never a series color. */ + --otari-danger: #dc2626; /* Foreground for code inside the dark code blocks in the bundled user guide (DocsPage). A near-white that reads on the --otari-ink block background. */ --otari-code-ink: #e8eef0; From b9f878f93c10412ed09c09bc1af1d85c1f1485c8 Mon Sep 17 00:00:00 2001 From: Nathan Brake Date: Mon, 3 Aug 2026 14:46:05 +0000 Subject: [PATCH 5/9] feat(usage): tighten the analytics chrome Three follow-ups from trying the page: the date presets, the Add filter toggle, and the window caption now share one row (FilterChips grew optional start/end slots); the redundant "Open activity log" header button is gone (breakdown rows already drill there); and provenance UI (the Source filter on Activity, the source group-by and breakdown tab on Usage) only appears once the window actually holds more than one source, since a single-option dimension is noise on a plain gateway. Co-Authored-By: Claude Opus 5 (1M context) --- ...e-BSXD7oi2.js => ActivityPage-8oLlQRnK.js} | 2 +- ...ge-DFSg4QUS.js => AliasesPage-YWTK3fom.js} | 2 +- ...ge-CnOzEeql.js => BudgetsPage-DzpynNOp.js} | 2 +- ...-DawcDVEg.js => ConfirmDialog-D_qqCO_E.js} | 2 +- ...sPage-CgRlIVtI.js => DocsPage-epKnwcXd.js} | 2 +- .../dashboard/assets/FilterChips-BLdhUEZK.js | 1 + .../dashboard/assets/FilterChips-BlzD0qFP.js | 1 - ...sPage-HexHbKWR.js => KeysPage-qur9pZ8W.js} | 2 +- ...76Tb8.js => ModelScopeControl-BxqgiAHY.js} | 2 +- ...age-Cwjl8fM-.js => ModelsPage-jrY_FD2Z.js} | 2 +- ...e-C0SW-na1.js => OverviewPage-CE2kZBwW.js} | 2 +- ...-17Tj43ca.js => ProvidersPage-BNd38xmH.js} | 2 +- ...e-CY71vadM.js => SettingsPage-CxLaAuqf.js} | 2 +- ...YC0DnfO.js => TablePagination-DQNDuKMr.js} | 2 +- ...vld.js => ToolsGuardrailsPage-BW2tcG_F.js} | 2 +- .../dashboard/assets/UsagePage-DTxN-kHP.js | 1 + .../dashboard/assets/UsagePage-r45FObnV.js | 1 - ...Page-DJTKoEIl.js => UsersPage-Dv0w97g2.js} | 2 +- .../{index-Dhxz7Eyv.js => index-J9GltkCK.js} | 4 +- src/gateway/static/dashboard/index.html | 2 +- web/src/components/FilterChips.test.tsx | 10 +++ web/src/components/FilterChips.tsx | 10 +++ web/src/pages/ActivityPage.test.tsx | 10 +++ web/src/pages/ActivityPage.tsx | 22 +++-- web/src/pages/UsagePage.test.tsx | 37 ++++++-- web/src/pages/UsagePage.tsx | 85 +++++++++---------- 26 files changed, 133 insertions(+), 79 deletions(-) rename src/gateway/static/dashboard/assets/{ActivityPage-BSXD7oi2.js => ActivityPage-8oLlQRnK.js} (63%) rename src/gateway/static/dashboard/assets/{AliasesPage-DFSg4QUS.js => AliasesPage-YWTK3fom.js} (98%) rename src/gateway/static/dashboard/assets/{BudgetsPage-CnOzEeql.js => BudgetsPage-DzpynNOp.js} (99%) rename src/gateway/static/dashboard/assets/{ConfirmDialog-DawcDVEg.js => ConfirmDialog-D_qqCO_E.js} (92%) rename src/gateway/static/dashboard/assets/{DocsPage-CgRlIVtI.js => DocsPage-epKnwcXd.js} (99%) create mode 100644 src/gateway/static/dashboard/assets/FilterChips-BLdhUEZK.js delete mode 100644 src/gateway/static/dashboard/assets/FilterChips-BlzD0qFP.js rename src/gateway/static/dashboard/assets/{KeysPage-HexHbKWR.js => KeysPage-qur9pZ8W.js} (98%) rename src/gateway/static/dashboard/assets/{ModelScopeControl-Bs976Tb8.js => ModelScopeControl-BxqgiAHY.js} (98%) rename src/gateway/static/dashboard/assets/{ModelsPage-Cwjl8fM-.js => ModelsPage-jrY_FD2Z.js} (99%) rename src/gateway/static/dashboard/assets/{OverviewPage-C0SW-na1.js => OverviewPage-CE2kZBwW.js} (99%) rename src/gateway/static/dashboard/assets/{ProvidersPage-17Tj43ca.js => ProvidersPage-BNd38xmH.js} (99%) rename src/gateway/static/dashboard/assets/{SettingsPage-CY71vadM.js => SettingsPage-CxLaAuqf.js} (99%) rename src/gateway/static/dashboard/assets/{TablePagination-BYC0DnfO.js => TablePagination-DQNDuKMr.js} (98%) rename src/gateway/static/dashboard/assets/{ToolsGuardrailsPage-D_8zOvld.js => ToolsGuardrailsPage-BW2tcG_F.js} (99%) create mode 100644 src/gateway/static/dashboard/assets/UsagePage-DTxN-kHP.js delete mode 100644 src/gateway/static/dashboard/assets/UsagePage-r45FObnV.js rename src/gateway/static/dashboard/assets/{UsersPage-DJTKoEIl.js => UsersPage-Dv0w97g2.js} (98%) rename src/gateway/static/dashboard/assets/{index-Dhxz7Eyv.js => index-J9GltkCK.js} (96%) diff --git a/src/gateway/static/dashboard/assets/ActivityPage-BSXD7oi2.js b/src/gateway/static/dashboard/assets/ActivityPage-8oLlQRnK.js similarity index 63% rename from src/gateway/static/dashboard/assets/ActivityPage-BSXD7oi2.js rename to src/gateway/static/dashboard/assets/ActivityPage-8oLlQRnK.js index 428f7e0a1..b5cb0c1c4 100644 --- a/src/gateway/static/dashboard/assets/ActivityPage-BSXD7oi2.js +++ b/src/gateway/static/dashboard/assets/ActivityPage-8oLlQRnK.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as d,u as lt}from"./react-dgEcD0HR.js";import{f as it,b as ct,a as dt,r as ut,u as mt,c as ht,d as xt,e as Fe,g as fe,h as z,i as pt,A as ce,j as gt,k as ft,P as bt,E as vt,C as Be,l as O,R as _t,F as be,m as ve,n as $e,Y as kt}from"./index-Dhxz7Eyv.js";import{C as yt,T as St}from"./charts-BI8Uczg4.js";import{B as U,S as jt}from"./heroui-DZj66Arc.js";import{u as wt,r as Nt,B as Ct}from"./tableSelection-CojkFPwd.js";import{C as Pt}from"./ConfirmDialog-DawcDVEg.js";import{D as It}from"./DataTable-CrQq0sYf.js";import{F as Mt}from"./FilterChips-BlzD0qFP.js";import{T as Tt,S as At,P as Et}from"./TablePagination-BYC0DnfO.js";import"./recharts-BwTTRGtj.js";function Le(t,n){const c=new Date(t);return Number.isNaN(c.getTime())?t:n==="hour"?c.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):c.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const Rt={key:"success",label:"Succeeded",color:"var(--otari-brand)"},Dt={key:"errors",label:"Failed",color:"var(--otari-danger)"},Ft={key:"requests",label:"Requests",color:"var(--otari-brand)"};function Lt({presets:t,extentKey:n,onPreset:c,onSelectRange:r,onSelectFull:i,series:v,bucket:o,windowStart:u,windowEnd:h,loading:_=!1,ariaLabel:j="Request volume over the selected window",action:w}){const p=v.map(a=>a.bucketStart),m=v.length,Q=it(u,h),B=v.some(a=>(a.errors??0)>0),D=B?[Rt,Dt]:[Ft],g=v.map(a=>{const x=Math.min(a.errors??0,a.requests);return B?{x:a.bucketStart,success:a.requests-x,errors:x}:{x:a.bucketStart,requests:a.requests}}),W=m>0?ct(p,u,h):{startIndex:0,endIndex:0},[F,$]=d.useState(null),Y=d.useRef(F),q=a=>{Y.current=a,$(a)},f=F??W,b=f.endIndex-f.startIndex+1,y=f.startIndex===0&&f.endIndex>=m-1,P=m>0&&!y,I=(a,x)=>{if(m===0)return;const k=Math.max(0,Math.min(a,x)),E=Math.min(m-1,Math.max(a,x));if(k===0&&E===m-1){i();return}const X=ut(p,k,E,o);X&&r(X.startIso,X.endIso)},N=t.findIndex(a=>a.key===n),M=N>=0?t[N].seconds:m*dt(o)/1e3,Z=N>=0?t[N+1]:t.find(a=>a.seconds===null||M!==null&&a.seconds>M),K=a=>{const x=Math.max(1,Math.min(m,Math.round(a))),k=(f.startIndex+f.endIndex+1)/2;let E=Math.round(k-x/2);E=Math.max(0,Math.min(m-x,E)),I(E,E+x-1)},G=()=>{if(y){Z&&c(Z);return}K(b*2)},ee=()=>K(b/2),H=d.useRef(null),T=d.useRef(null),V=a=>{const x=Math.max(0,Math.min(m-b,a));return{startIndex:x,endIndex:x+b-1}},de=a=>{const x=a.key==="ArrowRight"||a.key==="ArrowUp"?1:a.key==="ArrowLeft"||a.key==="ArrowDown"?-1:a.key==="PageUp"?b:a.key==="PageDown"?-b:a.key==="Home"?-m:a.key==="End"?m:0;if(x===0)return;a.preventDefault();const k=V(f.startIndex+x);k.startIndex!==f.startIndex&&I(k.startIndex,k.endIndex)},L=a=>{if(!T.current||!H.current)return;const x=H.current.getBoundingClientRect().width;if(x<=0)return;const k=Math.round((a.clientX-T.current.x)/x*m);q(V(T.current.startIndex+k))},A=a=>{a.currentTarget.hasPointerCapture(a.pointerId)&&a.currentTarget.releasePointerCapture(a.pointerId),T.current=null;const x=Y.current;q(null),x&&x.startIndex!==W.startIndex&&I(x.startIndex,x.endIndex)},te=m?f.startIndex/m*100:0,se=m?(f.endIndex+1)/m*100:100,ae=Math.max(0,m-b);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.map(a=>e.jsx(U,{size:"sm",variant:n===a.key?"primary":"outline",onPress:()=>c(a),children:a.label},a.key)),e.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",Q," · UTC"]}),w]})]}),e.jsxs("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[e.jsxs("span",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:["Requests / ",o==="hour"?"hour":"day"]}),e.jsx(yt,{series:D})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"hidden text-[11px] text-[var(--otari-muted)] sm:inline",children:"drag across the chart to zoom"}),e.jsx(U,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom in",isDisabled:m===0,onPress:ee,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M12 5v14M5 12h14",strokeLinecap:"round"})})}),e.jsx(U,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom out",isDisabled:m===0||y&&!Z,onPress:G,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})})}),P?e.jsx(U,{size:"sm",variant:"ghost",onPress:()=>I(0,m-1),children:"Reset"}):null]})]}),_&&m===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center",children:e.jsx(jt,{size:"sm"})}):m===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center text-xs text-[var(--otari-muted)]",children:"No activity in this range."}):e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(St,{data:g,series:D,formatValue:a=>a.toLocaleString(),formatXTick:a=>Le(a,o),ariaLabel:j,height:90,onSelectRange:I,window:P||F?f:null}),P||F?e.jsx("div",{ref:H,className:"relative h-2.5 w-full rounded-full bg-[var(--otari-bg)]",children:e.jsx("div",{role:"slider","aria-label":"Pan the selected window","aria-valuemin":0,"aria-valuemax":ae,"aria-valuenow":Math.min(f.startIndex,ae),"aria-valuetext":`Window starting at ${Le(p[f.startIndex]??p[0],o)}`,tabIndex:0,className:"absolute inset-y-0 cursor-grab touch-none rounded-full bg-[var(--otari-brand)]/40 outline-none hover:bg-[var(--otari-brand)]/60 focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)] active:cursor-grabbing",style:{left:`${te}%`,width:`${Math.max(2,se-te)}%`},onKeyDown:de,onPointerDown:a=>{a.preventDefault(),T.current={x:a.clientX,startIndex:f.startIndex},q({...f}),a.currentTarget.setPointerCapture(a.pointerId)},onPointerMove:L,onPointerUp:A,onPointerCancel:A})}):null]})]})]})}function Ot(t){const[n,c]=lt(),r=d.useCallback(o=>n.get(o)??t[o],[n,t]),i=d.useCallback(o=>{const u=Number.parseInt(n.get(o)??"",10);if(!Number.isNaN(u))return u;const h=Number.parseInt(t[o],10);return Number.isNaN(h)?0:h},[n,t]),v=d.useCallback(o=>{c(u=>{const h=new URLSearchParams(u);for(const[_,j]of Object.entries(o)){const w=String(j);w===""||w===t[_]?h.delete(_):h.set(_,w)}return h},{replace:!0})},[c,t]);return{get:r,getNumber:i,patch:v}}const Ut=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function le(t){return t===null?"—":Ut.format(t)}function C(t){return t===null?"—":t.toLocaleString()}function qe(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function Bt(t){const n=new Date(t);return Number.isNaN(n.getTime())?t:n.toLocaleString()}function $t(t){const n=new Date(t).getTime();if(Number.isNaN(n))return t;const c=Math.max(0,Math.round((Date.now()-n)/1e3));if(c<60)return`${c}s ago`;const r=Math.round(c/60);if(r<60)return`${r}m ago`;const i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}const qt=t=>t.id,Kt=t=>t.status==="error"?"bg-red-50":void 0,Oe=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],Ue=[{label:"All",value:""},{label:"Priced",value:"true"},{label:"Unpriced",value:"false"}],zt=50,Wt={range:ce,start_date:"",end_date:"",status:"",model:"",user_id:"",api_key_id:"",priced:"",source:"",page:"0",size:String(zt)};function ie(t,n,c){if(n||c)return{start:n||void 0,end:c||void 0};if(t===Be)return{};const r=z(O,t)??z(O,ce),i=(r==null?void 0:r.seconds)??null;return{start:i==null?void 0:$e(i),end:void 0}}function _e(t){const n=ie(t,"","");if(n.start)return n;const c=z(O,t);return(c==null?void 0:c.seconds)==null?{start:$e(kt)}:n}function Yt({status:t}){const n=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${n}`,children:t})}const Zt={gateway:"Gateway",claude_code:"Claude Code",codex:"Codex"};function ke(t){return Zt[t]??t}function R(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function Ke(t){const n=t.billing_meters??null,c=R(n?n.total_input_tokens:t.prompt_tokens),r=R(n?n.cache_read_tokens:t.cache_read_tokens),i=R(n?n.cache_write_tokens:t.cache_write_tokens),v=R(n?n.completion_tokens:t.completion_tokens),o=Math.max(0,c-r-i),u=o+r+i+v;return u>0?{fresh:o,cacheRead:r,cacheWrite:i,output:v,total:u}:null}const Gt=[{key:"fresh",label:"Fresh input",fill:"var(--otari-ink)"},{key:"cacheRead",label:"Cache read",fill:"var(--otari-brand)"},{key:"cacheWrite",label:"Cache write",fill:"var(--otari-brand-soft)"},{key:"output",label:"Output",fill:"var(--otari-brand-dark)"}];function Ht({entry:t}){const n=Ke(t);if(n===null)return e.jsx("span",{className:"tabular-nums",children:C(t.total_tokens)});const c=Gt.map(o=>({...o,value:n[o.key]})),r=c.filter(o=>o.value>0).map(o=>`${o.label} ${o.value.toLocaleString()}`).join(", ");let i=0;const v=c.map(o=>{const u=o.value/n.total*100,h={...o,x:i,width:u};return i+=u,h});return e.jsxs("span",{className:"inline-flex flex-col items-end gap-1",title:r,children:[e.jsx("span",{className:"tabular-nums",children:n.total.toLocaleString()}),e.jsx("svg",{viewBox:"0 0 100 4",preserveAspectRatio:"none",role:"img","aria-label":`Token composition: ${r}`,className:"h-1.5 w-20 overflow-hidden rounded-full bg-[var(--otari-brand-tint)]",children:v.filter(o=>o.width>0).map(o=>e.jsx("rect",{x:o.x,y:0,width:o.width,height:4,fill:o.fill},o.key))})]})}function S({label:t,children:n}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:n})]})}function Vt({entry:t}){var n,c;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"This request failed. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(S,{label:"Provider",children:t.provider??"—"}),e.jsx(S,{label:"Endpoint",children:t.endpoint}),e.jsx(S,{label:"Source",children:ke(t.source)}),t.source_label?e.jsx(S,{label:"Session",children:t.source_label}):null,e.jsx(S,{label:"User",children:t.user_id??"—"}),e.jsx(S,{label:"API key",children:t.api_key_id??"—"}),e.jsx(S,{label:"Prompt tokens",children:C(t.prompt_tokens)}),e.jsx(S,{label:"Completion tokens",children:C(t.completion_tokens)}),e.jsx(S,{label:"Total tokens",children:C(t.total_tokens)}),e.jsx(S,{label:"Billed tokens",children:e.jsx("span",{title:"Fresh input, cache reads and writes, and output: the tokens this request was priced on, and the total the activity row's bar splits.",children:C(((n=Ke(t))==null?void 0:n.total)??null)})}),e.jsx(S,{label:"Cost",children:le(t.cost)}),e.jsx(S,{label:"Cache read tokens",children:C(t.cache_read_tokens)}),e.jsx(S,{label:"Cache write tokens",children:C(t.cache_write_tokens)}),e.jsx(S,{label:"1h cache writes",children:C(t.cache_write_1h_tokens??null)}),e.jsx(S,{label:"Total time",children:qe(t.latency_ms)}),e.jsx(S,{label:"Request ID",children:t.id})]}),(c=t.pricing_breakdown)!=null&&c.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(r=>e.jsxs(S,{label:r.meter.replaceAll("_"," "),children:[C(r.units)," at ",le(r.rate_per_million)," / 1M, ",le(r.cost)]},r.meter))})]}):null]})}function cs(){var Ie,Me,Te,Ae,Ee,Re;const t=mt(),n=ht(),c=d.useMemo(()=>{const s=new Map;for(const l of n.data??[])s.set(l.id,l.key_name??`${l.id.slice(0,8)}…`);return s},[n.data]),r=Ot(Wt),i=r.get("range"),v=r.get("start_date"),o=r.get("end_date"),u=r.get("status"),h=r.get("model"),_=r.get("user_id"),j=r.get("api_key_id"),w=r.get("priced"),p=r.get("source"),m=Math.max(0,r.getNumber("page")),Q=r.getNumber("size"),B=Et.reduce((s,l)=>Math.abs(l-Q)ie(i,v,o)),F=d.useRef(D);d.useEffect(()=>{F.current!==D&&(F.current=D,W(ie(i,v,o)))},[D,i,v,o]);const[$,Y]=d.useState(()=>_e(i)),q=d.useRef(i);d.useEffect(()=>{q.current!==i&&(q.current=i,Y(_e(i)))},[i]);const f=w==="true"?!0:w==="false"?!1:void 0,b=d.useMemo(()=>({start_date:g.start,end_date:g.end,status:u||void 0,model:h.trim()||void 0,user_id:_||void 0,api_key_id:j||void 0,source:p||void 0,priced:f}),[g,u,h,_,j,p,f]),y=wt(),P=JSON.stringify(b),I=d.useRef(P);d.useEffect(()=>{I.current!==P&&(I.current=P,r.patch({page:0}),y.clear())},[P,r,y]);const N=xt(b,m,B),M=Fe(b),Z=d.useMemo(()=>({start_date:g.start,end_date:g.end,status:u||void 0,user_id:_||void 0,api_key_id:j||void 0,source:p||void 0}),[g,u,_,j,p]),K=fe(Z,"day"),G=((Me=(Ie=K.data)==null?void 0:Ie.by_model)==null?void 0:Me.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],ee=(n.data??[]).map(s=>({value:s.id,label:s.key_name??`${s.id.slice(0,8)}…`})),H=d.useMemo(()=>({start_date:g.start,end_date:g.end,status:u||void 0,model:h.trim()||void 0,user_id:_||void 0,api_key_id:j||void 0}),[g,u,h,_,j]),T=fe(H,"day",!!p),V=(Te=p?T.data:K.data)==null?void 0:Te.by_source,de=d.useMemo(()=>{const s=(V??[]).filter(l=>!l.is_other&&l.key!==null).map(l=>l.key);return p&&!s.includes(p)?[p,...s]:s},[V,p]),L=z(O,i)??z(O,ce),A=!!(g.start&&$.start&&new Date(g.start).getTime()({start_date:A?g.start:$.start,end_date:A?g.end:void 0,status:u||void 0,model:h.trim()||void 0,user_id:_||void 0,api_key_id:j||void 0,source:p||void 0,priced:f}),[A,g,$,u,h,_,j,p,f]),a=fe(ae,se),x=(((Ae=a.data)==null?void 0:Ae.series)??[]).map(s=>({bucketStart:s.bucket_start,requests:s.requests,errors:s.errors??0})),k=N.data??[],X=M.isSuccess&&!M.isPlaceholderData?((Ee=M.data)==null?void 0:Ee.total)??0:null,ue=z(O,i),ze=!!(v||o)||i!==ce&&(ue==null?void 0:ue.seconds)!=null,We=!!(u||h.trim()||_||j||w||p||ze),re=(s,l)=>{var De;return((De=s.find(ot=>ot.value===l))==null?void 0:De.label)??l},ye=(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),Ye=()=>r.patch({status:"",priced:"",model:"",user_id:"",api_key_id:"",source:""}),Ze=[...u?[{key:"status",label:"Status",value:re(Oe,u),onClear:()=>r.patch({status:""})}]:[],...w?[{key:"priced",label:"Priced",value:re(Ue,w),onClear:()=>r.patch({priced:""})}]:[],..._?[{key:"user",label:"User",value:re(ye,_),onClear:()=>r.patch({user_id:""})}]:[],...h.trim()?[{key:"model",label:"Model",value:h.trim(),onClear:()=>r.patch({model:""})}]:[],...j?[{key:"key",label:"API key",value:re(ee,j),onClear:()=>r.patch({api_key_id:""})}]:[],...p?[{key:"source",label:"Source",value:ke(p),onClear:()=>r.patch({source:""})}]:[]],me=d.useMemo(()=>k.filter(s=>!s.counts_toward_budget).map(s=>s.id),[k]),Ge=d.useMemo(()=>k.filter(s=>s.counts_toward_budget).map(s=>s.id),[k]),Se=Nt(y.selectedKeys,me),J=Se.length,je=y.allMatching||J>0,He=d.useMemo(()=>({...b,counts_toward_budget:!1}),[b]),we=Fe(He,je),ne=we.isSuccess?((Re=we.data)==null?void 0:Re.total)??null:null,Ve=me.length>0&&J===me.length&&ne!=null&&ne>J,oe=y.allMatching?ne??J:J,he=gt(),xe=ft(),[Xe,pe]=d.useState(!1),[Je,ge]=d.useState(!1),[Qe,Ne]=d.useState(null),et=d.useCallback(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Request detail"}),e.jsx(U,{size:"sm",variant:"ghost",onPress:()=>Ne(null),children:"Close"})]}),e.jsx(Vt,{entry:s})]}),[]),Ce=()=>y.allMatching?{by_filter:!0,model:b.model,user_id:b.user_id,api_key_id:b.api_key_id,status:b.status,start_date:b.start_date,end_date:b.end_date,priced:b.priced}:{ids:Se},tt=()=>{he.mutate(Ce(),{onSuccess:()=>{pe(!1),y.clear()}})},st=s=>{xe.mutate({...Ce(),...s},{onSuccess:()=>{ge(!1),y.clear()}})},at=()=>{N.refetch(),M.refetch(),a.refetch(),K.refetch(),T.refetch()},Pe=s=>{if(s.key===i&&!v&&!o){W(ie(s.key,"","")),Y(_e(s.key));return}r.patch({range:s.key,start_date:"",end_date:""})},rt=(s,l)=>r.patch({start_date:s,end_date:l}),nt=d.useMemo(()=>{const s=l=>l===null?"—":c.get(l)??`${l.slice(0,8)}…`;return[{id:"time",header:"Time",cell:l=>e.jsx("span",{title:Bt(l.timestamp),className:"text-[var(--otari-muted)]",children:$t(l.timestamp)})},{id:"user",header:"User",cell:l=>l.user_id??"—"},{id:"model",header:"Model",isRowHeader:!0,cell:l=>l.model},{id:"api_key",header:"API key",cell:l=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:s(l.api_key_id)})},{id:"tokens",header:"Tokens",align:"end",cell:l=>e.jsx(Ht,{entry:l})},{id:"cost",header:"Cost",align:"end",cell:l=>le(l.cost)},{id:"latency",header:"Total time",align:"end",cell:l=>qe(l.latency_ms)},{id:"status",header:"Status",cell:l=>e.jsx(Yt,{status:l.status})}]},[c]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(bt,{title:"Activity",description:"A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored."}),e.jsx(vt,{error:N.error??M.error}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(Lt,{presets:O,extentKey:te,onPreset:Pe,onSelectRange:rt,onSelectFull:()=>L?Pe(L):void 0,series:x,bucket:se,windowStart:g.start,windowEnd:g.end,loading:a.isLoading,ariaLabel:"Activity request volume over the selected window",action:e.jsx(_t,{onRefresh:at,isFetching:N.isFetching,updatedAt:N.dataUpdatedAt})}),e.jsxs(Mt,{chips:Ze,onClearAll:Ye,children:[e.jsx(be,{id:"filter-status",label:"Status",value:u,onChange:s=>r.patch({status:s}),children:Oe.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsx(be,{id:"filter-priced",label:"Priced?",value:w,onChange:s=>r.patch({priced:s}),children:Ue.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsxs(be,{id:"filter-source",label:"Source",value:p,onChange:s=>r.patch({source:s}),children:[e.jsx("option",{value:"",children:"All"}),de.map(s=>e.jsx("option",{value:s,children:ke(s)},s))]}),e.jsx(ve,{label:"API key",value:j,onChange:s=>r.patch({api_key_id:s}),placeholder:"All keys",options:ee}),e.jsx(ve,{label:"User",value:_,onChange:s=>r.patch({user_id:s}),placeholder:"All users",options:ye}),e.jsx(ve,{label:"Model",value:h,onChange:s=>r.patch({model:s}),allowsCustom:!0,placeholder:"Any model",options:(h&&!G.includes(h)?[h,...G]:G).map(s=>({value:s,label:s}))})]})]}),je?e.jsxs(Ct,{selectedCount:oe,allMatching:y.allMatching,matchingTotal:ne,canSelectAllMatching:Ve,onSelectAllMatching:y.enableAllMatching,onClear:y.clear,children:[e.jsx(U,{size:"sm",variant:"primary",onPress:()=>ge(!0),children:"Set price"}),e.jsx(U,{size:"sm",variant:"danger",onPress:()=>pe(!0),children:"Delete"})]}):null,e.jsx(It,{ariaLabel:"Activity log",columns:nt,rows:k,getRowKey:qt,isLoading:N.isLoading,emptyContent:We?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange,disabledKeys:Ge,onRowAction:s=>Ne(l=>l===s?null:s),rowClassName:Kt,detailKey:Qe,renderDetail:et}),e.jsx(Tt,{page:m,pageSize:B,total:X,rowsOnPage:k.length,onPageChange:s=>r.patch({page:s}),onPageSizeChange:s=>r.patch({size:s,page:0}),isFetching:N.isFetching,hasNextFallback:k.length===B}),e.jsx(Pt,{isOpen:Xe,onOpenChange:pe,heading:"Delete usage rows",body:`Delete ${oe.toLocaleString()} imported ${oe===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:he.isPending,error:he.error,onConfirm:tt}),e.jsx(At,{isOpen:Je,onOpenChange:ge,targetCount:oe,isPending:xe.isPending,error:xe.error,onSubmit:st})]})}export{cs as ActivityPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as d,u as lt}from"./react-dgEcD0HR.js";import{f as it,b as ct,a as dt,r as ut,u as mt,c as ht,d as xt,e as Fe,g as fe,h as z,i as pt,A as de,j as gt,k as ft,P as bt,E as vt,C as Be,l as O,R as _t,F as be,m as ve,n as $e,Y as kt}from"./index-J9GltkCK.js";import{C as yt,T as St}from"./charts-BI8Uczg4.js";import{B as U,S as jt}from"./heroui-DZj66Arc.js";import{u as wt,r as Nt,B as Ct}from"./tableSelection-CojkFPwd.js";import{C as Pt}from"./ConfirmDialog-D_qqCO_E.js";import{D as It}from"./DataTable-CrQq0sYf.js";import{F as Mt}from"./FilterChips-BLdhUEZK.js";import{T as Tt,S as At,P as Et}from"./TablePagination-DQNDuKMr.js";import"./recharts-BwTTRGtj.js";function Le(t,r){const c=new Date(t);return Number.isNaN(c.getTime())?t:r==="hour"?c.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):c.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const Rt={key:"success",label:"Succeeded",color:"var(--otari-brand)"},Dt={key:"errors",label:"Failed",color:"var(--otari-danger)"},Ft={key:"requests",label:"Requests",color:"var(--otari-brand)"};function Lt({presets:t,extentKey:r,onPreset:c,onSelectRange:n,onSelectFull:i,series:v,bucket:o,windowStart:u,windowEnd:h,loading:_=!1,ariaLabel:j="Request volume over the selected window",action:w}){const p=v.map(a=>a.bucketStart),m=v.length,Q=it(u,h),B=v.some(a=>(a.errors??0)>0),D=B?[Rt,Dt]:[Ft],g=v.map(a=>{const x=Math.min(a.errors??0,a.requests);return B?{x:a.bucketStart,success:a.requests-x,errors:x}:{x:a.bucketStart,requests:a.requests}}),W=m>0?ct(p,u,h):{startIndex:0,endIndex:0},[F,$]=d.useState(null),Y=d.useRef(F),q=a=>{Y.current=a,$(a)},f=F??W,b=f.endIndex-f.startIndex+1,y=f.startIndex===0&&f.endIndex>=m-1,P=m>0&&!y,I=(a,x)=>{if(m===0)return;const k=Math.max(0,Math.min(a,x)),E=Math.min(m-1,Math.max(a,x));if(k===0&&E===m-1){i();return}const X=ut(p,k,E,o);X&&n(X.startIso,X.endIso)},N=t.findIndex(a=>a.key===r),M=N>=0?t[N].seconds:m*dt(o)/1e3,Z=N>=0?t[N+1]:t.find(a=>a.seconds===null||M!==null&&a.seconds>M),K=a=>{const x=Math.max(1,Math.min(m,Math.round(a))),k=(f.startIndex+f.endIndex+1)/2;let E=Math.round(k-x/2);E=Math.max(0,Math.min(m-x,E)),I(E,E+x-1)},G=()=>{if(y){Z&&c(Z);return}K(b*2)},ee=()=>K(b/2),H=d.useRef(null),T=d.useRef(null),V=a=>{const x=Math.max(0,Math.min(m-b,a));return{startIndex:x,endIndex:x+b-1}},te=a=>{const x=a.key==="ArrowRight"||a.key==="ArrowUp"?1:a.key==="ArrowLeft"||a.key==="ArrowDown"?-1:a.key==="PageUp"?b:a.key==="PageDown"?-b:a.key==="Home"?-m:a.key==="End"?m:0;if(x===0)return;a.preventDefault();const k=V(f.startIndex+x);k.startIndex!==f.startIndex&&I(k.startIndex,k.endIndex)},L=a=>{if(!T.current||!H.current)return;const x=H.current.getBoundingClientRect().width;if(x<=0)return;const k=Math.round((a.clientX-T.current.x)/x*m);q(V(T.current.startIndex+k))},A=a=>{a.currentTarget.hasPointerCapture(a.pointerId)&&a.currentTarget.releasePointerCapture(a.pointerId),T.current=null;const x=Y.current;q(null),x&&x.startIndex!==W.startIndex&&I(x.startIndex,x.endIndex)},se=m?f.startIndex/m*100:0,ae=m?(f.endIndex+1)/m*100:100,ne=Math.max(0,m-b);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.map(a=>e.jsx(U,{size:"sm",variant:r===a.key?"primary":"outline",onPress:()=>c(a),children:a.label},a.key)),e.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",Q," · UTC"]}),w]})]}),e.jsxs("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[e.jsxs("span",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:["Requests / ",o==="hour"?"hour":"day"]}),e.jsx(yt,{series:D})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"hidden text-[11px] text-[var(--otari-muted)] sm:inline",children:"drag across the chart to zoom"}),e.jsx(U,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom in",isDisabled:m===0,onPress:ee,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M12 5v14M5 12h14",strokeLinecap:"round"})})}),e.jsx(U,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom out",isDisabled:m===0||y&&!Z,onPress:G,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})})}),P?e.jsx(U,{size:"sm",variant:"ghost",onPress:()=>I(0,m-1),children:"Reset"}):null]})]}),_&&m===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center",children:e.jsx(jt,{size:"sm"})}):m===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center text-xs text-[var(--otari-muted)]",children:"No activity in this range."}):e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(St,{data:g,series:D,formatValue:a=>a.toLocaleString(),formatXTick:a=>Le(a,o),ariaLabel:j,height:90,onSelectRange:I,window:P||F?f:null}),P||F?e.jsx("div",{ref:H,className:"relative h-2.5 w-full rounded-full bg-[var(--otari-bg)]",children:e.jsx("div",{role:"slider","aria-label":"Pan the selected window","aria-valuemin":0,"aria-valuemax":ne,"aria-valuenow":Math.min(f.startIndex,ne),"aria-valuetext":`Window starting at ${Le(p[f.startIndex]??p[0],o)}`,tabIndex:0,className:"absolute inset-y-0 cursor-grab touch-none rounded-full bg-[var(--otari-brand)]/40 outline-none hover:bg-[var(--otari-brand)]/60 focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)] active:cursor-grabbing",style:{left:`${se}%`,width:`${Math.max(2,ae-se)}%`},onKeyDown:te,onPointerDown:a=>{a.preventDefault(),T.current={x:a.clientX,startIndex:f.startIndex},q({...f}),a.currentTarget.setPointerCapture(a.pointerId)},onPointerMove:L,onPointerUp:A,onPointerCancel:A})}):null]})]})]})}function Ot(t){const[r,c]=lt(),n=d.useCallback(o=>r.get(o)??t[o],[r,t]),i=d.useCallback(o=>{const u=Number.parseInt(r.get(o)??"",10);if(!Number.isNaN(u))return u;const h=Number.parseInt(t[o],10);return Number.isNaN(h)?0:h},[r,t]),v=d.useCallback(o=>{c(u=>{const h=new URLSearchParams(u);for(const[_,j]of Object.entries(o)){const w=String(j);w===""||w===t[_]?h.delete(_):h.set(_,w)}return h},{replace:!0})},[c,t]);return{get:n,getNumber:i,patch:v}}const Ut=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function ie(t){return t===null?"—":Ut.format(t)}function C(t){return t===null?"—":t.toLocaleString()}function qe(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function Bt(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleString()}function $t(t){const r=new Date(t).getTime();if(Number.isNaN(r))return t;const c=Math.max(0,Math.round((Date.now()-r)/1e3));if(c<60)return`${c}s ago`;const n=Math.round(c/60);if(n<60)return`${n}m ago`;const i=Math.round(n/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}const qt=t=>t.id,Kt=t=>t.status==="error"?"bg-red-50":void 0,Oe=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],Ue=[{label:"All",value:""},{label:"Priced",value:"true"},{label:"Unpriced",value:"false"}],zt=50,Wt={range:de,start_date:"",end_date:"",status:"",model:"",user_id:"",api_key_id:"",priced:"",source:"",page:"0",size:String(zt)};function ce(t,r,c){if(r||c)return{start:r||void 0,end:c||void 0};if(t===Be)return{};const n=z(O,t)??z(O,de),i=(n==null?void 0:n.seconds)??null;return{start:i==null?void 0:$e(i),end:void 0}}function _e(t){const r=ce(t,"","");if(r.start)return r;const c=z(O,t);return(c==null?void 0:c.seconds)==null?{start:$e(kt)}:r}function Yt({status:t}){const r=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r}`,children:t})}const Zt={gateway:"Gateway",claude_code:"Claude Code",codex:"Codex"};function ke(t){return Zt[t]??t}function R(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function Ke(t){const r=t.billing_meters??null,c=R(r?r.total_input_tokens:t.prompt_tokens),n=R(r?r.cache_read_tokens:t.cache_read_tokens),i=R(r?r.cache_write_tokens:t.cache_write_tokens),v=R(r?r.completion_tokens:t.completion_tokens),o=Math.max(0,c-n-i),u=o+n+i+v;return u>0?{fresh:o,cacheRead:n,cacheWrite:i,output:v,total:u}:null}const Gt=[{key:"fresh",label:"Fresh input",fill:"var(--otari-ink)"},{key:"cacheRead",label:"Cache read",fill:"var(--otari-brand)"},{key:"cacheWrite",label:"Cache write",fill:"var(--otari-brand-soft)"},{key:"output",label:"Output",fill:"var(--otari-brand-dark)"}];function Ht({entry:t}){const r=Ke(t);if(r===null)return e.jsx("span",{className:"tabular-nums",children:C(t.total_tokens)});const c=Gt.map(o=>({...o,value:r[o.key]})),n=c.filter(o=>o.value>0).map(o=>`${o.label} ${o.value.toLocaleString()}`).join(", ");let i=0;const v=c.map(o=>{const u=o.value/r.total*100,h={...o,x:i,width:u};return i+=u,h});return e.jsxs("span",{className:"inline-flex flex-col items-end gap-1",title:n,children:[e.jsx("span",{className:"tabular-nums",children:r.total.toLocaleString()}),e.jsx("svg",{viewBox:"0 0 100 4",preserveAspectRatio:"none",role:"img","aria-label":`Token composition: ${n}`,className:"h-1.5 w-20 overflow-hidden rounded-full bg-[var(--otari-brand-tint)]",children:v.filter(o=>o.width>0).map(o=>e.jsx("rect",{x:o.x,y:0,width:o.width,height:4,fill:o.fill},o.key))})]})}function S({label:t,children:r}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:r})]})}function Vt({entry:t}){var r,c;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"This request failed. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(S,{label:"Provider",children:t.provider??"—"}),e.jsx(S,{label:"Endpoint",children:t.endpoint}),e.jsx(S,{label:"Source",children:ke(t.source)}),t.source_label?e.jsx(S,{label:"Session",children:t.source_label}):null,e.jsx(S,{label:"User",children:t.user_id??"—"}),e.jsx(S,{label:"API key",children:t.api_key_id??"—"}),e.jsx(S,{label:"Prompt tokens",children:C(t.prompt_tokens)}),e.jsx(S,{label:"Completion tokens",children:C(t.completion_tokens)}),e.jsx(S,{label:"Total tokens",children:C(t.total_tokens)}),e.jsx(S,{label:"Billed tokens",children:e.jsx("span",{title:"Fresh input, cache reads and writes, and output: the tokens this request was priced on, and the total the activity row's bar splits.",children:C(((r=Ke(t))==null?void 0:r.total)??null)})}),e.jsx(S,{label:"Cost",children:ie(t.cost)}),e.jsx(S,{label:"Cache read tokens",children:C(t.cache_read_tokens)}),e.jsx(S,{label:"Cache write tokens",children:C(t.cache_write_tokens)}),e.jsx(S,{label:"1h cache writes",children:C(t.cache_write_1h_tokens??null)}),e.jsx(S,{label:"Total time",children:qe(t.latency_ms)}),e.jsx(S,{label:"Request ID",children:t.id})]}),(c=t.pricing_breakdown)!=null&&c.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(n=>e.jsxs(S,{label:n.meter.replaceAll("_"," "),children:[C(n.units)," at ",ie(n.rate_per_million)," / 1M, ",ie(n.cost)]},n.meter))})]}):null]})}function cs(){var Ie,Me,Te,Ae,Ee,Re;const t=mt(),r=ht(),c=d.useMemo(()=>{const s=new Map;for(const l of r.data??[])s.set(l.id,l.key_name??`${l.id.slice(0,8)}…`);return s},[r.data]),n=Ot(Wt),i=n.get("range"),v=n.get("start_date"),o=n.get("end_date"),u=n.get("status"),h=n.get("model"),_=n.get("user_id"),j=n.get("api_key_id"),w=n.get("priced"),p=n.get("source"),m=Math.max(0,n.getNumber("page")),Q=n.getNumber("size"),B=Et.reduce((s,l)=>Math.abs(l-Q)ce(i,v,o)),F=d.useRef(D);d.useEffect(()=>{F.current!==D&&(F.current=D,W(ce(i,v,o)))},[D,i,v,o]);const[$,Y]=d.useState(()=>_e(i)),q=d.useRef(i);d.useEffect(()=>{q.current!==i&&(q.current=i,Y(_e(i)))},[i]);const f=w==="true"?!0:w==="false"?!1:void 0,b=d.useMemo(()=>({start_date:g.start,end_date:g.end,status:u||void 0,model:h.trim()||void 0,user_id:_||void 0,api_key_id:j||void 0,source:p||void 0,priced:f}),[g,u,h,_,j,p,f]),y=wt(),P=JSON.stringify(b),I=d.useRef(P);d.useEffect(()=>{I.current!==P&&(I.current=P,n.patch({page:0}),y.clear())},[P,n,y]);const N=xt(b,m,B),M=Fe(b),Z=d.useMemo(()=>({start_date:g.start,end_date:g.end,status:u||void 0,user_id:_||void 0,api_key_id:j||void 0,source:p||void 0}),[g,u,_,j,p]),K=fe(Z,"day"),G=((Me=(Ie=K.data)==null?void 0:Ie.by_model)==null?void 0:Me.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],ee=(r.data??[]).map(s=>({value:s.id,label:s.key_name??`${s.id.slice(0,8)}…`})),H=d.useMemo(()=>({start_date:g.start,end_date:g.end,status:u||void 0,model:h.trim()||void 0,user_id:_||void 0,api_key_id:j||void 0}),[g,u,h,_,j]),T=fe(H,"day",!!p),V=(Te=p?T.data:K.data)==null?void 0:Te.by_source,te=d.useMemo(()=>{const s=(V??[]).filter(l=>!l.is_other&&l.key!==null).map(l=>l.key);return p&&!s.includes(p)?[p,...s]:s},[V,p]),L=z(O,i)??z(O,de),A=!!(g.start&&$.start&&new Date(g.start).getTime()({start_date:A?g.start:$.start,end_date:A?g.end:void 0,status:u||void 0,model:h.trim()||void 0,user_id:_||void 0,api_key_id:j||void 0,source:p||void 0,priced:f}),[A,g,$,u,h,_,j,p,f]),a=fe(ne,ae),x=(((Ae=a.data)==null?void 0:Ae.series)??[]).map(s=>({bucketStart:s.bucket_start,requests:s.requests,errors:s.errors??0})),k=N.data??[],X=M.isSuccess&&!M.isPlaceholderData?((Ee=M.data)==null?void 0:Ee.total)??0:null,ue=z(O,i),ze=!!(v||o)||i!==de&&(ue==null?void 0:ue.seconds)!=null,We=!!(u||h.trim()||_||j||w||p||ze),re=(s,l)=>{var De;return((De=s.find(ot=>ot.value===l))==null?void 0:De.label)??l},ye=(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),Ye=()=>n.patch({status:"",priced:"",model:"",user_id:"",api_key_id:"",source:""}),Ze=[...u?[{key:"status",label:"Status",value:re(Oe,u),onClear:()=>n.patch({status:""})}]:[],...w?[{key:"priced",label:"Priced",value:re(Ue,w),onClear:()=>n.patch({priced:""})}]:[],..._?[{key:"user",label:"User",value:re(ye,_),onClear:()=>n.patch({user_id:""})}]:[],...h.trim()?[{key:"model",label:"Model",value:h.trim(),onClear:()=>n.patch({model:""})}]:[],...j?[{key:"key",label:"API key",value:re(ee,j),onClear:()=>n.patch({api_key_id:""})}]:[],...p?[{key:"source",label:"Source",value:ke(p),onClear:()=>n.patch({source:""})}]:[]],me=d.useMemo(()=>k.filter(s=>!s.counts_toward_budget).map(s=>s.id),[k]),Ge=d.useMemo(()=>k.filter(s=>s.counts_toward_budget).map(s=>s.id),[k]),Se=Nt(y.selectedKeys,me),J=Se.length,je=y.allMatching||J>0,He=d.useMemo(()=>({...b,counts_toward_budget:!1}),[b]),we=Fe(He,je),oe=we.isSuccess?((Re=we.data)==null?void 0:Re.total)??null:null,Ve=me.length>0&&J===me.length&&oe!=null&&oe>J,le=y.allMatching?oe??J:J,he=gt(),xe=ft(),[Xe,pe]=d.useState(!1),[Je,ge]=d.useState(!1),[Qe,Ne]=d.useState(null),et=d.useCallback(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Request detail"}),e.jsx(U,{size:"sm",variant:"ghost",onPress:()=>Ne(null),children:"Close"})]}),e.jsx(Vt,{entry:s})]}),[]),Ce=()=>y.allMatching?{by_filter:!0,model:b.model,user_id:b.user_id,api_key_id:b.api_key_id,status:b.status,start_date:b.start_date,end_date:b.end_date,priced:b.priced}:{ids:Se},tt=()=>{he.mutate(Ce(),{onSuccess:()=>{pe(!1),y.clear()}})},st=s=>{xe.mutate({...Ce(),...s},{onSuccess:()=>{ge(!1),y.clear()}})},at=()=>{N.refetch(),M.refetch(),a.refetch(),K.refetch(),T.refetch()},Pe=s=>{if(s.key===i&&!v&&!o){W(ce(s.key,"","")),Y(_e(s.key));return}n.patch({range:s.key,start_date:"",end_date:""})},nt=(s,l)=>n.patch({start_date:s,end_date:l}),rt=d.useMemo(()=>{const s=l=>l===null?"—":c.get(l)??`${l.slice(0,8)}…`;return[{id:"time",header:"Time",cell:l=>e.jsx("span",{title:Bt(l.timestamp),className:"text-[var(--otari-muted)]",children:$t(l.timestamp)})},{id:"user",header:"User",cell:l=>l.user_id??"—"},{id:"model",header:"Model",isRowHeader:!0,cell:l=>l.model},{id:"api_key",header:"API key",cell:l=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:s(l.api_key_id)})},{id:"tokens",header:"Tokens",align:"end",cell:l=>e.jsx(Ht,{entry:l})},{id:"cost",header:"Cost",align:"end",cell:l=>ie(l.cost)},{id:"latency",header:"Total time",align:"end",cell:l=>qe(l.latency_ms)},{id:"status",header:"Status",cell:l=>e.jsx(Yt,{status:l.status})}]},[c]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(bt,{title:"Activity",description:"A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored."}),e.jsx(vt,{error:N.error??M.error}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(Lt,{presets:O,extentKey:se,onPreset:Pe,onSelectRange:nt,onSelectFull:()=>L?Pe(L):void 0,series:x,bucket:ae,windowStart:g.start,windowEnd:g.end,loading:a.isLoading,ariaLabel:"Activity request volume over the selected window",action:e.jsx(_t,{onRefresh:at,isFetching:N.isFetching,updatedAt:N.dataUpdatedAt})}),e.jsxs(Mt,{chips:Ze,onClearAll:Ye,children:[e.jsx(be,{id:"filter-status",label:"Status",value:u,onChange:s=>n.patch({status:s}),children:Oe.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsx(be,{id:"filter-priced",label:"Priced?",value:w,onChange:s=>n.patch({priced:s}),children:Ue.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),te.length>1||p?e.jsxs(be,{id:"filter-source",label:"Source",value:p,onChange:s=>n.patch({source:s}),children:[e.jsx("option",{value:"",children:"All"}),te.map(s=>e.jsx("option",{value:s,children:ke(s)},s))]}):null,e.jsx(ve,{label:"API key",value:j,onChange:s=>n.patch({api_key_id:s}),placeholder:"All keys",options:ee}),e.jsx(ve,{label:"User",value:_,onChange:s=>n.patch({user_id:s}),placeholder:"All users",options:ye}),e.jsx(ve,{label:"Model",value:h,onChange:s=>n.patch({model:s}),allowsCustom:!0,placeholder:"Any model",options:(h&&!G.includes(h)?[h,...G]:G).map(s=>({value:s,label:s}))})]})]}),je?e.jsxs(Ct,{selectedCount:le,allMatching:y.allMatching,matchingTotal:oe,canSelectAllMatching:Ve,onSelectAllMatching:y.enableAllMatching,onClear:y.clear,children:[e.jsx(U,{size:"sm",variant:"primary",onPress:()=>ge(!0),children:"Set price"}),e.jsx(U,{size:"sm",variant:"danger",onPress:()=>pe(!0),children:"Delete"})]}):null,e.jsx(It,{ariaLabel:"Activity log",columns:rt,rows:k,getRowKey:qt,isLoading:N.isLoading,emptyContent:We?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange,disabledKeys:Ge,onRowAction:s=>Ne(l=>l===s?null:s),rowClassName:Kt,detailKey:Qe,renderDetail:et}),e.jsx(Tt,{page:m,pageSize:B,total:X,rowsOnPage:k.length,onPageChange:s=>n.patch({page:s}),onPageSizeChange:s=>n.patch({size:s,page:0}),isFetching:N.isFetching,hasNextFallback:k.length===B}),e.jsx(Pt,{isOpen:Xe,onOpenChange:pe,heading:"Delete usage rows",body:`Delete ${le.toLocaleString()} imported ${le===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:he.isPending,error:he.error,onConfirm:tt}),e.jsx(At,{isOpen:Je,onOpenChange:ge,targetCount:le,isPending:xe.isPending,error:xe.error,onSubmit:st})]})}export{cs as ActivityPage}; diff --git a/src/gateway/static/dashboard/assets/AliasesPage-DFSg4QUS.js b/src/gateway/static/dashboard/assets/AliasesPage-YWTK3fom.js similarity index 98% rename from src/gateway/static/dashboard/assets/AliasesPage-DFSg4QUS.js rename to src/gateway/static/dashboard/assets/AliasesPage-YWTK3fom.js index 4520e9cef..3524a0c61 100644 --- a/src/gateway/static/dashboard/assets/AliasesPage-DFSg4QUS.js +++ b/src/gateway/static/dashboard/assets/AliasesPage-YWTK3fom.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as L}from"./react-dgEcD0HR.js";import{o as T,p as I,q as M,s as R,P as K,E as w,t as P,u as F}from"./index-Dhxz7Eyv.js";import{u as O,r as $,B as q}from"./tableSelection-CojkFPwd.js";import{C as U}from"./ConfirmDialog-DawcDVEg.js";import{D as H}from"./DataTable-CrQq0sYf.js";import{F as V}from"./Field-DEJ6Wjg9.js";import{C as k,L as z,I as G,a as J,b as W,f as X,B as j,d as A}from"./heroui-DZj66Arc.js";import{U as Q}from"./UserComboBox-nt7pHfqn.js";const Y=50;function B({label:t,value:a,onChange:n,description:r,placeholder:c="provider:model",autoFocus:l,isRequired:d}){const o=T(),{visible:m,total:h,failed:x}=u.useMemo(()=>{var N;const i=a.trim().toLowerCase(),v=((N=o.data)==null?void 0:N.providers)??[],C=v.flatMap(f=>f.models),p=i?C.filter(f=>f.key.toLowerCase().includes(i)):C;return{visible:p.slice(0,Y),total:p.length,failed:v.filter(f=>!f.ok)}},[o.data,a]),g=o.isLoading?"Loading models from your providers…":x.length>0?`Could not list models for ${x.map(v=>v.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:h>m.length?`Showing ${m.length} of ${h} matches. Keep typing to narrow them.`:r;return e.jsxs(k.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:a,onInputChange:n,onSelectionChange:i=>{i!=null&&n(String(i))},isRequired:d,className:"flex max-w-md flex-col gap-1",children:[e.jsx(z,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(k.InputGroup,{children:[e.jsx(G,{placeholder:c,autoFocus:l}),e.jsx(k.Trigger,{})]}),e.jsx(k.Popover,{children:e.jsx(J,{items:m,className:"max-h-72 overflow-auto",children:i=>e.jsx(W,{id:i.key,textValue:i.key,children:i.key})})}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:g}):null]})}const S=t=>JSON.stringify([t.user_id,t.name]);function Z({userId:t,onChange:a}){const n=F(),r=t!==null,c=(l,d)=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>a(l?"":null),className:r===l?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:d});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Applies to"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"A global alias resolves for every caller. A user-scoped one resolves only for that user, and takes precedence over a global alias of the same name."})]}),e.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[c(!1,"Every caller"),c(!0,"One user")]}),r?e.jsx(Q,{label:"User",value:t??"",onChange:a,users:n.data??[],placeholder:"Pick a user…",description:"Only this user resolves the alias.",unknownHint:e.jsx("span",{className:"text-red-700",children:"No such user. Pick an existing one."})}):null]})}function ee({alias:t,onClose:a}){const n=P(),[r,c]=u.useState(t.target),l=r.trim()!==""&&r.trim()!==t.target,d=()=>{l&&n.mutate({name:t.name,target:r.trim(),user_id:t.user_id},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name}),t.user_id?e.jsxs(e.Fragment,{children:[" for user ",e.jsx("code",{children:t.user_id})]}):null]}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["The alias name and who it applies to (",t.user_id?e.jsx("code",{children:t.user_id}):"every caller",") are the key and cannot be changed here. Delete and recreate to change either."]})]}),e.jsx(B,{label:"Target",value:r,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!l||n.isPending,onPress:d,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function se({onClose:t,initialTarget:a=""}){const n=P(),[r,c]=u.useState(""),[l,d]=u.useState(a),[o,m]=u.useState(null),h=/[:/]/.test(r),x=o===null||o.trim()!=="",g=r.trim()!==""&&l.trim()!==""&&!h&&x,i=()=>{g&&n.mutate({name:r.trim(),target:l.trim(),user_id:o===null?null:o.trim()},{onSuccess:t})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(V,{label:"Alias name",value:r,onChange:c,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:h?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(B,{label:"Target",value:l,onChange:d,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsx(Z,{userId:o,onChange:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!g||n.isPending,onPress:i,children:n.isPending?"Creating…":"Create alias"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function me(){const t=I(),a=M(),[n]=L(),r=n.get("target")??"",[c,l]=u.useState(r!==""),[d,o]=u.useState(null),m=O(),[h,x]=u.useState(!1),[g,i]=u.useState(void 0),[v,C]=u.useState(!1),p=[...t.data??[]].sort((s,b)=>s.name.localeCompare(b.name)||(s.user_id??"").localeCompare(b.user_id??"")),N=p.filter(s=>s.source==="stored").map(S),f=p.filter(s=>s.source!=="stored").map(S),y=$(m.selectedKeys,N),D=new Map(p.map(s=>[S(s),s])),_=async()=>{C(!0),i(void 0);try{for(const s of y){const b=D.get(s);b!==void 0&&await a.mutateAsync({name:b.name,userId:b.user_id})}m.clear(),x(!1)}catch(s){i(s)}finally{C(!1)}},E=u.useMemo(()=>[{id:"alias",header:"Alias",isRowHeader:!0,cell:s=>e.jsx("span",{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name})},{id:"target",header:"Target",cell:s=>e.jsx("span",{className:"break-all text-[var(--otari-muted)]",children:s.target})},{id:"scope",header:"Applies to",cell:s=>s.user_id?e.jsx("code",{className:"break-all text-xs text-[var(--otari-ink)]",children:s.user_id}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Every caller"})},{id:"source",header:"Source",cell:s=>e.jsx(X,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})},{id:"actions",header:"Actions",align:"end",cell:s=>s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{l(!1),o(s)},children:"Edit"}),e.jsx(R,{confirmLabel:"Delete",isPending:a.isPending,onConfirm:()=>a.mutate({name:s.name,userId:s.user_id}),children:"Delete"})]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})}],[a.isPending,a.mutate]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(K,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:c||d?null:e.jsx(j,{variant:"primary",onPress:()=>{o(null),l(!0)},children:"New alias"})}),e.jsx(w,{error:t.error}),c?e.jsx(se,{initialTarget:r,onClose:()=>l(!1)}):null,d?e.jsx(ee,{alias:d,onClose:()=>o(null)}):null,a.error?e.jsx(w,{error:a.error}):null,y.length>0?e.jsx(q,{selectedCount:y.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:m.clear,children:e.jsx(j,{size:"sm",variant:"danger",onPress:()=>x(!0),children:"Delete"})}):null,e.jsx(H,{ariaLabel:"Aliases",columns:E,rows:p,getRowKey:S,isLoading:t.isLoading,emptyContent:"No aliases yet. Create one to give a model a friendly name.",selectionMode:"multiple",selectedKeys:m.selectedKeys,onSelectionChange:m.onSelectionChange,disabledKeys:f}),e.jsx(U,{isOpen:h,onOpenChange:x,heading:"Delete aliases",body:`Delete ${y.length} stored ${y.length===1?"alias":"aliases"}? Callers using ${y.length===1?"it":"them"} will get a model-not-found error.`,confirmLabel:"Delete",isPending:v,error:g,onConfirm:_})]})}export{me as AliasesPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as L}from"./react-dgEcD0HR.js";import{o as T,p as I,q as M,s as R,P as K,E as w,t as P,u as F}from"./index-J9GltkCK.js";import{u as O,r as $,B as q}from"./tableSelection-CojkFPwd.js";import{C as U}from"./ConfirmDialog-D_qqCO_E.js";import{D as H}from"./DataTable-CrQq0sYf.js";import{F as V}from"./Field-DEJ6Wjg9.js";import{C as k,L as z,I as G,a as J,b as W,f as X,B as j,d as A}from"./heroui-DZj66Arc.js";import{U as Q}from"./UserComboBox-nt7pHfqn.js";const Y=50;function B({label:t,value:a,onChange:n,description:r,placeholder:c="provider:model",autoFocus:l,isRequired:d}){const o=T(),{visible:m,total:h,failed:x}=u.useMemo(()=>{var N;const i=a.trim().toLowerCase(),v=((N=o.data)==null?void 0:N.providers)??[],C=v.flatMap(f=>f.models),p=i?C.filter(f=>f.key.toLowerCase().includes(i)):C;return{visible:p.slice(0,Y),total:p.length,failed:v.filter(f=>!f.ok)}},[o.data,a]),g=o.isLoading?"Loading models from your providers…":x.length>0?`Could not list models for ${x.map(v=>v.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:h>m.length?`Showing ${m.length} of ${h} matches. Keep typing to narrow them.`:r;return e.jsxs(k.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:a,onInputChange:n,onSelectionChange:i=>{i!=null&&n(String(i))},isRequired:d,className:"flex max-w-md flex-col gap-1",children:[e.jsx(z,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(k.InputGroup,{children:[e.jsx(G,{placeholder:c,autoFocus:l}),e.jsx(k.Trigger,{})]}),e.jsx(k.Popover,{children:e.jsx(J,{items:m,className:"max-h-72 overflow-auto",children:i=>e.jsx(W,{id:i.key,textValue:i.key,children:i.key})})}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:g}):null]})}const S=t=>JSON.stringify([t.user_id,t.name]);function Z({userId:t,onChange:a}){const n=F(),r=t!==null,c=(l,d)=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>a(l?"":null),className:r===l?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:d});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Applies to"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"A global alias resolves for every caller. A user-scoped one resolves only for that user, and takes precedence over a global alias of the same name."})]}),e.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[c(!1,"Every caller"),c(!0,"One user")]}),r?e.jsx(Q,{label:"User",value:t??"",onChange:a,users:n.data??[],placeholder:"Pick a user…",description:"Only this user resolves the alias.",unknownHint:e.jsx("span",{className:"text-red-700",children:"No such user. Pick an existing one."})}):null]})}function ee({alias:t,onClose:a}){const n=P(),[r,c]=u.useState(t.target),l=r.trim()!==""&&r.trim()!==t.target,d=()=>{l&&n.mutate({name:t.name,target:r.trim(),user_id:t.user_id},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name}),t.user_id?e.jsxs(e.Fragment,{children:[" for user ",e.jsx("code",{children:t.user_id})]}):null]}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["The alias name and who it applies to (",t.user_id?e.jsx("code",{children:t.user_id}):"every caller",") are the key and cannot be changed here. Delete and recreate to change either."]})]}),e.jsx(B,{label:"Target",value:r,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!l||n.isPending,onPress:d,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function se({onClose:t,initialTarget:a=""}){const n=P(),[r,c]=u.useState(""),[l,d]=u.useState(a),[o,m]=u.useState(null),h=/[:/]/.test(r),x=o===null||o.trim()!=="",g=r.trim()!==""&&l.trim()!==""&&!h&&x,i=()=>{g&&n.mutate({name:r.trim(),target:l.trim(),user_id:o===null?null:o.trim()},{onSuccess:t})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(V,{label:"Alias name",value:r,onChange:c,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:h?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(B,{label:"Target",value:l,onChange:d,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsx(Z,{userId:o,onChange:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!g||n.isPending,onPress:i,children:n.isPending?"Creating…":"Create alias"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function me(){const t=I(),a=M(),[n]=L(),r=n.get("target")??"",[c,l]=u.useState(r!==""),[d,o]=u.useState(null),m=O(),[h,x]=u.useState(!1),[g,i]=u.useState(void 0),[v,C]=u.useState(!1),p=[...t.data??[]].sort((s,b)=>s.name.localeCompare(b.name)||(s.user_id??"").localeCompare(b.user_id??"")),N=p.filter(s=>s.source==="stored").map(S),f=p.filter(s=>s.source!=="stored").map(S),y=$(m.selectedKeys,N),D=new Map(p.map(s=>[S(s),s])),_=async()=>{C(!0),i(void 0);try{for(const s of y){const b=D.get(s);b!==void 0&&await a.mutateAsync({name:b.name,userId:b.user_id})}m.clear(),x(!1)}catch(s){i(s)}finally{C(!1)}},E=u.useMemo(()=>[{id:"alias",header:"Alias",isRowHeader:!0,cell:s=>e.jsx("span",{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name})},{id:"target",header:"Target",cell:s=>e.jsx("span",{className:"break-all text-[var(--otari-muted)]",children:s.target})},{id:"scope",header:"Applies to",cell:s=>s.user_id?e.jsx("code",{className:"break-all text-xs text-[var(--otari-ink)]",children:s.user_id}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Every caller"})},{id:"source",header:"Source",cell:s=>e.jsx(X,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})},{id:"actions",header:"Actions",align:"end",cell:s=>s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{l(!1),o(s)},children:"Edit"}),e.jsx(R,{confirmLabel:"Delete",isPending:a.isPending,onConfirm:()=>a.mutate({name:s.name,userId:s.user_id}),children:"Delete"})]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})}],[a.isPending,a.mutate]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(K,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:c||d?null:e.jsx(j,{variant:"primary",onPress:()=>{o(null),l(!0)},children:"New alias"})}),e.jsx(w,{error:t.error}),c?e.jsx(se,{initialTarget:r,onClose:()=>l(!1)}):null,d?e.jsx(ee,{alias:d,onClose:()=>o(null)}):null,a.error?e.jsx(w,{error:a.error}):null,y.length>0?e.jsx(q,{selectedCount:y.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:m.clear,children:e.jsx(j,{size:"sm",variant:"danger",onPress:()=>x(!0),children:"Delete"})}):null,e.jsx(H,{ariaLabel:"Aliases",columns:E,rows:p,getRowKey:S,isLoading:t.isLoading,emptyContent:"No aliases yet. Create one to give a model a friendly name.",selectionMode:"multiple",selectedKeys:m.selectedKeys,onSelectionChange:m.onSelectionChange,disabledKeys:f}),e.jsx(U,{isOpen:h,onOpenChange:x,heading:"Delete aliases",body:`Delete ${y.length} stored ${y.length===1?"alias":"aliases"}? Callers using ${y.length===1?"it":"them"} will get a model-not-found error.`,confirmLabel:"Delete",isPending:v,error:g,onConfirm:_})]})}export{me as AliasesPage}; diff --git a/src/gateway/static/dashboard/assets/BudgetsPage-CnOzEeql.js b/src/gateway/static/dashboard/assets/BudgetsPage-DzpynNOp.js similarity index 99% rename from src/gateway/static/dashboard/assets/BudgetsPage-CnOzEeql.js rename to src/gateway/static/dashboard/assets/BudgetsPage-DzpynNOp.js index 10408bd97..450d1ca44 100644 --- a/src/gateway/static/dashboard/assets/BudgetsPage-CnOzEeql.js +++ b/src/gateway/static/dashboard/assets/BudgetsPage-DzpynNOp.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{v as ae,u as re,w as le,x as ie,y as oe,z as de,P as ue,E as T,I as ce,B as me,D as xe}from"./index-Dhxz7Eyv.js";import{u as ge,r as he,B as pe}from"./tableSelection-CojkFPwd.js";import{C as fe}from"./ConfirmDialog-DawcDVEg.js";import{D as be}from"./DataTable-CrQq0sYf.js";import{F as $}from"./Field-DEJ6Wjg9.js";import{C as E,I as je,a as ve,b as ye,B as x,d as k,S as Ne}from"./heroui-DZj66Arc.js";const Se=50;function _e({value:t,onChange:r,users:a,label:o,description:l}){const[g,h]=i.useState(""),d=i.useMemo(()=>a.filter(s=>!s.user_id.startsWith("apikey-")).map(s=>({id:s.user_id,label:s.alias?`${s.user_id} (${s.alias})`:s.user_id})),[a]),p=i.useMemo(()=>{const s=g.trim().toLowerCase();return d.filter(u=>!t.includes(u.id)).filter(u=>!s||u.id.toLowerCase().includes(s)||u.label.toLowerCase().includes(s)).slice(0,Se)},[d,t,g]),c=s=>{t.includes(s)||r([...t,s]),h("")},m=s=>r(t.filter(u=>u!==s));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:o}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[s,e.jsx("button",{type:"button","aria-label":`Remove ${s}`,onClick:()=>m(s),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},s))}):null,d.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:h,selectedKey:null,onSelectionChange:s=>{s!=null&&c(String(s))},className:"flex flex-col gap-1",children:[e.jsxs(E.InputGroup,{children:[e.jsx(je,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(ve,{items:p,className:"max-h-72 overflow-auto",children:s=>e.jsx(ye,{id:s.id,textValue:s.label,children:s.label})})})]})]})}const Ce=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function D(t){return Ce.format(t)}const j=86400,W=3600,O=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function we(t){if(t===null)return"No reset";const r=O.find(a=>a.seconds===t);return r?r.label:t%j===0?`Every ${t/j} days`:t%W===0?`Every ${t/W} hours`:`Every ${t}s`}function q(t){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function De(t){const r=t.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function Y(t){return t!==null&&t%j===0?String(t/j):""}function Be({value:t,onChange:r,onInvalidChange:a}){const o=O.some(s=>s.seconds===t),[l,g]=i.useState(!o),[h,d]=i.useState(()=>Y(t)),p=h.trim(),c=Number(p),m=p!==""&&(!Number.isSafeInteger(c)||c<=0);return i.useEffect(()=>{a==null||a(m)},[m,a]),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.map(s=>e.jsx(x,{size:"sm",variant:!l&&t===s.seconds?"primary":"outline",onPress:()=>{g(!1),d(Y(s.seconds)),r(s.seconds)},children:s.label},s.label)),e.jsx(x,{size:"sm",variant:l?"primary":"outline",onPress:()=>g(!0),children:"Custom"})]}),l?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx($,{label:"Every N days",value:h,onChange:s=>{d(s);const u=Number(s.trim());r(s.trim()===""||!Number.isSafeInteger(u)||u<=0?null:u*j)},placeholder:"14",description:m?e.jsx("span",{className:"text-red-700",children:"Enter a whole number of days."}):"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function G({title:t,submitLabel:r,initial:a,error:o,isPending:l,onSubmit:g,onClose:h,assignUsers:d}){const[p,c]=i.useState(a.name??""),[m,s]=i.useState(a.max_budget===null?"":String(a.max_budget)),[u,b]=i.useState(a.budget_duration_sec),[S,v]=i.useState(!1),[B,P]=i.useState([]),f=De(m),A=!l&&f.valid&&!S,C=()=>{A&&g({name:p.trim()||null,max_budget:f.value,budget_duration_sec:u},B)};return e.jsx(k,{children:e.jsxs(k.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(T,{error:o}),e.jsx($,{label:"Name (optional)",value:p,onChange:c,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx($,{label:"Spending limit (USD)",value:m,onChange:s,placeholder:"100.00",description:f.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(Be,{value:u,onChange:b,onInvalidChange:v}),d?e.jsx(_e,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:B,onChange:P,users:d}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:!A,onPress:C,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:h,children:"Cancel"})]})]})})}function Pe({budget:t}){if(t.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=t.total_spend;if(t.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[D(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=t.max_budget*t.user_count,o=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:D(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",D(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(o,l?100:2)}%`}})})]})}function Ae({budgetId:t}){const r=xe(t);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(Ne,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:o.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:D(o.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:q(o.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:q(o.next_reset_at)})]},o.id))})]})})}function Ee({label:t,isPending:r,onConfirm:a}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:t}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}const ke=t=>t.budget_id;function Q(t){return t.split("-")[0]}function z(t){return t.name??Q(t.budget_id)}function Te(){const t=ae(),r=re(),a=le(),o=ie(),l=oe(),g=de(),[h,d]=i.useState(!1),[p,c]=i.useState(null),[m,s]=i.useState(null),[u,b]=i.useState(null),[S,v]=i.useState(null),[B,P]=i.useState(!1),f=ge(),[A,C]=i.useState(!1),[X,F]=i.useState(void 0),[J,H]=i.useState(!1),w=t.data??[],K=t.isLoading,y=w.find(n=>n.budget_id===p)??null,U=w.find(n=>n.budget_id===m)??null,L=!K&&w.length===0&&!h,Z=w.map(n=>n.budget_id),_=he(f.selectedKeys,Z),ee=async()=>{H(!0),F(void 0);try{for(const n of _)await l.mutateAsync(n);f.clear(),C(!1)}catch(n){F(n)}finally{H(!1)}},te=i.useMemo(()=>[{id:"budget",header:"Budget",isRowHeader:!0,cell:n=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:Q(n.budget_id)})]})},{id:"limit",header:"Limit (per user)",cell:n=>n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):D(n.max_budget)},{id:"reset",header:"Reset",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:we(n.budget_duration_sec)})},{id:"users",header:"Users",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:n.user_count})},{id:"usage",header:"Usage",cell:n=>e.jsx(Pe,{budget:n})},{id:"actions",header:"Actions",align:"end",cell:n=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(N=>N===n.budget_id?null:n.budget_id),children:m===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{d(!1),c(n.budget_id)},children:"Edit"}),e.jsx(Ee,{label:z(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})}],[m,l.isPending,l.mutate]),V=async(n,N)=>{P(!0),b(null);const I=await Promise.allSettled(N.map(M=>g.mutateAsync({id:M,body:{budget_id:n}})));P(!1);const R=I.flatMap((M,ne)=>M.status==="rejected"?[N[ne]]:[]);if(R.length>0){v({budgetId:n,userIds:R}),b(new Error(`Budget created, but could not assign it to: ${R.join(", ")}. Retry to try again.`));return}v(null),d(!1)},se=(n,N)=>{if(S){V(S.budgetId,S.userIds);return}b(null),a.mutate(n,{onSuccess:async I=>{if(N.length>0){await V(I.budget_id,N);return}d(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ue,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:h||L?null:e.jsx(x,{variant:"primary",onPress:()=>{c(null),b(null),v(null),d(!0)},children:"Create budget"})}),e.jsx(T,{error:t.error??a.error??o.error??l.error??g.error}),e.jsx(ce,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),L?e.jsx(me,{title:"No budgets yet",description:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit.",actionLabel:"Create your first budget",onAction:()=>{c(null),b(null),v(null),d(!0)}}):null,h?e.jsx(G,{title:"Create budget",submitLabel:S?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??u,isPending:a.isPending||B,assignUsers:r.data??[],onSubmit:se,onClose:()=>{b(null),v(null),d(!1)}}):null,y?e.jsx(G,{title:`Edit budget ${z(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:o.error,isPending:o.isPending,onSubmit:n=>o.mutate({id:y.budget_id,body:n},{onSuccess:()=>c(null)}),onClose:()=>c(null)},y.budget_id):null,_.length>0?e.jsx(pe,{selectedCount:_.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:f.clear,children:e.jsx(x,{size:"sm",variant:"danger",onPress:()=>C(!0),children:"Delete"})}):null,L?null:e.jsx(be,{ariaLabel:"Budgets",columns:te,rows:w,getRowKey:ke,isLoading:K,emptyContent:"No budgets yet. Create one to cap spending.",selectionMode:"multiple",selectedKeys:f.selectedKeys,onSelectionChange:f.onSelectionChange}),U?e.jsx(k,{children:e.jsxs(k.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsxs("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:["Reset history — ",z(U)]}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(null),children:"Close"})]}),e.jsx(Ae,{budgetId:U.budget_id})]})}):null,e.jsx(fe,{isOpen:A,onOpenChange:C,heading:"Delete budgets",body:`Delete ${_.length} ${_.length===1?"budget":"budgets"}? Users on ${_.length===1?"it":"them"} will no longer be capped.`,confirmLabel:"Delete",isPending:J,error:X,onConfirm:ee})]})}export{Te as BudgetsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{v as ae,u as re,w as le,x as ie,y as oe,z as de,P as ue,E as T,I as ce,B as me,D as xe}from"./index-J9GltkCK.js";import{u as ge,r as he,B as pe}from"./tableSelection-CojkFPwd.js";import{C as fe}from"./ConfirmDialog-D_qqCO_E.js";import{D as be}from"./DataTable-CrQq0sYf.js";import{F as $}from"./Field-DEJ6Wjg9.js";import{C as E,I as je,a as ve,b as ye,B as x,d as k,S as Ne}from"./heroui-DZj66Arc.js";const Se=50;function _e({value:t,onChange:r,users:a,label:o,description:l}){const[g,h]=i.useState(""),d=i.useMemo(()=>a.filter(s=>!s.user_id.startsWith("apikey-")).map(s=>({id:s.user_id,label:s.alias?`${s.user_id} (${s.alias})`:s.user_id})),[a]),p=i.useMemo(()=>{const s=g.trim().toLowerCase();return d.filter(u=>!t.includes(u.id)).filter(u=>!s||u.id.toLowerCase().includes(s)||u.label.toLowerCase().includes(s)).slice(0,Se)},[d,t,g]),c=s=>{t.includes(s)||r([...t,s]),h("")},m=s=>r(t.filter(u=>u!==s));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:o}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[s,e.jsx("button",{type:"button","aria-label":`Remove ${s}`,onClick:()=>m(s),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},s))}):null,d.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:h,selectedKey:null,onSelectionChange:s=>{s!=null&&c(String(s))},className:"flex flex-col gap-1",children:[e.jsxs(E.InputGroup,{children:[e.jsx(je,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(ve,{items:p,className:"max-h-72 overflow-auto",children:s=>e.jsx(ye,{id:s.id,textValue:s.label,children:s.label})})})]})]})}const Ce=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function D(t){return Ce.format(t)}const j=86400,W=3600,O=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function we(t){if(t===null)return"No reset";const r=O.find(a=>a.seconds===t);return r?r.label:t%j===0?`Every ${t/j} days`:t%W===0?`Every ${t/W} hours`:`Every ${t}s`}function q(t){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function De(t){const r=t.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function Y(t){return t!==null&&t%j===0?String(t/j):""}function Be({value:t,onChange:r,onInvalidChange:a}){const o=O.some(s=>s.seconds===t),[l,g]=i.useState(!o),[h,d]=i.useState(()=>Y(t)),p=h.trim(),c=Number(p),m=p!==""&&(!Number.isSafeInteger(c)||c<=0);return i.useEffect(()=>{a==null||a(m)},[m,a]),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.map(s=>e.jsx(x,{size:"sm",variant:!l&&t===s.seconds?"primary":"outline",onPress:()=>{g(!1),d(Y(s.seconds)),r(s.seconds)},children:s.label},s.label)),e.jsx(x,{size:"sm",variant:l?"primary":"outline",onPress:()=>g(!0),children:"Custom"})]}),l?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx($,{label:"Every N days",value:h,onChange:s=>{d(s);const u=Number(s.trim());r(s.trim()===""||!Number.isSafeInteger(u)||u<=0?null:u*j)},placeholder:"14",description:m?e.jsx("span",{className:"text-red-700",children:"Enter a whole number of days."}):"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function G({title:t,submitLabel:r,initial:a,error:o,isPending:l,onSubmit:g,onClose:h,assignUsers:d}){const[p,c]=i.useState(a.name??""),[m,s]=i.useState(a.max_budget===null?"":String(a.max_budget)),[u,b]=i.useState(a.budget_duration_sec),[S,v]=i.useState(!1),[B,P]=i.useState([]),f=De(m),A=!l&&f.valid&&!S,C=()=>{A&&g({name:p.trim()||null,max_budget:f.value,budget_duration_sec:u},B)};return e.jsx(k,{children:e.jsxs(k.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(T,{error:o}),e.jsx($,{label:"Name (optional)",value:p,onChange:c,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx($,{label:"Spending limit (USD)",value:m,onChange:s,placeholder:"100.00",description:f.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(Be,{value:u,onChange:b,onInvalidChange:v}),d?e.jsx(_e,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:B,onChange:P,users:d}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:!A,onPress:C,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:h,children:"Cancel"})]})]})})}function Pe({budget:t}){if(t.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=t.total_spend;if(t.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[D(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=t.max_budget*t.user_count,o=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:D(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",D(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(o,l?100:2)}%`}})})]})}function Ae({budgetId:t}){const r=xe(t);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(Ne,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:o.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:D(o.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:q(o.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:q(o.next_reset_at)})]},o.id))})]})})}function Ee({label:t,isPending:r,onConfirm:a}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:t}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}const ke=t=>t.budget_id;function Q(t){return t.split("-")[0]}function z(t){return t.name??Q(t.budget_id)}function Te(){const t=ae(),r=re(),a=le(),o=ie(),l=oe(),g=de(),[h,d]=i.useState(!1),[p,c]=i.useState(null),[m,s]=i.useState(null),[u,b]=i.useState(null),[S,v]=i.useState(null),[B,P]=i.useState(!1),f=ge(),[A,C]=i.useState(!1),[X,F]=i.useState(void 0),[J,H]=i.useState(!1),w=t.data??[],K=t.isLoading,y=w.find(n=>n.budget_id===p)??null,U=w.find(n=>n.budget_id===m)??null,L=!K&&w.length===0&&!h,Z=w.map(n=>n.budget_id),_=he(f.selectedKeys,Z),ee=async()=>{H(!0),F(void 0);try{for(const n of _)await l.mutateAsync(n);f.clear(),C(!1)}catch(n){F(n)}finally{H(!1)}},te=i.useMemo(()=>[{id:"budget",header:"Budget",isRowHeader:!0,cell:n=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:Q(n.budget_id)})]})},{id:"limit",header:"Limit (per user)",cell:n=>n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):D(n.max_budget)},{id:"reset",header:"Reset",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:we(n.budget_duration_sec)})},{id:"users",header:"Users",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:n.user_count})},{id:"usage",header:"Usage",cell:n=>e.jsx(Pe,{budget:n})},{id:"actions",header:"Actions",align:"end",cell:n=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(N=>N===n.budget_id?null:n.budget_id),children:m===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{d(!1),c(n.budget_id)},children:"Edit"}),e.jsx(Ee,{label:z(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})}],[m,l.isPending,l.mutate]),V=async(n,N)=>{P(!0),b(null);const I=await Promise.allSettled(N.map(M=>g.mutateAsync({id:M,body:{budget_id:n}})));P(!1);const R=I.flatMap((M,ne)=>M.status==="rejected"?[N[ne]]:[]);if(R.length>0){v({budgetId:n,userIds:R}),b(new Error(`Budget created, but could not assign it to: ${R.join(", ")}. Retry to try again.`));return}v(null),d(!1)},se=(n,N)=>{if(S){V(S.budgetId,S.userIds);return}b(null),a.mutate(n,{onSuccess:async I=>{if(N.length>0){await V(I.budget_id,N);return}d(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ue,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:h||L?null:e.jsx(x,{variant:"primary",onPress:()=>{c(null),b(null),v(null),d(!0)},children:"Create budget"})}),e.jsx(T,{error:t.error??a.error??o.error??l.error??g.error}),e.jsx(ce,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),L?e.jsx(me,{title:"No budgets yet",description:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit.",actionLabel:"Create your first budget",onAction:()=>{c(null),b(null),v(null),d(!0)}}):null,h?e.jsx(G,{title:"Create budget",submitLabel:S?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??u,isPending:a.isPending||B,assignUsers:r.data??[],onSubmit:se,onClose:()=>{b(null),v(null),d(!1)}}):null,y?e.jsx(G,{title:`Edit budget ${z(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:o.error,isPending:o.isPending,onSubmit:n=>o.mutate({id:y.budget_id,body:n},{onSuccess:()=>c(null)}),onClose:()=>c(null)},y.budget_id):null,_.length>0?e.jsx(pe,{selectedCount:_.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:f.clear,children:e.jsx(x,{size:"sm",variant:"danger",onPress:()=>C(!0),children:"Delete"})}):null,L?null:e.jsx(be,{ariaLabel:"Budgets",columns:te,rows:w,getRowKey:ke,isLoading:K,emptyContent:"No budgets yet. Create one to cap spending.",selectionMode:"multiple",selectedKeys:f.selectedKeys,onSelectionChange:f.onSelectionChange}),U?e.jsx(k,{children:e.jsxs(k.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsxs("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:["Reset history — ",z(U)]}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(null),children:"Close"})]}),e.jsx(Ae,{budgetId:U.budget_id})]})}):null,e.jsx(fe,{isOpen:A,onOpenChange:C,heading:"Delete budgets",body:`Delete ${_.length} ${_.length===1?"budget":"budgets"}? Users on ${_.length===1?"it":"them"} will no longer be capped.`,confirmLabel:"Delete",isPending:J,error:X,onConfirm:ee})]})}export{Te as BudgetsPage}; diff --git a/src/gateway/static/dashboard/assets/ConfirmDialog-DawcDVEg.js b/src/gateway/static/dashboard/assets/ConfirmDialog-D_qqCO_E.js similarity index 92% rename from src/gateway/static/dashboard/assets/ConfirmDialog-DawcDVEg.js rename to src/gateway/static/dashboard/assets/ConfirmDialog-D_qqCO_E.js index 9a6351c2c..c3b71bcf3 100644 --- a/src/gateway/static/dashboard/assets/ConfirmDialog-DawcDVEg.js +++ b/src/gateway/static/dashboard/assets/ConfirmDialog-D_qqCO_E.js @@ -1 +1 @@ -import{j as r}from"./tanstack-query-1t81HyiD.js";import{E as j}from"./index-Dhxz7Eyv.js";import{A as e,B as l}from"./heroui-DZj66Arc.js";function p({isOpen:s,onOpenChange:a,heading:n,body:o,confirmLabel:t,confirmVariant:c="danger",isPending:i,error:d,onConfirm:x}){return r.jsx(e,{isOpen:s,onOpenChange:a,children:s?r.jsx(e.Backdrop,{children:r.jsx(e.Container,{placement:"center",size:"md",children:r.jsxs(e.Dialog,{children:[r.jsx(e.Header,{children:r.jsx(e.Heading,{children:n})}),r.jsxs(e.Body,{className:"flex flex-col gap-4",children:[r.jsx("div",{className:"text-sm text-[var(--otari-muted)]",children:o}),r.jsx(j,{error:d})]}),r.jsxs(e.Footer,{children:[r.jsx(l,{variant:"ghost",isDisabled:i,onPress:()=>a(!1),children:"Cancel"}),r.jsx(l,{variant:c,isPending:i,onPress:x,children:t})]})]})})}):null})}export{p as C}; +import{j as r}from"./tanstack-query-1t81HyiD.js";import{E as j}from"./index-J9GltkCK.js";import{A as e,B as l}from"./heroui-DZj66Arc.js";function p({isOpen:s,onOpenChange:a,heading:n,body:o,confirmLabel:t,confirmVariant:c="danger",isPending:i,error:d,onConfirm:x}){return r.jsx(e,{isOpen:s,onOpenChange:a,children:s?r.jsx(e.Backdrop,{children:r.jsx(e.Container,{placement:"center",size:"md",children:r.jsxs(e.Dialog,{children:[r.jsx(e.Header,{children:r.jsx(e.Heading,{children:n})}),r.jsxs(e.Body,{className:"flex flex-col gap-4",children:[r.jsx("div",{className:"text-sm text-[var(--otari-muted)]",children:o}),r.jsx(j,{error:d})]}),r.jsxs(e.Footer,{children:[r.jsx(l,{variant:"ghost",isDisabled:i,onPress:()=>a(!1),children:"Cancel"}),r.jsx(l,{variant:c,isPending:i,onPress:x,children:t})]})]})})}):null})}export{p as C}; diff --git a/src/gateway/static/dashboard/assets/DocsPage-CgRlIVtI.js b/src/gateway/static/dashboard/assets/DocsPage-epKnwcXd.js similarity index 99% rename from src/gateway/static/dashboard/assets/DocsPage-CgRlIVtI.js rename to src/gateway/static/dashboard/assets/DocsPage-epKnwcXd.js index 9db36ff75..827275e28 100644 --- a/src/gateway/static/dashboard/assets/DocsPage-CgRlIVtI.js +++ b/src/gateway/static/dashboard/assets/DocsPage-epKnwcXd.js @@ -1,4 +1,4 @@ -import{j as re}from"./tanstack-query-1t81HyiD.js";import{P as gi}from"./index-Dhxz7Eyv.js";import{d as ct}from"./heroui-DZj66Arc.js";import{g as nr}from"./react-dgEcD0HR.js";function yi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi={};function ht(e,t){return(bi.jsx?xi:ki).test(e)}const wi=/[ \t\n\f\r]/g;function Si(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(wi,"")===""}class Ke{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function tr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ke(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ci=0;const L=Te(),Y=Te(),Dn=Te(),E=Te(),$=Te(),Ie=Te(),te=Te();function Te(){return 2**++Ci}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:Ie,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ai.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Di);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Ti,zi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function zi(e){return"-"+e.toLowerCase()}function Di(e){return e.charAt(1).toUpperCase()}const Li=tr([rr,Ei,or,ar,sr],"html"),qn=tr([rr,Ii,or,ar,sr],"svg");function _i(e){return e.join(" ").trim()}var De={},mn,dt;function Ri(){if(dt)return mn;dt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=` +import{j as re}from"./tanstack-query-1t81HyiD.js";import{P as gi}from"./index-J9GltkCK.js";import{d as ct}from"./heroui-DZj66Arc.js";import{g as nr}from"./react-dgEcD0HR.js";function yi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi={};function ht(e,t){return(bi.jsx?xi:ki).test(e)}const wi=/[ \t\n\f\r]/g;function Si(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(wi,"")===""}class Ke{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function tr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ke(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ci=0;const L=Te(),Y=Te(),Dn=Te(),E=Te(),$=Te(),Ie=Te(),te=Te();function Te(){return 2**++Ci}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:Ie,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ai.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Di);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Ti,zi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function zi(e){return"-"+e.toLowerCase()}function Di(e){return e.charAt(1).toUpperCase()}const Li=tr([rr,Ei,or,ar,sr],"html"),qn=tr([rr,Ii,or,ar,sr],"svg");function _i(e){return e.join(" ").trim()}var De={},mn,dt;function Ri(){if(dt)return mn;dt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=` `,u="/",h="*",c="",p="comment",f="declaration";function g(S,y){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];y=y||{};var I=1,C=1;function R(D){var T=D.match(t);T&&(I+=T.length);var U=D.lastIndexOf(s);C=~U?D.length-U:C+D.length}function F(){var D={line:I,column:C};return function(T){return T.position=new b(D),j(),T}}function b(D){this.start=D,this.end={line:I,column:C},this.source=y.source}b.prototype.content=S;function M(D){var T=new Error(y.source+":"+I+":"+C+": "+D);if(T.reason=D,T.filename=y.source,T.line=I,T.column=C,T.source=S,!y.silent)throw T}function H(D){var T=D.exec(S);if(T){var U=T[0];return R(U),S=S.slice(U.length),T}}function j(){H(n)}function k(D){var T;for(D=D||[];T=A();)T!==!1&&D.push(T);return D}function A(){var D=F();if(!(u!=S.charAt(0)||h!=S.charAt(1))){for(var T=2;c!=S.charAt(T)&&(h!=S.charAt(T)||u!=S.charAt(T+1));)++T;if(T+=2,c===S.charAt(T-1))return M("End of comment missing");var U=S.slice(2,T-2);return C+=2,R(U),S=S.slice(T),C+=2,D({type:p,comment:U})}}function P(){var D=F(),T=H(r);if(T){if(A(),!H(i))return M("property missing ':'");var U=H(o),K=D({type:f,property:w(T[0].replace(e,c)),value:U?w(U[0].replace(e,c)):c});return H(l),K}}function q(){var D=[];k(D);for(var T;T=P();)T!==!1&&(D.push(T),k(D));return D}return j(),q()}function w(S){return S?S.replace(a,c):c}return mn=g,mn}var gt;function Fi(){if(gt)return De;gt=1;var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(De,"__esModule",{value:!0}),De.default=n;const t=e(Ri());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),a=typeof i=="function";return l.forEach(s=>{if(s.type!=="declaration")return;const{property:u,value:h}=s;a?i(u,h,s):h&&(o=o||{},o[u]=h)}),o}return De}var Be={},yt;function Oi(){if(yt)return Be;yt=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(u){return!u||n.test(u)||e.test(u)},l=function(u,h){return h.toUpperCase()},a=function(u,h){return"".concat(h,"-")},s=function(u,h){return h===void 0&&(h={}),o(u)?u:(u=u.toLowerCase(),h.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(t,l))};return Be.camelCase=s,Be}var je,kt;function Mi(){if(kt)return je;kt=1;var e=je&&je.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Fi()),n=Oi();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(a,s){a&&s&&(l[(0,n.camelCase)(a,o)]=s)}),l}return r.default=r,je=r,je}var Ni=Mi();const Bi=nr(Ni),ur=cr("end"),Un=cr("start");function cr(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ji(e){const t=Un(e),n=ur(e);if(t&&n)return{start:t,end:n}}function Ue(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xt(e.position):"start"in e||"end"in e?xt(e):"line"in e||"column"in e?_n(e):""}function _n(e){return bt(e&&e.line)+":"+bt(e&&e.column)}function xt(e){return _n(e&&e.start)+"-"+_n(e&&e.end)}function bt(e){return e&&typeof e=="number"?e:1}class G extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?o.ruleId=r:(o.source=r.slice(0,s),o.ruleId=r.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){const s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ue(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}G.prototype.file="";G.prototype.name="";G.prototype.reason="";G.prototype.message="";G.prototype.stack="";G.prototype.column=void 0;G.prototype.line=void 0;G.prototype.ancestors=void 0;G.prototype.cause=void 0;G.prototype.fatal=void 0;G.prototype.place=void 0;G.prototype.ruleId=void 0;G.prototype.source=void 0;const Vn={}.hasOwnProperty,Hi=new Map,qi=/[A-Z]/g,Ui=new Set(["table","tbody","thead","tfoot","tr"]),Vi=new Set(["td","th"]),hr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $i(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Zi(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ji(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qn:Li,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=fr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function fr(e,t,n){if(t.type==="element")return Wi(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Yi(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Qi(e,t,n);if(t.type==="mdxjsEsm")return Ki(e,t);if(t.type==="root")return Xi(e,t,n);if(t.type==="text")return Gi(e,t)}function Wi(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=qn,e.schema=i),e.ancestors.push(t);const o=mr(e,t.tagName,!1),l=el(e,t);let a=Wn(e,t);return Ui.has(t.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!Si(s):!0})),pr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Yi(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}We(e,t.position)}function Ki(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);We(e,t.position)}function Qi(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=qn,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:mr(e,t.name,!0),l=nl(e,t),a=Wn(e,t);return pr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Xi(e,t,n){const r={};return $n(r,Wn(e,t)),e.create(t,e.Fragment,r,n)}function Gi(e,t){return t.value}function pr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $n(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ji(e,t,n){return r;function r(i,o,l,a){const u=Array.isArray(l.children)?n:t;return a?u(o,l,a):u(o,l)}}function Zi(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),s=Un(r);return t(i,o,l,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function el(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Vn.call(t.properties,i)){const o=tl(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&Vi.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function nl(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else We(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else We(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Wn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Hi;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(ie(e,e.length,0,t),e):t}const Ct={}.hasOwnProperty;function gr(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ce(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const J=be(/[A-Za-z]/),X=be(/[\dA-Za-z]/),hl=be(/[#-'*+\--9=?A-Z^-~]/);function rn(e){return e!==null&&(e<32||e===127)}const Rn=be(/\d/),fl=be(/[\dA-Fa-f]/),pl=be(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function W(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}const sn=be(new RegExp("\\p{P}|\\p{S}","u")),ve=be(/\s/);function be(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fe(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function B(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(s){return O(s)?(e.enter(n),a(s)):t(s)}function a(s){return O(s)&&o++l))return;const M=t.events.length;let H=M,j,k;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(j){k=t.events[H][1].end;break}j=!0}for(y(r),b=M;bC;){const F=n[R];t.containerState=F[1],F[0].exit.call(t,e)}n.length=C}function I(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function kl(e,t,n){return B(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _e(e){if(e===null||W(e)||ve(e))return 1;if(sn(e))return 2}function un(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};It(c,-s),It(p,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:s>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=le(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=le(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=le(u,un(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=le(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,u=le(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,ie(e,r-1,n-r+3,u),n=r+u.length-h-2;break}}for(n=-1;++n0&&O(b)?B(e,I,"linePrefix",o+1)(b):I(b)}function I(b){return b===null||z(b)?e.check(vt,w,R)(b):(e.enter("codeFlowValue"),C(b))}function C(b){return b===null||z(b)?(e.exit("codeFlowValue"),I(b)):(e.consume(b),C)}function R(b){return e.exit("codeFenced"),t(b)}function F(b,M,H){let j=0;return k;function k(T){return b.enter("lineEnding"),b.consume(T),b.exit("lineEnding"),A}function A(T){return b.enter("codeFencedFence"),O(T)?B(b,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):P(T)}function P(T){return T===a?(b.enter("codeFencedFenceSequence"),q(T)):H(T)}function q(T){return T===a?(j++,b.consume(T),q):j>=l?(b.exit("codeFencedFenceSequence"),O(T)?B(b,D,"whitespace")(T):D(T)):H(T)}function D(T){return T===null||z(T)?(b.exit("codeFencedFence"),M(T)):H(T)}}}function zl(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const gn={name:"codeIndented",tokenize:Ll},Dl={partial:!0,tokenize:_l};function Ll(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),B(e,o,"linePrefix",5)(u)}function o(u){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?s(u):z(u)?e.attempt(Dl,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||z(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),t(u)}}function _l(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):B(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):z(l)?i(l):n(l)}}const Rl={name:"codeText",previous:Ol,resolve:Fl,tokenize:Ml};function Fl(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&He(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),He(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),He(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Sr(e,t,n,r,i,o,l,a,s){const u=s||Number.POSITIVE_INFINITY;let h=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||rn(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||z(y)?n(y):(e.consume(y),y===92?g:f)}function g(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function w(y){return!h&&(y===null||y===41||W(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):h999||f===null||f===91||f===93&&!s||f===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===null||f===91||f===93||z(f)||a++>999?(e.exit("chunkString"),h(f)):(e.consume(f),s||(s=!O(f)),f===92?p:c)}function p(f){return f===91||f===92||f===93?(e.consume(f),a++,c):c(f)}}function Er(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,s):n(p)}function s(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),s(l)):p===null?n(p):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),B(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===l||p===null||z(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:h)}function c(p){return p===l||p===92?(e.consume(p),h):h(p)}}function Ve(e,t){let n;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):O(i)?B(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const $l={name:"definition",tokenize:Yl},Wl={partial:!0,tokenize:Kl};function Yl(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),l(f)}function l(f){return Cr.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=ce(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),s):n(f)}function s(f){return W(f)?Ve(e,u)(f):u(f)}function u(f){return Sr(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function h(f){return e.attempt(Wl,c,c)(f)}function c(f){return O(f)?B(e,p,"whitespace")(f):p(f)}function p(f){return f===null||z(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function Kl(e,t,n){return r;function r(a){return W(a)?Ve(e,i)(a):n(a)}function i(a){return Er(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return O(a)?B(e,l,"whitespace")(a):l(a)}function l(a){return a===null||z(a)?t(a):n(a)}}const Ql={name:"hardBreakEscape",tokenize:Xl};function Xl(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return z(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Gl={name:"headingAtx",resolve:Jl,tokenize:Zl};function Jl(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ie(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Zl(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),o(h)}function o(h){return e.enter("atxHeadingSequence"),l(h)}function l(h){return h===35&&r++<6?(e.consume(h),l):h===null||W(h)?(e.exit("atxHeadingSequence"),a(h)):n(h)}function a(h){return h===35?(e.enter("atxHeadingSequence"),s(h)):h===null||z(h)?(e.exit("atxHeading"),t(h)):O(h)?B(e,a,"whitespace")(h):(e.enter("atxHeadingText"),u(h))}function s(h){return h===35?(e.consume(h),s):(e.exit("atxHeadingSequence"),a(h))}function u(h){return h===null||h===35||W(h)?(e.exit("atxHeadingText"),a(h)):(e.consume(h),u)}}const eo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],At=["pre","script","style","textarea"],no={concrete:!0,name:"htmlFlow",resolveTo:io,tokenize:lo},to={partial:!0,tokenize:ao},ro={partial:!0,tokenize:oo};function io(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function lo(e,t,n){const r=this;let i,o,l,a,s;return u;function u(d){return h(d)}function h(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,w):d===63?(e.consume(d),i=3,r.interrupt?t:m):J(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function p(d){return d===45?(e.consume(d),i=2,f):d===91?(e.consume(d),i=5,a=0,g):J(d)?(e.consume(d),i=4,r.interrupt?t:m):n(d)}function f(d){return d===45?(e.consume(d),r.interrupt?t:m):n(d)}function g(d){const se="CDATA[";return d===se.charCodeAt(a++)?(e.consume(d),a===se.length?r.interrupt?t:P:g):n(d)}function w(d){return J(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function S(d){if(d===null||d===47||d===62||W(d)){const se=d===47,we=l.toLowerCase();return!se&&!o&&At.includes(we)?(i=1,r.interrupt?t(d):P(d)):eo.includes(l.toLowerCase())?(i=6,se?(e.consume(d),y):r.interrupt?t(d):P(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(d):o?I(d):C(d))}return d===45||X(d)?(e.consume(d),l+=String.fromCharCode(d),S):n(d)}function y(d){return d===62?(e.consume(d),r.interrupt?t:P):n(d)}function I(d){return O(d)?(e.consume(d),I):k(d)}function C(d){return d===47?(e.consume(d),k):d===58||d===95||J(d)?(e.consume(d),R):O(d)?(e.consume(d),C):k(d)}function R(d){return d===45||d===46||d===58||d===95||X(d)?(e.consume(d),R):F(d)}function F(d){return d===61?(e.consume(d),b):O(d)?(e.consume(d),F):C(d)}function b(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),s=d,M):O(d)?(e.consume(d),b):H(d)}function M(d){return d===s?(e.consume(d),s=null,j):d===null||z(d)?n(d):(e.consume(d),M)}function H(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||W(d)?F(d):(e.consume(d),H)}function j(d){return d===47||d===62||O(d)?C(d):n(d)}function k(d){return d===62?(e.consume(d),A):n(d)}function A(d){return d===null||z(d)?P(d):O(d)?(e.consume(d),A):n(d)}function P(d){return d===45&&i===2?(e.consume(d),U):d===60&&i===1?(e.consume(d),K):d===62&&i===4?(e.consume(d),ae):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),pe):z(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(to,me,q)(d)):d===null||z(d)?(e.exit("htmlFlowData"),q(d)):(e.consume(d),P)}function q(d){return e.check(ro,D,me)(d)}function D(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),T}function T(d){return d===null||z(d)?q(d):(e.enter("htmlFlowData"),P(d))}function U(d){return d===45?(e.consume(d),m):P(d)}function K(d){return d===47?(e.consume(d),l="",oe):P(d)}function oe(d){if(d===62){const se=l.toLowerCase();return At.includes(se)?(e.consume(d),ae):P(d)}return J(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),oe):P(d)}function pe(d){return d===93?(e.consume(d),m):P(d)}function m(d){return d===62?(e.consume(d),ae):d===45&&i===2?(e.consume(d),m):P(d)}function ae(d){return d===null||z(d)?(e.exit("htmlFlowData"),me(d)):(e.consume(d),ae)}function me(d){return e.exit("htmlFlow"),t(d)}}function oo(e,t,n){const r=this;return i;function i(l){return z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ao(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Qe,t,n)}}const so={name:"htmlText",tokenize:uo};function uo(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),s}function s(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),F):m===63?(e.consume(m),C):J(m)?(e.consume(m),H):n(m)}function u(m){return m===45?(e.consume(m),h):m===91?(e.consume(m),o=0,g):J(m)?(e.consume(m),I):n(m)}function h(m){return m===45?(e.consume(m),f):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):z(m)?(l=c,K(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),f):c(m)}function f(m){return m===62?U(m):m===45?p(m):c(m)}function g(m){const ae="CDATA[";return m===ae.charCodeAt(o++)?(e.consume(m),o===ae.length?w:g):n(m)}function w(m){return m===null?n(m):m===93?(e.consume(m),S):z(m)?(l=w,K(m)):(e.consume(m),w)}function S(m){return m===93?(e.consume(m),y):w(m)}function y(m){return m===62?U(m):m===93?(e.consume(m),y):w(m)}function I(m){return m===null||m===62?U(m):z(m)?(l=I,K(m)):(e.consume(m),I)}function C(m){return m===null?n(m):m===63?(e.consume(m),R):z(m)?(l=C,K(m)):(e.consume(m),C)}function R(m){return m===62?U(m):C(m)}function F(m){return J(m)?(e.consume(m),b):n(m)}function b(m){return m===45||X(m)?(e.consume(m),b):M(m)}function M(m){return z(m)?(l=M,K(m)):O(m)?(e.consume(m),M):U(m)}function H(m){return m===45||X(m)?(e.consume(m),H):m===47||m===62||W(m)?j(m):n(m)}function j(m){return m===47?(e.consume(m),U):m===58||m===95||J(m)?(e.consume(m),k):z(m)?(l=j,K(m)):O(m)?(e.consume(m),j):U(m)}function k(m){return m===45||m===46||m===58||m===95||X(m)?(e.consume(m),k):A(m)}function A(m){return m===61?(e.consume(m),P):z(m)?(l=A,K(m)):O(m)?(e.consume(m),A):j(m)}function P(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,q):z(m)?(l=P,K(m)):O(m)?(e.consume(m),P):(e.consume(m),D)}function q(m){return m===i?(e.consume(m),i=void 0,T):m===null?n(m):z(m)?(l=q,K(m)):(e.consume(m),q)}function D(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||W(m)?j(m):(e.consume(m),D)}function T(m){return m===47||m===62||W(m)?j(m):n(m)}function U(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function K(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),oe}function oe(m){return O(m)?B(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):pe(m)}function pe(m){return e.enter("htmlTextData"),l(m)}}const Qn={name:"labelEnd",resolveAll:po,resolveTo:mo,tokenize:go},co={tokenize:yo},ho={tokenize:ko},fo={tokenize:xo};function po(e){let t=-1;const n=[];for(;++t=3&&(u===null||z(u))?(e.exit("thematicBreak"),t(u)):n(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),O(u)?B(e,a,"whitespace")(u):a(u))}}const Z={continuation:{tokenize:Po},exit:Do,name:"list",tokenize:Ao},vo={partial:!0,tokenize:Lo},To={partial:!0,tokenize:zo};function Ao(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(f){const g=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Rn(f)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(tn,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(f)}return n(f)}function s(f){return Rn(f)&&++l<10?(e.consume(f),s):(!r.interrupt||l<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Qe,r.interrupt?n:h,e.attempt(vo,p,c))}function h(f){return r.containerState.initialBlankLine=!0,o++,p(f)}function c(f){return O(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Po(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Qe,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,B(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!O(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(To,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,B(e,e.attempt(Z,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function zo(e,t,n){const r=this;return B(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function Do(e){e.exit(this.containerState.type)}function Lo(e,t,n){const r=this;return B(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!O(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Pt={name:"setextUnderline",resolveTo:_o,tokenize:Ro};function _o(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Ro(e,t,n){const r=this;let i;return o;function o(u){let h=r.events.length,c;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){c=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),O(u)?B(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||z(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Fo={tokenize:Oo};function Oo(e){const t=this,n=e.attempt(Qe,r,e.attempt(this.parser.constructs.flowInitial,i,B(e,e.attempt(this.parser.constructs.flow,i,e.attempt(jl,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Mo={resolveAll:vr()},No=Ir("string"),Bo=Ir("text");function Ir(e){return{resolveAll:vr(e==="text"?jo:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(h){return u(h)?o(h):a(h)}function a(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),s}function s(h){return u(h)?(n.exit("data"),o(h)):(n.consume(h),s)}function u(h){if(h===null)return!0;const c=i[h];let p=-1;if(c)for(;++p-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Zo(e,t){let n=-1;const r=[];let i;for(;++n0){const ue=_.tokenStack[_.tokenStack.length-1];(ue[1]||Dt).call(_,void 0,ue[0])}for(v.position={start:xe(x.length>0?x[0][1].start:{line:1,column:1,offset:0}),end:xe(x.length>0?x[x.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++Vm(r=>!r),"aria-expanded":a,"aria-controls":l,children:a?"Done":"Add filter"}),s.map(r=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] py-0.5 pl-2.5 pr-1 text-xs text-[var(--otari-brand-dark)]",children:[e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[r.label,":"]}),e.jsx("span",{className:"font-medium",children:r.value}),e.jsx("button",{type:"button",onClick:r.onClear,"aria-label":`Remove ${r.label} filter`,className:"ml-0.5 inline-flex h-4 w-4 items-center justify-center rounded-full text-[var(--otari-muted)] outline-none hover:bg-[var(--otari-line)] hover:text-[var(--otari-ink)] focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)]",children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"h-3 w-3","aria-hidden":"true",children:e.jsx("path",{d:"M6 6l12 12M18 6L6 18",strokeLinecap:"round"})})})]},r.key)),s.length>0&&t?e.jsx(o,{size:"sm",variant:"ghost",onPress:t,children:"Clear all"}):null,n?e.jsx("div",{className:"ml-auto flex items-center gap-3",children:n}):null]}),e.jsx("div",{id:l,className:a?"flex flex-wrap items-end gap-3":"hidden",children:d})]})}export{p as F}; diff --git a/src/gateway/static/dashboard/assets/FilterChips-BlzD0qFP.js b/src/gateway/static/dashboard/assets/FilterChips-BlzD0qFP.js deleted file mode 100644 index d5d5d5ed1..000000000 --- a/src/gateway/static/dashboard/assets/FilterChips-BlzD0qFP.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{B as l}from"./heroui-DZj66Arc.js";function u({chips:s,children:o,onClearAll:t}){const[a,d]=i.useState(!1),n=i.useId();return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(l,{size:"sm",variant:"outline",onPress:()=>d(r=>!r),"aria-expanded":a,"aria-controls":n,children:a?"Done":"Add filter"}),s.map(r=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] py-0.5 pl-2.5 pr-1 text-xs text-[var(--otari-brand-dark)]",children:[e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[r.label,":"]}),e.jsx("span",{className:"font-medium",children:r.value}),e.jsx("button",{type:"button",onClick:r.onClear,"aria-label":`Remove ${r.label} filter`,className:"ml-0.5 inline-flex h-4 w-4 items-center justify-center rounded-full text-[var(--otari-muted)] outline-none hover:bg-[var(--otari-line)] hover:text-[var(--otari-ink)] focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)]",children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"h-3 w-3","aria-hidden":"true",children:e.jsx("path",{d:"M6 6l12 12M18 6L6 18",strokeLinecap:"round"})})})]},r.key)),s.length>0&&t?e.jsx(l,{size:"sm",variant:"ghost",onPress:t,children:"Clear all"}):null]}),e.jsx("div",{id:n,className:a?"flex flex-wrap items-end gap-3":"hidden",children:o})]})}export{u as F}; diff --git a/src/gateway/static/dashboard/assets/KeysPage-HexHbKWR.js b/src/gateway/static/dashboard/assets/KeysPage-qur9pZ8W.js similarity index 98% rename from src/gateway/static/dashboard/assets/KeysPage-HexHbKWR.js rename to src/gateway/static/dashboard/assets/KeysPage-qur9pZ8W.js index 48642a37c..e7499cf74 100644 --- a/src/gateway/static/dashboard/assets/KeysPage-HexHbKWR.js +++ b/src/gateway/static/dashboard/assets/KeysPage-qur9pZ8W.js @@ -1,4 +1,4 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{c as Y,G as U,H as Q,J as X,P as Z,E as O,B as ee,K as te,u as V,I as se}from"./index-Dhxz7Eyv.js";import{u as ae,r as ne,B as re}from"./tableSelection-CojkFPwd.js";import{C as ie}from"./ConfirmDialog-DawcDVEg.js";import{D as le}from"./DataTable-CrQq0sYf.js";import{F as A}from"./Field-DEJ6Wjg9.js";import{a as F,M as q}from"./ModelScopeControl-Bs976Tb8.js";import{U as oe}from"./UserComboBox-nt7pHfqn.js";import{f as P,B as f,d as D}from"./heroui-DZj66Arc.js";function $(t){if(!t)return"—";const a=new Date(t);return Number.isNaN(a.getTime())?"—":a.toLocaleDateString()}function ce(t){if(!t)return null;const a=new Date(t).getTime();if(Number.isNaN(a))return null;const n=Math.round((a-Date.now())/1e3),r=Math.abs(n),d=[["day",86400],["hour",3600],["minute",60]],o=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[l,x]of d)if(r>=x)return o.format(Math.round(n/x),l);return o.format(n,"second")}function de(t){if(!t.expires_at)return!1;const a=new Date(t.expires_at).getTime();return!Number.isNaN(a)&&aString(r).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}T${n(a.getHours())}:${n(a.getMinutes())}`}const me=t=>(t??"").startsWith("apikey-"),K=t=>t.key_name??t.id,xe=t=>t.id;function M({label:t,value:a,multiline:n=!1,fieldRef:r}){const d=i.useRef(null),o=r??d,[l,x]=i.useState(!1),[g,p]=i.useState(!1),c=async()=>{var m,y,h;(m=o.current)==null||m.focus(),(y=o.current)==null||y.select();try{if((h=navigator.clipboard)!=null&&h.writeText){await navigator.clipboard.writeText(a),x(!0),p(!1),window.setTimeout(()=>x(!1),2e3);return}}catch{}p(!0)},u="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(f,{size:"sm",variant:"outline",onPress:c,children:l?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:o,readOnly:!0,rows:a.split(` +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{c as Y,G as U,H as Q,J as X,P as Z,E as O,B as ee,K as te,u as V,I as se}from"./index-J9GltkCK.js";import{u as ae,r as ne,B as re}from"./tableSelection-CojkFPwd.js";import{C as ie}from"./ConfirmDialog-D_qqCO_E.js";import{D as le}from"./DataTable-CrQq0sYf.js";import{F as A}from"./Field-DEJ6Wjg9.js";import{a as F,M as q}from"./ModelScopeControl-BxqgiAHY.js";import{U as oe}from"./UserComboBox-nt7pHfqn.js";import{f as P,B as f,d as D}from"./heroui-DZj66Arc.js";function $(t){if(!t)return"—";const a=new Date(t);return Number.isNaN(a.getTime())?"—":a.toLocaleDateString()}function ce(t){if(!t)return null;const a=new Date(t).getTime();if(Number.isNaN(a))return null;const n=Math.round((a-Date.now())/1e3),r=Math.abs(n),d=[["day",86400],["hour",3600],["minute",60]],o=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[l,x]of d)if(r>=x)return o.format(Math.round(n/x),l);return o.format(n,"second")}function de(t){if(!t.expires_at)return!1;const a=new Date(t.expires_at).getTime();return!Number.isNaN(a)&&aString(r).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}T${n(a.getHours())}:${n(a.getMinutes())}`}const me=t=>(t??"").startsWith("apikey-"),K=t=>t.key_name??t.id,xe=t=>t.id;function M({label:t,value:a,multiline:n=!1,fieldRef:r}){const d=i.useRef(null),o=r??d,[l,x]=i.useState(!1),[g,p]=i.useState(!1),c=async()=>{var m,y,h;(m=o.current)==null||m.focus(),(y=o.current)==null||y.select();try{if((h=navigator.clipboard)!=null&&h.writeText){await navigator.clipboard.writeText(a),x(!0),p(!1),window.setTimeout(()=>x(!1),2e3);return}}catch{}p(!0)},u="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(f,{size:"sm",variant:"outline",onPress:c,children:l?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:o,readOnly:!0,rows:a.split(` `).length,value:a,onFocus:m=>m.currentTarget.select(),className:`${u} resize-none whitespace-pre`}):e.jsx("input",{ref:o,readOnly:!0,value:a,onFocus:m=>m.currentTarget.select(),className:u}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-green-700",children:l?"Copied to clipboard.":""}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function he({title:t,result:a,onClose:n}){const r=i.useRef(null),d=i.useRef(null),o=typeof window<"u"?window.location.origin:"",l=a.key;i.useEffect(()=>{var c,u;(c=d.current)==null||c.focus(),(u=d.current)==null||u.select()},[]);const x=c=>{var h;if(c.key!=="Tab")return;const u=(h=r.current)==null?void 0:h.querySelectorAll('button, input, textarea, a[href], [tabindex]:not([tabindex="-1"])');if(!u||u.length===0)return;const m=u[0],y=u[u.length-1];c.shiftKey&&document.activeElement===m?(c.preventDefault(),y.focus()):!c.shiftKey&&document.activeElement===y&&(c.preventDefault(),m.focus())},g=[`curl ${o}/v1/chat/completions \\`,` -H "Otari-Key: ${l}" \\`,' -H "Content-Type: application/json" \\',` -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'`].join(` `),p=["from openai import OpenAI","",`client = OpenAI(base_url="${o}/v1", api_key="${l}")`,"resp = client.chat.completions.create(",' model="your-model",',' messages=[{"role": "user", "content": "Hello"}],',")","print(resp.choices[0].message.content)"].join(` `);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:x,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(se,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",F(a.allowed_models).text,"."]}),e.jsx(M,{label:"Secret key",value:l,fieldRef:d}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(M,{label:"curl",value:g,multiline:!0}),e.jsx(M,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(f,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function H({trigger:t,message:a,confirmLabel:n,isPending:r,onConfirm:d}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:a}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(f,{size:"sm",variant:"danger",isDisabled:r,onPress:d,children:n}),e.jsx(f,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(f,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:t})}function G({userId:t,users:a}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const r=a.find(l=>l.user_id===n);if(!r)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:d}=F(r.allowed_models),o=r.allowed_models&&r.allowed_models.length>0?r.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:d.toLowerCase()}),o?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:o}),")"]}):null,". This key inherits that, or narrows within it."]})}function J({checked:t,onChange:a}){return e.jsxs("label",{className:"flex items-start gap-2 rounded-lg border border-[var(--otari-line)] p-3 text-sm",children:[e.jsx("input",{type:"checkbox",checked:t,onChange:n=>a(n.target.checked),className:"mt-0.5 h-4 w-4 accent-[var(--otari-brand)]","aria-label":"Exempt this key from budget"}),e.jsxs("span",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:"Exempt from budget"}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Requests on this key are logged with their cost but never counted toward the owner's budget or spend, and never blocked by it."})]})]})}function fe({onClose:t,onCreated:a}){const n=te(),r=V(),[d,o]=i.useState(""),[l,x]=i.useState(""),[g,p]=i.useState(!1),[c,u]=i.useState(""),[m,y]=i.useState(null),[h,N]=i.useState(!1),[v,I]=i.useState(!0),C=l!==""&&new Date(l).getTime(){if(n.isPending||!v||w)return;const b={key_name:d.trim()||null,user_id:c.trim(),expires_at:l?new Date(l).toISOString():null,allowed_models:m,exclude_from_budget:h};n.mutate(b,{onSuccess:j=>{a(j),t()}})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(A,{label:"Expires (optional)",value:l,onChange:x,type:"datetime-local",description:C?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(oe,{value:c,onChange:u,users:r.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(b=>!b),children:g?"Hide advanced":"Advanced"}),g?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(G,{userId:c,users:r.data??[]}),e.jsx(q,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(b,j)=>{y(b),I(j)}}),e.jsx(J,{checked:h,onChange:N})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!v||w,onPress:S,children:n.isPending?"Creating…":"Create key"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ge({apiKey:t,onClose:a}){const n=U(),r=V(),[d,o]=i.useState(t.key_name??""),[l,x]=i.useState(ue(t.expires_at)),[g,p]=i.useState(t.allowed_models),[c,u]=i.useState(t.exclude_from_budget),[m,y]=i.useState(!0),h=()=>{n.isPending||!m||n.mutate({id:t.id,body:{key_name:d.trim()||null,expires_at:l?new Date(l).toISOString():null,allowed_models:g,exclude_from_budget:c}},{onSuccess:a})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot"}),e.jsx(A,{label:"Expires",value:l,onChange:x,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(G,{userId:t.user_id,users:r.data??[]}):null,e.jsx(q,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(N,v)=>{p(N),y(v)}}),e.jsx(J,{checked:c,onChange:u}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!m,onPress:h,children:n.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function pe({apiKey:t}){return t.is_active?de(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function ye({allowed:t}){const{text:a,tone:n}=F(t),r=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",d=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${r}`,title:d,children:a})}function Ae(){const t=Y(),a=U(),n=Q(),r=X(),[d,o]=i.useState(!1),[l,x]=i.useState(null),[g,p]=i.useState(null),c=t.data??[],u=t.isLoading,m=c.find(s=>s.id===l)??null,y=!u&&c.length===0&&!d,h=ae(),[N,v]=i.useState(!1),[I,C]=i.useState(void 0),[w,S]=i.useState(!1),b=c.map(s=>s.id),j=ne(h.selectedKeys,b),E=c.filter(s=>j.includes(s.id)),z=i.useCallback((s,k)=>a.mutate({id:s.id,body:{is_active:k}}),[a.mutate]),L=i.useCallback(s=>n.mutate(s.id,{onSuccess:k=>p({title:`New secret for ${K(s)}`,result:k})}),[n.mutate]),R=async(s,k,T)=>{S(!0),C(void 0);try{for(const B of s)await k(B);h.clear(),T==null||T()}catch(B){C(B)}finally{S(!1)}},W=i.useMemo(()=>[{id:"name",header:"Name",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:s.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx(ye,{allowed:s.allowed_models}),s.exclude_from_budget?e.jsx("span",{className:"inline-flex items-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] px-2 py-0.5 text-xs font-medium text-[var(--otari-brand-dark)]",title:"Requests on this key are logged with cost but never counted toward budget",children:"Budget-exempt"}):null]})]})},{id:"status",header:"Status",cell:s=>e.jsx(pe,{apiKey:s})},{id:"owner",header:"Owner",cell:s=>me(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.user_id??"—"})},{id:"key",header:"Key",cell:s=>e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.key_prefix?`${s.key_prefix}…`:"—"})},{id:"created",header:"Created",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:$(s.created_at)})},{id:"last_used",header:"Last used",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:ce(s.last_used_at)??"never"})},{id:"expires",header:"Expires",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.expires_at?new Date(s.expires_at).toLocaleString():void 0,children:s.expires_at?$(s.expires_at):"never"})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:a.isPending,onPress:()=>z(s,!s.is_active),children:s.is_active?"Disable":"Enable"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{o(!1),x(s.id)},children:"Edit"}),e.jsx(H,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:K(s)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>L(s)}),s.is_active?null:e.jsx(H,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:r.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:K(s)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>r.mutate(s.id)})]})}],[a.isPending,n.isPending,r.isPending,r.mutate,z,L]),_=E.filter(s=>!s.is_active);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:d?null:e.jsx(f,{variant:"primary",onPress:()=>{x(null),o(!0)},children:"Create key"})}),e.jsx(O,{error:t.error??a.error??n.error??r.error}),y?e.jsx(ee,{title:"No API keys yet",description:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe.",actionLabel:"Create your first key",onAction:()=>{x(null),o(!0)}}):null,d?e.jsx(fe,{onClose:()=>o(!1),onCreated:s=>p({title:"API key created",result:s})}):null,m?e.jsx(ge,{apiKey:m,onClose:()=>x(null)},m.id):null,j.length>0?e.jsxs(re,{selectedCount:j.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:h.clear,children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{is_active:!1}})),children:"Disable"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{exclude_from_budget:!0}})),children:"Budget-exempt"}),e.jsx(f,{size:"sm",variant:"danger",isDisabled:_.length===0,onPress:()=>v(!0),children:"Delete"})]}):null,y?null:e.jsx(le,{ariaLabel:"API keys",columns:W,rows:c,getRowKey:xe,isLoading:u,emptyContent:"No API keys yet. Create one to authenticate a caller.",selectionMode:"multiple",selectedKeys:h.selectedKeys,onSelectionChange:h.onSelectionChange}),e.jsx(ie,{isOpen:N,onOpenChange:v,heading:"Delete API keys",body:`Permanently delete ${_.length} disabled ${_.length===1?"key":"keys"}? This removes them and unlinks their usage history. Cannot be undone. Active keys in the selection are skipped; disable them first.`,confirmLabel:"Delete permanently",isPending:w,error:I,onConfirm:()=>void R(_,s=>r.mutateAsync(s.id),()=>v(!1))}),g?e.jsx(he,{title:g.title,result:g.result,onClose:()=>{p(null),n.reset()}}):null]})}export{Ae as KeysPage}; diff --git a/src/gateway/static/dashboard/assets/ModelScopeControl-Bs976Tb8.js b/src/gateway/static/dashboard/assets/ModelScopeControl-BxqgiAHY.js similarity index 98% rename from src/gateway/static/dashboard/assets/ModelScopeControl-Bs976Tb8.js rename to src/gateway/static/dashboard/assets/ModelScopeControl-BxqgiAHY.js index da616d50a..1c2673dc8 100644 --- a/src/gateway/static/dashboard/assets/ModelScopeControl-Bs976Tb8.js +++ b/src/gateway/static/dashboard/assets/ModelScopeControl-BxqgiAHY.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{X as A,o as $,p as P}from"./index-Dhxz7Eyv.js";import{C as d,I as R,a as T,b as V}from"./heroui-DZj66Arc.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{X as A,o as $,p as P}from"./index-J9GltkCK.js";import{C as d,I as R,a as T,b as V}from"./heroui-DZj66Arc.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function Q({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function W(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{Q as M,W as a}; diff --git a/src/gateway/static/dashboard/assets/ModelsPage-Cwjl8fM-.js b/src/gateway/static/dashboard/assets/ModelsPage-jrY_FD2Z.js similarity index 99% rename from src/gateway/static/dashboard/assets/ModelsPage-Cwjl8fM-.js rename to src/gateway/static/dashboard/assets/ModelsPage-jrY_FD2Z.js index 652e512d0..d7d5701c6 100644 --- a/src/gateway/static/dashboard/assets/ModelsPage-Cwjl8fM-.js +++ b/src/gateway/static/dashboard/assets/ModelsPage-jrY_FD2Z.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as gt,u as vt,r as c}from"./react-dgEcD0HR.js";import{L as _t,M as bt,o as jt,N as yt,O as je,P as Pt,E as Nt,F as B,I as St,Q as se,S as Re,s as we,T as be,U as Ct,V as kt,W as E}from"./index-Dhxz7Eyv.js";import{u as Mt,r as Wt,B as Tt}from"./tableSelection-CojkFPwd.js";import{D as It}from"./DataTable-CrQq0sYf.js";import{T as Lt,S as $t}from"./TablePagination-BYC0DnfO.js";import{B as $,d as ae,f as V}from"./heroui-DZj66Arc.js";function Oe(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function At(t,i=Date.now()){const r=new Map;for(const n of t){const l=r.get(n.model_key)??[];l.push(n),r.set(n.model_key,l)}const a=[];for(const n of r.values()){const l=[...n].sort((p,u)=>Date.parse(p.effective_at)-Date.parse(u.effective_at)),m=[...l].reverse().find(p=>Date.parse(p.effective_at)<=i);a.push(m??l[0])}return a.sort((n,l)=>n.model_key.localeCompare(l.model_key))}const Et="otari",De=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],Ot=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Fe={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Dt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],Ft=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Bt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],Kt=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Rt=1440*60*1e3,wt=t=>t.key;function Be(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function Ke(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const a=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,l)=>l.min_input_tokens-n.min_input_tokens)[0];return a?{inputPrice:a.input_price_per_million??r.inputPrice,outputPrice:a.output_price_per_million??r.outputPrice,cacheReadPrice:a.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:a.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:a.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ce(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function z(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function Y(t){return t.trim()===""?null:Number(t)}function ze(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Ve(t){const i=new Set;return t.every(r=>{const a=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(l=>l.trim()!=="");return!Number.isInteger(a)||a<=0||i.has(a)||!n?!1:(i.add(a),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(z))})}function Ye(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function b({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:a=>i(a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function qe({tiers:t,onChange:i}){const r=(n,l,m)=>{i(t.map(p=>p.id===n?{...p,[l]:m}:p))},a=()=>{const n=t.reduce((l,m)=>Math.max(l,m.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx($,{size:"sm",variant:"outline",onPress:a,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:l=>r(n.id,"minInputTokens",l.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(b,{value:n.input,onChange:l=>r(n.id,"input",l),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(b,{value:n.output,onChange:l=>r(n.id,"output",l),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(b,{value:n.cacheRead,onChange:l=>r(n.id,"cacheRead",l),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(b,{value:n.cacheWrite,onChange:l=>r(n.id,"cacheWrite",l),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(b,{value:n.cacheWrite1h,onChange:l=>r(n.id,"cacheWrite1h",l),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(l=>l.id!==n.id)),children:"Remove"})]},n.id))]})}function zt({source:t}){return t==="configured"?e.jsx(V,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(V,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function oe({label:t,tone:i="info",children:r}){const a=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":a,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:a,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Vt(){const t=kt();return t.data?t.data.default_pricing?e.jsx(oe,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(oe,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function le({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Yt({row:t}){const i=je(),r=Re(),[a,n]=c.useState(!1),[l,m]=c.useState(""),[p,u]=c.useState(""),[P,j]=c.useState(""),[k,I]=c.useState(""),[y,h]=c.useState(""),[N,O]=c.useState([]),S=()=>{m(t.inputPrice==null?"":String(t.inputPrice)),u(t.outputPrice==null?"":String(t.outputPrice)),j(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),I(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),h(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),O(ze(t.pricingTiers)),n(!0)},X=ce(l)&&ce(p)&&z(P)&&z(k)&&z(y)&&Ve(N),W=()=>{X&&i.mutate({model_key:t.key,input_price_per_million:Number(l),output_price_per_million:Number(p),cache_read_price_per_million:Y(P),cache_write_price_per_million:Y(k),cache_write_1h_price_per_million:Y(y),pricing_tiers:Ye(N)},{onSuccess:()=>n(!1)})};return a?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(b,{value:l,onChange:m,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(b,{value:p,onChange:u,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(b,{value:P,onChange:j,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(b,{value:k,onChange:I,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(b,{value:y,onChange:h,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(qe,{tiers:N,onChange:O}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:"sm",variant:"primary",isDisabled:i.isPending||!X,onPress:W,children:"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:be(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${E(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${E(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${E(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${E(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${E(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx($,{size:"sm",variant:"outline",onPress:S,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(we,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error)}):null]})]})}function qt({row:t,metadata:i,metadataAvailable:r,onMakeAlias:a,onClose:n}){const l=(i==null?void 0:i.input_modalities)??[],m=(i==null?void 0:i.output_modalities)??[],p=Ot.filter(({key:u})=>i==null?void 0:i[u]);return e.jsx(ae,{children:e.jsxs(ae.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(V,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(le,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Yt,{row:t},t.key),e.jsx($,{size:"sm",variant:"outline",onPress:()=>a(t.key),children:"Make an alias"})]}),e.jsxs(le,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:se(t.contextWindow)}),e.jsx(T,{label:"Max output",value:se((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:Ct(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(le,{title:"Modalities",children:l.length===0&&m.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),l.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),m.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]})]})}),e.jsx(le,{title:"Capabilities",children:p.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(({key:u,label:P})=>e.jsx(V,{size:"sm",color:"default",children:P},u))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Ut=15;function Ht({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:a=>i(a.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}const Ue="otari.dashboard.modelsSort",_e={col:"model",dir:"asc"},Gt=["model","released","input","output"];function Jt(){if(typeof window>"u")return _e;try{const t=window.localStorage.getItem(Ue);if(!t)return _e;const i=JSON.parse(t);if(Gt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return _e}function Qt({row:t,onClose:i}){const r=je(),a=Re(),[n,l]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[m,p]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[u,P]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[j,k]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[I,y]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[h,N]=c.useState(ze(t.pricingTiers)),O=ce(n)&&ce(m)&&z(u)&&z(j)&&z(I)&&Ve(h),S=()=>{O&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(m),cache_read_price_per_million:Y(u),cache_write_price_per_million:Y(j),cache_write_1h_price_per_million:Y(I),pricing_tiers:Ye(h)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(b,{value:n,onChange:l,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(b,{value:m,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(b,{value:u,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(b,{value:j,onChange:k,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(b,{value:I,onChange:y,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx($,{size:"sm",variant:"primary",isDisabled:r.isPending||!O,onPress:S,children:r.isPending?"Saving…":"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(we,{confirmLabel:"Reset",isPending:a.isPending,onConfirm:()=>a.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||a.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error??a.error)}):null]}),e.jsx(qe,{tiers:h,onChange:N})]})}function Xt({primary:t,secondary:i,rowKey:r,primaryLabel:a,secondaryLabel:n,onEdit:l}){const m=(p,u)=>e.jsx("button",{type:"button","aria-label":`Edit ${u} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:P=>{P.stopPropagation(),l()},children:p==null?"—":E(p)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[m(t,a),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),m(i,n)]})}function Zt({rates:t,rowKey:i,onEdit:r}){const a=[t.cacheReadPrice==null?null:`R ${E(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${E(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${E(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:a.length>0?a.join(" · "):"Input-rate fallback"})}function ei({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,l)=>n.min_input_tokens-l.min_input_tokens).map(n=>se(n.min_input_tokens)),a=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:a})}function ti({rows:t,isLoading:i,empty:r,sortDescriptor:a,onSortChange:n,selectedKey:l,onSelect:m,onEditPricing:p,comparisonContextTokens:u,selectedKeys:P,onSelectionChange:j}){const k=c.useMemo(()=>{const y=u==null?"Base":`at ${se(u)}`;return[{id:"model",header:"Model",isRowHeader:!0,allowsSorting:!0,cell:h=>e.jsxs("span",{className:"font-medium break-all",children:[h.model,e.jsx("span",{className:"sr-only",children:h.key})]})},{id:"provider",header:"Provider",cell:h=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:h.provider})},{id:"input",header:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[`${y} in / out $ / 1M`,e.jsx(Vt,{})]}),align:"end",allowsSorting:!0,cell:h=>{const N=Ke(h,u);return e.jsx(Xt,{primary:N.inputPrice,secondary:N.outputPrice,rowKey:h.key,primaryLabel:"input",secondaryLabel:"output",onEdit:()=>p(h.key)})}},{id:"caching",header:`Caching ${u==null?"policy":y}`,align:"end",cell:h=>e.jsx(Zt,{rates:Ke(h,u),rowKey:h.key,onEdit:()=>p(h.key)})},{id:"policy",header:"Pricing policy",align:"end",cell:h=>e.jsx(ei,{row:h,onEdit:()=>p(h.key)})}]},[u,p]),I=c.useCallback(y=>y.key===l?"bg-[var(--otari-brand-tint)]":void 0,[l]);return e.jsx(It,{ariaLabel:"Models",columns:k,rows:t,getRowKey:wt,isLoading:i,emptyContent:r,selectionMode:"multiple",selectedKeys:P,onSelectionChange:j,sortDescriptor:a,onSortChange:n,onRowAction:m,rowClassName:I})}function ii({providers:t}){if(t.length===0)return null;const i=t.filter(l=>!l.discovery_unsupported),r=t.filter(l=>l.discovery_unsupported),a=l=>l.map(m=>m.provider).join(", "),n=l=>l.length===1;return e.jsxs(St,{tone:"warning",children:[i.length>0?e.jsxs("span",{className:"block",children:["Could not list ",a(i),". Check ",n(i)?"that provider's":"those providers'"," ","credentials in config.yml; ",n(i)?"its":"their"," models are missing from the list below."]}):null,r.length>0?e.jsxs("span",{className:"block",children:[a(r)," ",n(r)?"does":"do"," not offer model discovery, so"," ",n(r)?"its":"their"," models are missing from the list below."," ",n(r)?"The provider":"They"," may still serve requests; declare the model ids"," ",n(r)?"it serves":"they serve"," under the ",e.jsx("code",{children:"models:"})," key in config.yml to list them here."]}):null]})}function pi(){var Ie,Le,$e;const t=gt(),[i]=vt(),r=_t(),a=bt(),n=jt(),l=yt(),m=je(),[p,u]=c.useState(""),[P,j]=c.useState(0),[k,I]=c.useState(Ut),[y,h]=c.useState(null),[N,O]=c.useState(null),[S,X]=c.useState(Jt),W=Mt(),[He,ue]=c.useState(!1),[Ge,ye]=c.useState(!1),[Je,Pe]=c.useState(void 0);c.useEffect(()=>{try{window.localStorage.setItem(Ue,JSON.stringify(S))}catch{}},[S]);const[D,Ne]=c.useState(i.get("provider")||"all"),[K,Qe]=c.useState("all"),[q,Xe]=c.useState("all"),[U,Ze]=c.useState("all"),[de,et]=c.useState("0"),[Z,tt]=c.useState(""),[ee,it]=c.useState("all"),[pe,rt]=c.useState(""),F=((Ie=l.data)==null?void 0:Ie.models)??{},nt=((Le=l.data)==null?void 0:Le.available)??!1,Se=c.useMemo(()=>{var s;return new Set((((s=n.data)==null?void 0:s.providers)??[]).flatMap(x=>x.models.map(o=>o.key)))},[n.data]),lt=s=>{u(s),j(0)},R=s=>x=>{s(x),j(0)},te=c.useMemo(()=>{var M,v,_,A,L,w,Ae;const s=new Map(At(a.data??[]).map(d=>[d.model_key,d])),x=[],o=new Set,g=(d,ve,Ee,f)=>{if(o.has(d))return;o.add(d);const C=s.get(d);x.push({key:d,model:Be(ve,Ee),provider:Ee,isDiscovered:Se.has(d),contextWindow:(f==null?void 0:f.contextWindow)??null,inputPrice:C?C.input_price_per_million:(f==null?void 0:f.inputPrice)??null,outputPrice:C?C.output_price_per_million:(f==null?void 0:f.outputPrice)??null,cacheReadPrice:C?C.cache_read_price_per_million:(f==null?void 0:f.cacheReadPrice)??null,cacheWritePrice:C?C.cache_write_price_per_million:(f==null?void 0:f.cacheWritePrice)??null,cacheWrite1hPrice:C?C.cache_write_1h_price_per_million??null:(f==null?void 0:f.cacheWrite1hPrice)??null,pricingTiers:C?C.pricing_tiers??[]:(f==null?void 0:f.pricingTiers)??[],source:C?"configured":(f==null?void 0:f.source)??"none"})};for(const d of((M=r.data)==null?void 0:M.data)??[]){if(d.owned_by===Et)continue;const ve=d.pricing_source==="default"?"default":d.pricing?"configured":"none";g(d.id,d.id,d.owned_by||Oe(d.id),{key:d.id,model:d.id,provider:d.owned_by,contextWindow:d.context_window,inputPrice:((v=d.pricing)==null?void 0:v.input_price_per_million)??null,outputPrice:((_=d.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:((A=d.pricing)==null?void 0:A.cache_read_price_per_million)??null,cacheWritePrice:((L=d.pricing)==null?void 0:L.cache_write_price_per_million)??null,cacheWrite1hPrice:((w=d.pricing)==null?void 0:w.cache_write_1h_price_per_million)??null,pricingTiers:((Ae=d.pricing)==null?void 0:Ae.pricing_tiers)??[],source:ve})}for(const d of s.keys())g(d,d,Oe(d));return x},[r.data,a.data,Se]),Ce=c.useMemo(()=>new Map(te.map(s=>[s.key,s])),[te]),ie=c.useMemo(()=>{var o,g,M;const s=te.map(v=>{var _,A;return{...v,contextWindow:v.contextWindow??((_=F[v.key])==null?void 0:_.context_window)??null,releaseDate:((A=F[v.key])==null?void 0:A.release_date)??null}}),x=new Set(s.map(v=>v.key));for(const v of((o=n.data)==null?void 0:o.providers)??[])for(const _ of v.models)x.has(_.key)||(x.add(_.key),s.push({key:_.key,model:Be(_.key,v.provider),provider:v.provider,isDiscovered:!0,contextWindow:((g=F[_.key])==null?void 0:g.context_window)??null,releaseDate:((M=F[_.key])==null?void 0:M.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return s},[te,n.data,F]),st=((($e=n.data)==null?void 0:$e.providers)??[]).filter(s=>!s.ok),re=c.useMemo(()=>{const s=Array.from(new Set(ie.map(x=>x.provider))).sort((x,o)=>x.localeCompare(o));return[{value:"all",label:"All providers"},...s.map(x=>({value:x,label:x}))]},[ie]);c.useEffect(()=>{D==="all"||re.length<=1||re.some(s=>s.value===D)||Ne("all")},[re,D]);const H=p.trim().toLowerCase(),he=Number(de)||0,me=Z===""?Number.POSITIVE_INFINITY:Number(Z),at=pe===""?null:Number(pe),xe=ee==="all"?null:Date.now()-Number(ee)*Rt,G=c.useMemo(()=>{const s=o=>{if(H&&!o.key.toLowerCase().includes(H)&&!o.provider.toLowerCase().includes(H)||D!=="all"&&o.provider!==D||K==="configured"&&o.source!=="configured"||K==="default"&&o.source!=="default"||K==="priced"&&o.inputPrice==null||K==="unpriced"&&o.inputPrice!=null||q==="discovered"&&!o.isDiscovered||q==="custom"&&o.isDiscovered)return!1;if(U!=="all"){const g=De.find(v=>v.value===U),M=F[o.key];if(!g||!M||!g.test(M))return!1}if(he>0&&(o.contextWindow==null||o.contextWindowme))return!1;if(xe!=null){const g=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(g)||g{const M=S.dir==="asc"?1:-1;if(S.col==="model")return o.model.localeCompare(g.model)*M;if(S.col==="released"){const L=o.releaseDate??null,w=g.releaseDate??null;return!L&&!w?o.model.localeCompare(g.model):L?w?(Lw?1:0)*M||o.model.localeCompare(g.model):-1:1}const v=L=>S.col==="input"?L.inputPrice:L.outputPrice,_=v(o),A=v(g);return _==null&&A==null?o.model.localeCompare(g.model):_==null?1:A==null?-1:(_-A)*M||o.model.localeCompare(g.model)};return ie.filter(s).sort(x)},[ie,H,D,K,q,U,he,me,xe,F,S]),J=G.length,ct=Math.max(1,Math.ceil(J/k)),ke=Math.min(P,ct-1),Me=ke*k,fe=G.slice(Me,Me+k),ot={column:S.col,direction:S.dir==="asc"?"ascending":"descending"},ut=s=>{X({col:String(s.column),dir:s.direction==="ascending"?"asc":"desc"}),j(0)},dt=c.useCallback(s=>h(x=>x===s?null:s),[]),ge=fe.map(s=>s.key),Q=Wt(W.selectedKeys,ge),pt=ge.length>0&&Q.length===ge.length&&J>Q.length,ht=W.allMatching?G.map(s=>s.key):Q,We=W.allMatching?J:Q.length,Te=y?G.find(s=>s.key===y)??Ce.get(y)??null:null,mt=async s=>{ye(!0),Pe(void 0);try{for(const x of ht)await m.mutateAsync({model_key:x,input_price_per_million:s.input_price_per_million,output_price_per_million:s.output_price_per_million,cache_read_price_per_million:s.cache_read_price_per_million??null,cache_write_price_per_million:s.cache_write_price_per_million??null,cache_write_1h_price_per_million:null,pricing_tiers:[]});W.clear(),ue(!1)}catch(x){Pe(x)}finally{ye(!1)}},xt=r.isLoading||a.isLoading||n.isLoading,ft=H!==""||D!=="all"||K!=="all"||q!=="all"||U!=="all"||de!=="0"||Z!==""||ee!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",ne=N?G.find(s=>s.key===N)??Ce.get(N)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Pt,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(Nt,{error:r.error??a.error??n.error??l.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${ne?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ht,{value:p,onChange:lt,placeholder:"Search models…"}),e.jsx(B,{ariaLabel:"Filter by provider",value:D,onChange:R(Ne),options:re}),e.jsx(B,{ariaLabel:"Filter by pricing",value:K,onChange:R(Qe),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(B,{ariaLabel:"Filter by source",value:q,onChange:R(Xe),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(B,{ariaLabel:"Filter by capability",value:U,onChange:R(Ze),options:[{value:"all",label:"Any capability"},...De.map(s=>({value:s.value,label:s.label}))]}),e.jsx(B,{ariaLabel:"Minimum context window",value:de,onChange:R(et),options:Dt}),e.jsx(B,{ariaLabel:"Maximum input price",value:Z,onChange:R(tt),options:Ft}),e.jsx(B,{ariaLabel:"Compare prices at context",value:pe,onChange:rt,options:Bt}),e.jsx(B,{ariaLabel:"Filter by release date",value:ee,onChange:R(it),options:Kt})]}),e.jsx(ii,{providers:st}),Q.length>0?e.jsx(Tt,{selectedCount:We,allMatching:W.allMatching,matchingTotal:J,canSelectAllMatching:pt,onSelectAllMatching:W.enableAllMatching,onClear:W.clear,children:e.jsx($,{size:"sm",variant:"primary",onPress:()=>ue(!0),children:"Set pricing"})}):null,e.jsx(ti,{rows:fe,isLoading:xt,empty:ft,sortDescriptor:ot,onSortChange:ut,selectedKey:N,onSelect:O,onEditPricing:dt,comparisonContextTokens:at,selectedKeys:W.selectedKeys,onSelectionChange:W.onSelectionChange}),Te?e.jsx(ae,{children:e.jsxs(ae.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Edit pricing"}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>h(null),children:"Close"})]}),e.jsx(Qt,{row:Te,onClose:()=>h(null)})]})}):null,e.jsx(Lt,{page:ke,pageSize:k,total:J,rowsOnPage:fe.length,onPageChange:j,onPageSizeChange:s=>{I(s),j(0)},pageSizeOptions:[15,25,50]})]}),ne?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(qt,{row:ne,metadata:F[ne.key],metadataAvailable:nt,onMakeAlias:s=>t(`/aliases?target=${encodeURIComponent(s)}`),onClose:()=>O(null)})}):null]}),e.jsx($t,{isOpen:He,onOpenChange:ue,targetCount:We,isPending:Ge,error:Je,onSubmit:mt,title:"Set pricing",description:s=>`Apply these per-1M rates to ${s.toLocaleString()} selected ${s===1?"model":"models"}. This replaces each model's price; pricing tiers and the 1h cache rate are cleared. Edit a single model for tiers.`})]})}export{pi as ModelsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as gt,u as vt,r as c}from"./react-dgEcD0HR.js";import{L as _t,M as bt,o as jt,N as yt,O as je,P as Pt,E as Nt,F as B,I as St,Q as se,S as Re,s as we,T as be,U as Ct,V as kt,W as E}from"./index-J9GltkCK.js";import{u as Mt,r as Wt,B as Tt}from"./tableSelection-CojkFPwd.js";import{D as It}from"./DataTable-CrQq0sYf.js";import{T as Lt,S as $t}from"./TablePagination-DQNDuKMr.js";import{B as $,d as ae,f as V}from"./heroui-DZj66Arc.js";function Oe(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function At(t,i=Date.now()){const r=new Map;for(const n of t){const l=r.get(n.model_key)??[];l.push(n),r.set(n.model_key,l)}const a=[];for(const n of r.values()){const l=[...n].sort((p,u)=>Date.parse(p.effective_at)-Date.parse(u.effective_at)),m=[...l].reverse().find(p=>Date.parse(p.effective_at)<=i);a.push(m??l[0])}return a.sort((n,l)=>n.model_key.localeCompare(l.model_key))}const Et="otari",De=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],Ot=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Fe={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Dt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],Ft=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Bt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],Kt=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Rt=1440*60*1e3,wt=t=>t.key;function Be(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function Ke(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const a=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,l)=>l.min_input_tokens-n.min_input_tokens)[0];return a?{inputPrice:a.input_price_per_million??r.inputPrice,outputPrice:a.output_price_per_million??r.outputPrice,cacheReadPrice:a.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:a.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:a.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ce(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function z(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function Y(t){return t.trim()===""?null:Number(t)}function ze(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Ve(t){const i=new Set;return t.every(r=>{const a=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(l=>l.trim()!=="");return!Number.isInteger(a)||a<=0||i.has(a)||!n?!1:(i.add(a),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(z))})}function Ye(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function b({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:a=>i(a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function qe({tiers:t,onChange:i}){const r=(n,l,m)=>{i(t.map(p=>p.id===n?{...p,[l]:m}:p))},a=()=>{const n=t.reduce((l,m)=>Math.max(l,m.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx($,{size:"sm",variant:"outline",onPress:a,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:l=>r(n.id,"minInputTokens",l.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(b,{value:n.input,onChange:l=>r(n.id,"input",l),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(b,{value:n.output,onChange:l=>r(n.id,"output",l),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(b,{value:n.cacheRead,onChange:l=>r(n.id,"cacheRead",l),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(b,{value:n.cacheWrite,onChange:l=>r(n.id,"cacheWrite",l),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(b,{value:n.cacheWrite1h,onChange:l=>r(n.id,"cacheWrite1h",l),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(l=>l.id!==n.id)),children:"Remove"})]},n.id))]})}function zt({source:t}){return t==="configured"?e.jsx(V,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(V,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function oe({label:t,tone:i="info",children:r}){const a=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":a,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:a,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Vt(){const t=kt();return t.data?t.data.default_pricing?e.jsx(oe,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(oe,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function le({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Yt({row:t}){const i=je(),r=Re(),[a,n]=c.useState(!1),[l,m]=c.useState(""),[p,u]=c.useState(""),[P,j]=c.useState(""),[k,I]=c.useState(""),[y,h]=c.useState(""),[N,O]=c.useState([]),S=()=>{m(t.inputPrice==null?"":String(t.inputPrice)),u(t.outputPrice==null?"":String(t.outputPrice)),j(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),I(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),h(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),O(ze(t.pricingTiers)),n(!0)},X=ce(l)&&ce(p)&&z(P)&&z(k)&&z(y)&&Ve(N),W=()=>{X&&i.mutate({model_key:t.key,input_price_per_million:Number(l),output_price_per_million:Number(p),cache_read_price_per_million:Y(P),cache_write_price_per_million:Y(k),cache_write_1h_price_per_million:Y(y),pricing_tiers:Ye(N)},{onSuccess:()=>n(!1)})};return a?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(b,{value:l,onChange:m,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(b,{value:p,onChange:u,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(b,{value:P,onChange:j,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(b,{value:k,onChange:I,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(b,{value:y,onChange:h,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(qe,{tiers:N,onChange:O}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:"sm",variant:"primary",isDisabled:i.isPending||!X,onPress:W,children:"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:be(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${E(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${E(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${E(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${E(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${E(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx($,{size:"sm",variant:"outline",onPress:S,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(we,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error)}):null]})]})}function qt({row:t,metadata:i,metadataAvailable:r,onMakeAlias:a,onClose:n}){const l=(i==null?void 0:i.input_modalities)??[],m=(i==null?void 0:i.output_modalities)??[],p=Ot.filter(({key:u})=>i==null?void 0:i[u]);return e.jsx(ae,{children:e.jsxs(ae.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(V,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(le,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Yt,{row:t},t.key),e.jsx($,{size:"sm",variant:"outline",onPress:()=>a(t.key),children:"Make an alias"})]}),e.jsxs(le,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:se(t.contextWindow)}),e.jsx(T,{label:"Max output",value:se((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:Ct(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(le,{title:"Modalities",children:l.length===0&&m.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),l.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),m.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]})]})}),e.jsx(le,{title:"Capabilities",children:p.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(({key:u,label:P})=>e.jsx(V,{size:"sm",color:"default",children:P},u))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Ut=15;function Ht({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:a=>i(a.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}const Ue="otari.dashboard.modelsSort",_e={col:"model",dir:"asc"},Gt=["model","released","input","output"];function Jt(){if(typeof window>"u")return _e;try{const t=window.localStorage.getItem(Ue);if(!t)return _e;const i=JSON.parse(t);if(Gt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return _e}function Qt({row:t,onClose:i}){const r=je(),a=Re(),[n,l]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[m,p]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[u,P]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[j,k]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[I,y]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[h,N]=c.useState(ze(t.pricingTiers)),O=ce(n)&&ce(m)&&z(u)&&z(j)&&z(I)&&Ve(h),S=()=>{O&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(m),cache_read_price_per_million:Y(u),cache_write_price_per_million:Y(j),cache_write_1h_price_per_million:Y(I),pricing_tiers:Ye(h)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(b,{value:n,onChange:l,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(b,{value:m,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(b,{value:u,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(b,{value:j,onChange:k,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(b,{value:I,onChange:y,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx($,{size:"sm",variant:"primary",isDisabled:r.isPending||!O,onPress:S,children:r.isPending?"Saving…":"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(we,{confirmLabel:"Reset",isPending:a.isPending,onConfirm:()=>a.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||a.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error??a.error)}):null]}),e.jsx(qe,{tiers:h,onChange:N})]})}function Xt({primary:t,secondary:i,rowKey:r,primaryLabel:a,secondaryLabel:n,onEdit:l}){const m=(p,u)=>e.jsx("button",{type:"button","aria-label":`Edit ${u} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:P=>{P.stopPropagation(),l()},children:p==null?"—":E(p)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[m(t,a),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),m(i,n)]})}function Zt({rates:t,rowKey:i,onEdit:r}){const a=[t.cacheReadPrice==null?null:`R ${E(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${E(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${E(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:a.length>0?a.join(" · "):"Input-rate fallback"})}function ei({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,l)=>n.min_input_tokens-l.min_input_tokens).map(n=>se(n.min_input_tokens)),a=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:a})}function ti({rows:t,isLoading:i,empty:r,sortDescriptor:a,onSortChange:n,selectedKey:l,onSelect:m,onEditPricing:p,comparisonContextTokens:u,selectedKeys:P,onSelectionChange:j}){const k=c.useMemo(()=>{const y=u==null?"Base":`at ${se(u)}`;return[{id:"model",header:"Model",isRowHeader:!0,allowsSorting:!0,cell:h=>e.jsxs("span",{className:"font-medium break-all",children:[h.model,e.jsx("span",{className:"sr-only",children:h.key})]})},{id:"provider",header:"Provider",cell:h=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:h.provider})},{id:"input",header:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[`${y} in / out $ / 1M`,e.jsx(Vt,{})]}),align:"end",allowsSorting:!0,cell:h=>{const N=Ke(h,u);return e.jsx(Xt,{primary:N.inputPrice,secondary:N.outputPrice,rowKey:h.key,primaryLabel:"input",secondaryLabel:"output",onEdit:()=>p(h.key)})}},{id:"caching",header:`Caching ${u==null?"policy":y}`,align:"end",cell:h=>e.jsx(Zt,{rates:Ke(h,u),rowKey:h.key,onEdit:()=>p(h.key)})},{id:"policy",header:"Pricing policy",align:"end",cell:h=>e.jsx(ei,{row:h,onEdit:()=>p(h.key)})}]},[u,p]),I=c.useCallback(y=>y.key===l?"bg-[var(--otari-brand-tint)]":void 0,[l]);return e.jsx(It,{ariaLabel:"Models",columns:k,rows:t,getRowKey:wt,isLoading:i,emptyContent:r,selectionMode:"multiple",selectedKeys:P,onSelectionChange:j,sortDescriptor:a,onSortChange:n,onRowAction:m,rowClassName:I})}function ii({providers:t}){if(t.length===0)return null;const i=t.filter(l=>!l.discovery_unsupported),r=t.filter(l=>l.discovery_unsupported),a=l=>l.map(m=>m.provider).join(", "),n=l=>l.length===1;return e.jsxs(St,{tone:"warning",children:[i.length>0?e.jsxs("span",{className:"block",children:["Could not list ",a(i),". Check ",n(i)?"that provider's":"those providers'"," ","credentials in config.yml; ",n(i)?"its":"their"," models are missing from the list below."]}):null,r.length>0?e.jsxs("span",{className:"block",children:[a(r)," ",n(r)?"does":"do"," not offer model discovery, so"," ",n(r)?"its":"their"," models are missing from the list below."," ",n(r)?"The provider":"They"," may still serve requests; declare the model ids"," ",n(r)?"it serves":"they serve"," under the ",e.jsx("code",{children:"models:"})," key in config.yml to list them here."]}):null]})}function pi(){var Ie,Le,$e;const t=gt(),[i]=vt(),r=_t(),a=bt(),n=jt(),l=yt(),m=je(),[p,u]=c.useState(""),[P,j]=c.useState(0),[k,I]=c.useState(Ut),[y,h]=c.useState(null),[N,O]=c.useState(null),[S,X]=c.useState(Jt),W=Mt(),[He,ue]=c.useState(!1),[Ge,ye]=c.useState(!1),[Je,Pe]=c.useState(void 0);c.useEffect(()=>{try{window.localStorage.setItem(Ue,JSON.stringify(S))}catch{}},[S]);const[D,Ne]=c.useState(i.get("provider")||"all"),[K,Qe]=c.useState("all"),[q,Xe]=c.useState("all"),[U,Ze]=c.useState("all"),[de,et]=c.useState("0"),[Z,tt]=c.useState(""),[ee,it]=c.useState("all"),[pe,rt]=c.useState(""),F=((Ie=l.data)==null?void 0:Ie.models)??{},nt=((Le=l.data)==null?void 0:Le.available)??!1,Se=c.useMemo(()=>{var s;return new Set((((s=n.data)==null?void 0:s.providers)??[]).flatMap(x=>x.models.map(o=>o.key)))},[n.data]),lt=s=>{u(s),j(0)},R=s=>x=>{s(x),j(0)},te=c.useMemo(()=>{var M,v,_,A,L,w,Ae;const s=new Map(At(a.data??[]).map(d=>[d.model_key,d])),x=[],o=new Set,g=(d,ve,Ee,f)=>{if(o.has(d))return;o.add(d);const C=s.get(d);x.push({key:d,model:Be(ve,Ee),provider:Ee,isDiscovered:Se.has(d),contextWindow:(f==null?void 0:f.contextWindow)??null,inputPrice:C?C.input_price_per_million:(f==null?void 0:f.inputPrice)??null,outputPrice:C?C.output_price_per_million:(f==null?void 0:f.outputPrice)??null,cacheReadPrice:C?C.cache_read_price_per_million:(f==null?void 0:f.cacheReadPrice)??null,cacheWritePrice:C?C.cache_write_price_per_million:(f==null?void 0:f.cacheWritePrice)??null,cacheWrite1hPrice:C?C.cache_write_1h_price_per_million??null:(f==null?void 0:f.cacheWrite1hPrice)??null,pricingTiers:C?C.pricing_tiers??[]:(f==null?void 0:f.pricingTiers)??[],source:C?"configured":(f==null?void 0:f.source)??"none"})};for(const d of((M=r.data)==null?void 0:M.data)??[]){if(d.owned_by===Et)continue;const ve=d.pricing_source==="default"?"default":d.pricing?"configured":"none";g(d.id,d.id,d.owned_by||Oe(d.id),{key:d.id,model:d.id,provider:d.owned_by,contextWindow:d.context_window,inputPrice:((v=d.pricing)==null?void 0:v.input_price_per_million)??null,outputPrice:((_=d.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:((A=d.pricing)==null?void 0:A.cache_read_price_per_million)??null,cacheWritePrice:((L=d.pricing)==null?void 0:L.cache_write_price_per_million)??null,cacheWrite1hPrice:((w=d.pricing)==null?void 0:w.cache_write_1h_price_per_million)??null,pricingTiers:((Ae=d.pricing)==null?void 0:Ae.pricing_tiers)??[],source:ve})}for(const d of s.keys())g(d,d,Oe(d));return x},[r.data,a.data,Se]),Ce=c.useMemo(()=>new Map(te.map(s=>[s.key,s])),[te]),ie=c.useMemo(()=>{var o,g,M;const s=te.map(v=>{var _,A;return{...v,contextWindow:v.contextWindow??((_=F[v.key])==null?void 0:_.context_window)??null,releaseDate:((A=F[v.key])==null?void 0:A.release_date)??null}}),x=new Set(s.map(v=>v.key));for(const v of((o=n.data)==null?void 0:o.providers)??[])for(const _ of v.models)x.has(_.key)||(x.add(_.key),s.push({key:_.key,model:Be(_.key,v.provider),provider:v.provider,isDiscovered:!0,contextWindow:((g=F[_.key])==null?void 0:g.context_window)??null,releaseDate:((M=F[_.key])==null?void 0:M.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return s},[te,n.data,F]),st=((($e=n.data)==null?void 0:$e.providers)??[]).filter(s=>!s.ok),re=c.useMemo(()=>{const s=Array.from(new Set(ie.map(x=>x.provider))).sort((x,o)=>x.localeCompare(o));return[{value:"all",label:"All providers"},...s.map(x=>({value:x,label:x}))]},[ie]);c.useEffect(()=>{D==="all"||re.length<=1||re.some(s=>s.value===D)||Ne("all")},[re,D]);const H=p.trim().toLowerCase(),he=Number(de)||0,me=Z===""?Number.POSITIVE_INFINITY:Number(Z),at=pe===""?null:Number(pe),xe=ee==="all"?null:Date.now()-Number(ee)*Rt,G=c.useMemo(()=>{const s=o=>{if(H&&!o.key.toLowerCase().includes(H)&&!o.provider.toLowerCase().includes(H)||D!=="all"&&o.provider!==D||K==="configured"&&o.source!=="configured"||K==="default"&&o.source!=="default"||K==="priced"&&o.inputPrice==null||K==="unpriced"&&o.inputPrice!=null||q==="discovered"&&!o.isDiscovered||q==="custom"&&o.isDiscovered)return!1;if(U!=="all"){const g=De.find(v=>v.value===U),M=F[o.key];if(!g||!M||!g.test(M))return!1}if(he>0&&(o.contextWindow==null||o.contextWindowme))return!1;if(xe!=null){const g=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(g)||g{const M=S.dir==="asc"?1:-1;if(S.col==="model")return o.model.localeCompare(g.model)*M;if(S.col==="released"){const L=o.releaseDate??null,w=g.releaseDate??null;return!L&&!w?o.model.localeCompare(g.model):L?w?(Lw?1:0)*M||o.model.localeCompare(g.model):-1:1}const v=L=>S.col==="input"?L.inputPrice:L.outputPrice,_=v(o),A=v(g);return _==null&&A==null?o.model.localeCompare(g.model):_==null?1:A==null?-1:(_-A)*M||o.model.localeCompare(g.model)};return ie.filter(s).sort(x)},[ie,H,D,K,q,U,he,me,xe,F,S]),J=G.length,ct=Math.max(1,Math.ceil(J/k)),ke=Math.min(P,ct-1),Me=ke*k,fe=G.slice(Me,Me+k),ot={column:S.col,direction:S.dir==="asc"?"ascending":"descending"},ut=s=>{X({col:String(s.column),dir:s.direction==="ascending"?"asc":"desc"}),j(0)},dt=c.useCallback(s=>h(x=>x===s?null:s),[]),ge=fe.map(s=>s.key),Q=Wt(W.selectedKeys,ge),pt=ge.length>0&&Q.length===ge.length&&J>Q.length,ht=W.allMatching?G.map(s=>s.key):Q,We=W.allMatching?J:Q.length,Te=y?G.find(s=>s.key===y)??Ce.get(y)??null:null,mt=async s=>{ye(!0),Pe(void 0);try{for(const x of ht)await m.mutateAsync({model_key:x,input_price_per_million:s.input_price_per_million,output_price_per_million:s.output_price_per_million,cache_read_price_per_million:s.cache_read_price_per_million??null,cache_write_price_per_million:s.cache_write_price_per_million??null,cache_write_1h_price_per_million:null,pricing_tiers:[]});W.clear(),ue(!1)}catch(x){Pe(x)}finally{ye(!1)}},xt=r.isLoading||a.isLoading||n.isLoading,ft=H!==""||D!=="all"||K!=="all"||q!=="all"||U!=="all"||de!=="0"||Z!==""||ee!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",ne=N?G.find(s=>s.key===N)??Ce.get(N)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Pt,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(Nt,{error:r.error??a.error??n.error??l.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${ne?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ht,{value:p,onChange:lt,placeholder:"Search models…"}),e.jsx(B,{ariaLabel:"Filter by provider",value:D,onChange:R(Ne),options:re}),e.jsx(B,{ariaLabel:"Filter by pricing",value:K,onChange:R(Qe),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(B,{ariaLabel:"Filter by source",value:q,onChange:R(Xe),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(B,{ariaLabel:"Filter by capability",value:U,onChange:R(Ze),options:[{value:"all",label:"Any capability"},...De.map(s=>({value:s.value,label:s.label}))]}),e.jsx(B,{ariaLabel:"Minimum context window",value:de,onChange:R(et),options:Dt}),e.jsx(B,{ariaLabel:"Maximum input price",value:Z,onChange:R(tt),options:Ft}),e.jsx(B,{ariaLabel:"Compare prices at context",value:pe,onChange:rt,options:Bt}),e.jsx(B,{ariaLabel:"Filter by release date",value:ee,onChange:R(it),options:Kt})]}),e.jsx(ii,{providers:st}),Q.length>0?e.jsx(Tt,{selectedCount:We,allMatching:W.allMatching,matchingTotal:J,canSelectAllMatching:pt,onSelectAllMatching:W.enableAllMatching,onClear:W.clear,children:e.jsx($,{size:"sm",variant:"primary",onPress:()=>ue(!0),children:"Set pricing"})}):null,e.jsx(ti,{rows:fe,isLoading:xt,empty:ft,sortDescriptor:ot,onSortChange:ut,selectedKey:N,onSelect:O,onEditPricing:dt,comparisonContextTokens:at,selectedKeys:W.selectedKeys,onSelectionChange:W.onSelectionChange}),Te?e.jsx(ae,{children:e.jsxs(ae.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Edit pricing"}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>h(null),children:"Close"})]}),e.jsx(Qt,{row:Te,onClose:()=>h(null)})]})}):null,e.jsx(Lt,{page:ke,pageSize:k,total:J,rowsOnPage:fe.length,onPageChange:j,onPageSizeChange:s=>{I(s),j(0)},pageSizeOptions:[15,25,50]})]}),ne?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(qt,{row:ne,metadata:F[ne.key],metadataAvailable:nt,onMakeAlias:s=>t(`/aliases?target=${encodeURIComponent(s)}`),onClose:()=>O(null)})}):null]}),e.jsx($t,{isOpen:He,onOpenChange:ue,targetCount:We,isPending:Ge,error:Je,onSubmit:mt,title:"Set pricing",description:s=>`Apply these per-1M rates to ${s.toLocaleString()} selected ${s===1?"model":"models"}. This replaces each model's price; pricing tiers and the 1h cache rate are cleared. Edit a single model for tiers.`})]})}export{pi as ModelsPage}; diff --git a/src/gateway/static/dashboard/assets/OverviewPage-C0SW-na1.js b/src/gateway/static/dashboard/assets/OverviewPage-CE2kZBwW.js similarity index 99% rename from src/gateway/static/dashboard/assets/OverviewPage-C0SW-na1.js rename to src/gateway/static/dashboard/assets/OverviewPage-CE2kZBwW.js index ea18c6deb..db74c917d 100644 --- a/src/gateway/static/dashboard/assets/OverviewPage-C0SW-na1.js +++ b/src/gateway/static/dashboard/assets/OverviewPage-CE2kZBwW.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as y,i as at,N as T}from"./react-dgEcD0HR.js";import{X as st,Z as nt,g as S,_ as ot,v as it,c as lt,u as dt,d as ct,$ as w,P as ut,R as mt,E as Y,a0 as b,a1 as _,a2 as N,a3 as R,a4 as D,a5 as vt}from"./index-Dhxz7Eyv.js";import{S as U}from"./charts-BI8Uczg4.js";import{D as ht}from"./DataTable-CrQq0sYf.js";import{d as B,B as xt}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function M(e){return e==="neutral"?void 0:e}const ft=.02,pt=.1;function K(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,a=n>=pt?"alert":n>=ft?"warn":"ok";return{rate:n,status:a}}function gt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy+e.degraded===0?"alert":"warn"}const bt=.8;function yt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(o=>o.max_budget!==null&&o.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let a=0,l=0,r,m=-1;for(const o of n){const s=o.max_budget*o.user_count,i=s>0?o.total_spend/s:0;i>=1?a+=1:i>=bt&&(l+=1),i>m&&(m=i,r={name:o.name??o.budget_id,spent:o.total_spend,allocated:s,pct:i})}const d=a>0?"alert":l>0?"warn":"ok",h=a>0?`${a} over limit`:l>0?`${l} near limit`:"All within budget";return{status:d,label:h,overCount:a,nearCount:l,cappedCount:n.length,worst:r}}const W=864e5,G=30;function I(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function jt(){const[e,n]=y.useState(I);return y.useEffect(()=>{const a=()=>{if(document.visibilityState==="visible"){const l=I();n(r=>r===l?r:l)}};return document.addEventListener("visibilitychange",a),window.addEventListener("focus",a),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}},[]),y.useMemo(()=>{const a=Date.now(),l=new Date(a);return{today:new Date(l.getFullYear(),l.getMonth(),l.getDate()).toISOString(),periodStart:new Date(a-G*W).toISOString(),prevStart:new Date(a-2*G*W).toISOString()}},[e])}const St={ok:"Healthy",warn:"Elevated",alert:"High"},wt={ok:"On track",warn:"Near limit",alert:"Over budget"};function qt(){const e=st();return e.isLoading?t.jsx(nt,{}):t.jsx(Nt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function Nt({needsSetup:e=!1}){var $,L,O,A,F,P,q,H;const n=jt(),a=y.useMemo(()=>({start_date:n.today}),[n]),l=y.useMemo(()=>({start_date:n.periodStart}),[n]),r=y.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=S(a,"hour"),d=S(l,"day"),h=S(r,"day"),o=ot(),s=it(),i=lt(),x=dt(),f=ct({},0,5),E=($=m.data)==null?void 0:$.totals,v=(L=d.data)==null?void 0:L.totals,p=(O=h.data)==null?void 0:O.totals,j=((A=d.data)==null?void 0:A.series)??[],C=j.length>1,c=K(v),k=K(p),V=c.rate!==null&&k.rate!==null?w(c.rate,k.rate):null,u=yt(s.data??[]),X=gt(o.data),Z=(i.data??[]).filter(g=>g.is_active).length,z=(x.data??[]).filter(g=>!g.blocked).length,J=(((F=f.data)==null?void 0:F.length)??0)>0,Q=e&&f.isSuccess&&!J,tt=m.error??d.error??o.error??s.error??i.error??x.error,et=()=>{m.refetch(),d.refetch(),h.refetch(),o.refetch(),s.refetch(),i.refetch(),x.refetch(),f.refetch()},rt=m.isFetching||d.isFetching||h.isFetching||o.isFetching||s.isFetching||i.isFetching||x.isFetching||f.isFetching;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ut,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway.",action:t.jsx(mt,{onRefresh:et,isFetching:rt,updatedAt:d.dataUpdatedAt})}),Q?t.jsx(Rt,{}):null,t.jsx(Y,{error:tt}),t.jsx(Dt,{providerHealth:X,healthy:((P=o.data)==null?void 0:P.healthy)??0,degraded:((q=o.data)==null?void 0:q.degraded)??0,total:((H=o.data)==null?void 0:H.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:o.isSuccess&&s.isSuccess&&d.isSuccess,failed:o.isError||s.isError||d.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(b,{label:"Spend today",value:E?_(E.cost):"—"}),t.jsx(b,{label:"Spend, last 30 days",value:v?_(v.cost):"—",hint:v?t.jsx(N,{fraction:w(v.cost,p==null?void 0:p.cost)}):null,chart:C?t.jsx(U,{values:j.map(g=>g.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Requests, last 30 days",value:v?R(v.request_count):"—",hint:v?t.jsx(N,{fraction:w(v.request_count,p==null?void 0:p.request_count)}):null,chart:C?t.jsx(U,{values:j.map(g=>g.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Error rate, last 30 days",value:c.rate===null?"—":D(c.rate),status:M(c.status),statusLabel:c.status==="neutral"?void 0:St[c.status],hint:c.rate!==null?t.jsx(N,{fraction:V}):null}),t.jsx(b,{label:"Budget health",value:s.data&&u.worst?D(u.worst.pct):"—",status:s.data?M(u.status):void 0,statusLabel:s.data&&u.status!=="neutral"?wt[u.status]:void 0,hint:s.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(b,{label:"Active keys",value:i.data?R(Z):"—",to:"/keys"}),t.jsx(b,{label:"Active users",value:x.data?R(z):"—",to:"/users"})]}),t.jsx(Ct,{entries:f.data??[],loading:f.isLoading,error:f.error})]})}function Rt(){const e=at();return t.jsx(B,{children:t.jsxs(B.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(xt,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function _t({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function Dt({providerHealth:e,healthy:n,degraded:a,total:l,budget:r,errStatus:m,errRate:d,ready:h,failed:o}){if(o)return t.jsx(_t,{text:"Some status data could not be loaded."});if(!h)return null;const s=[];if((e==="warn"||e==="alert")&&l>0){const i=l-n-a;i>0&&s.push({text:`${i} provider${i===1?"":"s"} unreachable`,to:"/providers"}),a>0&&s.push({text:`${a} provider${a===1?"":"s"} without model discovery`,to:"/providers"})}return r.overCount>0?s.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&s.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),m==="alert"&&d!==null&&s.push({text:`error rate ${D(d)}`,to:"/activity?status=error"}),s.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),s.map((i,x)=>t.jsxs("span",{className:"flex items-center gap-2",children:[x>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(T,{to:i.to,className:"underline underline-offset-2 hover:text-amber-950",children:i.text})]},i.to+i.text))]})}function Et(e){return e==="error"?"error":"ok"}function Ct({entries:e,loading:n,error:a}){const l=[{id:"time",header:"Time",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(r.timestamp).toLocaleString(),children:vt(r.timestamp)})},{id:"model",header:"Model",isRowHeader:!0,cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:r.model})},{id:"cost",header:"Cost",align:"end",cell:r=>r.cost===null?"—":_(r.cost)},{id:"status",header:"Status",cell:r=>t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Et(r.status)})}];return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(T,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(Y,{error:a}),t.jsx(ht,{ariaLabel:"Recent activity",columns:l,rows:e,getRowKey:r=>r.id,isLoading:n,emptyContent:"No requests yet. Once the gateway serves traffic, it appears here."})]})}export{qt as OverviewIndex,Nt as OverviewPage,I as localDayKey}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as y,i as at,N as T}from"./react-dgEcD0HR.js";import{X as st,Z as nt,g as S,_ as ot,v as it,c as lt,u as dt,d as ct,$ as w,P as ut,R as mt,E as Y,a0 as b,a1 as _,a2 as N,a3 as R,a4 as D,a5 as vt}from"./index-J9GltkCK.js";import{S as U}from"./charts-BI8Uczg4.js";import{D as ht}from"./DataTable-CrQq0sYf.js";import{d as B,B as xt}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function M(e){return e==="neutral"?void 0:e}const ft=.02,pt=.1;function K(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,a=n>=pt?"alert":n>=ft?"warn":"ok";return{rate:n,status:a}}function gt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy+e.degraded===0?"alert":"warn"}const bt=.8;function yt(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(o=>o.max_budget!==null&&o.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let a=0,l=0,r,m=-1;for(const o of n){const s=o.max_budget*o.user_count,i=s>0?o.total_spend/s:0;i>=1?a+=1:i>=bt&&(l+=1),i>m&&(m=i,r={name:o.name??o.budget_id,spent:o.total_spend,allocated:s,pct:i})}const d=a>0?"alert":l>0?"warn":"ok",h=a>0?`${a} over limit`:l>0?`${l} near limit`:"All within budget";return{status:d,label:h,overCount:a,nearCount:l,cappedCount:n.length,worst:r}}const W=864e5,G=30;function I(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function jt(){const[e,n]=y.useState(I);return y.useEffect(()=>{const a=()=>{if(document.visibilityState==="visible"){const l=I();n(r=>r===l?r:l)}};return document.addEventListener("visibilitychange",a),window.addEventListener("focus",a),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}},[]),y.useMemo(()=>{const a=Date.now(),l=new Date(a);return{today:new Date(l.getFullYear(),l.getMonth(),l.getDate()).toISOString(),periodStart:new Date(a-G*W).toISOString(),prevStart:new Date(a-2*G*W).toISOString()}},[e])}const St={ok:"Healthy",warn:"Elevated",alert:"High"},wt={ok:"On track",warn:"Near limit",alert:"Over budget"};function qt(){const e=st();return e.isLoading?t.jsx(nt,{}):t.jsx(Nt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function Nt({needsSetup:e=!1}){var $,L,O,A,F,P,q,H;const n=jt(),a=y.useMemo(()=>({start_date:n.today}),[n]),l=y.useMemo(()=>({start_date:n.periodStart}),[n]),r=y.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=S(a,"hour"),d=S(l,"day"),h=S(r,"day"),o=ot(),s=it(),i=lt(),x=dt(),f=ct({},0,5),E=($=m.data)==null?void 0:$.totals,v=(L=d.data)==null?void 0:L.totals,p=(O=h.data)==null?void 0:O.totals,j=((A=d.data)==null?void 0:A.series)??[],C=j.length>1,c=K(v),k=K(p),V=c.rate!==null&&k.rate!==null?w(c.rate,k.rate):null,u=yt(s.data??[]),X=gt(o.data),Z=(i.data??[]).filter(g=>g.is_active).length,z=(x.data??[]).filter(g=>!g.blocked).length,J=(((F=f.data)==null?void 0:F.length)??0)>0,Q=e&&f.isSuccess&&!J,tt=m.error??d.error??o.error??s.error??i.error??x.error,et=()=>{m.refetch(),d.refetch(),h.refetch(),o.refetch(),s.refetch(),i.refetch(),x.refetch(),f.refetch()},rt=m.isFetching||d.isFetching||h.isFetching||o.isFetching||s.isFetching||i.isFetching||x.isFetching||f.isFetching;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ut,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway.",action:t.jsx(mt,{onRefresh:et,isFetching:rt,updatedAt:d.dataUpdatedAt})}),Q?t.jsx(Rt,{}):null,t.jsx(Y,{error:tt}),t.jsx(Dt,{providerHealth:X,healthy:((P=o.data)==null?void 0:P.healthy)??0,degraded:((q=o.data)==null?void 0:q.degraded)??0,total:((H=o.data)==null?void 0:H.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:o.isSuccess&&s.isSuccess&&d.isSuccess,failed:o.isError||s.isError||d.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(b,{label:"Spend today",value:E?_(E.cost):"—"}),t.jsx(b,{label:"Spend, last 30 days",value:v?_(v.cost):"—",hint:v?t.jsx(N,{fraction:w(v.cost,p==null?void 0:p.cost)}):null,chart:C?t.jsx(U,{values:j.map(g=>g.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Requests, last 30 days",value:v?R(v.request_count):"—",hint:v?t.jsx(N,{fraction:w(v.request_count,p==null?void 0:p.request_count)}):null,chart:C?t.jsx(U,{values:j.map(g=>g.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Error rate, last 30 days",value:c.rate===null?"—":D(c.rate),status:M(c.status),statusLabel:c.status==="neutral"?void 0:St[c.status],hint:c.rate!==null?t.jsx(N,{fraction:V}):null}),t.jsx(b,{label:"Budget health",value:s.data&&u.worst?D(u.worst.pct):"—",status:s.data?M(u.status):void 0,statusLabel:s.data&&u.status!=="neutral"?wt[u.status]:void 0,hint:s.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(b,{label:"Active keys",value:i.data?R(Z):"—",to:"/keys"}),t.jsx(b,{label:"Active users",value:x.data?R(z):"—",to:"/users"})]}),t.jsx(Ct,{entries:f.data??[],loading:f.isLoading,error:f.error})]})}function Rt(){const e=at();return t.jsx(B,{children:t.jsxs(B.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(xt,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function _t({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function Dt({providerHealth:e,healthy:n,degraded:a,total:l,budget:r,errStatus:m,errRate:d,ready:h,failed:o}){if(o)return t.jsx(_t,{text:"Some status data could not be loaded."});if(!h)return null;const s=[];if((e==="warn"||e==="alert")&&l>0){const i=l-n-a;i>0&&s.push({text:`${i} provider${i===1?"":"s"} unreachable`,to:"/providers"}),a>0&&s.push({text:`${a} provider${a===1?"":"s"} without model discovery`,to:"/providers"})}return r.overCount>0?s.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&s.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),m==="alert"&&d!==null&&s.push({text:`error rate ${D(d)}`,to:"/activity?status=error"}),s.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),s.map((i,x)=>t.jsxs("span",{className:"flex items-center gap-2",children:[x>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(T,{to:i.to,className:"underline underline-offset-2 hover:text-amber-950",children:i.text})]},i.to+i.text))]})}function Et(e){return e==="error"?"error":"ok"}function Ct({entries:e,loading:n,error:a}){const l=[{id:"time",header:"Time",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(r.timestamp).toLocaleString(),children:vt(r.timestamp)})},{id:"model",header:"Model",isRowHeader:!0,cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:r.model})},{id:"cost",header:"Cost",align:"end",cell:r=>r.cost===null?"—":_(r.cost)},{id:"status",header:"Status",cell:r=>t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Et(r.status)})}];return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(T,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(Y,{error:a}),t.jsx(ht,{ariaLabel:"Recent activity",columns:l,rows:e,getRowKey:r=>r.id,isLoading:n,emptyContent:"No requests yet. Once the gateway serves traffic, it appears here."})]})}export{qt as OverviewIndex,Nt as OverviewPage,I as localDayKey}; diff --git a/src/gateway/static/dashboard/assets/ProvidersPage-17Tj43ca.js b/src/gateway/static/dashboard/assets/ProvidersPage-BNd38xmH.js similarity index 99% rename from src/gateway/static/dashboard/assets/ProvidersPage-17Tj43ca.js rename to src/gateway/static/dashboard/assets/ProvidersPage-BNd38xmH.js index d59f06ca6..49c6918be 100644 --- a/src/gateway/static/dashboard/assets/ProvidersPage-17Tj43ca.js +++ b/src/gateway/static/dashboard/assets/ProvidersPage-BNd38xmH.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,L as M}from"./react-dgEcD0HR.js";import{X as Y,a6 as V,V as G,_ as W,a7 as X,a8 as J,a9 as Q,P as Z,E as I,I as ee,aa as te,ab as se,a5 as q,s as ae,ac as $,ad as re,T as O,ae as ne,af as ie}from"./index-Dhxz7Eyv.js";import{F as _}from"./Field-DEJ6Wjg9.js";import{D as oe}from"./DataTable-CrQq0sYf.js";import{B as f,d as S,f as de,T as le,L as F,I as H,D as ce,S as me,C as T,a as ue,b as xe}from"./heroui-DZj66Arc.js";function E({value:t,onChange:s,label:a,placeholder:n,description:i}){return e.jsxs(le,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(H,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),i?e.jsx(ce,{className:"text-xs text-[var(--otari-muted)]",children:i}):null]})}function z({label:t,value:s,onChange:a,description:n,placeholder:i,extra:d=[],includeCatalog:l=!0}){var k;const g=ne(),u=x.useMemo(()=>l?[...d,...(g.data??[]).map(o=>({id:o.id,name:o.name}))]:d,[g.data,d,l]),[p,m]=x.useState(()=>{var o;return((o=u.find(b=>b.id===s))==null?void 0:o.name)??""}),j=((k=u.find(o=>o.id===s))==null?void 0:k.name)??"",h=p.trim()===j.trim()?"":p.trim().toLowerCase(),c=u.filter(o=>!h||o.name.toLowerCase().includes(h)||o.id.toLowerCase().includes(h)).slice(0,50);return e.jsxs(T.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:p,onInputChange:m,onSelectionChange:o=>{var b;o!=null?(a(String(o)),m(((b=u.find(N=>N.id===String(o)))==null?void 0:b.name)??"")):(a(""),m(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(T.InputGroup,{children:[e.jsx(H,{placeholder:i??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:o=>o.currentTarget.select()}),e.jsx(T.Trigger,{})]}),e.jsx(T.Popover,{children:e.jsx(ue,{items:c,className:"max-h-72 overflow-auto",children:o=>e.jsx(xe,{id:o.id,textValue:o.name,children:o.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function U({getPayload:t}){const s=ie(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:O(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):s.data.discovery_unsupported?e.jsxs("span",{className:"block max-w-md break-words text-xs text-amber-800",children:["This provider does not list models, so the key could not be verified here. Save it and use the provider; declare its model ids under ",e.jsx("code",{children:"models:"})," to have them show up in the catalogue. If you did not expect this, check the provider's reply below.",s.data.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:s.data.error}):null]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function pe({onClose:t}){var A;const s=$(),[a,n]=x.useState(""),[i,d]=x.useState(""),[l,g]=x.useState(!1),[u,p]=x.useState(""),[m,j]=x.useState(""),h=re(a),c=((A=h.data)==null?void 0:A.id)===a?h.data:void 0;x.useEffect(()=>{c&&p(c.default_api_base??"")},[c]);const k=(c==null?void 0:c.env_key_present)??!1,o=((c==null?void 0:c.requires_api_key)??!0)&&!k,b=m.trim()!==""&&m.trim()!==a,N=/[:/]/.test(m),P=a!==""&&!N&&(!o||i.trim()!=="")&&!s.isPending,C=()=>{P&&s.mutate({instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsx(z,{label:"Provider",value:a,onChange:w=>{n(w),j(""),p("")},description:"Its endpoint is built in."}),e.jsx(E,{value:i,onChange:d,label:c&&!o?"API key (optional)":"API key",description:c?o?`${c.name}'s endpoint is built in — just add your key.`:k?`${c.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${c.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>g(w=>!w),children:l?"Hide advanced":"Advanced (API base, rename)"}),l?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:u,onChange:p,placeholder:(c==null?void 0:c.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:m,onChange:j,placeholder:a||"instance name",description:N?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!P,onPress:C,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a===""?null:{instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null}})]})]})}function he({onClose:t}){const s=$(),[a,n]=x.useState(""),[i,d]=x.useState("openai-compatible"),[l,g]=x.useState(""),[u,p]=x.useState(""),m=/[:/]/.test(a),j=a.trim()!==""&&!m&&l.trim()!==""&&!s.isPending,h=()=>{j&&s.mutate({instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:m?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(z,{label:"Compatible with",value:i,onChange:d,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:l,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(E,{value:u,onChange:p,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!j,onPress:h,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a.trim()===""||l.trim()===""?null:{instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null}})]})]})}function ve({onClose:t}){const[s,a]=x.useState("known");return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,i])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:i},n))})}),s==="known"?e.jsx(pe,{onClose:t}):e.jsx(he,{onClose:t})]})})}function ge({provider:t,onClose:s}){const a=te(),[n,i]=x.useState(t.provider_type??""),[d,l]=x.useState(t.api_base??""),[g,u]=x.useState(!1),[p,m]=x.useState(""),j=()=>{if(a.isPending)return;const h={provider_type:n.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};g&&p.trim()&&(h.api_key=p.trim()),a.mutate({instance:t.instance,body:h},{onSuccess:s})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(I,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:i,placeholder:"openai"}),e.jsx(_,{label:"API base",value:d,onChange:l,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(E,{value:p,onChange:m,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),m("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(f,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:a.isPending,onPress:j,children:a.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function fe(t,s){const a=new Map((s??[]).map(d=>[d.instance,d])),n=new Map((t??[]).map(d=>[d.instance,d]));return[...new Set([...a.keys(),...n.keys()])].sort().map(d=>{const l=a.get(d);return{instance:d,source:l?"stored":"config",stored:l,meta:n.get(d)}})}function je({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(me,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):t.discovery_unsupported?e.jsxs("span",{className:"block max-w-xs break-words text-xs text-amber-800",children:["Could not list models, so the key could not be verified. It may still work for requests.",t.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:t.error}):null]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function be({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=!t.ok&&t.discovery_unsupported,a=t.ok?"border-green-200 bg-green-50 text-green-700":s?"border-amber-200 bg-amber-50 text-amber-800":"border-red-200 bg-red-50 text-red-700",n=t.ok?"bg-green-500":s?"bg-amber-500":"bg-red-500",i=t.checked_at?`Last checked ${q(t.checked_at)}`:"Not checked yet",d=s?`${t.error??"This provider does not list models."} Requests to it may still work.`:t.error??"Unreachable",l=t.ok?i:`${d} · ${i}`;return e.jsxs("span",{title:l,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${n}`}),t.ok?"Reachable":s?"No model discovery":"Unreachable"]})}function ye({healthy:t,degraded:s,total:a,checkedAt:n}){const d=t===a?"bg-green-500":t+s===a?"bg-amber-500":"bg-red-500",l=se();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${d}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s>0?e.jsxs("span",{className:"text-amber-800",children:[s," without model discovery"]}):null,n?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",q(n)]}):null,e.jsx(f,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function R({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function ke({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n,secretKeyConfigured:i}){return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(R,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(R,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(R,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(f,{variant:"primary",isDisabled:!i,onPress:t,children:"Add your first provider"})})]})})}function Ae(){var K,B,D,L;const t=Y(),s=V(),a=G(),n=W(),i=X(),d=J(),l=Q(),[g,u]=x.useState(!1),[p,m]=x.useState(null),[j,h]=x.useState({}),c=fe((K=t.data)==null?void 0:K.providers,s.data),k=new Map((((B=n.data)==null?void 0:B.providers)??[]).map(r=>[r.instance,r])),o=t.isLoading||s.isLoading,b=((D=s.data)==null?void 0:D.find(r=>r.instance===p))??null,N=((L=a.data)==null?void 0:L.require_pricing)===!0&&a.data.default_pricing===!1,P=a.data?a.data.secret_key_configured!==!1:!a.isError,C=!o&&c.length===0&&!g,A=r=>{h(v=>({...v,[r]:{status:"pending"}})),d.mutate(r,{onSuccess:v=>h(y=>({...y,[r]:{status:"done",...v}})),onError:v=>h(y=>({...y,[r]:{status:"done",ok:!1,model_count:0,error:O(v),discovery_unsupported:!1}}))})},w=[{id:"provider",header:"Provider",isRowHeader:!0,cell:r=>e.jsx(M,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"font-medium text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})},{id:"type",header:"Type",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:((v=r.meta)==null?void 0:v.provider_type)??((y=r.stored)==null?void 0:y.provider_type)??r.instance})}},{id:"source",header:"Source",cell:r=>e.jsx(de,{size:"sm",color:r.source==="stored"?"accent":"default",children:r.source==="stored"?"stored":"config"})},{id:"api_key",header:"API key",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:(v=r.stored)!=null&&v.last4?`••••${r.stored.last4}`:"none set"}):(y=r.meta)!=null&&y.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"})}},{id:"status",header:"Status",cell:r=>e.jsx(be,{health:k.get(r.instance)})},{id:"actions",header:"Actions",align:"end",cell:r=>{var v,y;return r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:((v=j[r.instance])==null?void 0:v.status)==="pending"||((y=r.stored)==null?void 0:y.decryptable)===!1,onPress:()=>A(r.instance),children:"Test"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{u(!1),m(r.instance)},children:"Edit"}),e.jsx(ae,{confirmLabel:"Delete",isPending:i.isPending,onConfirm:()=>i.mutate(r.instance),children:"Delete"})]}),e.jsx(je,{state:j[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})}}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||C?null:e.jsx(f,{variant:"primary",isDisabled:!P,onPress:()=>{m(null),u(!0)},children:"Add provider"})}),e.jsx(I,{error:t.error??s.error??a.error??n.error??l.error??i.error}),P?null:e.jsxs(ee,{tone:"warning",children:[e.jsx("code",{children:"OTARI_SECRET_KEY"})," is not set, so provider keys can't be encrypted at rest and adding providers from the dashboard is disabled. Set it on the server and restart to add providers here. Providers defined in"," ",e.jsx("code",{children:"config.yml"})," keep working without it."]}),C?e.jsx(ke,{onAddProvider:()=>{m(null),u(!0)},needsPricing:N,onEnablePricing:()=>l.mutate({default_pricing:!0}),enabling:l.isPending,secretKeyConfigured:P}):null,g&&P?e.jsx(ve,{onClose:()=>u(!1)}):null,b?e.jsx(ge,{provider:b,onClose:()=>m(null)}):null,!o&&c.length>0&&n.data&&n.data.total>0?e.jsx(ye,{healthy:n.data.healthy,degraded:n.data.degraded,total:n.data.total,checkedAt:n.data.checked_at}):null,C?null:e.jsx(oe,{ariaLabel:"Providers",columns:w,rows:c,getRowKey:r=>r.instance,isLoading:o,emptyContent:"No providers yet. Add your first provider to start serving models."})]})}export{Ae as ProvidersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x,L as M}from"./react-dgEcD0HR.js";import{X as Y,a6 as V,V as G,_ as W,a7 as X,a8 as J,a9 as Q,P as Z,E as I,I as ee,aa as te,ab as se,a5 as q,s as ae,ac as $,ad as re,T as O,ae as ne,af as ie}from"./index-J9GltkCK.js";import{F as _}from"./Field-DEJ6Wjg9.js";import{D as oe}from"./DataTable-CrQq0sYf.js";import{B as f,d as S,f as de,T as le,L as F,I as H,D as ce,S as me,C as T,a as ue,b as xe}from"./heroui-DZj66Arc.js";function E({value:t,onChange:s,label:a,placeholder:n,description:i}){return e.jsxs(le,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(H,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),i?e.jsx(ce,{className:"text-xs text-[var(--otari-muted)]",children:i}):null]})}function z({label:t,value:s,onChange:a,description:n,placeholder:i,extra:d=[],includeCatalog:l=!0}){var k;const g=ne(),u=x.useMemo(()=>l?[...d,...(g.data??[]).map(o=>({id:o.id,name:o.name}))]:d,[g.data,d,l]),[p,m]=x.useState(()=>{var o;return((o=u.find(b=>b.id===s))==null?void 0:o.name)??""}),j=((k=u.find(o=>o.id===s))==null?void 0:k.name)??"",h=p.trim()===j.trim()?"":p.trim().toLowerCase(),c=u.filter(o=>!h||o.name.toLowerCase().includes(h)||o.id.toLowerCase().includes(h)).slice(0,50);return e.jsxs(T.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:p,onInputChange:m,onSelectionChange:o=>{var b;o!=null?(a(String(o)),m(((b=u.find(N=>N.id===String(o)))==null?void 0:b.name)??"")):(a(""),m(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(F,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(T.InputGroup,{children:[e.jsx(H,{placeholder:i??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:o=>o.currentTarget.select()}),e.jsx(T.Trigger,{})]}),e.jsx(T.Popover,{children:e.jsx(ue,{items:c,className:"max-h-72 overflow-auto",children:o=>e.jsx(xe,{id:o.id,textValue:o.name,children:o.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function U({getPayload:t}){const s=ie(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(f,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:O(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):s.data.discovery_unsupported?e.jsxs("span",{className:"block max-w-md break-words text-xs text-amber-800",children:["This provider does not list models, so the key could not be verified here. Save it and use the provider; declare its model ids under ",e.jsx("code",{children:"models:"})," to have them show up in the catalogue. If you did not expect this, check the provider's reply below.",s.data.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:s.data.error}):null]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function pe({onClose:t}){var A;const s=$(),[a,n]=x.useState(""),[i,d]=x.useState(""),[l,g]=x.useState(!1),[u,p]=x.useState(""),[m,j]=x.useState(""),h=re(a),c=((A=h.data)==null?void 0:A.id)===a?h.data:void 0;x.useEffect(()=>{c&&p(c.default_api_base??"")},[c]);const k=(c==null?void 0:c.env_key_present)??!1,o=((c==null?void 0:c.requires_api_key)??!0)&&!k,b=m.trim()!==""&&m.trim()!==a,N=/[:/]/.test(m),P=a!==""&&!N&&(!o||i.trim()!=="")&&!s.isPending,C=()=>{P&&s.mutate({instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsx(z,{label:"Provider",value:a,onChange:w=>{n(w),j(""),p("")},description:"Its endpoint is built in."}),e.jsx(E,{value:i,onChange:d,label:c&&!o?"API key (optional)":"API key",description:c?o?`${c.name}'s endpoint is built in — just add your key.`:k?`${c.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${c.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>g(w=>!w),children:l?"Hide advanced":"Advanced (API base, rename)"}),l?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"API base",value:u,onChange:p,placeholder:(c==null?void 0:c.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(_,{label:"Name",value:m,onChange:j,placeholder:a||"instance name",description:N?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!P,onPress:C,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a===""?null:{instance:b?m.trim():a,provider_type:b?a:null,api_base:u.trim()||null,api_key:i.trim()||null}})]})]})}function he({onClose:t}){const s=$(),[a,n]=x.useState(""),[i,d]=x.useState("openai-compatible"),[l,g]=x.useState(""),[u,p]=x.useState(""),m=/[:/]/.test(a),j=a.trim()!==""&&!m&&l.trim()!==""&&!s.isPending,h=()=>{j&&s.mutate({instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:m?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(z,{label:"Compatible with",value:i,onChange:d,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(_,{label:"API base",value:l,onChange:g,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(E,{value:u,onChange:p,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:!j,onPress:h,children:s.isPending?"Adding…":"Add provider"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(U,{getPayload:()=>a.trim()===""||l.trim()===""?null:{instance:a.trim(),provider_type:i||"openai-compatible",api_base:l.trim(),api_key:u.trim()||null}})]})]})}function ve({onClose:t}){const[s,a]=x.useState("known");return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,i])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:i},n))})}),s==="known"?e.jsx(pe,{onClose:t}):e.jsx(he,{onClose:t})]})})}function ge({provider:t,onClose:s}){const a=te(),[n,i]=x.useState(t.provider_type??""),[d,l]=x.useState(t.api_base??""),[g,u]=x.useState(!1),[p,m]=x.useState(""),j=()=>{if(a.isPending)return;const h={provider_type:n.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};g&&p.trim()&&(h.api_key=p.trim()),a.mutate({instance:t.instance,body:h},{onSuccess:s})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(I,{error:a.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(_,{label:"Provider type",value:n,onChange:i,placeholder:"openai"}),e.jsx(_,{label:"API base",value:d,onChange:l,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:g?e.jsxs(e.Fragment,{children:[e.jsx(E,{value:p,onChange:m,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{u(!1),m("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(f,{size:"sm",variant:"outline",onPress:()=>u(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:a.isPending,onPress:j,children:a.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function fe(t,s){const a=new Map((s??[]).map(d=>[d.instance,d])),n=new Map((t??[]).map(d=>[d.instance,d]));return[...new Set([...a.keys(),...n.keys()])].sort().map(d=>{const l=a.get(d);return{instance:d,source:l?"stored":"config",stored:l,meta:n.get(d)}})}function je({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(me,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):t.discovery_unsupported?e.jsxs("span",{className:"block max-w-xs break-words text-xs text-amber-800",children:["Could not list models, so the key could not be verified. It may still work for requests.",t.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:t.error}):null]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function be({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=!t.ok&&t.discovery_unsupported,a=t.ok?"border-green-200 bg-green-50 text-green-700":s?"border-amber-200 bg-amber-50 text-amber-800":"border-red-200 bg-red-50 text-red-700",n=t.ok?"bg-green-500":s?"bg-amber-500":"bg-red-500",i=t.checked_at?`Last checked ${q(t.checked_at)}`:"Not checked yet",d=s?`${t.error??"This provider does not list models."} Requests to it may still work.`:t.error??"Unreachable",l=t.ok?i:`${d} · ${i}`;return e.jsxs("span",{title:l,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${n}`}),t.ok?"Reachable":s?"No model discovery":"Unreachable"]})}function ye({healthy:t,degraded:s,total:a,checkedAt:n}){const d=t===a?"bg-green-500":t+s===a?"bg-amber-500":"bg-red-500",l=se();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${d}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s>0?e.jsxs("span",{className:"text-amber-800",children:[s," without model discovery"]}):null,n?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",q(n)]}):null,e.jsx(f,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:l.isPending,onPress:()=>l.mutate(),children:l.isPending?"Re-checking…":"Re-check all"})]})}function R({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function ke({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n,secretKeyConfigured:i}){return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(R,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(R,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(R,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(f,{variant:"primary",isDisabled:!i,onPress:t,children:"Add your first provider"})})]})})}function Ae(){var K,B,D,L;const t=Y(),s=V(),a=G(),n=W(),i=X(),d=J(),l=Q(),[g,u]=x.useState(!1),[p,m]=x.useState(null),[j,h]=x.useState({}),c=fe((K=t.data)==null?void 0:K.providers,s.data),k=new Map((((B=n.data)==null?void 0:B.providers)??[]).map(r=>[r.instance,r])),o=t.isLoading||s.isLoading,b=((D=s.data)==null?void 0:D.find(r=>r.instance===p))??null,N=((L=a.data)==null?void 0:L.require_pricing)===!0&&a.data.default_pricing===!1,P=a.data?a.data.secret_key_configured!==!1:!a.isError,C=!o&&c.length===0&&!g,A=r=>{h(v=>({...v,[r]:{status:"pending"}})),d.mutate(r,{onSuccess:v=>h(y=>({...y,[r]:{status:"done",...v}})),onError:v=>h(y=>({...y,[r]:{status:"done",ok:!1,model_count:0,error:O(v),discovery_unsupported:!1}}))})},w=[{id:"provider",header:"Provider",isRowHeader:!0,cell:r=>e.jsx(M,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"font-medium text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})},{id:"type",header:"Type",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:((v=r.meta)==null?void 0:v.provider_type)??((y=r.stored)==null?void 0:y.provider_type)??r.instance})}},{id:"source",header:"Source",cell:r=>e.jsx(de,{size:"sm",color:r.source==="stored"?"accent":"default",children:r.source==="stored"?"stored":"config"})},{id:"api_key",header:"API key",cell:r=>{var v,y;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:(v=r.stored)!=null&&v.last4?`••••${r.stored.last4}`:"none set"}):(y=r.meta)!=null&&y.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"})}},{id:"status",header:"Status",cell:r=>e.jsx(be,{health:k.get(r.instance)})},{id:"actions",header:"Actions",align:"end",cell:r=>{var v,y;return r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:((v=j[r.instance])==null?void 0:v.status)==="pending"||((y=r.stored)==null?void 0:y.decryptable)===!1,onPress:()=>A(r.instance),children:"Test"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{u(!1),m(r.instance)},children:"Edit"}),e.jsx(ae,{confirmLabel:"Delete",isPending:i.isPending,onConfirm:()=>i.mutate(r.instance),children:"Delete"})]}),e.jsx(je,{state:j[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})}}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:g||C?null:e.jsx(f,{variant:"primary",isDisabled:!P,onPress:()=>{m(null),u(!0)},children:"Add provider"})}),e.jsx(I,{error:t.error??s.error??a.error??n.error??l.error??i.error}),P?null:e.jsxs(ee,{tone:"warning",children:[e.jsx("code",{children:"OTARI_SECRET_KEY"})," is not set, so provider keys can't be encrypted at rest and adding providers from the dashboard is disabled. Set it on the server and restart to add providers here. Providers defined in"," ",e.jsx("code",{children:"config.yml"})," keep working without it."]}),C?e.jsx(ke,{onAddProvider:()=>{m(null),u(!0)},needsPricing:N,onEnablePricing:()=>l.mutate({default_pricing:!0}),enabling:l.isPending,secretKeyConfigured:P}):null,g&&P?e.jsx(ve,{onClose:()=>u(!1)}):null,b?e.jsx(ge,{provider:b,onClose:()=>m(null)}):null,!o&&c.length>0&&n.data&&n.data.total>0?e.jsx(ye,{healthy:n.data.healthy,degraded:n.data.degraded,total:n.data.total,checkedAt:n.data.checked_at}):null,C?null:e.jsx(oe,{ariaLabel:"Providers",columns:w,rows:c,getRowKey:r=>r.instance,isLoading:o,emptyContent:"No providers yet. Add your first provider to start serving models."})]})}export{Ae as ProvidersPage}; diff --git a/src/gateway/static/dashboard/assets/SettingsPage-CY71vadM.js b/src/gateway/static/dashboard/assets/SettingsPage-CxLaAuqf.js similarity index 99% rename from src/gateway/static/dashboard/assets/SettingsPage-CY71vadM.js rename to src/gateway/static/dashboard/assets/SettingsPage-CxLaAuqf.js index 102172102..64817c51a 100644 --- a/src/gateway/static/dashboard/assets/SettingsPage-CY71vadM.js +++ b/src/gateway/static/dashboard/assets/SettingsPage-CxLaAuqf.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{V as R,a9 as C,P,E as y,Z as E,ag as T,ah as _,ai as D,F as A,aj as O,a6 as F,ak as I,I as w}from"./index-Dhxz7Eyv.js";import{d as v,B as h,A as d,g as K,I as z}from"./heroui-DZj66Arc.js";function b(t,r){return{[t]:r}}function M(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function L(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||M(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(A,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function V({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function U({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(U,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function X({source:t}){const r=O(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:K({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(G,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function Z(){var o;const t=F(),r=I(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(X,{source:t}),e.jsx(Z,{})]})})]})}function Q({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function W(){const t=T(),r=_(),s=D(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(Q,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&L(l,n)),k=ee(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,t.isLoading?e.jsx(E,{}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(V,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(W,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,L as fieldMatches}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{V as R,a9 as C,P,E as y,Z as E,ag as T,ah as _,ai as D,F as A,aj as O,a6 as F,ak as I,I as w}from"./index-J9GltkCK.js";import{d as v,B as h,A as d,g as K,I as z}from"./heroui-DZj66Arc.js";function b(t,r){return{[t]:r}}function M(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function L(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||M(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(A,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function V({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function U({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(U,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function X({source:t}){const r=O(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:K({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(G,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function Z(){var o;const t=F(),r=I(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(X,{source:t}),e.jsx(Z,{})]})})]})}function Q({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function W(){const t=T(),r=_(),s=D(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(Q,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&L(l,n)),k=ee(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,t.isLoading?e.jsx(E,{}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(V,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(W,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,L as fieldMatches}; diff --git a/src/gateway/static/dashboard/assets/TablePagination-BYC0DnfO.js b/src/gateway/static/dashboard/assets/TablePagination-DQNDuKMr.js similarity index 98% rename from src/gateway/static/dashboard/assets/TablePagination-BYC0DnfO.js rename to src/gateway/static/dashboard/assets/TablePagination-DQNDuKMr.js index 01bc818f9..d91edca27 100644 --- a/src/gateway/static/dashboard/assets/TablePagination-BYC0DnfO.js +++ b/src/gateway/static/dashboard/assets/TablePagination-DQNDuKMr.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{I as w,E as M,F as D}from"./index-Dhxz7Eyv.js";import{A as o,B as x,T as F,L as $,I as T,S as y}from"./heroui-DZj66Arc.js";function _({label:t,value:r,onChange:a,isRequired:c,autoFocus:i}){return e.jsxs(F,{value:r,onChange:a,isRequired:c,className:"flex flex-col gap-1",children:[e.jsx($,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsx(T,{inputMode:"decimal",placeholder:"0.00",autoFocus:i})]})}function R(t){const r=t.trim();if(r==="")return null;const a=Number(r);return Number.isFinite(a)&&a>=0?a:Number.NaN}const C=t=>`Recompute cost for ${t.toLocaleString()} imported ${t===1?"row":"rows"} from each row's own token counts at these per-1M rates. Enforced gateway rows are never affected.`;function W({isOpen:t,onOpenChange:r,targetCount:a,isPending:c,error:i,onSubmit:E,title:I="Set price",description:L=C}){const[j,p]=u.useState(""),[n,h]=u.useState(""),[b,N]=u.useState(""),[f,v]=u.useState("");u.useEffect(()=>{t&&(p(""),h(""),N(""),v(""))},[t]);const m=R(j),l=R(n),d=R(b),s=R(f),g=m===null||Number.isNaN(m)||l===null||Number.isNaN(l)||Number.isNaN(d??0)||Number.isNaN(s??0),S=()=>{g||m===null||l===null||E({input_price_per_million:m,output_price_per_million:l,...d!==null&&!Number.isNaN(d)?{cache_read_price_per_million:d}:{},...s!==null&&!Number.isNaN(s)?{cache_write_price_per_million:s}:{}})};return e.jsx(o,{isOpen:t,onOpenChange:r,children:t?e.jsx(o.Backdrop,{children:e.jsx(o.Container,{placement:"center",size:"lg",children:e.jsxs(o.Dialog,{children:[e.jsx(o.Header,{children:e.jsx(o.Heading,{children:I})}),e.jsxs(o.Body,{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:L(a)}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(_,{label:"Input $ / 1M",value:j,onChange:p,isRequired:!0,autoFocus:!0}),e.jsx(_,{label:"Output $ / 1M",value:n,onChange:h,isRequired:!0}),e.jsx(_,{label:"Cache read $ / 1M",value:b,onChange:N}),e.jsx(_,{label:"Cache write $ / 1M",value:f,onChange:v})]}),e.jsx(w,{tone:"info",children:"Leave a cache rate blank to bill those tokens at the input rate."}),e.jsx(M,{error:i})]}),e.jsxs(o.Footer,{children:[e.jsx(x,{variant:"ghost",isDisabled:c,onPress:()=>r(!1),children:"Cancel"}),e.jsx(x,{variant:"primary",isDisabled:g,isPending:c,onPress:S,children:"Set price"})]})]})})}):null})}const P=[25,50,100];function q({page:t,pageSize:r,total:a,rowsOnPage:c,onPageChange:i,onPageSizeChange:E,pageSizeOptions:I=P,isFetching:L=!1,hasNextFallback:j=!1}){const p=u.useId(),n=a!=null?Math.max(1,Math.ceil(a/r)):null,h=t===0,b=n!=null?t>=n-1:!j,N=c>0?t*r+1:0,f=t*r+c,v=a!=null?a===0?"0 of 0":`${N.toLocaleString()}–${f.toLocaleString()} of ${a.toLocaleString()}`:c>0?`${N.toLocaleString()}–${f.toLocaleString()}`:"0",[m,l]=u.useState(String(t+1));u.useEffect(()=>{l(String(t+1))},[t]);const d=()=>{const s=Number.parseInt(m,10);if(Number.isNaN(s)){l(String(t+1));return}const g=n??Number.MAX_SAFE_INTEGER,S=Math.min(Math.max(s,1),g);S-1!==t?i(S-1):l(String(t+1))};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:p,className:"text-sm text-[var(--otari-muted)]",children:"Rows"}),e.jsx(D,{id:p,ariaLabel:"Rows per page",value:String(r),onChange:s=>E(Number.parseInt(s,10)),options:I.map(s=>({value:String(s),label:String(s)}))}),L?e.jsx(y,{size:"sm"}):null]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[var(--otari-muted)] tabular-nums",children:v}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"outline","aria-label":"First page",isDisabled:h,onPress:()=>i(0),children:"«"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Previous page",isDisabled:h,onPress:()=>i(t-1),children:"‹"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{"aria-label":"Page number",inputMode:"numeric",value:m,onChange:s=>l(s.target.value.replace(/[^0-9]/g,"")),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()},onBlur:d,className:"w-12 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-2 py-1 text-center text-sm text-[var(--otari-ink)] tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"}),n!=null?e.jsxs("span",{className:"tabular-nums",children:["/ ",n.toLocaleString()]}):null]}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Next page",isDisabled:b,onPress:()=>i(t+1),children:"›"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Last page",isDisabled:n==null||b,onPress:()=>n!=null&&i(n-1),children:"»"})]})]})]})}export{P,W as S,q as T}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{I as w,E as M,F as D}from"./index-J9GltkCK.js";import{A as o,B as x,T as F,L as $,I as T,S as y}from"./heroui-DZj66Arc.js";function _({label:t,value:r,onChange:a,isRequired:c,autoFocus:i}){return e.jsxs(F,{value:r,onChange:a,isRequired:c,className:"flex flex-col gap-1",children:[e.jsx($,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsx(T,{inputMode:"decimal",placeholder:"0.00",autoFocus:i})]})}function R(t){const r=t.trim();if(r==="")return null;const a=Number(r);return Number.isFinite(a)&&a>=0?a:Number.NaN}const C=t=>`Recompute cost for ${t.toLocaleString()} imported ${t===1?"row":"rows"} from each row's own token counts at these per-1M rates. Enforced gateway rows are never affected.`;function W({isOpen:t,onOpenChange:r,targetCount:a,isPending:c,error:i,onSubmit:E,title:I="Set price",description:L=C}){const[j,p]=u.useState(""),[n,h]=u.useState(""),[b,N]=u.useState(""),[f,v]=u.useState("");u.useEffect(()=>{t&&(p(""),h(""),N(""),v(""))},[t]);const m=R(j),l=R(n),d=R(b),s=R(f),g=m===null||Number.isNaN(m)||l===null||Number.isNaN(l)||Number.isNaN(d??0)||Number.isNaN(s??0),S=()=>{g||m===null||l===null||E({input_price_per_million:m,output_price_per_million:l,...d!==null&&!Number.isNaN(d)?{cache_read_price_per_million:d}:{},...s!==null&&!Number.isNaN(s)?{cache_write_price_per_million:s}:{}})};return e.jsx(o,{isOpen:t,onOpenChange:r,children:t?e.jsx(o.Backdrop,{children:e.jsx(o.Container,{placement:"center",size:"lg",children:e.jsxs(o.Dialog,{children:[e.jsx(o.Header,{children:e.jsx(o.Heading,{children:I})}),e.jsxs(o.Body,{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:L(a)}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(_,{label:"Input $ / 1M",value:j,onChange:p,isRequired:!0,autoFocus:!0}),e.jsx(_,{label:"Output $ / 1M",value:n,onChange:h,isRequired:!0}),e.jsx(_,{label:"Cache read $ / 1M",value:b,onChange:N}),e.jsx(_,{label:"Cache write $ / 1M",value:f,onChange:v})]}),e.jsx(w,{tone:"info",children:"Leave a cache rate blank to bill those tokens at the input rate."}),e.jsx(M,{error:i})]}),e.jsxs(o.Footer,{children:[e.jsx(x,{variant:"ghost",isDisabled:c,onPress:()=>r(!1),children:"Cancel"}),e.jsx(x,{variant:"primary",isDisabled:g,isPending:c,onPress:S,children:"Set price"})]})]})})}):null})}const P=[25,50,100];function q({page:t,pageSize:r,total:a,rowsOnPage:c,onPageChange:i,onPageSizeChange:E,pageSizeOptions:I=P,isFetching:L=!1,hasNextFallback:j=!1}){const p=u.useId(),n=a!=null?Math.max(1,Math.ceil(a/r)):null,h=t===0,b=n!=null?t>=n-1:!j,N=c>0?t*r+1:0,f=t*r+c,v=a!=null?a===0?"0 of 0":`${N.toLocaleString()}–${f.toLocaleString()} of ${a.toLocaleString()}`:c>0?`${N.toLocaleString()}–${f.toLocaleString()}`:"0",[m,l]=u.useState(String(t+1));u.useEffect(()=>{l(String(t+1))},[t]);const d=()=>{const s=Number.parseInt(m,10);if(Number.isNaN(s)){l(String(t+1));return}const g=n??Number.MAX_SAFE_INTEGER,S=Math.min(Math.max(s,1),g);S-1!==t?i(S-1):l(String(t+1))};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:p,className:"text-sm text-[var(--otari-muted)]",children:"Rows"}),e.jsx(D,{id:p,ariaLabel:"Rows per page",value:String(r),onChange:s=>E(Number.parseInt(s,10)),options:I.map(s=>({value:String(s),label:String(s)}))}),L?e.jsx(y,{size:"sm"}):null]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[var(--otari-muted)] tabular-nums",children:v}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"outline","aria-label":"First page",isDisabled:h,onPress:()=>i(0),children:"«"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Previous page",isDisabled:h,onPress:()=>i(t-1),children:"‹"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{"aria-label":"Page number",inputMode:"numeric",value:m,onChange:s=>l(s.target.value.replace(/[^0-9]/g,"")),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()},onBlur:d,className:"w-12 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-2 py-1 text-center text-sm text-[var(--otari-ink)] tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"}),n!=null?e.jsxs("span",{className:"tabular-nums",children:["/ ",n.toLocaleString()]}):null]}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Next page",isDisabled:b,onPress:()=>i(t+1),children:"›"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Last page",isDisabled:n==null||b,onPress:()=>n!=null&&i(n-1),children:"»"})]})]})]})}export{P,W as S,q as T}; diff --git a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-D_8zOvld.js b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-BW2tcG_F.js similarity index 99% rename from src/gateway/static/dashboard/assets/ToolsGuardrailsPage-D_8zOvld.js rename to src/gateway/static/dashboard/assets/ToolsGuardrailsPage-BW2tcG_F.js index c0603ec39..ef8d59529 100644 --- a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-D_8zOvld.js +++ b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-BW2tcG_F.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x}from"./react-dgEcD0HR.js";import{al as L,am as C,P,E,Z as R,T as w,an as D,F as M}from"./index-Dhxz7Eyv.js";import{d as N,B as g}from"./heroui-DZj66Arc.js";function U(s,t){return{[s]:t}}const B=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=x.useState(null),a=x.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function z({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",b="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[o,i]=x.useState(r),[m,p]=x.useState(null),c=D();x.useEffect(()=>{i(r)},[r]);const l=o.trim()!==r,d=o.trim(),h=m!==null&&m===d;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:o,disabled:n,placeholder:"unset",onChange:v=>{i(v.target.value),c.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!l,onPress:()=>t(d===""?null:d),children:"Save"}),e.jsx(g,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:d===""||c.isPending,onPress:()=>{p(d),c.mutate({service:s.service,url:d})},children:c.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:c.isPending||!h?null:c.error?e.jsx("span",{className:"text-red-700",children:w(c.error)}):c.data?e.jsx("span",{className:c.data.ok?"font-medium text-green-700":"text-red-700",children:c.data.reason}):null}),e.jsx(j,{message:a})]})]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[o,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=o!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:o,disabled:n,placeholder:"default",onChange:p=>i(p.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(o.trim()===""?null:o.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[o,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=o.trim(),p=Number(m),l=(m===""||Number.isInteger(p)&&p>=1)&&m!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:o,disabled:n,placeholder:"default",onChange:d=>i(d.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!l,onPress:()=>t(m===""?null:p),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(M,{ariaLabel:s.key,value:r,onChange:o=>t(o==="default"?null:o==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function O({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(F,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n})}function V(){const s=L(),t=C(),[a,n]=$(),[r,o]=x.useState({}),i=s.data,m=!i||t.isPending,p=new Map(((i==null?void 0:i.fields)??[]).map(l=>[l.key,l])),c=(l,d)=>{o(h=>{const{[l.key]:v,...u}=h;return u}),t.mutate(U(l.key,d),{onSuccess:()=>n(`${l.key} saved`),onError:h=>o(v=>({...v,[l.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(E,{error:s.error}),s.isLoading?e.jsx(R,{}):null,B.map(l=>{const d=l.order.map(u=>p.get(u)).filter(u=>u!==void 0),h=((i==null?void 0:i.fields)??[]).filter(u=>u.service===l.key&&!l.order.includes(u.key)),v=[...d,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:l.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:l.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(O,{field:u,onSave:T=>c(u,T),saveError:r[u.key],disabled:m},u.key))})})]},l.key)}),e.jsx(z,{message:a})]})}export{V as ToolsGuardrailsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x}from"./react-dgEcD0HR.js";import{al as L,am as C,P,E,Z as R,T as w,an as D,F as M}from"./index-J9GltkCK.js";import{d as N,B as g}from"./heroui-DZj66Arc.js";function U(s,t){return{[s]:t}}const B=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=x.useState(null),a=x.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function z({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",b="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[o,i]=x.useState(r),[m,p]=x.useState(null),c=D();x.useEffect(()=>{i(r)},[r]);const l=o.trim()!==r,d=o.trim(),h=m!==null&&m===d;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:o,disabled:n,placeholder:"unset",onChange:v=>{i(v.target.value),c.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!l,onPress:()=>t(d===""?null:d),children:"Save"}),e.jsx(g,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:d===""||c.isPending,onPress:()=>{p(d),c.mutate({service:s.service,url:d})},children:c.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:c.isPending||!h?null:c.error?e.jsx("span",{className:"text-red-700",children:w(c.error)}):c.data?e.jsx("span",{className:c.data.ok?"font-medium text-green-700":"text-red-700",children:c.data.reason}):null}),e.jsx(j,{message:a})]})]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[o,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=o!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:o,disabled:n,placeholder:"default",onChange:p=>i(p.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(o.trim()===""?null:o.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[o,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=o.trim(),p=Number(m),l=(m===""||Number.isInteger(p)&&p>=1)&&m!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:o,disabled:n,placeholder:"default",onChange:d=>i(d.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!l,onPress:()=>t(m===""?null:p),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(M,{ariaLabel:s.key,value:r,onChange:o=>t(o==="default"?null:o==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function O({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(F,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n})}function V(){const s=L(),t=C(),[a,n]=$(),[r,o]=x.useState({}),i=s.data,m=!i||t.isPending,p=new Map(((i==null?void 0:i.fields)??[]).map(l=>[l.key,l])),c=(l,d)=>{o(h=>{const{[l.key]:v,...u}=h;return u}),t.mutate(U(l.key,d),{onSuccess:()=>n(`${l.key} saved`),onError:h=>o(v=>({...v,[l.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(E,{error:s.error}),s.isLoading?e.jsx(R,{}):null,B.map(l=>{const d=l.order.map(u=>p.get(u)).filter(u=>u!==void 0),h=((i==null?void 0:i.fields)??[]).filter(u=>u.service===l.key&&!l.order.includes(u.key)),v=[...d,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:l.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:l.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(O,{field:u,onSave:T=>c(u,T),saveError:r[u.key],disabled:m},u.key))})})]},l.key)}),e.jsx(z,{message:a})]})}export{V as ToolsGuardrailsPage}; diff --git a/src/gateway/static/dashboard/assets/UsagePage-DTxN-kHP.js b/src/gateway/static/dashboard/assets/UsagePage-DTxN-kHP.js new file mode 100644 index 000000000..dbcd7690f --- /dev/null +++ b/src/gateway/static/dashboard/assets/UsagePage-DTxN-kHP.js @@ -0,0 +1 @@ +import{j as t}from"./tanstack-query-1t81HyiD.js";import{i as nt,r as u}from"./react-dgEcD0HR.js";import{u as lt,c as it,n as ie,i as ct,g as ce,ao as dt,$ as Q,ap as Ue,P as ut,E as mt,m as de,f as ht,R as vt,aq as $e,B as pt,a0 as B,a2 as V,a1 as me,a4 as Ee,ar as M,F as kt,h as _t,r as ft}from"./index-J9GltkCK.js";import{S as X,C as xt,T as yt}from"./charts-BI8Uczg4.js";import{D as gt}from"./DataTable-CrQq0sYf.js";import{F as bt}from"./FilterChips-BLdhUEZK.js";import{B as R,S as Le}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function J(l){return l.toLocaleString()}function jt(l){return l===null?"—":l<1e3?`${Math.round(l)} ms`:`${(l/1e3).toFixed(2)} s`}function St(l,f){const x=new Date(l);return Number.isNaN(x.getTime())?l:f==="hour"?x.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):x.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const Re=_t($e,Ue),ue=15,qe=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}],wt=[{value:"",label:"None"},{value:"model",label:"Model"},{value:"user_id",label:"User"},{value:"api_key_id",label:"API key"},{value:"source",label:"Source"}],Nt=[{key:"fresh",label:"Fresh input",color:"var(--otari-ink)"},{key:"cache_read",label:"Cache read",color:"var(--otari-brand)"},{key:"cache_write",label:"Cache write",color:"var(--otari-brand-soft)"},{key:"output",label:"Output",color:"var(--otari-brand-dark)"}],Ct=[{key:"success",label:"Succeeded",color:"var(--otari-brand)"},{key:"errors",label:"Failed",color:"var(--otari-danger)"}],Oe=["var(--otari-cat-1)","var(--otari-cat-2)","var(--otari-cat-3)","var(--otari-cat-4)","var(--otari-cat-5)","var(--otari-cat-6)","var(--otari-cat-7)","var(--otari-cat-8)"],Ft="var(--otari-cat-other)";function Tt(l){return l==="cost"?me:l==="tokens"?M:J}const Ae="__other__",Pe="__unknown__";function Et({dimensionLabel:l,rows:f,totalCost:x,emptyLabel:_,labelFor:q,onDrill:F,loading:E}){const[v,O]=u.useState(!1),D=v?f:f.slice(0,ue),I=f.length-D.length,ee=a=>a.is_other?Ae:a.key??Pe,z=[{id:"name",header:l,isRowHeader:!0,cell:a=>{const A=x>0?a.cost/x:0;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"truncate text-[var(--otari-ink)]",children:a.is_other?`Other (${a.requests.toLocaleString()} req)`:a.key===null?"(unknown)":(q==null?void 0:q(a.key))??a.key}),t.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:t.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,A*100)}%`}})})]})}},{id:"requests",header:"Requests",align:"end",cell:a=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:J(a.requests)})},{id:"tokens",header:"Tokens",align:"end",cell:a=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:M(a.tokens)})},{id:"spend",header:"Spend",align:"end",cell:a=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:me(a.cost)})}];return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(gt,{ariaLabel:`Spend by ${l.toLowerCase()}`,columns:z,rows:D,getRowKey:ee,isLoading:E,emptyContent:_,onRowAction:a=>{a!==Ae&&a!==Pe&&F(a)}}),!E&&I>0?t.jsxs(R,{size:"sm",variant:"ghost",onPress:()=>O(!0),children:["Show all ",f.length]}):null,!E&&v&&f.length>ue?t.jsxs(R,{size:"sm",variant:"ghost",onPress:()=>O(!1),children:["Show top ",ue]}):null]})}function Bt(){var Ne,Ce,Fe;const l=nt(),f=lt(),x=it(),[_,q]=u.useState(Re),[F,E]=u.useState(()=>ie(Re.seconds??0)),[v,O]=u.useState(!1),[D,I]=u.useState(),[ee,z]=u.useState(),[a,A]=u.useState(""),[y,te]=u.useState(""),[g,se]=u.useState(""),[m,Be]=u.useState("cost"),[p,Me]=u.useState(""),k=v?D:F,b=v?ee:void 0,S=v?k?ct(k,b):"day":_.bucket,w=u.useMemo(()=>({start_date:k,end_date:b,model:a.trim()||void 0,user_id:y||void 0,api_key_id:g||void 0}),[k,b,a,y,g]),K=u.useMemo(()=>{if(v){if(!k||!b)return null;const e=new Date(b).getTime()-new Date(k).getTime();return e>0?{...w,start_date:new Date(new Date(k).getTime()-e).toISOString(),end_date:k}:null}return!F||_.seconds===null?null:{...w,start_date:new Date(new Date(F).getTime()-_.seconds*1e3).toISOString(),end_date:F}},[v,k,b,w,_.seconds,F]),N=ce(w,S),he=ce(K??w,S,K!==null),L=dt(w,S,p||null),r=N.data,s=r==null?void 0:r.totals,c=K!==null?(Ne=he.data)==null?void 0:Ne.totals:void 0,ve=s?Q(s.cost,c==null?void 0:c.cost):null,De=u.useMemo(()=>({...w,model:void 0}),[w]),pe=ce(De,S),ae=((Fe=(Ce=pe.data)==null?void 0:Ce.by_model)==null?void 0:Fe.filter(e=>!e.is_other&&e.key!==null).map(e=>e.key))??[],ke=(f.data??[]).map(e=>({value:e.user_id,label:e.alias?`${e.alias} (${e.user_id})`:e.user_id})),oe=(x.data??[]).map(e=>({value:e.id,label:e.key_name??`${e.id.slice(0,8)}…`})),_e=e=>{var i;return((i=oe.find(d=>d.value===e))==null?void 0:i.label)??e},Ie=(a&&!ae.includes(a)?[a,...ae]:ae).map(e=>({value:e,label:e})),ze=v||_.key!==Ue,fe=!!(a.trim()||y||g||ze),xe=(e,i)=>{var d;return((d=e.find(o=>o.value===i))==null?void 0:d.label)??i},Ke=()=>{A(""),te(""),se("")},Ge=[...y?[{key:"user",label:"User",value:xe(ke,y),onClear:()=>te("")}]:[],...a.trim()?[{key:"model",label:"Model",value:a.trim(),onClear:()=>A("")}]:[],...g?[{key:"key",label:"API key",value:xe(oe,g),onClear:()=>se("")}]:[]],He=!!(r&&s&&s.request_count===0&&!fe),Ye=(r==null?void 0:r.start_date)??k,We=(r==null?void 0:r.end_date)??b,ye=e=>{O(!1),q(e),E(ie(e.seconds??0)),I(void 0),z(void 0)},Ze=(e,i)=>{O(!0),I(e),z(i)},Qe=()=>{v||E(ie(_.seconds??0)),N.refetch(),pe.refetch(),K!==null&&he.refetch(),p&&L.refetch()},G=e=>{const i=new URLSearchParams;k&&i.set("start_date",k),b&&i.set("end_date",b);for(const[d,o]of Object.entries(e))o&&i.set(d,o);l(`/activity?${i.toString()}`)},Ve=s&&s.request_count>0?s.error_count/s.request_count:0,ge=((r==null?void 0:r.by_source)??[]).filter(e=>!e.is_other).length>1,Xe=ge||p==="source",h=(r==null?void 0:r.series)??[],H=h.length>1,P=s==null?void 0:s.billed_input_tokens,Y=s===void 0?null:P!==void 0?P+s.completion_tokens:s.total_tokens,Je=c===void 0?null:c.billed_input_tokens!==void 0?c.billed_input_tokens+c.completion_tokens:c.total_tokens,W=P!==void 0&&P>0&&s?s.cache_read_tokens/P:null,be=(c==null?void 0:c.billed_input_tokens)!==void 0&&c.billed_input_tokens>0?c.cache_read_tokens/c.billed_input_tokens:void 0,je=e=>e.input_tokens!==void 0?e.input_tokens+(e.output_tokens??0):e.tokens,re=h.some(e=>(e.input_tokens??0)>0),Se=h.some(e=>(e.errors??0)>0),C=u.useMemo(()=>{var d;const e=h.map(o=>o.bucket_start);if(p){const o=L.data;if(!o)return{series:[],data:[]};const T=o.groups.map((n,j)=>({key:`g${j}`,label:n.is_other?"Other":n.key===null?"(unknown)":p==="api_key_id"?_e(n.key):n.key,color:n.is_other?Ft:Oe[j%Oe.length]})),Z=new Map(o.groups.map((n,j)=>[`${n.is_other}|${n.key}`,`g${j}`])),$=new Map(e.map(n=>[n,{x:n,...Object.fromEntries(T.map(j=>[j.key,0]))}]));for(const n of o.points){const j=Z.get(`${n.is_other}|${n.key}`),Te=$.get(n.bucket_start);!j||!Te||(Te[j]=m==="cost"?n.cost:m==="tokens"?n.tokens:n.requests)}return{series:T,data:[...$.values()]}}return m==="tokens"&&re?{series:Nt,data:h.map(o=>{const T=o.input_tokens??0,Z=o.cache_read_tokens??0,$=o.cache_write_tokens??0;return{x:o.bucket_start,fresh:Math.max(0,T-Z-$),cache_read:Z,cache_write:$,output:o.output_tokens??0}})}:m==="requests"&&Se?{series:Ct,data:h.map(o=>{const T=Math.min(o.errors??0,o.requests);return{x:o.bucket_start,success:o.requests-T,errors:T}})}:{series:[{key:m,label:((d=qe.find(o=>o.key===m))==null?void 0:d.label)??m,color:"var(--otari-brand)"}],data:h.map(o=>({x:o.bucket_start,[m]:m==="cost"?o.cost:m==="tokens"?je(o):o.requests}))}},[h,p,L.data,m,re,Se,x.data]),we=Tt(m),et=N.isLoading||!!p&&L.isLoading,tt=C.data.length?Math.max(...C.data.map(e=>C.series.reduce((i,d)=>i+(typeof e[d.key]=="number"?e[d.key]:0),0))):0,st=h.map(e=>e.bucket_start),at=(e,i)=>{const d=ft(st,e,i,S);d&&Ze(d.startIso,d.endIso)},ot=[{key:"model",label:"Model",rows:(r==null?void 0:r.by_model)??[],labelFor:void 0,drill:e=>G({model:e,user_id:y||void 0,api_key_id:g||void 0})},{key:"user",label:"User",rows:(r==null?void 0:r.by_user)??[],labelFor:void 0,drill:e=>G({user_id:e,model:a.trim()||void 0,api_key_id:g||void 0})},{key:"api_key",label:"API key",rows:(r==null?void 0:r.by_api_key)??[],labelFor:_e,drill:e=>G({api_key_id:e,model:a.trim()||void 0,user_id:y||void 0})},{key:"source",label:"Source",rows:(r==null?void 0:r.by_source)??[],labelFor:void 0,drill:e=>G({source:e,model:a.trim()||void 0,user_id:y||void 0,api_key_id:g||void 0})}],[ne,rt]=u.useState("model"),le=ot.filter(e=>e.key!=="source"||ge||ne==="source"),U=le.find(e=>e.key===ne)??le[0];return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(ut,{title:"Usage & analytics",description:"Spend, tokens, cache use, and request volume over time. Group the chart by model, user, key, or source, and click a breakdown row to drill into the request log."}),t.jsx(mt,{error:N.error??(p?L.error:null)}),t.jsxs(bt,{chips:Ge,onClearAll:Ke,start:$e.map(e=>t.jsx(R,{size:"sm",variant:!v&&_.key===e.key?"primary":"outline",onPress:()=>ye(e),children:e.label},e.key)),end:t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",ht(Ye,We)," · UTC"]}),t.jsx(vt,{onRefresh:Qe,isFetching:N.isFetching,updatedAt:N.dataUpdatedAt})]}),children:[t.jsx(de,{label:"User",value:y,onChange:te,options:ke,placeholder:"All users"}),t.jsx(de,{label:"Model",value:a,onChange:A,options:Ie,placeholder:"All models"}),t.jsx(de,{label:"API key",value:g,onChange:se,options:oe,placeholder:"All keys"})]}),He?t.jsx(pt,{title:"No usage yet",description:"Once the gateway serves requests, spend and volume appear here."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-5",children:[t.jsx(B,{label:"Tracked cost",value:s?me(s.cost):"—",hint:s?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t.jsx(V,{fraction:ve}),s.unpriced_requests?`${ve!==null?" · ":""}${J(s.unpriced_requests)} unpriced`:null]}):null,chart:H?t.jsx(X,{values:h.map(e=>e.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),t.jsx(B,{label:"Requests",value:s?J(s.request_count):"—",hint:s?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Ee(Ve)," errors",c?t.jsxs(t.Fragment,{children:[" · ",t.jsx(V,{fraction:Q(s.request_count,c.request_count)})]}):null]}):null,chart:H?t.jsx(X,{values:h.map(e=>e.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),t.jsx(B,{label:"Tokens (billed)",value:Y!==null?M(Y):"—",hint:Y!==null?t.jsx(V,{fraction:Q(Y,Je??void 0)}):null,chart:H?t.jsx(X,{values:h.map(je),ariaLabel:"Billed token trend over the selected window"}):void 0}),t.jsx(B,{label:"Cache hit rate",value:W!==null?Ee(W):"—",hint:s?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[W!==null&&be!==void 0?t.jsxs(t.Fragment,{children:[t.jsx(V,{fraction:Q(W,be)})," · "]}):null,M(s.cache_read_tokens)," read · ",M(s.cache_write_tokens)," written"]}):null,chart:H&&re?t.jsx(X,{values:h.map(e=>(e.input_tokens??0)>0?(e.cache_read_tokens??0)/(e.input_tokens??1):0),ariaLabel:"Cache hit rate trend over the selected window"}):void 0}),t.jsx(B,{label:"Avg latency",value:s?jt(s.avg_latency_ms):"—"})]}),t.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("div",{className:"inline-flex gap-1.5",children:qe.map(e=>t.jsx(R,{size:"sm",variant:m===e.key?"primary":"outline",onPress:()=>Be(e.key),children:e.label},e.key))}),t.jsxs("div",{className:"flex items-center gap-2",children:[v?t.jsx(R,{size:"sm",variant:"ghost",onPress:()=>ye(_),children:"Reset zoom"}):null,N.isFetching||p&&L.isFetching?t.jsx(Le,{size:"sm"}):null,t.jsx(kt,{ariaLabel:"Group by",value:p,onChange:e=>Me(e),options:wt.filter(e=>e.value!=="source"||Xe).map(e=>({value:e.value,label:e.value?`By ${e.label.toLowerCase()}`:"No grouping"}))})]})]}),t.jsx(xt,{series:C.series}),et?t.jsx("div",{className:"flex h-64 items-center justify-center",children:t.jsx(Le,{size:"sm"})}):C.data.length===0?t.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):t.jsxs("figure",{className:"flex flex-col gap-2",children:[t.jsx(yt,{data:C.data,series:C.series,formatValue:we,formatXTick:e=>St(e,S),ariaLabel:`${m} per ${S}${p?`, grouped by ${p}`:""}`,height:260,showYAxis:!0,showTotal:!0,onSelectRange:at}),t.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[we(tt)," peak · ",C.data.length," ",S==="hour"?"hours":"days"," (times in UTC) · drag across the chart to zoom"]})]})]}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Spend by ",U.label.toLowerCase()]}),t.jsx("div",{className:"inline-flex gap-1.5",children:le.map(e=>t.jsx(R,{size:"sm",variant:ne===e.key?"primary":"outline",onPress:()=>rt(e.key),children:e.label},e.key))})]}),t.jsx(Et,{dimensionLabel:U.label,rows:U.rows,totalCost:(s==null?void 0:s.cost)??0,emptyLabel:fe?"No usage matches these filters.":"No usage recorded yet.",labelFor:U.labelFor,onDrill:U.drill,loading:N.isLoading})]})]})]})}export{Bt as UsagePage}; diff --git a/src/gateway/static/dashboard/assets/UsagePage-r45FObnV.js b/src/gateway/static/dashboard/assets/UsagePage-r45FObnV.js deleted file mode 100644 index f8982e6c0..000000000 --- a/src/gateway/static/dashboard/assets/UsagePage-r45FObnV.js +++ /dev/null @@ -1 +0,0 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{i as at,r as u}from"./react-dgEcD0HR.js";import{u as ot,c as rt,n as le,i as nt,g as ie,ao as lt,$ as Q,ap as Ae,P as it,E as ct,aq as Ue,f as dt,R as ut,m as ce,B as mt,a0 as M,a2 as V,a1 as ue,a4 as Ee,ar as D,F as ht,h as vt,r as pt}from"./index-Dhxz7Eyv.js";import{S as X,C as kt,T as _t}from"./charts-BI8Uczg4.js";import{D as xt}from"./DataTable-CrQq0sYf.js";import{F as ft}from"./FilterChips-BlzD0qFP.js";import{B as F,S as Fe}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function J(l){return l.toLocaleString()}function gt(l){return l===null?"—":l<1e3?`${Math.round(l)} ms`:`${(l/1e3).toFixed(2)} s`}function yt(l,g){const y=new Date(l);return Number.isNaN(y.getTime())?l:g==="hour"?y.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):y.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const Le=vt(Ue,Ae),de=15,Re=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}],bt=[{value:"",label:"None"},{value:"model",label:"Model"},{value:"user_id",label:"User"},{value:"api_key_id",label:"API key"},{value:"source",label:"Source"}],jt=[{key:"fresh",label:"Fresh input",color:"var(--otari-ink)"},{key:"cache_read",label:"Cache read",color:"var(--otari-brand)"},{key:"cache_write",label:"Cache write",color:"var(--otari-brand-soft)"},{key:"output",label:"Output",color:"var(--otari-brand-dark)"}],St=[{key:"success",label:"Succeeded",color:"var(--otari-brand)"},{key:"errors",label:"Failed",color:"var(--otari-danger)"}],qe=["var(--otari-cat-1)","var(--otari-cat-2)","var(--otari-cat-3)","var(--otari-cat-4)","var(--otari-cat-5)","var(--otari-cat-6)","var(--otari-cat-7)","var(--otari-cat-8)"],wt="var(--otari-cat-other)";function Nt(l){return l==="cost"?ue:l==="tokens"?D:J}const Oe="__other__",Pe="__unknown__";function Ct({dimensionLabel:l,rows:g,totalCost:y,emptyLabel:_,labelFor:q,onDrill:T,loading:L}){const[v,O]=u.useState(!1),I=v?g:g.slice(0,de),z=g.length-I.length,ee=s=>s.is_other?Oe:s.key??Pe,K=[{id:"name",header:l,isRowHeader:!0,cell:s=>{const P=y>0?s.cost/y:0;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"truncate text-[var(--otari-ink)]",children:s.is_other?`Other (${s.requests.toLocaleString()} req)`:s.key===null?"(unknown)":(q==null?void 0:q(s.key))??s.key}),t.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:t.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,P*100)}%`}})})]})}},{id:"requests",header:"Requests",align:"end",cell:s=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:J(s.requests)})},{id:"tokens",header:"Tokens",align:"end",cell:s=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:D(s.tokens)})},{id:"spend",header:"Spend",align:"end",cell:s=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:ue(s.cost)})}];return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(xt,{ariaLabel:`Spend by ${l.toLowerCase()}`,columns:K,rows:I,getRowKey:ee,isLoading:L,emptyContent:_,onRowAction:s=>{s!==Oe&&s!==Pe&&T(s)}}),!L&&z>0?t.jsxs(F,{size:"sm",variant:"ghost",onPress:()=>O(!0),children:["Show all ",g.length]}):null,!L&&v&&g.length>de?t.jsxs(F,{size:"sm",variant:"ghost",onPress:()=>O(!1),children:["Show top ",de]}):null]})}function At(){var we,Ne,Ce;const l=at(),g=ot(),y=rt(),[_,q]=u.useState(Le),[T,L]=u.useState(()=>le(Le.seconds??0)),[v,O]=u.useState(!1),[I,z]=u.useState(),[ee,K]=u.useState(),[s,P]=u.useState(""),[x,te]=u.useState(""),[f,se]=u.useState(""),[m,$e]=u.useState("cost"),[k,Be]=u.useState(""),p=v?I:T,b=v?ee:void 0,S=v?p?nt(p,b):"day":_.bucket,w=u.useMemo(()=>({start_date:p,end_date:b,model:s.trim()||void 0,user_id:x||void 0,api_key_id:f||void 0}),[p,b,s,x,f]),G=u.useMemo(()=>{if(v){if(!p||!b)return null;const e=new Date(b).getTime()-new Date(p).getTime();return e>0?{...w,start_date:new Date(new Date(p).getTime()-e).toISOString(),end_date:p}:null}return!T||_.seconds===null?null:{...w,start_date:new Date(new Date(T).getTime()-_.seconds*1e3).toISOString(),end_date:T}},[v,p,b,w,_.seconds,T]),N=ie(w,S),me=ie(G??w,S,G!==null),R=lt(w,S,k||null),r=N.data,a=r==null?void 0:r.totals,c=G!==null?(we=me.data)==null?void 0:we.totals:void 0,he=a?Q(a.cost,c==null?void 0:c.cost):null,Me=u.useMemo(()=>({...w,model:void 0}),[w]),ve=ie(Me,S),ae=((Ce=(Ne=ve.data)==null?void 0:Ne.by_model)==null?void 0:Ce.filter(e=>!e.is_other&&e.key!==null).map(e=>e.key))??[],pe=(g.data??[]).map(e=>({value:e.user_id,label:e.alias?`${e.alias} (${e.user_id})`:e.user_id})),oe=(y.data??[]).map(e=>({value:e.id,label:e.key_name??`${e.id.slice(0,8)}…`})),ke=e=>{var i;return((i=oe.find(d=>d.value===e))==null?void 0:i.label)??e},De=(s&&!ae.includes(s)?[s,...ae]:ae).map(e=>({value:e,label:e})),Ie=v||_.key!==Ae,_e=!!(s.trim()||x||f||Ie),xe=(e,i)=>{var d;return((d=e.find(o=>o.value===i))==null?void 0:d.label)??i},ze=()=>{P(""),te(""),se("")},Ke=[...x?[{key:"user",label:"User",value:xe(pe,x),onClear:()=>te("")}]:[],...s.trim()?[{key:"model",label:"Model",value:s.trim(),onClear:()=>P("")}]:[],...f?[{key:"key",label:"API key",value:xe(oe,f),onClear:()=>se("")}]:[]],Ge=!!(r&&a&&a.request_count===0&&!_e),He=(r==null?void 0:r.start_date)??p,Ye=(r==null?void 0:r.end_date)??b,fe=e=>{O(!1),q(e),L(le(e.seconds??0)),z(void 0),K(void 0)},We=(e,i)=>{O(!0),z(e),K(i)},Ze=()=>{v||L(le(_.seconds??0)),N.refetch(),ve.refetch(),G!==null&&me.refetch(),k&&R.refetch()},A=e=>{const i=new URLSearchParams;p&&i.set("start_date",p),b&&i.set("end_date",b);for(const[d,o]of Object.entries(e))o&&i.set(d,o);l(`/activity?${i.toString()}`)},Qe=a&&a.request_count>0?a.error_count/a.request_count:0,h=(r==null?void 0:r.series)??[],H=h.length>1,U=a==null?void 0:a.billed_input_tokens,Y=a===void 0?null:U!==void 0?U+a.completion_tokens:a.total_tokens,Ve=c===void 0?null:c.billed_input_tokens!==void 0?c.billed_input_tokens+c.completion_tokens:c.total_tokens,W=U!==void 0&&U>0&&a?a.cache_read_tokens/U:null,ge=(c==null?void 0:c.billed_input_tokens)!==void 0&&c.billed_input_tokens>0?c.cache_read_tokens/c.billed_input_tokens:void 0,ye=e=>e.input_tokens!==void 0?e.input_tokens+(e.output_tokens??0):e.tokens,re=h.some(e=>(e.input_tokens??0)>0),be=h.some(e=>(e.errors??0)>0),C=u.useMemo(()=>{var d;const e=h.map(o=>o.bucket_start);if(k){const o=R.data;if(!o)return{series:[],data:[]};const E=o.groups.map((n,j)=>({key:`g${j}`,label:n.is_other?"Other":n.key===null?"(unknown)":k==="api_key_id"?ke(n.key):n.key,color:n.is_other?wt:qe[j%qe.length]})),Z=new Map(o.groups.map((n,j)=>[`${n.is_other}|${n.key}`,`g${j}`])),B=new Map(e.map(n=>[n,{x:n,...Object.fromEntries(E.map(j=>[j.key,0]))}]));for(const n of o.points){const j=Z.get(`${n.is_other}|${n.key}`),Te=B.get(n.bucket_start);!j||!Te||(Te[j]=m==="cost"?n.cost:m==="tokens"?n.tokens:n.requests)}return{series:E,data:[...B.values()]}}return m==="tokens"&&re?{series:jt,data:h.map(o=>{const E=o.input_tokens??0,Z=o.cache_read_tokens??0,B=o.cache_write_tokens??0;return{x:o.bucket_start,fresh:Math.max(0,E-Z-B),cache_read:Z,cache_write:B,output:o.output_tokens??0}})}:m==="requests"&&be?{series:St,data:h.map(o=>{const E=Math.min(o.errors??0,o.requests);return{x:o.bucket_start,success:o.requests-E,errors:E}})}:{series:[{key:m,label:((d=Re.find(o=>o.key===m))==null?void 0:d.label)??m,color:"var(--otari-brand)"}],data:h.map(o=>({x:o.bucket_start,[m]:m==="cost"?o.cost:m==="tokens"?ye(o):o.requests}))}},[h,k,R.data,m,re,be,y.data]),je=Nt(m),Xe=N.isLoading||!!k&&R.isLoading,Je=C.data.length?Math.max(...C.data.map(e=>C.series.reduce((i,d)=>i+(typeof e[d.key]=="number"?e[d.key]:0),0))):0,et=h.map(e=>e.bucket_start),tt=(e,i)=>{const d=pt(et,e,i,S);d&&We(d.startIso,d.endIso)},ne=[{key:"model",label:"Model",rows:(r==null?void 0:r.by_model)??[],labelFor:void 0,drill:e=>A({model:e,user_id:x||void 0,api_key_id:f||void 0})},{key:"user",label:"User",rows:(r==null?void 0:r.by_user)??[],labelFor:void 0,drill:e=>A({user_id:e,model:s.trim()||void 0,api_key_id:f||void 0})},{key:"api_key",label:"API key",rows:(r==null?void 0:r.by_api_key)??[],labelFor:ke,drill:e=>A({api_key_id:e,model:s.trim()||void 0,user_id:x||void 0})},{key:"source",label:"Source",rows:(r==null?void 0:r.by_source)??[],labelFor:void 0,drill:e=>A({source:e,model:s.trim()||void 0,user_id:x||void 0,api_key_id:f||void 0})}],[Se,st]=u.useState("model"),$=ne.find(e=>e.key===Se)??ne[0];return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(it,{title:"Usage & analytics",description:"Spend, tokens, cache use, and request volume over time. Group the chart by model, user, key, or source, and click a breakdown row to drill into the request log.",action:t.jsx(F,{size:"sm",variant:"outline",onPress:()=>A({model:s.trim()||void 0,user_id:x||void 0,api_key_id:f||void 0}),children:"Open activity log"})}),t.jsx(ct,{error:N.error??(k?R.error:null)}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Ue.map(e=>t.jsx(F,{size:"sm",variant:!v&&_.key===e.key?"primary":"outline",onPress:()=>fe(e),children:e.label},e.key)),t.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[t.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",dt(He,Ye)," · UTC"]}),t.jsx(ut,{onRefresh:Ze,isFetching:N.isFetching,updatedAt:N.dataUpdatedAt})]})]}),t.jsxs(ft,{chips:Ke,onClearAll:ze,children:[t.jsx(ce,{label:"User",value:x,onChange:te,options:pe,placeholder:"All users"}),t.jsx(ce,{label:"Model",value:s,onChange:P,options:De,placeholder:"All models"}),t.jsx(ce,{label:"API key",value:f,onChange:se,options:oe,placeholder:"All keys"})]})]}),Ge?t.jsx(mt,{title:"No usage yet",description:"Once the gateway serves requests, spend and volume appear here."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-5",children:[t.jsx(M,{label:"Tracked cost",value:a?ue(a.cost):"—",hint:a?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t.jsx(V,{fraction:he}),a.unpriced_requests?`${he!==null?" · ":""}${J(a.unpriced_requests)} unpriced`:null]}):null,chart:H?t.jsx(X,{values:h.map(e=>e.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),t.jsx(M,{label:"Requests",value:a?J(a.request_count):"—",hint:a?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Ee(Qe)," errors",c?t.jsxs(t.Fragment,{children:[" · ",t.jsx(V,{fraction:Q(a.request_count,c.request_count)})]}):null]}):null,chart:H?t.jsx(X,{values:h.map(e=>e.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),t.jsx(M,{label:"Tokens (billed)",value:Y!==null?D(Y):"—",hint:Y!==null?t.jsx(V,{fraction:Q(Y,Ve??void 0)}):null,chart:H?t.jsx(X,{values:h.map(ye),ariaLabel:"Billed token trend over the selected window"}):void 0}),t.jsx(M,{label:"Cache hit rate",value:W!==null?Ee(W):"—",hint:a?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[W!==null&&ge!==void 0?t.jsxs(t.Fragment,{children:[t.jsx(V,{fraction:Q(W,ge)})," · "]}):null,D(a.cache_read_tokens)," read · ",D(a.cache_write_tokens)," written"]}):null,chart:H&&re?t.jsx(X,{values:h.map(e=>(e.input_tokens??0)>0?(e.cache_read_tokens??0)/(e.input_tokens??1):0),ariaLabel:"Cache hit rate trend over the selected window"}):void 0}),t.jsx(M,{label:"Avg latency",value:a?gt(a.avg_latency_ms):"—"})]}),t.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("div",{className:"inline-flex gap-1.5",children:Re.map(e=>t.jsx(F,{size:"sm",variant:m===e.key?"primary":"outline",onPress:()=>$e(e.key),children:e.label},e.key))}),t.jsxs("div",{className:"flex items-center gap-2",children:[v?t.jsx(F,{size:"sm",variant:"ghost",onPress:()=>fe(_),children:"Reset zoom"}):null,N.isFetching||k&&R.isFetching?t.jsx(Fe,{size:"sm"}):null,t.jsx(ht,{ariaLabel:"Group by",value:k,onChange:e=>Be(e),options:bt.map(e=>({value:e.value,label:e.value?`By ${e.label.toLowerCase()}`:"No grouping"}))})]})]}),t.jsx(kt,{series:C.series}),Xe?t.jsx("div",{className:"flex h-64 items-center justify-center",children:t.jsx(Fe,{size:"sm"})}):C.data.length===0?t.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):t.jsxs("figure",{className:"flex flex-col gap-2",children:[t.jsx(_t,{data:C.data,series:C.series,formatValue:je,formatXTick:e=>yt(e,S),ariaLabel:`${m} per ${S}${k?`, grouped by ${k}`:""}`,height:260,showYAxis:!0,showTotal:!0,onSelectRange:tt}),t.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[je(Je)," peak · ",C.data.length," ",S==="hour"?"hours":"days"," (times in UTC) · drag across the chart to zoom"]})]})]}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Spend by ",$.label.toLowerCase()]}),t.jsx("div",{className:"inline-flex gap-1.5",children:ne.map(e=>t.jsx(F,{size:"sm",variant:Se===e.key?"primary":"outline",onPress:()=>st(e.key),children:e.label},e.key))})]}),t.jsx(Ct,{dimensionLabel:$.label,rows:$.rows,totalCost:(a==null?void 0:a.cost)??0,emptyLabel:_e?"No usage matches these filters.":"No usage recorded yet.",labelFor:$.labelFor,onDrill:$.drill,loading:N.isLoading})]})]})]})}export{At as UsagePage}; diff --git a/src/gateway/static/dashboard/assets/UsersPage-DJTKoEIl.js b/src/gateway/static/dashboard/assets/UsersPage-Dv0w97g2.js similarity index 98% rename from src/gateway/static/dashboard/assets/UsersPage-DJTKoEIl.js rename to src/gateway/static/dashboard/assets/UsersPage-Dv0w97g2.js index fbad4f6bb..a7a7ca417 100644 --- a/src/gateway/static/dashboard/assets/UsersPage-DJTKoEIl.js +++ b/src/gateway/static/dashboard/assets/UsersPage-Dv0w97g2.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r}from"./react-dgEcD0HR.js";import{u as Q,v as M,z as K,as as X,P as Y,E as A,B as Z,at as ee,F as se}from"./index-Dhxz7Eyv.js";import{u as te,r as ae,B as ne}from"./tableSelection-CojkFPwd.js";import{C as re}from"./ConfirmDialog-DawcDVEg.js";import{D as le}from"./DataTable-CrQq0sYf.js";import{F as D}from"./Field-DEJ6Wjg9.js";import{a as ie,M as R}from"./ModelScopeControl-Bs976Tb8.js";import{f as I,B as d,d as S,A as f}from"./heroui-DZj66Arc.js";const de=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return de.format(t)}const oe=t=>t.user_id,B=t=>t.startsWith("apikey-");function H(t){return t.split("-")[0]}function z(t){return t.name??H(t.budget_id)}function $({value:t,onChange:l,budgets:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>l(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),n.map(a=>e.jsxs("option",{value:a.budget_id,children:[z(a),a.max_budget===null?" · no limit":` · ${U(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function ce({onClose:t}){const l=ee(),n=M(),[a,i]=r.useState(""),[o,u]=r.useState(""),[c,g]=r.useState(null),[p,m]=r.useState(null),[b,j]=r.useState(!0),x=()=>{if(l.isPending||!b||a.trim()==="")return;const h={user_id:a.trim(),alias:o.trim()||null,budget_id:c,allowed_models:p};l.mutate(h,{onSuccess:t})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:l.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(D,{label:"User ID",value:a,onChange:i,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(D,{label:"Alias (optional)",value:o,onChange:u,placeholder:"Alice"})]}),e.jsx($,{value:c,onChange:g,budgets:n.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{m(h),j(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:l.isPending||!b||a.trim()==="",onPress:x,children:l.isPending?"Creating…":"Create user"}),e.jsx(d,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ue({user:t,onClose:l}){const n=K(),a=M(),[i,o]=r.useState(t.alias??""),[u,c]=r.useState(t.budget_id),[g,p]=r.useState(t.allowed_models),[m,b]=r.useState(!0),j=()=>{if(n.isPending||!m)return;const x={alias:i.trim()||null,budget_id:u,allowed_models:g};n.mutate({id:t.user_id,body:x},{onSuccess:l})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:n.error}),e.jsx(D,{label:"Alias",value:i,onChange:o,placeholder:"Alice"}),e.jsx($,{value:u,onChange:c,budgets:a.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(x,h)=>{p(x),b(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:n.isPending||!m,onPress:j,children:n.isPending?"Saving…":"Save changes"}),e.jsx(d,{variant:"ghost",onPress:l,children:"Cancel"})]})]})})}function ge({trigger:t,message:l,confirmLabel:n,isPending:a,onConfirm:i}){const[o,u]=r.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:l}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(d,{size:"sm",variant:"danger",isDisabled:a,onPress:i,children:n}),e.jsx(d,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>u(!1),children:"Cancel"})]})]}):e.jsx(d,{size:"sm",variant:"danger-soft",onPress:()=>u(!0),children:t})}function me({user:t}){return t.blocked?e.jsx(I,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(I,{size:"sm",color:"accent",children:"Active"})}function xe({allowed:t}){const{text:l,tone:n}=ie(t),a=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",i=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:i,children:l})}function he({isOpen:t,onOpenChange:l,budgets:n,count:a,isPending:i,error:o,onAssign:u}){const[c,g]=r.useState("");return r.useEffect(()=>{t&&g("")},[t]),e.jsx(f,{isOpen:t,onOpenChange:l,children:t?e.jsx(f.Backdrop,{children:e.jsx(f.Container,{placement:"center",size:"md",children:e.jsxs(f.Dialog,{children:[e.jsx(f.Header,{children:e.jsx(f.Heading,{children:"Assign budget"})}),e.jsxs(f.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Assign a budget to ",a," selected ",a===1?"user":"users","."]}),e.jsx(se,{label:"Budget",value:c,onChange:g,options:[{value:"",label:"Select a budget…"},...n.map(p=>({value:p.budget_id,label:z(p)}))]}),e.jsx(A,{error:o})]}),e.jsxs(f.Footer,{children:[e.jsx(d,{variant:"ghost",isDisabled:i,onPress:()=>l(!1),children:"Cancel"}),e.jsx(d,{variant:"primary",isDisabled:!c,isPending:i,onPress:()=>u(c),children:"Assign"})]})]})})}):null})}function Ae(){const t=Q(),l=M(),n=K(),a=X(),[i,o]=r.useState(!1),[u,c]=r.useState(null),[g,p]=r.useState(!1),m=t.data??[],b=t.isLoading,j=m.filter(s=>B(s.user_id)).length,x=g?m:m.filter(s=>!B(s.user_id)),h=m.find(s=>s.user_id===u)??null,C=!b&&x.length===0&&!i,P=r.useMemo(()=>new Map((l.data??[]).map(s=>[s.budget_id,s])),[l.data]),y=te(),[q,_]=r.useState(!1),[W,N]=r.useState(!1),[E,F]=r.useState(void 0),[T,L]=r.useState(!1),G=x.map(s=>s.user_id),v=ae(y.selectedKeys,G),O=r.useCallback((s,k)=>n.mutate({id:s.user_id,body:{blocked:k}}),[n.mutate]),V=async(s,k)=>{L(!0),F(void 0);try{for(const w of v)await s(w);y.clear(),k()}catch(w){F(w)}finally{L(!1)}},J=r.useMemo(()=>[{id:"user",header:"User",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-medium text-[var(--otari-ink)]",children:s.user_id}),B(s.user_id)?e.jsx(I,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})},{id:"status",header:"Status",cell:s=>e.jsx(me,{user:s})},{id:"budget",header:"Budget",cell:s=>s.budget_id?e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.budget_id,children:P.get(s.budget_id)?z(P.get(s.budget_id)):H(s.budget_id)}):e.jsx("span",{className:"text-[var(--otari-muted)]",children:"—"})},{id:"spend",header:"Spend",cell:s=>e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[U(s.spend),s.reserved>0?e.jsxs("span",{children:[" (+",U(s.reserved)," held)"]}):null]})},{id:"access",header:"Model access",cell:s=>e.jsx(xe,{allowed:s.allowed_models})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(d,{size:"sm",variant:"outline",isDisabled:n.isPending,onPress:()=>O(s,!s.blocked),children:s.blocked?"Unblock":"Block"}),e.jsx(d,{size:"sm",variant:"ghost",onPress:()=>{o(!1),c(s.user_id)},children:"Edit"}),e.jsx(ge,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})}],[P,n.isPending,a.isPending,a.mutate,O]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:i?null:e.jsx(d,{variant:"primary",onPress:()=>{c(null),o(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??n.error??a.error}),C?e.jsx(Z,{title:"No users yet",description:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page.",actionLabel:"Create your first user",onAction:()=>{c(null),o(!0)}}):null,j>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>p(s.target.checked)}),"Show auto-created (virtual) users (",j,")"]}):null,i?e.jsx(ce,{onClose:()=>o(!1)}):null,h?e.jsx(ue,{user:h,onClose:()=>c(null)},h.user_id):null,v.length>0?e.jsxs(ne,{selectedCount:v.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:y.clear,children:[e.jsx(d,{size:"sm",variant:"primary",onPress:()=>N(!0),children:"Assign budget"}),e.jsx(d,{size:"sm",variant:"danger",onPress:()=>_(!0),children:"Delete"})]}):null,C?null:e.jsx(le,{ariaLabel:"Users",columns:J,rows:x,getRowKey:oe,isLoading:b,emptyContent:"No users yet. Create one, or create an API key to auto-create one.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange}),e.jsx(re,{isOpen:q,onOpenChange:_,heading:"Delete users",body:`Delete ${v.length} ${v.length===1?"user":"users"}? This deactivates their API keys and hides them; usage history is preserved.`,confirmLabel:"Delete",isPending:T,error:E,onConfirm:()=>V(s=>a.mutateAsync(s),()=>_(!1))}),e.jsx(he,{isOpen:W,onOpenChange:N,budgets:l.data??[],count:v.length,isPending:T,error:E,onAssign:s=>V(k=>n.mutateAsync({id:k,body:{budget_id:s}}),()=>N(!1))})]})}export{Ae as UsersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r}from"./react-dgEcD0HR.js";import{u as Q,v as M,z as K,as as X,P as Y,E as A,B as Z,at as ee,F as se}from"./index-J9GltkCK.js";import{u as te,r as ae,B as ne}from"./tableSelection-CojkFPwd.js";import{C as re}from"./ConfirmDialog-D_qqCO_E.js";import{D as le}from"./DataTable-CrQq0sYf.js";import{F as D}from"./Field-DEJ6Wjg9.js";import{a as ie,M as R}from"./ModelScopeControl-BxqgiAHY.js";import{f as I,B as d,d as S,A as f}from"./heroui-DZj66Arc.js";const de=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return de.format(t)}const oe=t=>t.user_id,B=t=>t.startsWith("apikey-");function H(t){return t.split("-")[0]}function z(t){return t.name??H(t.budget_id)}function $({value:t,onChange:l,budgets:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>l(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),n.map(a=>e.jsxs("option",{value:a.budget_id,children:[z(a),a.max_budget===null?" · no limit":` · ${U(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function ce({onClose:t}){const l=ee(),n=M(),[a,i]=r.useState(""),[o,u]=r.useState(""),[c,g]=r.useState(null),[p,m]=r.useState(null),[b,j]=r.useState(!0),x=()=>{if(l.isPending||!b||a.trim()==="")return;const h={user_id:a.trim(),alias:o.trim()||null,budget_id:c,allowed_models:p};l.mutate(h,{onSuccess:t})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:l.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(D,{label:"User ID",value:a,onChange:i,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(D,{label:"Alias (optional)",value:o,onChange:u,placeholder:"Alice"})]}),e.jsx($,{value:c,onChange:g,budgets:n.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{m(h),j(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:l.isPending||!b||a.trim()==="",onPress:x,children:l.isPending?"Creating…":"Create user"}),e.jsx(d,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ue({user:t,onClose:l}){const n=K(),a=M(),[i,o]=r.useState(t.alias??""),[u,c]=r.useState(t.budget_id),[g,p]=r.useState(t.allowed_models),[m,b]=r.useState(!0),j=()=>{if(n.isPending||!m)return;const x={alias:i.trim()||null,budget_id:u,allowed_models:g};n.mutate({id:t.user_id,body:x},{onSuccess:l})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:n.error}),e.jsx(D,{label:"Alias",value:i,onChange:o,placeholder:"Alice"}),e.jsx($,{value:u,onChange:c,budgets:a.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(x,h)=>{p(x),b(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:n.isPending||!m,onPress:j,children:n.isPending?"Saving…":"Save changes"}),e.jsx(d,{variant:"ghost",onPress:l,children:"Cancel"})]})]})})}function ge({trigger:t,message:l,confirmLabel:n,isPending:a,onConfirm:i}){const[o,u]=r.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:l}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(d,{size:"sm",variant:"danger",isDisabled:a,onPress:i,children:n}),e.jsx(d,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>u(!1),children:"Cancel"})]})]}):e.jsx(d,{size:"sm",variant:"danger-soft",onPress:()=>u(!0),children:t})}function me({user:t}){return t.blocked?e.jsx(I,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(I,{size:"sm",color:"accent",children:"Active"})}function xe({allowed:t}){const{text:l,tone:n}=ie(t),a=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",i=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:i,children:l})}function he({isOpen:t,onOpenChange:l,budgets:n,count:a,isPending:i,error:o,onAssign:u}){const[c,g]=r.useState("");return r.useEffect(()=>{t&&g("")},[t]),e.jsx(f,{isOpen:t,onOpenChange:l,children:t?e.jsx(f.Backdrop,{children:e.jsx(f.Container,{placement:"center",size:"md",children:e.jsxs(f.Dialog,{children:[e.jsx(f.Header,{children:e.jsx(f.Heading,{children:"Assign budget"})}),e.jsxs(f.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Assign a budget to ",a," selected ",a===1?"user":"users","."]}),e.jsx(se,{label:"Budget",value:c,onChange:g,options:[{value:"",label:"Select a budget…"},...n.map(p=>({value:p.budget_id,label:z(p)}))]}),e.jsx(A,{error:o})]}),e.jsxs(f.Footer,{children:[e.jsx(d,{variant:"ghost",isDisabled:i,onPress:()=>l(!1),children:"Cancel"}),e.jsx(d,{variant:"primary",isDisabled:!c,isPending:i,onPress:()=>u(c),children:"Assign"})]})]})})}):null})}function Ae(){const t=Q(),l=M(),n=K(),a=X(),[i,o]=r.useState(!1),[u,c]=r.useState(null),[g,p]=r.useState(!1),m=t.data??[],b=t.isLoading,j=m.filter(s=>B(s.user_id)).length,x=g?m:m.filter(s=>!B(s.user_id)),h=m.find(s=>s.user_id===u)??null,C=!b&&x.length===0&&!i,P=r.useMemo(()=>new Map((l.data??[]).map(s=>[s.budget_id,s])),[l.data]),y=te(),[q,_]=r.useState(!1),[W,N]=r.useState(!1),[E,F]=r.useState(void 0),[T,L]=r.useState(!1),G=x.map(s=>s.user_id),v=ae(y.selectedKeys,G),O=r.useCallback((s,k)=>n.mutate({id:s.user_id,body:{blocked:k}}),[n.mutate]),V=async(s,k)=>{L(!0),F(void 0);try{for(const w of v)await s(w);y.clear(),k()}catch(w){F(w)}finally{L(!1)}},J=r.useMemo(()=>[{id:"user",header:"User",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-medium text-[var(--otari-ink)]",children:s.user_id}),B(s.user_id)?e.jsx(I,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})},{id:"status",header:"Status",cell:s=>e.jsx(me,{user:s})},{id:"budget",header:"Budget",cell:s=>s.budget_id?e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.budget_id,children:P.get(s.budget_id)?z(P.get(s.budget_id)):H(s.budget_id)}):e.jsx("span",{className:"text-[var(--otari-muted)]",children:"—"})},{id:"spend",header:"Spend",cell:s=>e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[U(s.spend),s.reserved>0?e.jsxs("span",{children:[" (+",U(s.reserved)," held)"]}):null]})},{id:"access",header:"Model access",cell:s=>e.jsx(xe,{allowed:s.allowed_models})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(d,{size:"sm",variant:"outline",isDisabled:n.isPending,onPress:()=>O(s,!s.blocked),children:s.blocked?"Unblock":"Block"}),e.jsx(d,{size:"sm",variant:"ghost",onPress:()=>{o(!1),c(s.user_id)},children:"Edit"}),e.jsx(ge,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})}],[P,n.isPending,a.isPending,a.mutate,O]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:i?null:e.jsx(d,{variant:"primary",onPress:()=>{c(null),o(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??n.error??a.error}),C?e.jsx(Z,{title:"No users yet",description:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page.",actionLabel:"Create your first user",onAction:()=>{c(null),o(!0)}}):null,j>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>p(s.target.checked)}),"Show auto-created (virtual) users (",j,")"]}):null,i?e.jsx(ce,{onClose:()=>o(!1)}):null,h?e.jsx(ue,{user:h,onClose:()=>c(null)},h.user_id):null,v.length>0?e.jsxs(ne,{selectedCount:v.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:y.clear,children:[e.jsx(d,{size:"sm",variant:"primary",onPress:()=>N(!0),children:"Assign budget"}),e.jsx(d,{size:"sm",variant:"danger",onPress:()=>_(!0),children:"Delete"})]}):null,C?null:e.jsx(le,{ariaLabel:"Users",columns:J,rows:x,getRowKey:oe,isLoading:b,emptyContent:"No users yet. Create one, or create an API key to auto-create one.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange}),e.jsx(re,{isOpen:q,onOpenChange:_,heading:"Delete users",body:`Delete ${v.length} ${v.length===1?"user":"users"}? This deactivates their API keys and hides them; usage history is preserved.`,confirmLabel:"Delete",isPending:T,error:E,onConfirm:()=>V(s=>a.mutateAsync(s),()=>_(!1))}),e.jsx(he,{isOpen:W,onOpenChange:N,budgets:l.data??[],count:v.length,isPending:T,error:E,onAssign:s=>V(k=>n.mutateAsync({id:k,body:{budget_id:s}}),()=>N(!1))})]})}export{Ae as UsersPage}; diff --git a/src/gateway/static/dashboard/assets/index-Dhxz7Eyv.js b/src/gateway/static/dashboard/assets/index-J9GltkCK.js similarity index 96% rename from src/gateway/static/dashboard/assets/index-Dhxz7Eyv.js rename to src/gateway/static/dashboard/assets/index-J9GltkCK.js index ec06f4b5e..8595fdce4 100644 --- a/src/gateway/static/dashboard/assets/index-Dhxz7Eyv.js +++ b/src/gateway/static/dashboard/assets/index-J9GltkCK.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-BSXD7oi2.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/charts-BI8Uczg4.js","assets/recharts-BwTTRGtj.js","assets/heroui-DZj66Arc.js","assets/tableSelection-CojkFPwd.js","assets/ConfirmDialog-DawcDVEg.js","assets/DataTable-CrQq0sYf.js","assets/FilterChips-BlzD0qFP.js","assets/TablePagination-BYC0DnfO.js","assets/AliasesPage-DFSg4QUS.js","assets/Field-DEJ6Wjg9.js","assets/UserComboBox-nt7pHfqn.js","assets/BudgetsPage-CnOzEeql.js","assets/DocsPage-CgRlIVtI.js","assets/KeysPage-HexHbKWR.js","assets/ModelScopeControl-Bs976Tb8.js","assets/ModelsPage-Cwjl8fM-.js","assets/OverviewPage-C0SW-na1.js","assets/ProvidersPage-17Tj43ca.js","assets/SettingsPage-CY71vadM.js","assets/ToolsGuardrailsPage-D_8zOvld.js","assets/UsagePage-r45FObnV.js","assets/UsersPage-DJTKoEIl.js"])))=>i.map(i=>d[i]); -var Ie=Object.defineProperty;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>qe(e,typeof t!="symbol"?t+"":t,r);import{u as g,j as n,a as p,b as x,k as z,Q as Re,c as Oe}from"./tanstack-query-1t81HyiD.js";import{d as Me,r as o,N as ee,L as Fe,O as Ue,H as Ke,e as Be,f as j,h as $e}from"./react-dgEcD0HR.js";import{B as C,C as K,L as xe,I as ye,a as ze,b as Qe,d as I,S as Ve,c as T,T as We,e as He}from"./heroui-DZj66Arc.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ge=Me();const Je="modulepreload",Ye=function(e){return"/"+e},ue={},P=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let u=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(r.map(y=>{if(y=Ye(y),y in ue)return;ue[y]=!0;const h=y.endsWith(".css"),b=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Je,h||(m.as="script"),m.crossOrigin="",m.href=y,f&&m.setAttribute("nonce",f),document.head.appendChild(m),h)return new Promise((N,M)=>{m.addEventListener("load",N),m.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};class L extends Error{constructor(r,s){super(s);ce(this,"status");this.name="ApiError",this.status=r}}let B=null;function de(e){B=e}async function te(e){try{const t=await e.json();if(typeof t.detail=="string")return t.detail;if(t.detail!=null)return JSON.stringify(t.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Xe(e){let t;try{t=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(t.status===401||t.status===403)return!1;if(!t.ok)throw new L(t.status,await te(t));return!0}async function Ze(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function l(e,t={}){const r=new Headers(t.headers);r.set("Accept","application/json"),t.body!=null&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let s;try{s=await fetch(e,{...t,headers:r})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(s.status===401||s.status===403)throw B==null||B(),new L(s.status,await te(s));if(!s.ok)throw new L(s.status,await te(s));if(s.status!==204)return await s.json()}const ne="otari.dashboard.hasSession",ve=o.createContext(null);function et(){try{return window.localStorage.getItem(ne)==="1"}catch{return!1}}function tt({children:e}){const t=g(),[r,s]=o.useState(et),a=o.useCallback(()=>{Ze(),s(!1),t.clear();try{window.localStorage.removeItem(ne)}catch{}},[t]),i=o.useCallback(()=>{t.clear(),s(!0);try{window.localStorage.setItem(ne,"1")}catch{}},[t]);o.useEffect(()=>(de(a),()=>de(null)),[a]);const u=o.useMemo(()=>({isAuthenticated:r,login:i,logout:a}),[r,i,a]);return n.jsx(ve.Provider,{value:u,children:e})}function re(){const e=o.useContext(ve);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function nt(e){return e instanceof L&&e.status===0}function rt(){const e=g(),[t,r]=o.useState(!1);return o.useEffect(()=>{const s=e.getQueryCache(),a=()=>s.getAll().some(i=>i.state.status==="error"&&nt(i.state.error));return r(a()),s.subscribe(()=>r(a()))},[e]),t}function st(){return rt()?n.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const Q=3600,_=86400,at=365*_,dn=[{key:"1h",label:"Last hour",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"90d",label:"90d",seconds:90*_,bucket:"day"},{key:"12mo",label:"12mo",seconds:at,bucket:"day"}],mn="30d",fn=[{key:"1h",label:"1h",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"all",label:"All",seconds:null,bucket:"day"}],hn="24h",xn="custom";function yn(e,t){return e.find(r=>r.key===t)}function it(e,t=Date.now()){return new Date(t-e*1e3).toISOString()}function ot(e){return(e==="hour"?Q:_)*1e3}function vn(e,t,r=Date.now()){const s=new Date(e).getTime();return(t?new Date(t).getTime():r)-s<=_*1e3?"hour":"day"}function gn(e,t,r,s){if(e.length===0)return null;const a=Math.max(0,Math.min(t,r)),i=Math.min(e.length-1,Math.max(t,r)),u=new Date(e[a]).getTime(),d=new Date(e[i]).getTime()+ot(s);return{startIso:new Date(u).toISOString(),endIso:new Date(d).toISOString()}}function pn(e,t,r){const s=e.length;if(s===0)return{startIndex:0,endIndex:0};const a=e.map(d=>new Date(d).getTime());let i=0;if(t){const d=new Date(t).getTime();for(let f=0;fl("/v1/models"),staleTime:6e4})}function dt(){return p({queryKey:[ct],queryFn:()=>l("/dashboard-build.json"),refetchInterval:ut,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function jn(){return p({queryKey:[ae],queryFn:()=>l("/v1/models/discoverable"),staleTime:5*6e4})}function Sn(){return p({queryKey:[ie],queryFn:()=>l("/v1/providers"),staleTime:5*6e4})}function kn(){return p({queryKey:["provider-catalog"],queryFn:()=>l("/v1/providers/catalog"),staleTime:1/0})}function En(e){return p({queryKey:["provider-catalog",e],queryFn:()=>l(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Pn(){return p({queryKey:[oe],queryFn:()=>l("/v1/providers/health"),staleTime:me,refetchInterval:me})}function Nn(){const e=g();return x({mutationFn:()=>l("/v1/providers/health?refresh=true"),onSuccess:t=>e.setQueryData([oe],t)})}function Cn(){return p({queryKey:[be],queryFn:()=>l("/v1/provider-credentials"),staleTime:6e4})}function W(e){e.invalidateQueries({queryKey:[be]}),e.invalidateQueries({queryKey:[ie]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]}),e.invalidateQueries({queryKey:[oe]})}function Tn(){const e=g();return x({mutationFn:t=>l("/v1/provider-credentials",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>W(e)})}function _n(){const e=g();return x({mutationFn:({instance:t,body:r})=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>W(e)})}function Ln(){const e=g();return x({mutationFn:t=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>W(e)})}function Dn(){const e=g();return x({mutationFn:()=>l("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>W(e)})}function An(){return x({mutationFn:e=>l(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function In(){return x({mutationFn:e=>l("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function qn(){return p({queryKey:[lt],queryFn:()=>l("/v1/models/metadata"),staleTime:10*6e4})}function Rn(){return p({queryKey:[se],queryFn:()=>l("/v1/aliases"),staleTime:6e4})}function On(){const e=g();return x({mutationFn:t=>l("/v1/aliases",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function Mn(){const e=g();return x({mutationFn:({name:t,userId:r})=>{const s=r==null?"":`?user_id=${encodeURIComponent(r)}`;return l(`/v1/aliases/${encodeURIComponent(t)}${s}`,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function mt(){return p({queryKey:[ge],queryFn:()=>l("/v1/settings"),staleTime:6e4})}function ft(){const e=g();return x({mutationFn:t=>l("/v1/settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([ge],t),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]})}})}function Fn(){return x({mutationFn:()=>l("/v1/settings/master-key/rotate",{method:"POST"})})}function Un(){return p({queryKey:[pe],queryFn:()=>l("/v1/tool-settings"),staleTime:6e4})}function Kn(){const e=g();return x({mutationFn:t=>l("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([pe],t)}})}function Bn(){return x({mutationFn:({service:e,url:t})=>l(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:t})})})}const G=1e3,ht=100;async function xt(){const e=[];for(let t=0;tl("/v1/pricing",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Qn(){const e=g();return x({mutationFn:t=>l(`/v1/pricing/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Vn(){return x({mutationFn:()=>l("/v1/pricing/refresh",{method:"POST"})})}function Wn(){const e=g();return x({mutationFn:()=>l("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ie]})}})}function Hn(){return x({mutationFn:()=>l("/v1/pricing/refresh/reject",{method:"POST"})})}const J=1e3,yt=100;async function vt(){const e=[];for(let t=0;tl("/v1/keys",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Yn(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Xn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Zn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}const Y=1e3,gt=100;async function pt(){const e=[];for(let t=0;tl(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function nr(){const e=g();return x({mutationFn:t=>l("/v1/budgets",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function rr(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function sr(){const e=g();return x({mutationFn:t=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}const X=1e3,bt=100;async function wt(){const e=[];for(let t=0;tl("/v1/users",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>le(e)})}function or(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>le(e)})}function lr(){const e=g();return x({mutationFn:t=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{le(e),e.invalidateQueries({queryKey:[R]})}})}function U(e){const t=new URLSearchParams;return e.start_date&&t.set("start_date",e.start_date),e.end_date&&t.set("end_date",e.end_date),e.status&&t.set("status",e.status),e.model&&t.set("model",e.model),e.endpoint&&t.set("endpoint",e.endpoint),e.user_id&&t.set("user_id",e.user_id),e.api_key_id&&t.set("api_key_id",e.api_key_id),e.source&&t.set("source",e.source),e.priced!==void 0&&t.set("priced",String(e.priced)),e.counts_toward_budget!==void 0&&t.set("counts_toward_budget",String(e.counts_toward_budget)),t}function cr(e,t,r){return p({queryKey:[q,"list",e,t,r],queryFn:()=>{const s=U(e);return s.set("skip",String(t*r)),s.set("limit",String(r)),l(`/v1/usage?${s.toString()}`)},placeholderData:z,staleTime:1e4})}function ur(e,t=!0){return p({queryKey:[q,"count",e],queryFn:()=>l(`/v1/usage/count?${U(e).toString()}`),enabled:t,placeholderData:z,staleTime:1e4})}const jt=6e4;function St(e,t=!0){return p({queryKey:[q,"count","failures",e],queryFn:()=>{const r={status:"error",source:"gateway",start_date:it(e)};return l(`/v1/usage/count?${U(r).toString()}`)},enabled:t,refetchInterval:jt,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function dr(){const e=g();return x({mutationFn:t=>l("/v1/usage",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}function mr(){const e=g();return x({mutationFn:t=>l("/v1/usage/set-price",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}function fr(e,t,r=!0){return p({queryKey:[q,"summary",e,t],queryFn:()=>{const s=U(e);return s.set("bucket",t),l(`/v1/usage/summary?${s.toString()}`)},enabled:r,placeholderData:z,staleTime:3e4})}function hr(e,t,r,s=!0){return p({queryKey:[q,"series",e,t,r],queryFn:()=>{const a=U(e);return a.set("bucket",t),a.set("group_by",r),l(`/v1/usage/series?${a.toString()}`)},enabled:s&&r!==null,placeholderData:z,staleTime:3e4})}function xr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function yr(e){if(e==null)return"$0.00";const t=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}function vr(e){if(e==null)return"—";if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){const t=Math.round(e/1e3);return t>=1e3?"1M":`${t}K`}return String(e)}const kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function gr(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})/.exec(e);if(!t)return e;const r=Number(t[2])-1;return r<0||r>11?t[1]:`${kt[r]} ${t[1]}`}const Et=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function pr(e){return Et.format(e)}function br(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Pt(e){return`${(e*100).toFixed(1)}%`}function wr(e,t){return t===void 0||t===0?null:(e-t)/t}function Nt(e,t=Date.now()){if(!e)return"never";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const s=Math.round((t-r.getTime())/1e3),a=s<0,i=Math.abs(s),u=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let d=i,f="second";for(const[h,b]of u){if(f=h,d0?"▲":e<0?"▼":"•";return n.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t," ",Pt(Math.abs(e))," vs prev"]})}function Ct(e){return e instanceof L||e instanceof Error?e.message:"Something went wrong."}function Tt({error:e}){return e?n.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:Ct(e)}):null}function _t({tone:e="info",children:t}){const r=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return n.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${r}`,children:t})}function kr({title:e,description:t,action:r}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),r?n.jsx("div",{className:"flex flex-wrap gap-2",children:r}):null]})}function Lt(e){const[t,r]=o.useState(()=>Date.now());return o.useEffect(()=>{let s;const a=()=>{s===void 0&&(s=setInterval(()=>r(Date.now()),e))},i=()=>{s!==void 0&&(clearInterval(s),s=void 0)},u=()=>{r(Date.now()),document.visibilityState==="visible"?a():i()};return u(),document.addEventListener("visibilitychange",u),()=>{i(),document.removeEventListener("visibilitychange",u)}},[e]),t}function Er({onRefresh:e,isFetching:t=!1,updatedAt:r,label:s="Refresh"}){const a=Lt(15e3),i=r?Nt(new Date(r).toISOString(),a):null;return n.jsxs("span",{className:"inline-flex items-center gap-2",children:[i?n.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Updated ",i]}):null,n.jsx(C,{variant:"outline",size:"sm",isIconOnly:!0,isDisabled:t,onPress:e,"aria-label":s,children:n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`h-4 w-4 ${t?"animate-spin":""}`,"aria-hidden":"true",children:[n.jsx("path",{d:"M20 11a8 8 0 1 0-.5 4",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M20 4v5h-5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function Pr({title:e,description:t,actionLabel:r,onAction:s,isActionDisabled:a,children:i}){return n.jsx(I,{children:n.jsxs(I.Content,{className:"flex flex-col gap-4 p-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),i,r&&s?n.jsx("div",{children:n.jsx(C,{variant:"primary",isDisabled:a,onPress:s,children:r})}):null]})})}function Nr({label:e="Loading…"}){return n.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 px-4 py-10 text-sm text-[var(--otari-muted)]",children:[n.jsx(Ve,{size:"sm"}),n.jsx("span",{children:e})]})}function Cr({children:e,confirmLabel:t,onConfirm:r,isPending:s}){const[a,i]=o.useState(!1);return a?n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(C,{size:"sm",variant:"danger",isDisabled:s,onPress:r,children:t}),n.jsx(C,{size:"sm",variant:"ghost",isDisabled:s,onPress:()=>i(!1),children:"Cancel"})]}):n.jsx(C,{size:"sm",variant:"danger-soft",onPress:()=>i(!0),children:e})}const Dt="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Tr({id:e,label:t,ariaLabel:r,value:s,onChange:a,options:i,children:u,disabled:d}){const f=o.useId(),y=e??(t?f:void 0),h=n.jsx("select",{id:y,"aria-label":t?void 0:r,value:s,disabled:d,onChange:b=>a(b.target.value),className:Dt,children:i?i.map(b=>n.jsx("option",{value:b.value,children:b.label},b.value)):u});return t?n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),h]}):h}function _r({label:e,value:t,onChange:r,options:s,placeholder:a,maxVisible:i=50,allowsCustom:u=!1}){const d=m=>{var N;return((N=s.find(M=>M.value===m))==null?void 0:N.label)??m},[f,y]=o.useState(()=>d(t));o.useEffect(()=>{y(d(t))},[t]);const h=f.trim().toLowerCase(),b=s.filter(m=>!h||m.value.toLowerCase().includes(h)||m.label.toLowerCase().includes(h)).slice(0,i);return n.jsxs(K.Root,{allowsEmptyCollection:!0,allowsCustomValue:u,menuTrigger:"focus",inputValue:f,onInputChange:m=>{y(m),u?r(m.trim()):m.trim()===""&&r("")},onSelectionChange:m=>{m!=null&&r(String(m))},className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),n.jsxs(K.InputGroup,{children:[n.jsx(ye,{placeholder:a,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),n.jsx(K.Trigger,{})]}),n.jsx(K.Popover,{children:n.jsx(ze,{items:b,className:"max-h-72 overflow-auto",children:m=>n.jsx(Qe,{id:m.value,textValue:m.label,children:m.label})})})]})}function At(){var f,y;const e=mt(),t=ft(),[r,s]=o.useState(!1),i=((f=e.data)==null?void 0:f.require_pricing)===!0&&e.data.default_pricing===!1&&!r,d=((y=St(Q,i).data)==null?void 0:y.total)??0;return i?n.jsx("div",{className:"shrink-0 px-6 pt-3",children:n.jsx(_t,{tone:"warning",children:n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("span",{children:["Requests are rejected until pricing is set (",n.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away.",d>0?n.jsxs(n.Fragment,{children:[" ",n.jsxs("strong",{className:"font-semibold",children:[d.toLocaleString()," ",d===1?"request":"requests"," failed in the last hour."]})," ",n.jsx(Fe,{to:"/activity?status=error&range=1h&source=gateway",className:"underline underline-offset-2",children:"View failed requests"})]}):null]}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(C,{size:"sm",variant:"primary",isDisabled:t.isPending,onPress:()=>t.mutate({default_pricing:!0}),children:t.isPending?"Enabling…":"Enable default pricing"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Dismiss"})]})]})})}):null}function It(){const{data:e}=dt(),t=o.useRef(null);return e&&t.current===null&&(t.current=e.build),e!=null&&t.current!=null&&e.build!==t.current}function qt(){const e=It(),[t,r]=o.useState(!1);return!e||t?null:n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:n.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),n.jsx(C,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>r(!0),children:"Later"})]})})}const je=200,Se=480,Z=240,Rt=60,ke="otari.dashboard.sidebarWidth",Ee="otari.dashboard.sidebarCollapsed",he=16,Pe="(max-width: 767px)",$=e=>Math.min(Se,Math.max(je,e));function Ot(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(Pe).matches}const Mt='a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ft(e){return e?Array.from(e.querySelectorAll(Mt)).filter(t=>t.offsetParent!==null||t===document.activeElement):[]}function Ut(){if(typeof window>"u")return Z;try{const e=window.localStorage.getItem(ke),t=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(t)?Z:$(t)}catch{return Z}}function Kt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ee)==="1"}catch{return!1}}const Bt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],$t=[{to:"/",section:"home",label:"Overview",end:!0,icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),n.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),n.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),n.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),n.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function zt(){const{logout:e}=re(),t=o.useRef(null),r=o.useRef(null),s=o.useRef(null),[a,i]=o.useState(Ut),[u,d]=o.useState(Kt),[f,y]=o.useState(!1),[h,b]=o.useState(Ot),[m,N]=o.useState(!1);o.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const c=window.matchMedia(Pe),v=w=>{b(w.matches),w.matches||N(!1)};return typeof c.addEventListener=="function"?(c.addEventListener("change",v),()=>c.removeEventListener("change",v)):(c.addListener(v),()=>c.removeListener(v))},[]),o.useEffect(()=>{if(!m)return;const c=v=>{v.key==="Escape"&&N(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[m]),o.useEffect(()=>{var c,v,w;h&&(m?(c=t.current)==null||c.focus():(v=t.current)!=null&&v.contains(document.activeElement)&&((w=s.current)==null||w.focus()))},[h,m]);const M=o.useCallback(c=>{if(c.key!=="Tab")return;const v=Ft(t.current);if(v.length===0)return;const w=v[0],k=v[v.length-1],F=document.activeElement;c.shiftKey&&(F===w||F===t.current)?(c.preventDefault(),k.focus()):!c.shiftKey&&F===k&&(c.preventDefault(),w.focus())},[]);o.useEffect(()=>{const c=window.setTimeout(()=>{try{window.localStorage.setItem(ke,String(Math.round(a)))}catch{}},200);return()=>window.clearTimeout(c)},[a]),o.useEffect(()=>{try{window.localStorage.setItem(Ee,u?"1":"0")}catch{}},[u]);const Ce=o.useCallback(c=>{c.preventDefault(),c.currentTarget.setPointerCapture(c.pointerId),y(!0)},[]),Te=o.useCallback(c=>{var w;if(!c.currentTarget.hasPointerCapture(c.pointerId))return;const v=((w=t.current)==null?void 0:w.getBoundingClientRect().left)??0;i($(c.clientX-v))},[]),_e=o.useCallback(c=>{c.currentTarget.hasPointerCapture(c.pointerId)&&c.currentTarget.releasePointerCapture(c.pointerId),y(!1)},[]),Le=o.useCallback(c=>{var v;c.preventDefault(),(v=r.current)==null||v.focus()},[]),De=o.useCallback(c=>{c.key==="ArrowLeft"?(c.preventDefault(),i(v=>$(v-he))):c.key==="ArrowRight"&&(c.preventDefault(),i(v=>$(v+he)))},[]),Ae=u?Rt:a,S=h?!1:u,H=h&&m?!0:void 0;return n.jsxs("div",{className:T("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[n.jsx("button",{type:"button",inert:H,onClick:Le,className:"sr-only focus:not-sr-only focus:absolute focus:top-3 focus:left-3 focus:z-50 focus:rounded-lg focus:border focus:border-[var(--otari-brand)] focus:bg-[var(--otari-surface)] focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-[var(--otari-brand-dark)] focus:shadow-md focus:outline-none",children:"Skip to main content"}),n.jsxs("header",{inert:H,className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("button",{type:"button",ref:s,onClick:()=>N(c=>!c),"aria-label":m?"Close navigation":"Open navigation","aria-expanded":m,"aria-controls":"app-sidebar",className:"-ml-1 flex h-8 w-8 items-center justify-center rounded-lg text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)] md:hidden",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5",children:n.jsx("path",{d:"M4 6h16M4 12h16M4 18h16",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),n.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),n.jsx(C,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),n.jsx(qt,{}),n.jsx(st,{}),n.jsx(At,{}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[h&&m?n.jsx("div",{"aria-hidden":"true",onClick:()=>N(!1),className:"fixed inset-0 z-30 bg-black/40 md:hidden"}):null,n.jsxs("aside",{ref:t,id:"app-sidebar",role:h?"dialog":void 0,"aria-modal":h&&m?!0:void 0,"aria-label":h?"Navigation":void 0,tabIndex:h?-1:void 0,inert:h&&!m?!0:void 0,onKeyDown:h&&m?M:void 0,style:h?void 0:{width:Ae},className:T("flex flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)] focus:outline-none",h?T("fixed inset-y-0 left-0 z-40 w-[17rem] shadow-xl transition-transform duration-200",m?"translate-x-0":"-translate-x-full"):T("relative shrink-0",!f&&"transition-[width] duration-150")),children:[n.jsx("button",{type:"button",onClick:()=>d(c=>!c),"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-pressed":u,title:u?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 hidden h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)] md:flex",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:T("h-3.5 w-3.5 transition-transform",u&&"rotate-180"),children:n.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("nav",{className:T("flex flex-col py-4",S?"px-2":"px-3"),children:Bt.map((c,v)=>{const w=$t.filter(k=>k.section===c.key);return w.length===0?null:n.jsxs("div",{className:v>0?"mt-4":void 0,children:[!S&&c.label?n.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:c.label}):null,v>0&&(S||!c.label)?n.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,n.jsx("div",{className:"flex flex-col gap-1",children:w.map(k=>n.jsxs(ee,{to:k.to,end:k.end,onClick:()=>N(!1),"aria-label":S?k.label:void 0,title:S?k.label:void 0,className:({isActive:F})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"justify-center px-0":"gap-3 px-3",F?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,S?null:k.label]},k.to))})]},c.key)})}),n.jsxs("div",{className:"mt-auto flex flex-col gap-1 pb-3",children:[n.jsxs(ee,{to:"/docs",onClick:()=>N(!1),"aria-label":S?"User guide":void 0,title:S?"User guide":void 0,className:({isActive:c})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"mx-2 justify-center px-0":"mx-3 gap-3 px-3",c?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[n.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.5V18c4 0 6.5.5 8 2 1.5-1.5 4-2 8-2V4.5c-4 0-6.5.5-8 2z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 6.5V20",strokeLinecap:"round"})]}),S?null:"User guide"]}),n.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai: the hosted Otari gateway",className:T("flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",S?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),S?null:n.jsxs("span",{className:"flex-1",children:["otari.ai ",n.jsx("span",{"aria-hidden":!0,children:"↗"})]})]})]}),u||h?null:n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(a),"aria-valuemin":je,"aria-valuemax":Se,tabIndex:0,onPointerDown:Ce,onPointerMove:Te,onPointerUp:_e,onKeyDown:De,className:T("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),n.jsx("main",{ref:r,id:"main-content",tabIndex:-1,inert:H,className:"flex-1 overflow-y-auto focus:outline-none",children:n.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-4 py-5 md:px-6 md:py-6",children:n.jsx(Ue,{})})})]})]})}function Qt(){const{login:e}=re(),[t,r]=o.useState(""),[s,a]=o.useState(null),[i,u]=o.useState(!1),d=async()=>{const f=t.trim();if(!(!f||i)){u(!0),a(null);try{await Xe(f)?e():a(new Error("Invalid master key."))}catch(y){a(y)}finally{u(!1)}}};return n.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:n.jsx(I,{className:"w-full max-w-md",children:n.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),n.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),d()},children:[n.jsxs(We,{value:t,onChange:f=>{r(f),s&&a(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),n.jsx(ye,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),n.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[n.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),n.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",n.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",n.jsx("code",{children:"Your master key:"})," (for example, run"," ",n.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),n.jsx(Tt,{error:s}),n.jsx(C,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!t.trim()||i,children:i?"Signing in…":"Sign in"})]}),n.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),n.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:n.jsx(He,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const Vt=o.lazy(async()=>({default:(await P(async()=>{const{ActivityPage:e}=await import("./ActivityPage-BSXD7oi2.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))).ActivityPage})),Wt=o.lazy(async()=>({default:(await P(async()=>{const{AliasesPage:e}=await import("./AliasesPage-DFSg4QUS.js");return{AliasesPage:e}},__vite__mapDeps([11,1,2,6,5,7,8,12,13]))).AliasesPage})),Ht=o.lazy(async()=>({default:(await P(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-CnOzEeql.js");return{BudgetsPage:e}},__vite__mapDeps([14,1,2,6,5,7,8,12]))).BudgetsPage})),Gt=o.lazy(async()=>({default:(await P(async()=>{const{DocsPage:e}=await import("./DocsPage-CgRlIVtI.js");return{DocsPage:e}},__vite__mapDeps([15,1,2,5]))).DocsPage})),Jt=o.lazy(async()=>({default:(await P(async()=>{const{KeysPage:e}=await import("./KeysPage-HexHbKWR.js");return{KeysPage:e}},__vite__mapDeps([16,1,2,6,5,7,8,12,17,13]))).KeysPage})),Yt=o.lazy(async()=>({default:(await P(async()=>{const{ModelsPage:e}=await import("./ModelsPage-Cwjl8fM-.js");return{ModelsPage:e}},__vite__mapDeps([18,1,2,6,5,8,10]))).ModelsPage})),Xt=o.lazy(async()=>({default:(await P(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-C0SW-na1.js");return{OverviewIndex:e}},__vite__mapDeps([19,1,2,3,4,5,8]))).OverviewIndex})),Zt=o.lazy(async()=>({default:(await P(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-17Tj43ca.js");return{ProvidersPage:e}},__vite__mapDeps([20,1,2,12,5,8]))).ProvidersPage})),en=o.lazy(async()=>({default:(await P(async()=>{const{SettingsPage:e}=await import("./SettingsPage-CY71vadM.js");return{SettingsPage:e}},__vite__mapDeps([21,1,2,5]))).SettingsPage})),tn=o.lazy(async()=>({default:(await P(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-D_8zOvld.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([22,1,2,5]))).ToolsGuardrailsPage})),nn=o.lazy(async()=>({default:(await P(async()=>{const{UsagePage:e}=await import("./UsagePage-r45FObnV.js");return{UsagePage:e}},__vite__mapDeps([23,1,2,3,4,5,8,9]))).UsagePage})),rn=o.lazy(async()=>({default:(await P(async()=>{const{UsersPage:e}=await import("./UsersPage-DJTKoEIl.js");return{UsersPage:e}},__vite__mapDeps([24,1,2,6,5,7,8,12,17]))).UsersPage}));function E(e){return n.jsx(o.Suspense,{fallback:n.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function sn(){const{isAuthenticated:e}=re();return e?n.jsx(Ke,{children:n.jsx(Be,{children:n.jsxs(j,{element:n.jsx(zt,{}),children:[n.jsx(j,{index:!0,element:E(n.jsx(Xt,{}))}),n.jsx(j,{path:"providers",element:E(n.jsx(Zt,{}))}),n.jsx(j,{path:"keys",element:E(n.jsx(Jt,{}))}),n.jsx(j,{path:"users",element:E(n.jsx(rn,{}))}),n.jsx(j,{path:"budgets",element:E(n.jsx(Ht,{}))}),n.jsx(j,{path:"activity",element:E(n.jsx(Vt,{}))}),n.jsx(j,{path:"usage",element:E(n.jsx(nn,{}))}),n.jsx(j,{path:"models",element:E(n.jsx(Yt,{}))}),n.jsx(j,{path:"aliases",element:E(n.jsx(Wt,{}))}),n.jsx(j,{path:"tools",element:E(n.jsx(tn,{}))}),n.jsx(j,{path:"settings",element:E(n.jsx(en,{}))}),n.jsx(j,{path:"docs",element:E(n.jsx(Gt,{}))}),n.jsx(j,{path:"*",element:n.jsx($e,{to:"/",replace:!0})})]})})}):n.jsx(Qt,{})}function an({children:e}){const[t]=o.useState(()=>new Re({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(r,s)=>s instanceof L&&(s.status===401||s.status===403)?!1:r<2}}}));return n.jsx(Oe,{client:t,children:n.jsx(tt,{children:e})})}const Ne=document.getElementById("root");if(!Ne)throw new Error("Root element #root not found");Ge.createRoot(Ne).render(n.jsx(o.StrictMode,{children:n.jsx(an,{children:n.jsx(sn,{})})}));export{wr as $,hn as A,Pr as B,xn as C,tr as D,Tt as E,Tr as F,Yn as G,Xn as H,_t as I,Zn as J,Jn as K,wn as L,$n as M,qn as N,zn as O,kr as P,vr as Q,Er as R,Qn as S,Ct as T,gr as U,mt as V,yr as W,Sn as X,at as Y,Nr as Z,Pn as _,ot as a,jr as a0,pr as a1,Sr as a2,xr as a3,Pt as a4,Nt as a5,Cn as a6,Ln as a7,An as a8,ft as a9,_n as aa,Nn as ab,Tn as ac,En as ad,kn as ae,In as af,Vn as ag,Wn as ah,Hn as ai,Fn as aj,Dn as ak,Un as al,Kn as am,Bn as an,hr as ao,mn as ap,dn as aq,br as ar,lr as as,ir as at,pn as b,Gn as c,cr as d,ur as e,bn as f,fr as g,yn as h,vn as i,dr as j,mr as k,fn as l,_r as m,it as n,jn as o,Rn as p,Mn as q,gn as r,Cr as s,On as t,ar as u,er as v,nr as w,rr as x,sr as y,or as z}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-8oLlQRnK.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/charts-BI8Uczg4.js","assets/recharts-BwTTRGtj.js","assets/heroui-DZj66Arc.js","assets/tableSelection-CojkFPwd.js","assets/ConfirmDialog-D_qqCO_E.js","assets/DataTable-CrQq0sYf.js","assets/FilterChips-BLdhUEZK.js","assets/TablePagination-DQNDuKMr.js","assets/AliasesPage-YWTK3fom.js","assets/Field-DEJ6Wjg9.js","assets/UserComboBox-nt7pHfqn.js","assets/BudgetsPage-DzpynNOp.js","assets/DocsPage-epKnwcXd.js","assets/KeysPage-qur9pZ8W.js","assets/ModelScopeControl-BxqgiAHY.js","assets/ModelsPage-jrY_FD2Z.js","assets/OverviewPage-CE2kZBwW.js","assets/ProvidersPage-BNd38xmH.js","assets/SettingsPage-CxLaAuqf.js","assets/ToolsGuardrailsPage-BW2tcG_F.js","assets/UsagePage-DTxN-kHP.js","assets/UsersPage-Dv0w97g2.js"])))=>i.map(i=>d[i]); +var Ie=Object.defineProperty;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>qe(e,typeof t!="symbol"?t+"":t,r);import{u as g,j as n,a as p,b as x,k as z,Q as Re,c as Oe}from"./tanstack-query-1t81HyiD.js";import{d as Me,r as o,N as ee,L as Fe,O as Ue,H as Ke,e as Be,f as j,h as $e}from"./react-dgEcD0HR.js";import{B as C,C as K,L as xe,I as ye,a as ze,b as Qe,d as I,S as Ve,c as T,T as We,e as He}from"./heroui-DZj66Arc.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ge=Me();const Je="modulepreload",Ye=function(e){return"/"+e},ue={},P=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let u=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(r.map(y=>{if(y=Ye(y),y in ue)return;ue[y]=!0;const h=y.endsWith(".css"),b=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Je,h||(m.as="script"),m.crossOrigin="",m.href=y,f&&m.setAttribute("nonce",f),document.head.appendChild(m),h)return new Promise((N,M)=>{m.addEventListener("load",N),m.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};class L extends Error{constructor(r,s){super(s);ce(this,"status");this.name="ApiError",this.status=r}}let B=null;function de(e){B=e}async function te(e){try{const t=await e.json();if(typeof t.detail=="string")return t.detail;if(t.detail!=null)return JSON.stringify(t.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Xe(e){let t;try{t=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(t.status===401||t.status===403)return!1;if(!t.ok)throw new L(t.status,await te(t));return!0}async function Ze(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function l(e,t={}){const r=new Headers(t.headers);r.set("Accept","application/json"),t.body!=null&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let s;try{s=await fetch(e,{...t,headers:r})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(s.status===401||s.status===403)throw B==null||B(),new L(s.status,await te(s));if(!s.ok)throw new L(s.status,await te(s));if(s.status!==204)return await s.json()}const ne="otari.dashboard.hasSession",ve=o.createContext(null);function et(){try{return window.localStorage.getItem(ne)==="1"}catch{return!1}}function tt({children:e}){const t=g(),[r,s]=o.useState(et),a=o.useCallback(()=>{Ze(),s(!1),t.clear();try{window.localStorage.removeItem(ne)}catch{}},[t]),i=o.useCallback(()=>{t.clear(),s(!0);try{window.localStorage.setItem(ne,"1")}catch{}},[t]);o.useEffect(()=>(de(a),()=>de(null)),[a]);const u=o.useMemo(()=>({isAuthenticated:r,login:i,logout:a}),[r,i,a]);return n.jsx(ve.Provider,{value:u,children:e})}function re(){const e=o.useContext(ve);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function nt(e){return e instanceof L&&e.status===0}function rt(){const e=g(),[t,r]=o.useState(!1);return o.useEffect(()=>{const s=e.getQueryCache(),a=()=>s.getAll().some(i=>i.state.status==="error"&&nt(i.state.error));return r(a()),s.subscribe(()=>r(a()))},[e]),t}function st(){return rt()?n.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const Q=3600,_=86400,at=365*_,dn=[{key:"1h",label:"Last hour",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"90d",label:"90d",seconds:90*_,bucket:"day"},{key:"12mo",label:"12mo",seconds:at,bucket:"day"}],mn="30d",fn=[{key:"1h",label:"1h",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:_,bucket:"hour"},{key:"7d",label:"7d",seconds:7*_,bucket:"day"},{key:"30d",label:"30d",seconds:30*_,bucket:"day"},{key:"all",label:"All",seconds:null,bucket:"day"}],hn="24h",xn="custom";function yn(e,t){return e.find(r=>r.key===t)}function it(e,t=Date.now()){return new Date(t-e*1e3).toISOString()}function ot(e){return(e==="hour"?Q:_)*1e3}function vn(e,t,r=Date.now()){const s=new Date(e).getTime();return(t?new Date(t).getTime():r)-s<=_*1e3?"hour":"day"}function gn(e,t,r,s){if(e.length===0)return null;const a=Math.max(0,Math.min(t,r)),i=Math.min(e.length-1,Math.max(t,r)),u=new Date(e[a]).getTime(),d=new Date(e[i]).getTime()+ot(s);return{startIso:new Date(u).toISOString(),endIso:new Date(d).toISOString()}}function pn(e,t,r){const s=e.length;if(s===0)return{startIndex:0,endIndex:0};const a=e.map(d=>new Date(d).getTime());let i=0;if(t){const d=new Date(t).getTime();for(let f=0;fl("/v1/models"),staleTime:6e4})}function dt(){return p({queryKey:[ct],queryFn:()=>l("/dashboard-build.json"),refetchInterval:ut,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function jn(){return p({queryKey:[ae],queryFn:()=>l("/v1/models/discoverable"),staleTime:5*6e4})}function Sn(){return p({queryKey:[ie],queryFn:()=>l("/v1/providers"),staleTime:5*6e4})}function kn(){return p({queryKey:["provider-catalog"],queryFn:()=>l("/v1/providers/catalog"),staleTime:1/0})}function En(e){return p({queryKey:["provider-catalog",e],queryFn:()=>l(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Pn(){return p({queryKey:[oe],queryFn:()=>l("/v1/providers/health"),staleTime:me,refetchInterval:me})}function Nn(){const e=g();return x({mutationFn:()=>l("/v1/providers/health?refresh=true"),onSuccess:t=>e.setQueryData([oe],t)})}function Cn(){return p({queryKey:[be],queryFn:()=>l("/v1/provider-credentials"),staleTime:6e4})}function W(e){e.invalidateQueries({queryKey:[be]}),e.invalidateQueries({queryKey:[ie]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]}),e.invalidateQueries({queryKey:[oe]})}function Tn(){const e=g();return x({mutationFn:t=>l("/v1/provider-credentials",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>W(e)})}function _n(){const e=g();return x({mutationFn:({instance:t,body:r})=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>W(e)})}function Ln(){const e=g();return x({mutationFn:t=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>W(e)})}function Dn(){const e=g();return x({mutationFn:()=>l("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>W(e)})}function An(){return x({mutationFn:e=>l(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function In(){return x({mutationFn:e=>l("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function qn(){return p({queryKey:[lt],queryFn:()=>l("/v1/models/metadata"),staleTime:10*6e4})}function Rn(){return p({queryKey:[se],queryFn:()=>l("/v1/aliases"),staleTime:6e4})}function On(){const e=g();return x({mutationFn:t=>l("/v1/aliases",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function Mn(){const e=g();return x({mutationFn:({name:t,userId:r})=>{const s=r==null?"":`?user_id=${encodeURIComponent(r)}`;return l(`/v1/aliases/${encodeURIComponent(t)}${s}`,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function mt(){return p({queryKey:[ge],queryFn:()=>l("/v1/settings"),staleTime:6e4})}function ft(){const e=g();return x({mutationFn:t=>l("/v1/settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([ge],t),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]})}})}function Fn(){return x({mutationFn:()=>l("/v1/settings/master-key/rotate",{method:"POST"})})}function Un(){return p({queryKey:[pe],queryFn:()=>l("/v1/tool-settings"),staleTime:6e4})}function Kn(){const e=g();return x({mutationFn:t=>l("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([pe],t)}})}function Bn(){return x({mutationFn:({service:e,url:t})=>l(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:t})})})}const G=1e3,ht=100;async function xt(){const e=[];for(let t=0;tl("/v1/pricing",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Qn(){const e=g();return x({mutationFn:t=>l(`/v1/pricing/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Vn(){return x({mutationFn:()=>l("/v1/pricing/refresh",{method:"POST"})})}function Wn(){const e=g();return x({mutationFn:()=>l("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ie]})}})}function Hn(){return x({mutationFn:()=>l("/v1/pricing/refresh/reject",{method:"POST"})})}const J=1e3,yt=100;async function vt(){const e=[];for(let t=0;tl("/v1/keys",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Yn(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Xn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Zn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}const Y=1e3,gt=100;async function pt(){const e=[];for(let t=0;tl(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function nr(){const e=g();return x({mutationFn:t=>l("/v1/budgets",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function rr(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function sr(){const e=g();return x({mutationFn:t=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}const X=1e3,bt=100;async function wt(){const e=[];for(let t=0;tl("/v1/users",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>le(e)})}function or(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>le(e)})}function lr(){const e=g();return x({mutationFn:t=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{le(e),e.invalidateQueries({queryKey:[R]})}})}function U(e){const t=new URLSearchParams;return e.start_date&&t.set("start_date",e.start_date),e.end_date&&t.set("end_date",e.end_date),e.status&&t.set("status",e.status),e.model&&t.set("model",e.model),e.endpoint&&t.set("endpoint",e.endpoint),e.user_id&&t.set("user_id",e.user_id),e.api_key_id&&t.set("api_key_id",e.api_key_id),e.source&&t.set("source",e.source),e.priced!==void 0&&t.set("priced",String(e.priced)),e.counts_toward_budget!==void 0&&t.set("counts_toward_budget",String(e.counts_toward_budget)),t}function cr(e,t,r){return p({queryKey:[q,"list",e,t,r],queryFn:()=>{const s=U(e);return s.set("skip",String(t*r)),s.set("limit",String(r)),l(`/v1/usage?${s.toString()}`)},placeholderData:z,staleTime:1e4})}function ur(e,t=!0){return p({queryKey:[q,"count",e],queryFn:()=>l(`/v1/usage/count?${U(e).toString()}`),enabled:t,placeholderData:z,staleTime:1e4})}const jt=6e4;function St(e,t=!0){return p({queryKey:[q,"count","failures",e],queryFn:()=>{const r={status:"error",source:"gateway",start_date:it(e)};return l(`/v1/usage/count?${U(r).toString()}`)},enabled:t,refetchInterval:jt,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function dr(){const e=g();return x({mutationFn:t=>l("/v1/usage",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}function mr(){const e=g();return x({mutationFn:t=>l("/v1/usage/set-price",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}function fr(e,t,r=!0){return p({queryKey:[q,"summary",e,t],queryFn:()=>{const s=U(e);return s.set("bucket",t),l(`/v1/usage/summary?${s.toString()}`)},enabled:r,placeholderData:z,staleTime:3e4})}function hr(e,t,r,s=!0){return p({queryKey:[q,"series",e,t,r],queryFn:()=>{const a=U(e);return a.set("bucket",t),a.set("group_by",r),l(`/v1/usage/series?${a.toString()}`)},enabled:s&&r!==null,placeholderData:z,staleTime:3e4})}function xr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function yr(e){if(e==null)return"$0.00";const t=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}function vr(e){if(e==null)return"—";if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){const t=Math.round(e/1e3);return t>=1e3?"1M":`${t}K`}return String(e)}const kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function gr(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})/.exec(e);if(!t)return e;const r=Number(t[2])-1;return r<0||r>11?t[1]:`${kt[r]} ${t[1]}`}const Et=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function pr(e){return Et.format(e)}function br(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Pt(e){return`${(e*100).toFixed(1)}%`}function wr(e,t){return t===void 0||t===0?null:(e-t)/t}function Nt(e,t=Date.now()){if(!e)return"never";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const s=Math.round((t-r.getTime())/1e3),a=s<0,i=Math.abs(s),u=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let d=i,f="second";for(const[h,b]of u){if(f=h,d0?"▲":e<0?"▼":"•";return n.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t," ",Pt(Math.abs(e))," vs prev"]})}function Ct(e){return e instanceof L||e instanceof Error?e.message:"Something went wrong."}function Tt({error:e}){return e?n.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:Ct(e)}):null}function _t({tone:e="info",children:t}){const r=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return n.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${r}`,children:t})}function kr({title:e,description:t,action:r}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),r?n.jsx("div",{className:"flex flex-wrap gap-2",children:r}):null]})}function Lt(e){const[t,r]=o.useState(()=>Date.now());return o.useEffect(()=>{let s;const a=()=>{s===void 0&&(s=setInterval(()=>r(Date.now()),e))},i=()=>{s!==void 0&&(clearInterval(s),s=void 0)},u=()=>{r(Date.now()),document.visibilityState==="visible"?a():i()};return u(),document.addEventListener("visibilitychange",u),()=>{i(),document.removeEventListener("visibilitychange",u)}},[e]),t}function Er({onRefresh:e,isFetching:t=!1,updatedAt:r,label:s="Refresh"}){const a=Lt(15e3),i=r?Nt(new Date(r).toISOString(),a):null;return n.jsxs("span",{className:"inline-flex items-center gap-2",children:[i?n.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Updated ",i]}):null,n.jsx(C,{variant:"outline",size:"sm",isIconOnly:!0,isDisabled:t,onPress:e,"aria-label":s,children:n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`h-4 w-4 ${t?"animate-spin":""}`,"aria-hidden":"true",children:[n.jsx("path",{d:"M20 11a8 8 0 1 0-.5 4",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M20 4v5h-5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function Pr({title:e,description:t,actionLabel:r,onAction:s,isActionDisabled:a,children:i}){return n.jsx(I,{children:n.jsxs(I.Content,{className:"flex flex-col gap-4 p-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),i,r&&s?n.jsx("div",{children:n.jsx(C,{variant:"primary",isDisabled:a,onPress:s,children:r})}):null]})})}function Nr({label:e="Loading…"}){return n.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 px-4 py-10 text-sm text-[var(--otari-muted)]",children:[n.jsx(Ve,{size:"sm"}),n.jsx("span",{children:e})]})}function Cr({children:e,confirmLabel:t,onConfirm:r,isPending:s}){const[a,i]=o.useState(!1);return a?n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(C,{size:"sm",variant:"danger",isDisabled:s,onPress:r,children:t}),n.jsx(C,{size:"sm",variant:"ghost",isDisabled:s,onPress:()=>i(!1),children:"Cancel"})]}):n.jsx(C,{size:"sm",variant:"danger-soft",onPress:()=>i(!0),children:e})}const Dt="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Tr({id:e,label:t,ariaLabel:r,value:s,onChange:a,options:i,children:u,disabled:d}){const f=o.useId(),y=e??(t?f:void 0),h=n.jsx("select",{id:y,"aria-label":t?void 0:r,value:s,disabled:d,onChange:b=>a(b.target.value),className:Dt,children:i?i.map(b=>n.jsx("option",{value:b.value,children:b.label},b.value)):u});return t?n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),h]}):h}function _r({label:e,value:t,onChange:r,options:s,placeholder:a,maxVisible:i=50,allowsCustom:u=!1}){const d=m=>{var N;return((N=s.find(M=>M.value===m))==null?void 0:N.label)??m},[f,y]=o.useState(()=>d(t));o.useEffect(()=>{y(d(t))},[t]);const h=f.trim().toLowerCase(),b=s.filter(m=>!h||m.value.toLowerCase().includes(h)||m.label.toLowerCase().includes(h)).slice(0,i);return n.jsxs(K.Root,{allowsEmptyCollection:!0,allowsCustomValue:u,menuTrigger:"focus",inputValue:f,onInputChange:m=>{y(m),u?r(m.trim()):m.trim()===""&&r("")},onSelectionChange:m=>{m!=null&&r(String(m))},className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),n.jsxs(K.InputGroup,{children:[n.jsx(ye,{placeholder:a,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),n.jsx(K.Trigger,{})]}),n.jsx(K.Popover,{children:n.jsx(ze,{items:b,className:"max-h-72 overflow-auto",children:m=>n.jsx(Qe,{id:m.value,textValue:m.label,children:m.label})})})]})}function At(){var f,y;const e=mt(),t=ft(),[r,s]=o.useState(!1),i=((f=e.data)==null?void 0:f.require_pricing)===!0&&e.data.default_pricing===!1&&!r,d=((y=St(Q,i).data)==null?void 0:y.total)??0;return i?n.jsx("div",{className:"shrink-0 px-6 pt-3",children:n.jsx(_t,{tone:"warning",children:n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("span",{children:["Requests are rejected until pricing is set (",n.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away.",d>0?n.jsxs(n.Fragment,{children:[" ",n.jsxs("strong",{className:"font-semibold",children:[d.toLocaleString()," ",d===1?"request":"requests"," failed in the last hour."]})," ",n.jsx(Fe,{to:"/activity?status=error&range=1h&source=gateway",className:"underline underline-offset-2",children:"View failed requests"})]}):null]}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(C,{size:"sm",variant:"primary",isDisabled:t.isPending,onPress:()=>t.mutate({default_pricing:!0}),children:t.isPending?"Enabling…":"Enable default pricing"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Dismiss"})]})]})})}):null}function It(){const{data:e}=dt(),t=o.useRef(null);return e&&t.current===null&&(t.current=e.build),e!=null&&t.current!=null&&e.build!==t.current}function qt(){const e=It(),[t,r]=o.useState(!1);return!e||t?null:n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:n.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),n.jsx(C,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>r(!0),children:"Later"})]})})}const je=200,Se=480,Z=240,Rt=60,ke="otari.dashboard.sidebarWidth",Ee="otari.dashboard.sidebarCollapsed",he=16,Pe="(max-width: 767px)",$=e=>Math.min(Se,Math.max(je,e));function Ot(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(Pe).matches}const Mt='a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ft(e){return e?Array.from(e.querySelectorAll(Mt)).filter(t=>t.offsetParent!==null||t===document.activeElement):[]}function Ut(){if(typeof window>"u")return Z;try{const e=window.localStorage.getItem(ke),t=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(t)?Z:$(t)}catch{return Z}}function Kt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ee)==="1"}catch{return!1}}const Bt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],$t=[{to:"/",section:"home",label:"Overview",end:!0,icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),n.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),n.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),n.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),n.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function zt(){const{logout:e}=re(),t=o.useRef(null),r=o.useRef(null),s=o.useRef(null),[a,i]=o.useState(Ut),[u,d]=o.useState(Kt),[f,y]=o.useState(!1),[h,b]=o.useState(Ot),[m,N]=o.useState(!1);o.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const c=window.matchMedia(Pe),v=w=>{b(w.matches),w.matches||N(!1)};return typeof c.addEventListener=="function"?(c.addEventListener("change",v),()=>c.removeEventListener("change",v)):(c.addListener(v),()=>c.removeListener(v))},[]),o.useEffect(()=>{if(!m)return;const c=v=>{v.key==="Escape"&&N(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[m]),o.useEffect(()=>{var c,v,w;h&&(m?(c=t.current)==null||c.focus():(v=t.current)!=null&&v.contains(document.activeElement)&&((w=s.current)==null||w.focus()))},[h,m]);const M=o.useCallback(c=>{if(c.key!=="Tab")return;const v=Ft(t.current);if(v.length===0)return;const w=v[0],k=v[v.length-1],F=document.activeElement;c.shiftKey&&(F===w||F===t.current)?(c.preventDefault(),k.focus()):!c.shiftKey&&F===k&&(c.preventDefault(),w.focus())},[]);o.useEffect(()=>{const c=window.setTimeout(()=>{try{window.localStorage.setItem(ke,String(Math.round(a)))}catch{}},200);return()=>window.clearTimeout(c)},[a]),o.useEffect(()=>{try{window.localStorage.setItem(Ee,u?"1":"0")}catch{}},[u]);const Ce=o.useCallback(c=>{c.preventDefault(),c.currentTarget.setPointerCapture(c.pointerId),y(!0)},[]),Te=o.useCallback(c=>{var w;if(!c.currentTarget.hasPointerCapture(c.pointerId))return;const v=((w=t.current)==null?void 0:w.getBoundingClientRect().left)??0;i($(c.clientX-v))},[]),_e=o.useCallback(c=>{c.currentTarget.hasPointerCapture(c.pointerId)&&c.currentTarget.releasePointerCapture(c.pointerId),y(!1)},[]),Le=o.useCallback(c=>{var v;c.preventDefault(),(v=r.current)==null||v.focus()},[]),De=o.useCallback(c=>{c.key==="ArrowLeft"?(c.preventDefault(),i(v=>$(v-he))):c.key==="ArrowRight"&&(c.preventDefault(),i(v=>$(v+he)))},[]),Ae=u?Rt:a,S=h?!1:u,H=h&&m?!0:void 0;return n.jsxs("div",{className:T("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[n.jsx("button",{type:"button",inert:H,onClick:Le,className:"sr-only focus:not-sr-only focus:absolute focus:top-3 focus:left-3 focus:z-50 focus:rounded-lg focus:border focus:border-[var(--otari-brand)] focus:bg-[var(--otari-surface)] focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-[var(--otari-brand-dark)] focus:shadow-md focus:outline-none",children:"Skip to main content"}),n.jsxs("header",{inert:H,className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("button",{type:"button",ref:s,onClick:()=>N(c=>!c),"aria-label":m?"Close navigation":"Open navigation","aria-expanded":m,"aria-controls":"app-sidebar",className:"-ml-1 flex h-8 w-8 items-center justify-center rounded-lg text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)] md:hidden",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5",children:n.jsx("path",{d:"M4 6h16M4 12h16M4 18h16",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),n.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),n.jsx(C,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),n.jsx(qt,{}),n.jsx(st,{}),n.jsx(At,{}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[h&&m?n.jsx("div",{"aria-hidden":"true",onClick:()=>N(!1),className:"fixed inset-0 z-30 bg-black/40 md:hidden"}):null,n.jsxs("aside",{ref:t,id:"app-sidebar",role:h?"dialog":void 0,"aria-modal":h&&m?!0:void 0,"aria-label":h?"Navigation":void 0,tabIndex:h?-1:void 0,inert:h&&!m?!0:void 0,onKeyDown:h&&m?M:void 0,style:h?void 0:{width:Ae},className:T("flex flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)] focus:outline-none",h?T("fixed inset-y-0 left-0 z-40 w-[17rem] shadow-xl transition-transform duration-200",m?"translate-x-0":"-translate-x-full"):T("relative shrink-0",!f&&"transition-[width] duration-150")),children:[n.jsx("button",{type:"button",onClick:()=>d(c=>!c),"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-pressed":u,title:u?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 hidden h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)] md:flex",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:T("h-3.5 w-3.5 transition-transform",u&&"rotate-180"),children:n.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("nav",{className:T("flex flex-col py-4",S?"px-2":"px-3"),children:Bt.map((c,v)=>{const w=$t.filter(k=>k.section===c.key);return w.length===0?null:n.jsxs("div",{className:v>0?"mt-4":void 0,children:[!S&&c.label?n.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:c.label}):null,v>0&&(S||!c.label)?n.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,n.jsx("div",{className:"flex flex-col gap-1",children:w.map(k=>n.jsxs(ee,{to:k.to,end:k.end,onClick:()=>N(!1),"aria-label":S?k.label:void 0,title:S?k.label:void 0,className:({isActive:F})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"justify-center px-0":"gap-3 px-3",F?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,S?null:k.label]},k.to))})]},c.key)})}),n.jsxs("div",{className:"mt-auto flex flex-col gap-1 pb-3",children:[n.jsxs(ee,{to:"/docs",onClick:()=>N(!1),"aria-label":S?"User guide":void 0,title:S?"User guide":void 0,className:({isActive:c})=>T("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"mx-2 justify-center px-0":"mx-3 gap-3 px-3",c?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[n.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.5V18c4 0 6.5.5 8 2 1.5-1.5 4-2 8-2V4.5c-4 0-6.5.5-8 2z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 6.5V20",strokeLinecap:"round"})]}),S?null:"User guide"]}),n.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai: the hosted Otari gateway",className:T("flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",S?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),S?null:n.jsxs("span",{className:"flex-1",children:["otari.ai ",n.jsx("span",{"aria-hidden":!0,children:"↗"})]})]})]}),u||h?null:n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(a),"aria-valuemin":je,"aria-valuemax":Se,tabIndex:0,onPointerDown:Ce,onPointerMove:Te,onPointerUp:_e,onKeyDown:De,className:T("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),n.jsx("main",{ref:r,id:"main-content",tabIndex:-1,inert:H,className:"flex-1 overflow-y-auto focus:outline-none",children:n.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-4 py-5 md:px-6 md:py-6",children:n.jsx(Ue,{})})})]})]})}function Qt(){const{login:e}=re(),[t,r]=o.useState(""),[s,a]=o.useState(null),[i,u]=o.useState(!1),d=async()=>{const f=t.trim();if(!(!f||i)){u(!0),a(null);try{await Xe(f)?e():a(new Error("Invalid master key."))}catch(y){a(y)}finally{u(!1)}}};return n.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:n.jsx(I,{className:"w-full max-w-md",children:n.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),n.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),d()},children:[n.jsxs(We,{value:t,onChange:f=>{r(f),s&&a(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),n.jsx(ye,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),n.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[n.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),n.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",n.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",n.jsx("code",{children:"Your master key:"})," (for example, run"," ",n.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),n.jsx(Tt,{error:s}),n.jsx(C,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!t.trim()||i,children:i?"Signing in…":"Sign in"})]}),n.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),n.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:n.jsx(He,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const Vt=o.lazy(async()=>({default:(await P(async()=>{const{ActivityPage:e}=await import("./ActivityPage-8oLlQRnK.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))).ActivityPage})),Wt=o.lazy(async()=>({default:(await P(async()=>{const{AliasesPage:e}=await import("./AliasesPage-YWTK3fom.js");return{AliasesPage:e}},__vite__mapDeps([11,1,2,6,5,7,8,12,13]))).AliasesPage})),Ht=o.lazy(async()=>({default:(await P(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-DzpynNOp.js");return{BudgetsPage:e}},__vite__mapDeps([14,1,2,6,5,7,8,12]))).BudgetsPage})),Gt=o.lazy(async()=>({default:(await P(async()=>{const{DocsPage:e}=await import("./DocsPage-epKnwcXd.js");return{DocsPage:e}},__vite__mapDeps([15,1,2,5]))).DocsPage})),Jt=o.lazy(async()=>({default:(await P(async()=>{const{KeysPage:e}=await import("./KeysPage-qur9pZ8W.js");return{KeysPage:e}},__vite__mapDeps([16,1,2,6,5,7,8,12,17,13]))).KeysPage})),Yt=o.lazy(async()=>({default:(await P(async()=>{const{ModelsPage:e}=await import("./ModelsPage-jrY_FD2Z.js");return{ModelsPage:e}},__vite__mapDeps([18,1,2,6,5,8,10]))).ModelsPage})),Xt=o.lazy(async()=>({default:(await P(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-CE2kZBwW.js");return{OverviewIndex:e}},__vite__mapDeps([19,1,2,3,4,5,8]))).OverviewIndex})),Zt=o.lazy(async()=>({default:(await P(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-BNd38xmH.js");return{ProvidersPage:e}},__vite__mapDeps([20,1,2,12,5,8]))).ProvidersPage})),en=o.lazy(async()=>({default:(await P(async()=>{const{SettingsPage:e}=await import("./SettingsPage-CxLaAuqf.js");return{SettingsPage:e}},__vite__mapDeps([21,1,2,5]))).SettingsPage})),tn=o.lazy(async()=>({default:(await P(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-BW2tcG_F.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([22,1,2,5]))).ToolsGuardrailsPage})),nn=o.lazy(async()=>({default:(await P(async()=>{const{UsagePage:e}=await import("./UsagePage-DTxN-kHP.js");return{UsagePage:e}},__vite__mapDeps([23,1,2,3,4,5,8,9]))).UsagePage})),rn=o.lazy(async()=>({default:(await P(async()=>{const{UsersPage:e}=await import("./UsersPage-Dv0w97g2.js");return{UsersPage:e}},__vite__mapDeps([24,1,2,6,5,7,8,12,17]))).UsersPage}));function E(e){return n.jsx(o.Suspense,{fallback:n.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function sn(){const{isAuthenticated:e}=re();return e?n.jsx(Ke,{children:n.jsx(Be,{children:n.jsxs(j,{element:n.jsx(zt,{}),children:[n.jsx(j,{index:!0,element:E(n.jsx(Xt,{}))}),n.jsx(j,{path:"providers",element:E(n.jsx(Zt,{}))}),n.jsx(j,{path:"keys",element:E(n.jsx(Jt,{}))}),n.jsx(j,{path:"users",element:E(n.jsx(rn,{}))}),n.jsx(j,{path:"budgets",element:E(n.jsx(Ht,{}))}),n.jsx(j,{path:"activity",element:E(n.jsx(Vt,{}))}),n.jsx(j,{path:"usage",element:E(n.jsx(nn,{}))}),n.jsx(j,{path:"models",element:E(n.jsx(Yt,{}))}),n.jsx(j,{path:"aliases",element:E(n.jsx(Wt,{}))}),n.jsx(j,{path:"tools",element:E(n.jsx(tn,{}))}),n.jsx(j,{path:"settings",element:E(n.jsx(en,{}))}),n.jsx(j,{path:"docs",element:E(n.jsx(Gt,{}))}),n.jsx(j,{path:"*",element:n.jsx($e,{to:"/",replace:!0})})]})})}):n.jsx(Qt,{})}function an({children:e}){const[t]=o.useState(()=>new Re({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(r,s)=>s instanceof L&&(s.status===401||s.status===403)?!1:r<2}}}));return n.jsx(Oe,{client:t,children:n.jsx(tt,{children:e})})}const Ne=document.getElementById("root");if(!Ne)throw new Error("Root element #root not found");Ge.createRoot(Ne).render(n.jsx(o.StrictMode,{children:n.jsx(an,{children:n.jsx(sn,{})})}));export{wr as $,hn as A,Pr as B,xn as C,tr as D,Tt as E,Tr as F,Yn as G,Xn as H,_t as I,Zn as J,Jn as K,wn as L,$n as M,qn as N,zn as O,kr as P,vr as Q,Er as R,Qn as S,Ct as T,gr as U,mt as V,yr as W,Sn as X,at as Y,Nr as Z,Pn as _,ot as a,jr as a0,pr as a1,Sr as a2,xr as a3,Pt as a4,Nt as a5,Cn as a6,Ln as a7,An as a8,ft as a9,_n as aa,Nn as ab,Tn as ac,En as ad,kn as ae,In as af,Vn as ag,Wn as ah,Hn as ai,Fn as aj,Dn as ak,Un as al,Kn as am,Bn as an,hr as ao,mn as ap,dn as aq,br as ar,lr as as,ir as at,pn as b,Gn as c,cr as d,ur as e,bn as f,fr as g,yn as h,vn as i,dr as j,mr as k,fn as l,_r as m,it as n,jn as o,Rn as p,Mn as q,gn as r,Cr as s,On as t,ar as u,er as v,nr as w,rr as x,sr as y,or as z}; diff --git a/src/gateway/static/dashboard/index.html b/src/gateway/static/dashboard/index.html index 8dba6676c..d16a9cad5 100644 --- a/src/gateway/static/dashboard/index.html +++ b/src/gateway/static/dashboard/index.html @@ -19,7 +19,7 @@ insets to sit out of the way. --> Otari Dashboard - + diff --git a/web/src/components/FilterChips.test.tsx b/web/src/components/FilterChips.test.tsx index 63b2714ac..9b8608a29 100644 --- a/web/src/components/FilterChips.test.tsx +++ b/web/src/components/FilterChips.test.tsx @@ -54,4 +54,14 @@ describe("FilterChips", () => { await user.click(screen.getByRole("button", { name: "Clear all" })); expect(clearAll).toHaveBeenCalledOnce(); }); + + it("renders start and end slots on the toggle row", () => { + render( + 30d} end={Showing window}> + pickers + , + ); + expect(screen.getByRole("button", { name: "30d" })).toBeInTheDocument(); + expect(screen.getByText("Showing window")).toBeInTheDocument(); + }); }); diff --git a/web/src/components/FilterChips.tsx b/web/src/components/FilterChips.tsx index c71fdbedc..48f4c4d46 100644 --- a/web/src/components/FilterChips.tsx +++ b/web/src/components/FilterChips.tsx @@ -21,11 +21,19 @@ export function FilterChips({ chips, children, onClearAll, + start, + end, }: { chips: FilterChip[]; // The picker controls (comboboxes/selects), revealed by "Add filter". children: ReactNode; onClearAll?: () => void; + // Optional controls sharing the toggle's row: `start` renders before the + // toggle (e.g. the date preset buttons), `end` is pushed to the right edge + // (e.g. the window caption and refresh). Keeping them in this row saves a + // line of vertical space on pages where filters sit beside the range picker. + start?: ReactNode; + end?: ReactNode; }) { const [open, setOpen] = useState(false); const regionId = useId(); @@ -33,6 +41,7 @@ export function FilterChips({ return (
+ {start}
{children} diff --git a/web/src/pages/ActivityPage.test.tsx b/web/src/pages/ActivityPage.test.tsx index f7fa39bd2..5433d3ac1 100644 --- a/web/src/pages/ActivityPage.test.tsx +++ b/web/src/pages/ActivityPage.test.tsx @@ -300,6 +300,16 @@ describe("ActivityPage", () => { expect(select).toHaveValue("codex"); }); + it("hides the source picker while only one source exists", async () => { + // Most gateways only ever see their own traffic; a provenance select with a + // single option is noise, so it only appears once a second source shows up. + mockApi({ rows: [entry(), entry({ id: "b" })] }); + renderPage(); + await screen.findAllByText("gpt-4o"); + + await waitFor(() => expect(screen.queryByLabelText("Source")).not.toBeInTheDocument()); + }); + it("shows a row's token composition rather than one uninformative total", async () => { // A cached agent request: the total is ~98% cache read, so the total alone // makes every row look alike. The bar carries the split. diff --git a/web/src/pages/ActivityPage.tsx b/web/src/pages/ActivityPage.tsx index 8102a1063..5b048a3ea 100644 --- a/web/src/pages/ActivityPage.tsx +++ b/web/src/pages/ActivityPage.tsx @@ -750,14 +750,20 @@ export function ActivityPage() { ))} - url.patch({ source: value })}> - - {sourceOptions.map((source) => ( - - ))} - + {/* Provenance only earns a select once there is more than one source + to choose between: most gateways see only their own traffic, and a + filter with a single option is noise. A drill-down that arrives + with a source applied keeps the select so it stays clearable. */} + {sourceOptions.length > 1 || sourceFilter ? ( + url.patch({ source: value })}> + + {sourceOptions.map((source) => ( + + ))} + + ) : null} { expect(await screen.findByText(/No usage yet/)).toBeInTheDocument(); }); - it("hands the current view off to the Activity log instead of duplicating its table", async () => { - const user = userEvent.setup(); + it("no longer duplicates the Activity page's per-request table", async () => { mockApi(summary()); renderPage(); await screen.findByText("$1,240.50"); // The per-request table (and its bulk actions) lives on the Activity page; - // Usage carries the whole current view across instead of a second copy. + // the breakdown rows drill there instead. expect(screen.queryByText("Individual requests")).not.toBeInTheDocument(); - await user.click(screen.getByRole("button", { name: "Open activity log" })); + }); - const loc = screen.getByRole("status", { name: "Current location" }).textContent ?? ""; - expect(loc.startsWith("/activity")).toBe(true); - expect(loc).toContain("start_date="); + it("hides the source dimension while only one source exists", async () => { + // The fixture has no by_source rows at all (a plain gateway), so neither + // the breakdown tab nor the group-by option should surface provenance. + mockApi(summary()); + renderPage(); + await screen.findByText("$1,240.50"); + + expect(screen.queryByRole("button", { name: "Source" })).not.toBeInTheDocument(); + const groupSelect = screen.getByRole("combobox", { name: "Group by" }); + expect(within(groupSelect).queryByRole("option", { name: "By source" })).not.toBeInTheDocument(); + }); + + it("offers the source dimension once several sources exist", async () => { + mockApi( + summary({ + by_source: [ + { key: "gateway", cost: 900, tokens: 9_000_000, requests: 60_000, is_other: false }, + { key: "claude_code", cost: 340.5, tokens: 3_400_000, requests: 24_000, is_other: false }, + ], + }), + ); + renderPage(); + await screen.findByText("$1,240.50"); + + expect(screen.getByRole("button", { name: "Source" })).toBeInTheDocument(); + const groupSelect = screen.getByRole("combobox", { name: "Group by" }); + expect(within(groupSelect).getByRole("option", { name: "By source" })).toBeInTheDocument(); }); it("keeps the filter pickers behind an 'Add filter' toggle", async () => { diff --git a/web/src/pages/UsagePage.tsx b/web/src/pages/UsagePage.tsx index 136a53038..1a40b52b6 100644 --- a/web/src/pages/UsagePage.tsx +++ b/web/src/pages/UsagePage.tsx @@ -394,6 +394,13 @@ export function UsagePage() { const errorRate = totals && totals.request_count > 0 ? totals.error_count / totals.request_count : 0; + // Provenance only earns UI (a group-by option, a breakdown tab) once the + // window actually has more than one source: most gateways see only their own + // traffic, and a single-option dimension is noise. Kept while it is the + // active grouping so switching windows never strands the selection. + const multiSource = (data?.by_source ?? []).filter((r) => !r.is_other).length > 1; + const showSource = multiSource || groupBy === "source"; + // ---------- derived analytics ---------- const series = data?.series ?? []; @@ -551,63 +558,48 @@ export function UsagePage() { }, ] as const; const [dimension, setDimension] = useState<(typeof dimensions)[number]["key"]>("model"); - const activeDimension = dimensions.find((d) => d.key === dimension) ?? dimensions[0]; + const visibleDimensions = dimensions.filter((d) => d.key !== "source" || multiSource || dimension === "source"); + const activeDimension = visibleDimensions.find((d) => d.key === dimension) ?? visibleDimensions[0]; return (
- // Hand the whole current view (window + entity filters) to the - // Activity log, which owns the per-request table and its bulk - // actions; keeping a second copy of that table here only split - // the feature across two pages. - drillTo({ - model: modelFilter.trim() || undefined, - user_id: userFilter || undefined, - api_key_id: apiKeyFilter || undefined, - }) - } - > - Open activity log - - } /> - {/* Window row: presets anchor the rolling window; dragging on the chart - below selects an explicit sub-window. Chips carry entity filters. */} -
-
- {USAGE_PRESETS.map((p) => ( - - ))} -
+ {/* Window + filter row: presets anchor the rolling window (dragging on the + chart below selects an explicit sub-window), the Add filter toggle and + its chips share the same line, and the caption + refresh sit at the + right edge. */} + ( + + ))} + end={ + <> Showing {formatWindowLabel(effectiveStart, effectiveEnd)} · UTC -
-
- - - - - -
+ + } + > + + + + {isEmptyEver ? ( setGroupBy(value as "" | UsageGroupBy)} - options={GROUP_OPTIONS.map((o) => ({ value: o.value, label: o.value ? `By ${o.label.toLowerCase()}` : "No grouping" }))} + options={GROUP_OPTIONS.filter((o) => o.value !== "source" || showSource).map((o) => ({ + value: o.value, + label: o.value ? `By ${o.label.toLowerCase()}` : "No grouping", + }))} />
@@ -767,7 +762,7 @@ export function UsagePage() {

Spend by {activeDimension.label.toLowerCase()}

- {dimensions.map((d) => ( + {visibleDimensions.map((d) => ( ) : null} - {summary.isFetching || (groupBy && grouped.isFetching) ? : null} + {summary.isFetching || (effectiveGroupBy && grouped.isFetching) ? : null}
+ {groupingUnsupported ? ( +
+ The running gateway predates grouped series, so the chart shows ungrouped totals. Restart the gateway + on this build to enable grouping. +
+ ) : null} {chartLoading ? (
@@ -742,7 +755,7 @@ export function UsagePage() { series={chart.series} formatValue={formatValue} formatXTick={(iso) => formatBucketLabel(iso, bucket)} - ariaLabel={`${metric} per ${bucket}${groupBy ? `, grouped by ${groupBy}` : ""}`} + ariaLabel={`${metric} per ${bucket}${effectiveGroupBy ? `, grouped by ${effectiveGroupBy}` : ""}`} height={260} showYAxis showTotal From 4149937caef38e7a99d32ec5a0671a536065a22a Mon Sep 17 00:00:00 2001 From: Nathan Brake Date: Mon, 3 Aug 2026 21:45:13 +0000 Subject: [PATCH 7/9] fix(dashboard): surface a timeline summary failure on the Activity page A failed series request left the strip reading "No activity in this range", which misreads as a quiet gateway. The error banner now carries the summary error too. Flagged by CodeRabbit on the bundle output. Co-Authored-By: Claude Opus 5 (1M context) --- ...ge-B_xlQB4w.js => ActivityPage-BENT_1o4.js} | 2 +- ...age-CoIJBCqd.js => AliasesPage-CtStwRk-.js} | 2 +- ...age-C3pAx2YI.js => BudgetsPage-0J25eK0m.js} | 2 +- ...g-D9trL3a0.js => ConfirmDialog-BBkZMSqE.js} | 2 +- ...csPage-Dcxbdpf9.js => DocsPage-DoYdRqgR.js} | 2 +- ...ysPage-CbATIDtN.js => KeysPage-JwzirK0P.js} | 2 +- ...Q9nHtN.js => ModelScopeControl-gV_ax1BN.js} | 2 +- ...Page-DZ6zDjTj.js => ModelsPage-DyZuS75D.js} | 2 +- ...ge-gipwh9ys.js => OverviewPage-Tme0ej_W.js} | 2 +- ...e-Bvzss9dV.js => ProvidersPage-B46VzXV5.js} | 2 +- ...ge-DGmFxbDI.js => SettingsPage-CMbg-FaW.js} | 2 +- ...C-pfgcm6.js => TablePagination-0H6sFfIt.js} | 2 +- ...0CuT.js => ToolsGuardrailsPage-DkLhKtcA.js} | 2 +- ...ePage-4kYrVw0Z.js => UsagePage-CjaSd7XG.js} | 2 +- ...sPage-Ch4B0UUJ.js => UsersPage-Cfif2r2r.js} | 2 +- .../{index-gNSmom8p.js => index-C-bDZxkO.js} | 4 ++-- src/gateway/static/dashboard/index.html | 2 +- web/src/pages/ActivityPage.test.tsx | 18 ++++++++++++++++++ web/src/pages/ActivityPage.tsx | 4 +++- 19 files changed, 39 insertions(+), 19 deletions(-) rename src/gateway/static/dashboard/assets/{ActivityPage-B_xlQB4w.js => ActivityPage-BENT_1o4.js} (81%) rename src/gateway/static/dashboard/assets/{AliasesPage-CoIJBCqd.js => AliasesPage-CtStwRk-.js} (98%) rename src/gateway/static/dashboard/assets/{BudgetsPage-C3pAx2YI.js => BudgetsPage-0J25eK0m.js} (99%) rename src/gateway/static/dashboard/assets/{ConfirmDialog-D9trL3a0.js => ConfirmDialog-BBkZMSqE.js} (92%) rename src/gateway/static/dashboard/assets/{DocsPage-Dcxbdpf9.js => DocsPage-DoYdRqgR.js} (99%) rename src/gateway/static/dashboard/assets/{KeysPage-CbATIDtN.js => KeysPage-JwzirK0P.js} (98%) rename src/gateway/static/dashboard/assets/{ModelScopeControl-xLQ9nHtN.js => ModelScopeControl-gV_ax1BN.js} (98%) rename src/gateway/static/dashboard/assets/{ModelsPage-DZ6zDjTj.js => ModelsPage-DyZuS75D.js} (99%) rename src/gateway/static/dashboard/assets/{OverviewPage-gipwh9ys.js => OverviewPage-Tme0ej_W.js} (99%) rename src/gateway/static/dashboard/assets/{ProvidersPage-Bvzss9dV.js => ProvidersPage-B46VzXV5.js} (99%) rename src/gateway/static/dashboard/assets/{SettingsPage-DGmFxbDI.js => SettingsPage-CMbg-FaW.js} (99%) rename src/gateway/static/dashboard/assets/{TablePagination-C-pfgcm6.js => TablePagination-0H6sFfIt.js} (98%) rename src/gateway/static/dashboard/assets/{ToolsGuardrailsPage-CSEh0CuT.js => ToolsGuardrailsPage-DkLhKtcA.js} (99%) rename src/gateway/static/dashboard/assets/{UsagePage-4kYrVw0Z.js => UsagePage-CjaSd7XG.js} (99%) rename src/gateway/static/dashboard/assets/{UsersPage-Ch4B0UUJ.js => UsersPage-Cfif2r2r.js} (98%) rename src/gateway/static/dashboard/assets/{index-gNSmom8p.js => index-C-bDZxkO.js} (96%) diff --git a/src/gateway/static/dashboard/assets/ActivityPage-B_xlQB4w.js b/src/gateway/static/dashboard/assets/ActivityPage-BENT_1o4.js similarity index 81% rename from src/gateway/static/dashboard/assets/ActivityPage-B_xlQB4w.js rename to src/gateway/static/dashboard/assets/ActivityPage-BENT_1o4.js index d85504f38..4af33ad68 100644 --- a/src/gateway/static/dashboard/assets/ActivityPage-B_xlQB4w.js +++ b/src/gateway/static/dashboard/assets/ActivityPage-BENT_1o4.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as ct}from"./react-dgEcD0HR.js";import{f as dt,b as ut,a as mt,r as ht,u as pt,c as xt,d as gt,e as Oe,g as ve,h as G,i as ft,A as ce,j as vt,k as bt,P as _t,E as kt,C as Ke,l as $,R as yt,F as be,m as _e,n as $e,Y as St,N as jt}from"./index-gNSmom8p.js";import{C as wt,T as Nt}from"./charts-B_hm0rXH.js";import{B as q,S as Ct}from"./heroui-DZj66Arc.js";import{u as Pt,r as It,B as Mt}from"./tableSelection-CojkFPwd.js";import{C as Et}from"./ConfirmDialog-D9trL3a0.js";import{D as At}from"./DataTable-CrQq0sYf.js";import{F as Rt}from"./FilterChips-BLdhUEZK.js";import{T as Tt,S as Dt,P as Ft}from"./TablePagination-C-pfgcm6.js";import"./recharts-BwTTRGtj.js";function Le(t,n){const d=new Date(t);return Number.isNaN(d.getTime())?t:n==="hour"?d.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):d.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const Ot={key:"success",label:"Succeeded",color:"var(--otari-brand)"},Lt={key:"errors",label:"Failed",color:"var(--otari-danger)"},Ut={key:"requests",label:"Requests",color:"var(--otari-brand)"};function Bt({presets:t,extentKey:n,onPreset:d,onSelectRange:a,onSelectFull:i,series:b,bucket:o,windowStart:m,windowEnd:p,loading:_=!1,ariaLabel:S="Request volume over the selected window",action:j}){const x=b.map(r=>r.bucketStart),c=b.length,C=dt(m,p),w=b.some(r=>(r.errors??0)>0),H=w?[Ot,Lt]:[Ut],se=b.map(r=>{const h=Math.min(r.errors??0,r.requests);return w?{x:r.bucketStart,success:r.requests-h,errors:h}:{x:r.bucketStart,requests:r.requests}}),z=c>0?ut(x,m,p):{startIndex:0,endIndex:0},[E,f]=u.useState(null),V=u.useRef(E),W=r=>{V.current=r,f(r)},v=E??z,I=v.endIndex-v.startIndex+1,Y=v.startIndex===0&&v.endIndex>=c-1,T=c>0&&!Y,g=(r,h)=>{if(c===0)return;const N=Math.max(0,Math.min(r,h)),P=Math.min(c-1,Math.max(r,h));if(N===0&&P===c-1){i();return}const ee=ht(x,N,P,o);ee&&a(ee.startIso,ee.endIso)},k=t.findIndex(r=>r.key===n),O=k>=0?t[k].seconds:c*mt(o)/1e3,Z=k>=0?t[k+1]:t.find(r=>r.seconds===null||O!==null&&r.seconds>O),M=r=>{const h=Math.max(1,Math.min(c,Math.round(r))),N=(v.startIndex+v.endIndex+1)/2;let P=Math.round(N-h/2);P=Math.max(0,Math.min(c-h,P)),g(P,P+h-1)},L=()=>{if(Y){Z&&d(Z);return}M(I*2)},de=()=>M(I/2),U=u.useRef(null),A=u.useRef(null),X=r=>{const h=Math.max(0,Math.min(c-I,r));return{startIndex:h,endIndex:h+I-1}},ue=r=>{const h=r.key==="ArrowRight"||r.key==="ArrowUp"?1:r.key==="ArrowLeft"||r.key==="ArrowDown"?-1:r.key==="PageUp"?I:r.key==="PageDown"?-I:r.key==="Home"?-c:r.key==="End"?c:0;if(h===0)return;r.preventDefault();const N=X(v.startIndex+h);N.startIndex!==v.startIndex&&g(N.startIndex,N.endIndex)},ae=r=>{if(!A.current||!U.current)return;const h=U.current.getBoundingClientRect().width;if(h<=0)return;const N=Math.round((r.clientX-A.current.x)/h*c);W(X(A.current.startIndex+N))},J=r=>{r.currentTarget.hasPointerCapture(r.pointerId)&&r.currentTarget.releasePointerCapture(r.pointerId),A.current=null;const h=V.current;W(null),h&&h.startIndex!==z.startIndex&&g(h.startIndex,h.endIndex)},Q=c?v.startIndex/c*100:0,B=c?(v.endIndex+1)/c*100:100,D=Math.max(0,c-I);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.map(r=>e.jsx(q,{size:"sm",variant:n===r.key?"primary":"outline",onPress:()=>d(r),children:r.label},r.key)),e.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",C," · UTC"]}),j]})]}),e.jsxs("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[e.jsxs("span",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:["Requests / ",o==="hour"?"hour":"day"]}),e.jsx(wt,{series:H})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"hidden text-[11px] text-[var(--otari-muted)] sm:inline",children:"drag across the chart to zoom"}),e.jsx(q,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom in",isDisabled:c===0,onPress:de,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M12 5v14M5 12h14",strokeLinecap:"round"})})}),e.jsx(q,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom out",isDisabled:c===0||Y&&!Z,onPress:L,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})})}),T?e.jsx(q,{size:"sm",variant:"ghost",onPress:()=>g(0,c-1),children:"Reset"}):null]})]}),_&&c===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center",children:e.jsx(Ct,{size:"sm"})}):c===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center text-xs text-[var(--otari-muted)]",children:"No activity in this range."}):e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(Nt,{data:se,series:H,formatValue:r=>r.toLocaleString(),formatXTick:r=>Le(r,o),ariaLabel:S,height:90,onSelectRange:g,window:T||E?v:null}),T||E?e.jsx("div",{ref:U,className:"relative h-2.5 w-full rounded-full bg-[var(--otari-bg)]",children:e.jsx("div",{role:"slider","aria-label":"Pan the selected window","aria-valuemin":0,"aria-valuemax":D,"aria-valuenow":Math.min(v.startIndex,D),"aria-valuetext":`Window starting at ${Le(x[v.startIndex]??x[0],o)}`,tabIndex:0,className:"absolute inset-y-0 cursor-grab touch-none rounded-full bg-[var(--otari-brand)]/40 outline-none hover:bg-[var(--otari-brand)]/60 focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)] active:cursor-grabbing",style:{left:`${Q}%`,width:`${Math.max(2,B-Q)}%`},onKeyDown:ue,onPointerDown:r=>{r.preventDefault(),A.current={x:r.clientX,startIndex:v.startIndex},W({...v}),r.currentTarget.setPointerCapture(r.pointerId)},onPointerMove:ae,onPointerUp:J,onPointerCancel:J})}):null]})]})]})}function Kt(t){const[n,d]=ct(),a=u.useCallback(o=>n.get(o)??t[o],[n,t]),i=u.useCallback(o=>{const m=Number.parseInt(n.get(o)??"",10);if(!Number.isNaN(m))return m;const p=Number.parseInt(t[o],10);return Number.isNaN(p)?0:p},[n,t]),b=u.useCallback(o=>{d(m=>{const p=new URLSearchParams(m);for(const[_,S]of Object.entries(o)){const j=String(S);j===""||j===t[_]?p.delete(_):p.set(_,j)}return p},{replace:!0})},[d,t]);return{get:a,getNumber:i,patch:b}}const $t=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function le(t){return t===null?"—":$t.format(t)}function R(t){return t===null?"—":t.toLocaleString()}function qe(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function qt(t){const n=new Date(t);return Number.isNaN(n.getTime())?t:n.toLocaleString()}function zt(t){const n=new Date(t).getTime();if(Number.isNaN(n))return t;const d=Math.max(0,Math.round((Date.now()-n)/1e3));if(d<60)return`${d}s ago`;const a=Math.round(d/60);if(a<60)return`${a}m ago`;const i=Math.round(a/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}const Wt=t=>t.id,Yt=t=>t.status==="error"?"bg-red-50":void 0,Ue=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],Be=[{label:"All",value:""},{label:"Priced",value:"true"},{label:"Unpriced",value:"false"}],Zt=50,Gt=["model","source"],Ht=["source"],Vt={range:ce,start_date:"",end_date:"",status:"",model:"",user_id:"",api_key_id:"",priced:"",source:"",source_label:"",endpoint:"",provider:"",page:"0",size:String(Zt)};function ie(t,n,d){if(n||d)return{start:n||void 0,end:d||void 0};if(t===Ke)return{};const a=G($,t)??G($,ce),i=(a==null?void 0:a.seconds)??null;return{start:i==null?void 0:$e(i),end:void 0}}function ke(t){const n=ie(t,"","");if(n.start)return n;const d=G($,t);return(d==null?void 0:d.seconds)==null?{start:$e(St)}:n}function Xt({status:t}){const n=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${n}`,children:t})}const Jt={gateway:"Gateway",claude_code:"Claude Code",codex:"Codex"};function ye(t){return Jt[t]??t}function F(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function ze(t){const n=t.billing_meters??null,d=F(n?n.total_input_tokens:t.prompt_tokens),a=F(n?n.cache_read_tokens:t.cache_read_tokens),i=F(n?n.cache_write_tokens:t.cache_write_tokens),b=F(n?n.completion_tokens:t.completion_tokens),o=Math.max(0,d-a-i),m=o+a+i+b;return m>0?{fresh:o,cacheRead:a,cacheWrite:i,output:b,total:m}:null}const Qt=[{key:"fresh",label:"Fresh input",fill:"var(--otari-ink)"},{key:"cacheRead",label:"Cache read",fill:"var(--otari-brand)"},{key:"cacheWrite",label:"Cache write",fill:"var(--otari-brand-soft)"},{key:"output",label:"Output",fill:"var(--otari-brand-dark)"}];function es({entry:t}){const n=ze(t);if(n===null)return e.jsx("span",{className:"tabular-nums",children:R(t.total_tokens)});const d=Qt.map(o=>({...o,value:n[o.key]})),a=d.filter(o=>o.value>0).map(o=>`${o.label} ${o.value.toLocaleString()}`).join(", ");let i=0;const b=d.map(o=>{const m=o.value/n.total*100,p={...o,x:i,width:m};return i+=m,p});return e.jsxs("span",{className:"inline-flex flex-col items-end gap-1",title:a,children:[e.jsx("span",{className:"tabular-nums",children:n.total.toLocaleString()}),e.jsx("svg",{viewBox:"0 0 100 4",preserveAspectRatio:"none",role:"img","aria-label":`Token composition: ${a}`,className:"h-1.5 w-20 overflow-hidden rounded-full bg-[var(--otari-brand-tint)]",children:b.filter(o=>o.width>0).map(o=>e.jsx("rect",{x:o.x,y:0,width:o.width,height:4,fill:o.fill},o.key))})]})}function y({label:t,children:n}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:n})]})}function ts({entry:t}){var n,d;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"This request failed. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(y,{label:"Provider",children:t.provider??"—"}),e.jsx(y,{label:"Endpoint",children:t.endpoint}),e.jsx(y,{label:"Source",children:ye(t.source)}),t.source_label?e.jsx(y,{label:"Session",children:t.source_label}):null,e.jsx(y,{label:"User",children:t.user_id??"—"}),e.jsx(y,{label:"API key",children:t.api_key_id??"—"}),e.jsx(y,{label:"Prompt tokens",children:R(t.prompt_tokens)}),e.jsx(y,{label:"Completion tokens",children:R(t.completion_tokens)}),e.jsx(y,{label:"Total tokens",children:R(t.total_tokens)}),e.jsx(y,{label:"Billed tokens",children:e.jsx("span",{title:"Fresh input, cache reads and writes, and output: the tokens this request was priced on, and the total the activity row's bar splits.",children:R(((n=ze(t))==null?void 0:n.total)??null)})}),e.jsx(y,{label:"Cost",children:le(t.cost)}),e.jsx(y,{label:"Cache read tokens",children:R(t.cache_read_tokens)}),e.jsx(y,{label:"Cache write tokens",children:R(t.cache_write_tokens)}),e.jsx(y,{label:"1h cache writes",children:R(t.cache_write_1h_tokens??null)}),e.jsx(y,{label:"Total time",children:qe(t.latency_ms)}),e.jsx(y,{label:"Request ID",children:t.id})]}),(d=t.pricing_breakdown)!=null&&d.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(a=>e.jsxs(y,{label:a.meter.replaceAll("_"," "),children:[R(a.units)," at ",le(a.rate_per_million)," / 1M, ",le(a.cost)]},a.meter))})]}):null]})}function xs(){var Me,Ee,Ae,Re,Te,De;const t=pt(),n=xt(),d=u.useMemo(()=>{const s=new Map;for(const l of n.data??[])s.set(l.id,l.key_name??`${l.id.slice(0,8)}…`);return s},[n.data]),a=Kt(Vt),i=a.get("range"),b=a.get("start_date"),o=a.get("end_date"),m=a.get("status"),p=a.get("model"),_=a.get("user_id"),S=a.get("api_key_id"),j=a.get("priced"),x=a.get("source"),c=a.get("source_label"),C=a.get("endpoint"),w=a.get("provider"),H=Math.max(0,a.getNumber("page")),se=a.getNumber("size"),z=Ft.reduce((s,l)=>Math.abs(l-se)ie(i,b,o)),W=u.useRef(E);u.useEffect(()=>{W.current!==E&&(W.current=E,V(ie(i,b,o)))},[E,i,b,o]);const[v,I]=u.useState(()=>ke(i)),Y=u.useRef(i);u.useEffect(()=>{Y.current!==i&&(Y.current=i,I(ke(i)))},[i]);const T=j==="true"?!0:j==="false"?!1:void 0,g=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:C||void 0,provider:w||void 0,priced:T}),[f,m,p,_,S,x,c,C,w,T]),k=Pt(),O=JSON.stringify(g),Z=u.useRef(O);u.useEffect(()=>{Z.current!==O&&(Z.current=O,a.patch({page:0}),k.clear())},[O,a,k]);const M=gt(g,H,z),L=Oe(g),de=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:C||void 0,provider:w||void 0}),[f,m,_,S,x,c,C,w]),U=ve(de,"day",Gt),A=((Ee=(Me=U.data)==null?void 0:Me.by_model)==null?void 0:Ee.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],X=(n.data??[]).map(s=>({value:s.id,label:s.key_name??`${s.id.slice(0,8)}…`})),ue=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0}),[f,m,p,_,S]),ae=ve(ue,"day",Ht,!!x),J=(Ae=x?ae.data:U.data)==null?void 0:Ae.by_source,Q=u.useMemo(()=>{const s=(J??[]).filter(l=>!l.is_other&&l.key!==null).map(l=>l.key);return x&&!s.includes(x)?[x,...s]:s},[J,x]),B=G($,i)??G($,ce),D=!!(f.start&&v.start&&new Date(f.start).getTime()({start_date:D?f.start:v.start,end_date:D?f.end:void 0,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:C||void 0,provider:w||void 0,priced:T}),[D,f,v,m,p,_,S,x,c,C,w,T]),P=ve(N,h,jt),ee=(((Re=P.data)==null?void 0:Re.series)??[]).map(s=>({bucketStart:s.bucket_start,requests:s.requests,errors:s.errors??0})),K=M.data??[],We=L.isSuccess&&!L.isPlaceholderData?((Te=L.data)==null?void 0:Te.total)??0:null,me=G($,i),Ye=!!(b||o)||i!==ce&&(me==null?void 0:me.seconds)!=null,Ze=!!(m||p.trim()||_||S||j||x||c||C||w||Ye),re=(s,l)=>{var Fe;return((Fe=s.find(it=>it.value===l))==null?void 0:Fe.label)??l},Se=(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),Ge=()=>a.patch({status:"",priced:"",model:"",user_id:"",api_key_id:"",source:"",source_label:"",endpoint:"",provider:""}),He=[...m?[{key:"status",label:"Status",value:re(Ue,m),onClear:()=>a.patch({status:""})}]:[],...j?[{key:"priced",label:"Priced",value:re(Be,j),onClear:()=>a.patch({priced:""})}]:[],..._?[{key:"user",label:"User",value:re(Se,_),onClear:()=>a.patch({user_id:""})}]:[],...p.trim()?[{key:"model",label:"Model",value:p.trim(),onClear:()=>a.patch({model:""})}]:[],...S?[{key:"key",label:"API key",value:re(X,S),onClear:()=>a.patch({api_key_id:""})}]:[],...x?[{key:"source",label:"Source",value:ye(x),onClear:()=>a.patch({source:""})}]:[],...c?[{key:"session",label:"Session",value:c,onClear:()=>a.patch({source_label:""})}]:[],...C?[{key:"endpoint",label:"Endpoint",value:C,onClear:()=>a.patch({endpoint:""})}]:[],...w?[{key:"provider",label:"Provider",value:w,onClear:()=>a.patch({provider:""})}]:[]],he=u.useMemo(()=>K.filter(s=>!s.counts_toward_budget).map(s=>s.id),[K]),Ve=u.useMemo(()=>K.filter(s=>s.counts_toward_budget).map(s=>s.id),[K]),je=It(k.selectedKeys,he),te=je.length,we=k.allMatching||te>0,Xe=u.useMemo(()=>({...g,counts_toward_budget:!1}),[g]),Ne=Oe(Xe,we),ne=Ne.isSuccess?((De=Ne.data)==null?void 0:De.total)??null:null,Je=he.length>0&&te===he.length&&ne!=null&&ne>te,oe=k.allMatching?ne??te:te,pe=vt(),xe=bt(),[Qe,ge]=u.useState(!1),[et,fe]=u.useState(!1),[tt,Ce]=u.useState(null),st=u.useCallback(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Request detail"}),e.jsx(q,{size:"sm",variant:"ghost",onPress:()=>Ce(null),children:"Close"})]}),e.jsx(ts,{entry:s})]}),[]),Pe=()=>k.allMatching?{by_filter:!0,model:g.model,user_id:g.user_id,api_key_id:g.api_key_id,status:g.status,source:g.source,source_label:g.source_label,endpoint:g.endpoint,provider:g.provider,start_date:g.start_date,end_date:g.end_date,priced:g.priced}:{ids:je},at=()=>{pe.mutate(Pe(),{onSuccess:()=>{ge(!1),k.clear()}})},rt=s=>{xe.mutate({...Pe(),...s},{onSuccess:()=>{fe(!1),k.clear()}})},nt=()=>{M.refetch(),L.refetch(),P.refetch(),U.refetch(),x&&ae.refetch()},Ie=s=>{if(s.key===i&&!b&&!o){V(ie(s.key,"","")),I(ke(s.key));return}a.patch({range:s.key,start_date:"",end_date:""})},ot=(s,l)=>a.patch({start_date:s,end_date:l}),lt=u.useMemo(()=>{const s=l=>l===null?"—":d.get(l)??`${l.slice(0,8)}…`;return[{id:"time",header:"Time",cell:l=>e.jsx("span",{title:qt(l.timestamp),className:"text-[var(--otari-muted)]",children:zt(l.timestamp)})},{id:"user",header:"User",cell:l=>l.user_id??"—"},{id:"model",header:"Model",isRowHeader:!0,cell:l=>l.model},{id:"api_key",header:"API key",cell:l=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:s(l.api_key_id)})},{id:"tokens",header:"Tokens",align:"end",cell:l=>e.jsx(es,{entry:l})},{id:"cost",header:"Cost",align:"end",cell:l=>le(l.cost)},{id:"latency",header:"Total time",align:"end",cell:l=>qe(l.latency_ms)},{id:"status",header:"Status",cell:l=>e.jsx(Xt,{status:l.status})}]},[d]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(_t,{title:"Activity",description:"A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored."}),e.jsx(kt,{error:M.error??L.error}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(Bt,{presets:$,extentKey:r,onPreset:Ie,onSelectRange:ot,onSelectFull:()=>B?Ie(B):void 0,series:ee,bucket:h,windowStart:f.start,windowEnd:f.end,loading:P.isLoading,ariaLabel:"Activity request volume over the selected window",action:e.jsx(yt,{onRefresh:nt,isFetching:M.isFetching,updatedAt:M.dataUpdatedAt})}),e.jsxs(Rt,{chips:He,onClearAll:Ge,children:[e.jsx(be,{id:"filter-status",label:"Status",value:m,onChange:s=>a.patch({status:s}),children:Ue.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsx(be,{id:"filter-priced",label:"Priced?",value:j,onChange:s=>a.patch({priced:s}),children:Be.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),Q.length>1||x?e.jsxs(be,{id:"filter-source",label:"Source",value:x,onChange:s=>a.patch({source:s}),children:[e.jsx("option",{value:"",children:"All"}),Q.map(s=>e.jsx("option",{value:s,children:ye(s)},s))]}):null,e.jsx(_e,{label:"API key",value:S,onChange:s=>a.patch({api_key_id:s}),placeholder:"All keys",options:X}),e.jsx(_e,{label:"User",value:_,onChange:s=>a.patch({user_id:s}),placeholder:"All users",options:Se}),e.jsx(_e,{label:"Model",value:p,onChange:s=>a.patch({model:s}),allowsCustom:!0,placeholder:"Any model",options:(p&&!A.includes(p)?[p,...A]:A).map(s=>({value:s,label:s}))})]})]}),we?e.jsxs(Mt,{selectedCount:oe,allMatching:k.allMatching,matchingTotal:ne,canSelectAllMatching:Je,onSelectAllMatching:k.enableAllMatching,onClear:k.clear,children:[e.jsx(q,{size:"sm",variant:"primary",onPress:()=>fe(!0),children:"Set price"}),e.jsx(q,{size:"sm",variant:"danger",onPress:()=>ge(!0),children:"Delete"})]}):null,e.jsx(At,{ariaLabel:"Activity log",columns:lt,rows:K,getRowKey:Wt,isLoading:M.isLoading,emptyContent:Ze?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:k.selectedKeys,onSelectionChange:k.onSelectionChange,disabledKeys:Ve,onRowAction:s=>Ce(l=>l===s?null:s),rowClassName:Yt,detailKey:tt,renderDetail:st}),e.jsx(Tt,{page:H,pageSize:z,total:We,rowsOnPage:K.length,onPageChange:s=>a.patch({page:s}),onPageSizeChange:s=>a.patch({size:s,page:0}),isFetching:M.isFetching,hasNextFallback:K.length===z}),e.jsx(Et,{isOpen:Qe,onOpenChange:ge,heading:"Delete usage rows",body:`Delete ${oe.toLocaleString()} imported ${oe===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:pe.isPending,error:pe.error,onConfirm:at}),e.jsx(Dt,{isOpen:et,onOpenChange:fe,targetCount:oe,isPending:xe.isPending,error:xe.error,onSubmit:rt})]})}export{xs as ActivityPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as ct}from"./react-dgEcD0HR.js";import{f as dt,b as ut,a as mt,r as ht,u as pt,c as xt,d as gt,e as Oe,g as ve,h as G,i as ft,A as ce,j as vt,k as bt,P as _t,E as kt,C as Ke,l as $,R as yt,F as be,m as _e,n as $e,Y as St,N as jt}from"./index-C-bDZxkO.js";import{C as wt,T as Nt}from"./charts-B_hm0rXH.js";import{B as q,S as Ct}from"./heroui-DZj66Arc.js";import{u as Pt,r as It,B as Mt}from"./tableSelection-CojkFPwd.js";import{C as Et}from"./ConfirmDialog-BBkZMSqE.js";import{D as At}from"./DataTable-CrQq0sYf.js";import{F as Rt}from"./FilterChips-BLdhUEZK.js";import{T as Tt,S as Dt,P as Ft}from"./TablePagination-0H6sFfIt.js";import"./recharts-BwTTRGtj.js";function Le(t,n){const d=new Date(t);return Number.isNaN(d.getTime())?t:n==="hour"?d.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):d.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const Ot={key:"success",label:"Succeeded",color:"var(--otari-brand)"},Lt={key:"errors",label:"Failed",color:"var(--otari-danger)"},Ut={key:"requests",label:"Requests",color:"var(--otari-brand)"};function Bt({presets:t,extentKey:n,onPreset:d,onSelectRange:a,onSelectFull:i,series:b,bucket:o,windowStart:m,windowEnd:p,loading:_=!1,ariaLabel:S="Request volume over the selected window",action:j}){const x=b.map(r=>r.bucketStart),c=b.length,P=dt(m,p),w=b.some(r=>(r.errors??0)>0),H=w?[Ot,Lt]:[Ut],se=b.map(r=>{const h=Math.min(r.errors??0,r.requests);return w?{x:r.bucketStart,success:r.requests-h,errors:h}:{x:r.bucketStart,requests:r.requests}}),z=c>0?ut(x,m,p):{startIndex:0,endIndex:0},[E,f]=u.useState(null),V=u.useRef(E),W=r=>{V.current=r,f(r)},v=E??z,I=v.endIndex-v.startIndex+1,Y=v.startIndex===0&&v.endIndex>=c-1,T=c>0&&!Y,g=(r,h)=>{if(c===0)return;const N=Math.max(0,Math.min(r,h)),C=Math.min(c-1,Math.max(r,h));if(N===0&&C===c-1){i();return}const ee=ht(x,N,C,o);ee&&a(ee.startIso,ee.endIso)},k=t.findIndex(r=>r.key===n),O=k>=0?t[k].seconds:c*mt(o)/1e3,Z=k>=0?t[k+1]:t.find(r=>r.seconds===null||O!==null&&r.seconds>O),M=r=>{const h=Math.max(1,Math.min(c,Math.round(r))),N=(v.startIndex+v.endIndex+1)/2;let C=Math.round(N-h/2);C=Math.max(0,Math.min(c-h,C)),g(C,C+h-1)},L=()=>{if(Y){Z&&d(Z);return}M(I*2)},de=()=>M(I/2),U=u.useRef(null),A=u.useRef(null),X=r=>{const h=Math.max(0,Math.min(c-I,r));return{startIndex:h,endIndex:h+I-1}},ue=r=>{const h=r.key==="ArrowRight"||r.key==="ArrowUp"?1:r.key==="ArrowLeft"||r.key==="ArrowDown"?-1:r.key==="PageUp"?I:r.key==="PageDown"?-I:r.key==="Home"?-c:r.key==="End"?c:0;if(h===0)return;r.preventDefault();const N=X(v.startIndex+h);N.startIndex!==v.startIndex&&g(N.startIndex,N.endIndex)},ae=r=>{if(!A.current||!U.current)return;const h=U.current.getBoundingClientRect().width;if(h<=0)return;const N=Math.round((r.clientX-A.current.x)/h*c);W(X(A.current.startIndex+N))},J=r=>{r.currentTarget.hasPointerCapture(r.pointerId)&&r.currentTarget.releasePointerCapture(r.pointerId),A.current=null;const h=V.current;W(null),h&&h.startIndex!==z.startIndex&&g(h.startIndex,h.endIndex)},Q=c?v.startIndex/c*100:0,B=c?(v.endIndex+1)/c*100:100,D=Math.max(0,c-I);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.map(r=>e.jsx(q,{size:"sm",variant:n===r.key?"primary":"outline",onPress:()=>d(r),children:r.label},r.key)),e.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",P," · UTC"]}),j]})]}),e.jsxs("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[e.jsxs("span",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:["Requests / ",o==="hour"?"hour":"day"]}),e.jsx(wt,{series:H})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"hidden text-[11px] text-[var(--otari-muted)] sm:inline",children:"drag across the chart to zoom"}),e.jsx(q,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom in",isDisabled:c===0,onPress:de,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M12 5v14M5 12h14",strokeLinecap:"round"})})}),e.jsx(q,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom out",isDisabled:c===0||Y&&!Z,onPress:L,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})})}),T?e.jsx(q,{size:"sm",variant:"ghost",onPress:()=>g(0,c-1),children:"Reset"}):null]})]}),_&&c===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center",children:e.jsx(Ct,{size:"sm"})}):c===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center text-xs text-[var(--otari-muted)]",children:"No activity in this range."}):e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(Nt,{data:se,series:H,formatValue:r=>r.toLocaleString(),formatXTick:r=>Le(r,o),ariaLabel:S,height:90,onSelectRange:g,window:T||E?v:null}),T||E?e.jsx("div",{ref:U,className:"relative h-2.5 w-full rounded-full bg-[var(--otari-bg)]",children:e.jsx("div",{role:"slider","aria-label":"Pan the selected window","aria-valuemin":0,"aria-valuemax":D,"aria-valuenow":Math.min(v.startIndex,D),"aria-valuetext":`Window starting at ${Le(x[v.startIndex]??x[0],o)}`,tabIndex:0,className:"absolute inset-y-0 cursor-grab touch-none rounded-full bg-[var(--otari-brand)]/40 outline-none hover:bg-[var(--otari-brand)]/60 focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)] active:cursor-grabbing",style:{left:`${Q}%`,width:`${Math.max(2,B-Q)}%`},onKeyDown:ue,onPointerDown:r=>{r.preventDefault(),A.current={x:r.clientX,startIndex:v.startIndex},W({...v}),r.currentTarget.setPointerCapture(r.pointerId)},onPointerMove:ae,onPointerUp:J,onPointerCancel:J})}):null]})]})]})}function Kt(t){const[n,d]=ct(),a=u.useCallback(o=>n.get(o)??t[o],[n,t]),i=u.useCallback(o=>{const m=Number.parseInt(n.get(o)??"",10);if(!Number.isNaN(m))return m;const p=Number.parseInt(t[o],10);return Number.isNaN(p)?0:p},[n,t]),b=u.useCallback(o=>{d(m=>{const p=new URLSearchParams(m);for(const[_,S]of Object.entries(o)){const j=String(S);j===""||j===t[_]?p.delete(_):p.set(_,j)}return p},{replace:!0})},[d,t]);return{get:a,getNumber:i,patch:b}}const $t=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function le(t){return t===null?"—":$t.format(t)}function R(t){return t===null?"—":t.toLocaleString()}function qe(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function qt(t){const n=new Date(t);return Number.isNaN(n.getTime())?t:n.toLocaleString()}function zt(t){const n=new Date(t).getTime();if(Number.isNaN(n))return t;const d=Math.max(0,Math.round((Date.now()-n)/1e3));if(d<60)return`${d}s ago`;const a=Math.round(d/60);if(a<60)return`${a}m ago`;const i=Math.round(a/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}const Wt=t=>t.id,Yt=t=>t.status==="error"?"bg-red-50":void 0,Ue=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],Be=[{label:"All",value:""},{label:"Priced",value:"true"},{label:"Unpriced",value:"false"}],Zt=50,Gt=["model","source"],Ht=["source"],Vt={range:ce,start_date:"",end_date:"",status:"",model:"",user_id:"",api_key_id:"",priced:"",source:"",source_label:"",endpoint:"",provider:"",page:"0",size:String(Zt)};function ie(t,n,d){if(n||d)return{start:n||void 0,end:d||void 0};if(t===Ke)return{};const a=G($,t)??G($,ce),i=(a==null?void 0:a.seconds)??null;return{start:i==null?void 0:$e(i),end:void 0}}function ke(t){const n=ie(t,"","");if(n.start)return n;const d=G($,t);return(d==null?void 0:d.seconds)==null?{start:$e(St)}:n}function Xt({status:t}){const n=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${n}`,children:t})}const Jt={gateway:"Gateway",claude_code:"Claude Code",codex:"Codex"};function ye(t){return Jt[t]??t}function F(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function ze(t){const n=t.billing_meters??null,d=F(n?n.total_input_tokens:t.prompt_tokens),a=F(n?n.cache_read_tokens:t.cache_read_tokens),i=F(n?n.cache_write_tokens:t.cache_write_tokens),b=F(n?n.completion_tokens:t.completion_tokens),o=Math.max(0,d-a-i),m=o+a+i+b;return m>0?{fresh:o,cacheRead:a,cacheWrite:i,output:b,total:m}:null}const Qt=[{key:"fresh",label:"Fresh input",fill:"var(--otari-ink)"},{key:"cacheRead",label:"Cache read",fill:"var(--otari-brand)"},{key:"cacheWrite",label:"Cache write",fill:"var(--otari-brand-soft)"},{key:"output",label:"Output",fill:"var(--otari-brand-dark)"}];function es({entry:t}){const n=ze(t);if(n===null)return e.jsx("span",{className:"tabular-nums",children:R(t.total_tokens)});const d=Qt.map(o=>({...o,value:n[o.key]})),a=d.filter(o=>o.value>0).map(o=>`${o.label} ${o.value.toLocaleString()}`).join(", ");let i=0;const b=d.map(o=>{const m=o.value/n.total*100,p={...o,x:i,width:m};return i+=m,p});return e.jsxs("span",{className:"inline-flex flex-col items-end gap-1",title:a,children:[e.jsx("span",{className:"tabular-nums",children:n.total.toLocaleString()}),e.jsx("svg",{viewBox:"0 0 100 4",preserveAspectRatio:"none",role:"img","aria-label":`Token composition: ${a}`,className:"h-1.5 w-20 overflow-hidden rounded-full bg-[var(--otari-brand-tint)]",children:b.filter(o=>o.width>0).map(o=>e.jsx("rect",{x:o.x,y:0,width:o.width,height:4,fill:o.fill},o.key))})]})}function y({label:t,children:n}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:n})]})}function ts({entry:t}){var n,d;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"This request failed. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(y,{label:"Provider",children:t.provider??"—"}),e.jsx(y,{label:"Endpoint",children:t.endpoint}),e.jsx(y,{label:"Source",children:ye(t.source)}),t.source_label?e.jsx(y,{label:"Session",children:t.source_label}):null,e.jsx(y,{label:"User",children:t.user_id??"—"}),e.jsx(y,{label:"API key",children:t.api_key_id??"—"}),e.jsx(y,{label:"Prompt tokens",children:R(t.prompt_tokens)}),e.jsx(y,{label:"Completion tokens",children:R(t.completion_tokens)}),e.jsx(y,{label:"Total tokens",children:R(t.total_tokens)}),e.jsx(y,{label:"Billed tokens",children:e.jsx("span",{title:"Fresh input, cache reads and writes, and output: the tokens this request was priced on, and the total the activity row's bar splits.",children:R(((n=ze(t))==null?void 0:n.total)??null)})}),e.jsx(y,{label:"Cost",children:le(t.cost)}),e.jsx(y,{label:"Cache read tokens",children:R(t.cache_read_tokens)}),e.jsx(y,{label:"Cache write tokens",children:R(t.cache_write_tokens)}),e.jsx(y,{label:"1h cache writes",children:R(t.cache_write_1h_tokens??null)}),e.jsx(y,{label:"Total time",children:qe(t.latency_ms)}),e.jsx(y,{label:"Request ID",children:t.id})]}),(d=t.pricing_breakdown)!=null&&d.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(a=>e.jsxs(y,{label:a.meter.replaceAll("_"," "),children:[R(a.units)," at ",le(a.rate_per_million)," / 1M, ",le(a.cost)]},a.meter))})]}):null]})}function xs(){var Me,Ee,Ae,Re,Te,De;const t=pt(),n=xt(),d=u.useMemo(()=>{const s=new Map;for(const l of n.data??[])s.set(l.id,l.key_name??`${l.id.slice(0,8)}…`);return s},[n.data]),a=Kt(Vt),i=a.get("range"),b=a.get("start_date"),o=a.get("end_date"),m=a.get("status"),p=a.get("model"),_=a.get("user_id"),S=a.get("api_key_id"),j=a.get("priced"),x=a.get("source"),c=a.get("source_label"),P=a.get("endpoint"),w=a.get("provider"),H=Math.max(0,a.getNumber("page")),se=a.getNumber("size"),z=Ft.reduce((s,l)=>Math.abs(l-se)ie(i,b,o)),W=u.useRef(E);u.useEffect(()=>{W.current!==E&&(W.current=E,V(ie(i,b,o)))},[E,i,b,o]);const[v,I]=u.useState(()=>ke(i)),Y=u.useRef(i);u.useEffect(()=>{Y.current!==i&&(Y.current=i,I(ke(i)))},[i]);const T=j==="true"?!0:j==="false"?!1:void 0,g=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:P||void 0,provider:w||void 0,priced:T}),[f,m,p,_,S,x,c,P,w,T]),k=Pt(),O=JSON.stringify(g),Z=u.useRef(O);u.useEffect(()=>{Z.current!==O&&(Z.current=O,a.patch({page:0}),k.clear())},[O,a,k]);const M=gt(g,H,z),L=Oe(g),de=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:P||void 0,provider:w||void 0}),[f,m,_,S,x,c,P,w]),U=ve(de,"day",Gt),A=((Ee=(Me=U.data)==null?void 0:Me.by_model)==null?void 0:Ee.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],X=(n.data??[]).map(s=>({value:s.id,label:s.key_name??`${s.id.slice(0,8)}…`})),ue=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0}),[f,m,p,_,S]),ae=ve(ue,"day",Ht,!!x),J=(Ae=x?ae.data:U.data)==null?void 0:Ae.by_source,Q=u.useMemo(()=>{const s=(J??[]).filter(l=>!l.is_other&&l.key!==null).map(l=>l.key);return x&&!s.includes(x)?[x,...s]:s},[J,x]),B=G($,i)??G($,ce),D=!!(f.start&&v.start&&new Date(f.start).getTime()({start_date:D?f.start:v.start,end_date:D?f.end:void 0,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:P||void 0,provider:w||void 0,priced:T}),[D,f,v,m,p,_,S,x,c,P,w,T]),C=ve(N,h,jt),ee=(((Re=C.data)==null?void 0:Re.series)??[]).map(s=>({bucketStart:s.bucket_start,requests:s.requests,errors:s.errors??0})),K=M.data??[],We=L.isSuccess&&!L.isPlaceholderData?((Te=L.data)==null?void 0:Te.total)??0:null,me=G($,i),Ye=!!(b||o)||i!==ce&&(me==null?void 0:me.seconds)!=null,Ze=!!(m||p.trim()||_||S||j||x||c||P||w||Ye),re=(s,l)=>{var Fe;return((Fe=s.find(it=>it.value===l))==null?void 0:Fe.label)??l},Se=(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),Ge=()=>a.patch({status:"",priced:"",model:"",user_id:"",api_key_id:"",source:"",source_label:"",endpoint:"",provider:""}),He=[...m?[{key:"status",label:"Status",value:re(Ue,m),onClear:()=>a.patch({status:""})}]:[],...j?[{key:"priced",label:"Priced",value:re(Be,j),onClear:()=>a.patch({priced:""})}]:[],..._?[{key:"user",label:"User",value:re(Se,_),onClear:()=>a.patch({user_id:""})}]:[],...p.trim()?[{key:"model",label:"Model",value:p.trim(),onClear:()=>a.patch({model:""})}]:[],...S?[{key:"key",label:"API key",value:re(X,S),onClear:()=>a.patch({api_key_id:""})}]:[],...x?[{key:"source",label:"Source",value:ye(x),onClear:()=>a.patch({source:""})}]:[],...c?[{key:"session",label:"Session",value:c,onClear:()=>a.patch({source_label:""})}]:[],...P?[{key:"endpoint",label:"Endpoint",value:P,onClear:()=>a.patch({endpoint:""})}]:[],...w?[{key:"provider",label:"Provider",value:w,onClear:()=>a.patch({provider:""})}]:[]],he=u.useMemo(()=>K.filter(s=>!s.counts_toward_budget).map(s=>s.id),[K]),Ve=u.useMemo(()=>K.filter(s=>s.counts_toward_budget).map(s=>s.id),[K]),je=It(k.selectedKeys,he),te=je.length,we=k.allMatching||te>0,Xe=u.useMemo(()=>({...g,counts_toward_budget:!1}),[g]),Ne=Oe(Xe,we),ne=Ne.isSuccess?((De=Ne.data)==null?void 0:De.total)??null:null,Je=he.length>0&&te===he.length&&ne!=null&&ne>te,oe=k.allMatching?ne??te:te,pe=vt(),xe=bt(),[Qe,ge]=u.useState(!1),[et,fe]=u.useState(!1),[tt,Ce]=u.useState(null),st=u.useCallback(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Request detail"}),e.jsx(q,{size:"sm",variant:"ghost",onPress:()=>Ce(null),children:"Close"})]}),e.jsx(ts,{entry:s})]}),[]),Pe=()=>k.allMatching?{by_filter:!0,model:g.model,user_id:g.user_id,api_key_id:g.api_key_id,status:g.status,source:g.source,source_label:g.source_label,endpoint:g.endpoint,provider:g.provider,start_date:g.start_date,end_date:g.end_date,priced:g.priced}:{ids:je},at=()=>{pe.mutate(Pe(),{onSuccess:()=>{ge(!1),k.clear()}})},rt=s=>{xe.mutate({...Pe(),...s},{onSuccess:()=>{fe(!1),k.clear()}})},nt=()=>{M.refetch(),L.refetch(),C.refetch(),U.refetch(),x&&ae.refetch()},Ie=s=>{if(s.key===i&&!b&&!o){V(ie(s.key,"","")),I(ke(s.key));return}a.patch({range:s.key,start_date:"",end_date:""})},ot=(s,l)=>a.patch({start_date:s,end_date:l}),lt=u.useMemo(()=>{const s=l=>l===null?"—":d.get(l)??`${l.slice(0,8)}…`;return[{id:"time",header:"Time",cell:l=>e.jsx("span",{title:qt(l.timestamp),className:"text-[var(--otari-muted)]",children:zt(l.timestamp)})},{id:"user",header:"User",cell:l=>l.user_id??"—"},{id:"model",header:"Model",isRowHeader:!0,cell:l=>l.model},{id:"api_key",header:"API key",cell:l=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:s(l.api_key_id)})},{id:"tokens",header:"Tokens",align:"end",cell:l=>e.jsx(es,{entry:l})},{id:"cost",header:"Cost",align:"end",cell:l=>le(l.cost)},{id:"latency",header:"Total time",align:"end",cell:l=>qe(l.latency_ms)},{id:"status",header:"Status",cell:l=>e.jsx(Xt,{status:l.status})}]},[d]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(_t,{title:"Activity",description:"A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored."}),e.jsx(kt,{error:M.error??L.error??C.error}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(Bt,{presets:$,extentKey:r,onPreset:Ie,onSelectRange:ot,onSelectFull:()=>B?Ie(B):void 0,series:ee,bucket:h,windowStart:f.start,windowEnd:f.end,loading:C.isLoading,ariaLabel:"Activity request volume over the selected window",action:e.jsx(yt,{onRefresh:nt,isFetching:M.isFetching,updatedAt:M.dataUpdatedAt})}),e.jsxs(Rt,{chips:He,onClearAll:Ge,children:[e.jsx(be,{id:"filter-status",label:"Status",value:m,onChange:s=>a.patch({status:s}),children:Ue.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsx(be,{id:"filter-priced",label:"Priced?",value:j,onChange:s=>a.patch({priced:s}),children:Be.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),Q.length>1||x?e.jsxs(be,{id:"filter-source",label:"Source",value:x,onChange:s=>a.patch({source:s}),children:[e.jsx("option",{value:"",children:"All"}),Q.map(s=>e.jsx("option",{value:s,children:ye(s)},s))]}):null,e.jsx(_e,{label:"API key",value:S,onChange:s=>a.patch({api_key_id:s}),placeholder:"All keys",options:X}),e.jsx(_e,{label:"User",value:_,onChange:s=>a.patch({user_id:s}),placeholder:"All users",options:Se}),e.jsx(_e,{label:"Model",value:p,onChange:s=>a.patch({model:s}),allowsCustom:!0,placeholder:"Any model",options:(p&&!A.includes(p)?[p,...A]:A).map(s=>({value:s,label:s}))})]})]}),we?e.jsxs(Mt,{selectedCount:oe,allMatching:k.allMatching,matchingTotal:ne,canSelectAllMatching:Je,onSelectAllMatching:k.enableAllMatching,onClear:k.clear,children:[e.jsx(q,{size:"sm",variant:"primary",onPress:()=>fe(!0),children:"Set price"}),e.jsx(q,{size:"sm",variant:"danger",onPress:()=>ge(!0),children:"Delete"})]}):null,e.jsx(At,{ariaLabel:"Activity log",columns:lt,rows:K,getRowKey:Wt,isLoading:M.isLoading,emptyContent:Ze?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:k.selectedKeys,onSelectionChange:k.onSelectionChange,disabledKeys:Ve,onRowAction:s=>Ce(l=>l===s?null:s),rowClassName:Yt,detailKey:tt,renderDetail:st}),e.jsx(Tt,{page:H,pageSize:z,total:We,rowsOnPage:K.length,onPageChange:s=>a.patch({page:s}),onPageSizeChange:s=>a.patch({size:s,page:0}),isFetching:M.isFetching,hasNextFallback:K.length===z}),e.jsx(Et,{isOpen:Qe,onOpenChange:ge,heading:"Delete usage rows",body:`Delete ${oe.toLocaleString()} imported ${oe===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:pe.isPending,error:pe.error,onConfirm:at}),e.jsx(Dt,{isOpen:et,onOpenChange:fe,targetCount:oe,isPending:xe.isPending,error:xe.error,onSubmit:rt})]})}export{xs as ActivityPage}; diff --git a/src/gateway/static/dashboard/assets/AliasesPage-CoIJBCqd.js b/src/gateway/static/dashboard/assets/AliasesPage-CtStwRk-.js similarity index 98% rename from src/gateway/static/dashboard/assets/AliasesPage-CoIJBCqd.js rename to src/gateway/static/dashboard/assets/AliasesPage-CtStwRk-.js index 214c0340f..b14eba313 100644 --- a/src/gateway/static/dashboard/assets/AliasesPage-CoIJBCqd.js +++ b/src/gateway/static/dashboard/assets/AliasesPage-CtStwRk-.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as L}from"./react-dgEcD0HR.js";import{o as T,p as I,q as M,s as R,P as K,E as w,t as P,u as F}from"./index-gNSmom8p.js";import{u as O,r as $,B as q}from"./tableSelection-CojkFPwd.js";import{C as U}from"./ConfirmDialog-D9trL3a0.js";import{D as H}from"./DataTable-CrQq0sYf.js";import{F as V}from"./Field-DEJ6Wjg9.js";import{C as k,L as z,I as G,a as J,b as W,f as X,B as j,d as A}from"./heroui-DZj66Arc.js";import{U as Q}from"./UserComboBox-nt7pHfqn.js";const Y=50;function B({label:t,value:a,onChange:n,description:r,placeholder:c="provider:model",autoFocus:l,isRequired:d}){const o=T(),{visible:m,total:h,failed:x}=u.useMemo(()=>{var N;const i=a.trim().toLowerCase(),v=((N=o.data)==null?void 0:N.providers)??[],C=v.flatMap(f=>f.models),p=i?C.filter(f=>f.key.toLowerCase().includes(i)):C;return{visible:p.slice(0,Y),total:p.length,failed:v.filter(f=>!f.ok)}},[o.data,a]),g=o.isLoading?"Loading models from your providers…":x.length>0?`Could not list models for ${x.map(v=>v.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:h>m.length?`Showing ${m.length} of ${h} matches. Keep typing to narrow them.`:r;return e.jsxs(k.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:a,onInputChange:n,onSelectionChange:i=>{i!=null&&n(String(i))},isRequired:d,className:"flex max-w-md flex-col gap-1",children:[e.jsx(z,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(k.InputGroup,{children:[e.jsx(G,{placeholder:c,autoFocus:l}),e.jsx(k.Trigger,{})]}),e.jsx(k.Popover,{children:e.jsx(J,{items:m,className:"max-h-72 overflow-auto",children:i=>e.jsx(W,{id:i.key,textValue:i.key,children:i.key})})}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:g}):null]})}const S=t=>JSON.stringify([t.user_id,t.name]);function Z({userId:t,onChange:a}){const n=F(),r=t!==null,c=(l,d)=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>a(l?"":null),className:r===l?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:d});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Applies to"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"A global alias resolves for every caller. A user-scoped one resolves only for that user, and takes precedence over a global alias of the same name."})]}),e.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[c(!1,"Every caller"),c(!0,"One user")]}),r?e.jsx(Q,{label:"User",value:t??"",onChange:a,users:n.data??[],placeholder:"Pick a user…",description:"Only this user resolves the alias.",unknownHint:e.jsx("span",{className:"text-red-700",children:"No such user. Pick an existing one."})}):null]})}function ee({alias:t,onClose:a}){const n=P(),[r,c]=u.useState(t.target),l=r.trim()!==""&&r.trim()!==t.target,d=()=>{l&&n.mutate({name:t.name,target:r.trim(),user_id:t.user_id},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name}),t.user_id?e.jsxs(e.Fragment,{children:[" for user ",e.jsx("code",{children:t.user_id})]}):null]}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["The alias name and who it applies to (",t.user_id?e.jsx("code",{children:t.user_id}):"every caller",") are the key and cannot be changed here. Delete and recreate to change either."]})]}),e.jsx(B,{label:"Target",value:r,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!l||n.isPending,onPress:d,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function se({onClose:t,initialTarget:a=""}){const n=P(),[r,c]=u.useState(""),[l,d]=u.useState(a),[o,m]=u.useState(null),h=/[:/]/.test(r),x=o===null||o.trim()!=="",g=r.trim()!==""&&l.trim()!==""&&!h&&x,i=()=>{g&&n.mutate({name:r.trim(),target:l.trim(),user_id:o===null?null:o.trim()},{onSuccess:t})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(V,{label:"Alias name",value:r,onChange:c,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:h?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(B,{label:"Target",value:l,onChange:d,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsx(Z,{userId:o,onChange:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!g||n.isPending,onPress:i,children:n.isPending?"Creating…":"Create alias"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function me(){const t=I(),a=M(),[n]=L(),r=n.get("target")??"",[c,l]=u.useState(r!==""),[d,o]=u.useState(null),m=O(),[h,x]=u.useState(!1),[g,i]=u.useState(void 0),[v,C]=u.useState(!1),p=[...t.data??[]].sort((s,b)=>s.name.localeCompare(b.name)||(s.user_id??"").localeCompare(b.user_id??"")),N=p.filter(s=>s.source==="stored").map(S),f=p.filter(s=>s.source!=="stored").map(S),y=$(m.selectedKeys,N),D=new Map(p.map(s=>[S(s),s])),_=async()=>{C(!0),i(void 0);try{for(const s of y){const b=D.get(s);b!==void 0&&await a.mutateAsync({name:b.name,userId:b.user_id})}m.clear(),x(!1)}catch(s){i(s)}finally{C(!1)}},E=u.useMemo(()=>[{id:"alias",header:"Alias",isRowHeader:!0,cell:s=>e.jsx("span",{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name})},{id:"target",header:"Target",cell:s=>e.jsx("span",{className:"break-all text-[var(--otari-muted)]",children:s.target})},{id:"scope",header:"Applies to",cell:s=>s.user_id?e.jsx("code",{className:"break-all text-xs text-[var(--otari-ink)]",children:s.user_id}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Every caller"})},{id:"source",header:"Source",cell:s=>e.jsx(X,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})},{id:"actions",header:"Actions",align:"end",cell:s=>s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{l(!1),o(s)},children:"Edit"}),e.jsx(R,{confirmLabel:"Delete",isPending:a.isPending,onConfirm:()=>a.mutate({name:s.name,userId:s.user_id}),children:"Delete"})]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})}],[a.isPending,a.mutate]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(K,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:c||d?null:e.jsx(j,{variant:"primary",onPress:()=>{o(null),l(!0)},children:"New alias"})}),e.jsx(w,{error:t.error}),c?e.jsx(se,{initialTarget:r,onClose:()=>l(!1)}):null,d?e.jsx(ee,{alias:d,onClose:()=>o(null)}):null,a.error?e.jsx(w,{error:a.error}):null,y.length>0?e.jsx(q,{selectedCount:y.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:m.clear,children:e.jsx(j,{size:"sm",variant:"danger",onPress:()=>x(!0),children:"Delete"})}):null,e.jsx(H,{ariaLabel:"Aliases",columns:E,rows:p,getRowKey:S,isLoading:t.isLoading,emptyContent:"No aliases yet. Create one to give a model a friendly name.",selectionMode:"multiple",selectedKeys:m.selectedKeys,onSelectionChange:m.onSelectionChange,disabledKeys:f}),e.jsx(U,{isOpen:h,onOpenChange:x,heading:"Delete aliases",body:`Delete ${y.length} stored ${y.length===1?"alias":"aliases"}? Callers using ${y.length===1?"it":"them"} will get a model-not-found error.`,confirmLabel:"Delete",isPending:v,error:g,onConfirm:_})]})}export{me as AliasesPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as L}from"./react-dgEcD0HR.js";import{o as T,p as I,q as M,s as R,P as K,E as w,t as P,u as F}from"./index-C-bDZxkO.js";import{u as O,r as $,B as q}from"./tableSelection-CojkFPwd.js";import{C as U}from"./ConfirmDialog-BBkZMSqE.js";import{D as H}from"./DataTable-CrQq0sYf.js";import{F as V}from"./Field-DEJ6Wjg9.js";import{C as k,L as z,I as G,a as J,b as W,f as X,B as j,d as A}from"./heroui-DZj66Arc.js";import{U as Q}from"./UserComboBox-nt7pHfqn.js";const Y=50;function B({label:t,value:a,onChange:n,description:r,placeholder:c="provider:model",autoFocus:l,isRequired:d}){const o=T(),{visible:m,total:h,failed:x}=u.useMemo(()=>{var N;const i=a.trim().toLowerCase(),v=((N=o.data)==null?void 0:N.providers)??[],C=v.flatMap(f=>f.models),p=i?C.filter(f=>f.key.toLowerCase().includes(i)):C;return{visible:p.slice(0,Y),total:p.length,failed:v.filter(f=>!f.ok)}},[o.data,a]),g=o.isLoading?"Loading models from your providers…":x.length>0?`Could not list models for ${x.map(v=>v.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:h>m.length?`Showing ${m.length} of ${h} matches. Keep typing to narrow them.`:r;return e.jsxs(k.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:a,onInputChange:n,onSelectionChange:i=>{i!=null&&n(String(i))},isRequired:d,className:"flex max-w-md flex-col gap-1",children:[e.jsx(z,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(k.InputGroup,{children:[e.jsx(G,{placeholder:c,autoFocus:l}),e.jsx(k.Trigger,{})]}),e.jsx(k.Popover,{children:e.jsx(J,{items:m,className:"max-h-72 overflow-auto",children:i=>e.jsx(W,{id:i.key,textValue:i.key,children:i.key})})}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:g}):null]})}const S=t=>JSON.stringify([t.user_id,t.name]);function Z({userId:t,onChange:a}){const n=F(),r=t!==null,c=(l,d)=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>a(l?"":null),className:r===l?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:d});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Applies to"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"A global alias resolves for every caller. A user-scoped one resolves only for that user, and takes precedence over a global alias of the same name."})]}),e.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[c(!1,"Every caller"),c(!0,"One user")]}),r?e.jsx(Q,{label:"User",value:t??"",onChange:a,users:n.data??[],placeholder:"Pick a user…",description:"Only this user resolves the alias.",unknownHint:e.jsx("span",{className:"text-red-700",children:"No such user. Pick an existing one."})}):null]})}function ee({alias:t,onClose:a}){const n=P(),[r,c]=u.useState(t.target),l=r.trim()!==""&&r.trim()!==t.target,d=()=>{l&&n.mutate({name:t.name,target:r.trim(),user_id:t.user_id},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name}),t.user_id?e.jsxs(e.Fragment,{children:[" for user ",e.jsx("code",{children:t.user_id})]}):null]}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["The alias name and who it applies to (",t.user_id?e.jsx("code",{children:t.user_id}):"every caller",") are the key and cannot be changed here. Delete and recreate to change either."]})]}),e.jsx(B,{label:"Target",value:r,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!l||n.isPending,onPress:d,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function se({onClose:t,initialTarget:a=""}){const n=P(),[r,c]=u.useState(""),[l,d]=u.useState(a),[o,m]=u.useState(null),h=/[:/]/.test(r),x=o===null||o.trim()!=="",g=r.trim()!==""&&l.trim()!==""&&!h&&x,i=()=>{g&&n.mutate({name:r.trim(),target:l.trim(),user_id:o===null?null:o.trim()},{onSuccess:t})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(V,{label:"Alias name",value:r,onChange:c,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:h?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(B,{label:"Target",value:l,onChange:d,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsx(Z,{userId:o,onChange:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!g||n.isPending,onPress:i,children:n.isPending?"Creating…":"Create alias"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function me(){const t=I(),a=M(),[n]=L(),r=n.get("target")??"",[c,l]=u.useState(r!==""),[d,o]=u.useState(null),m=O(),[h,x]=u.useState(!1),[g,i]=u.useState(void 0),[v,C]=u.useState(!1),p=[...t.data??[]].sort((s,b)=>s.name.localeCompare(b.name)||(s.user_id??"").localeCompare(b.user_id??"")),N=p.filter(s=>s.source==="stored").map(S),f=p.filter(s=>s.source!=="stored").map(S),y=$(m.selectedKeys,N),D=new Map(p.map(s=>[S(s),s])),_=async()=>{C(!0),i(void 0);try{for(const s of y){const b=D.get(s);b!==void 0&&await a.mutateAsync({name:b.name,userId:b.user_id})}m.clear(),x(!1)}catch(s){i(s)}finally{C(!1)}},E=u.useMemo(()=>[{id:"alias",header:"Alias",isRowHeader:!0,cell:s=>e.jsx("span",{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name})},{id:"target",header:"Target",cell:s=>e.jsx("span",{className:"break-all text-[var(--otari-muted)]",children:s.target})},{id:"scope",header:"Applies to",cell:s=>s.user_id?e.jsx("code",{className:"break-all text-xs text-[var(--otari-ink)]",children:s.user_id}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Every caller"})},{id:"source",header:"Source",cell:s=>e.jsx(X,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})},{id:"actions",header:"Actions",align:"end",cell:s=>s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{l(!1),o(s)},children:"Edit"}),e.jsx(R,{confirmLabel:"Delete",isPending:a.isPending,onConfirm:()=>a.mutate({name:s.name,userId:s.user_id}),children:"Delete"})]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})}],[a.isPending,a.mutate]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(K,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:c||d?null:e.jsx(j,{variant:"primary",onPress:()=>{o(null),l(!0)},children:"New alias"})}),e.jsx(w,{error:t.error}),c?e.jsx(se,{initialTarget:r,onClose:()=>l(!1)}):null,d?e.jsx(ee,{alias:d,onClose:()=>o(null)}):null,a.error?e.jsx(w,{error:a.error}):null,y.length>0?e.jsx(q,{selectedCount:y.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:m.clear,children:e.jsx(j,{size:"sm",variant:"danger",onPress:()=>x(!0),children:"Delete"})}):null,e.jsx(H,{ariaLabel:"Aliases",columns:E,rows:p,getRowKey:S,isLoading:t.isLoading,emptyContent:"No aliases yet. Create one to give a model a friendly name.",selectionMode:"multiple",selectedKeys:m.selectedKeys,onSelectionChange:m.onSelectionChange,disabledKeys:f}),e.jsx(U,{isOpen:h,onOpenChange:x,heading:"Delete aliases",body:`Delete ${y.length} stored ${y.length===1?"alias":"aliases"}? Callers using ${y.length===1?"it":"them"} will get a model-not-found error.`,confirmLabel:"Delete",isPending:v,error:g,onConfirm:_})]})}export{me as AliasesPage}; diff --git a/src/gateway/static/dashboard/assets/BudgetsPage-C3pAx2YI.js b/src/gateway/static/dashboard/assets/BudgetsPage-0J25eK0m.js similarity index 99% rename from src/gateway/static/dashboard/assets/BudgetsPage-C3pAx2YI.js rename to src/gateway/static/dashboard/assets/BudgetsPage-0J25eK0m.js index f59a14805..f14df0b72 100644 --- a/src/gateway/static/dashboard/assets/BudgetsPage-C3pAx2YI.js +++ b/src/gateway/static/dashboard/assets/BudgetsPage-0J25eK0m.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{v as ae,u as re,w as le,x as ie,y as oe,z as de,P as ue,E as T,I as ce,B as me,D as xe}from"./index-gNSmom8p.js";import{u as ge,r as he,B as pe}from"./tableSelection-CojkFPwd.js";import{C as fe}from"./ConfirmDialog-D9trL3a0.js";import{D as be}from"./DataTable-CrQq0sYf.js";import{F as $}from"./Field-DEJ6Wjg9.js";import{C as E,I as je,a as ve,b as ye,B as x,d as k,S as Ne}from"./heroui-DZj66Arc.js";const Se=50;function _e({value:t,onChange:r,users:a,label:o,description:l}){const[g,h]=i.useState(""),d=i.useMemo(()=>a.filter(s=>!s.user_id.startsWith("apikey-")).map(s=>({id:s.user_id,label:s.alias?`${s.user_id} (${s.alias})`:s.user_id})),[a]),p=i.useMemo(()=>{const s=g.trim().toLowerCase();return d.filter(u=>!t.includes(u.id)).filter(u=>!s||u.id.toLowerCase().includes(s)||u.label.toLowerCase().includes(s)).slice(0,Se)},[d,t,g]),c=s=>{t.includes(s)||r([...t,s]),h("")},m=s=>r(t.filter(u=>u!==s));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:o}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[s,e.jsx("button",{type:"button","aria-label":`Remove ${s}`,onClick:()=>m(s),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},s))}):null,d.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:h,selectedKey:null,onSelectionChange:s=>{s!=null&&c(String(s))},className:"flex flex-col gap-1",children:[e.jsxs(E.InputGroup,{children:[e.jsx(je,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(ve,{items:p,className:"max-h-72 overflow-auto",children:s=>e.jsx(ye,{id:s.id,textValue:s.label,children:s.label})})})]})]})}const Ce=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function D(t){return Ce.format(t)}const j=86400,W=3600,O=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function we(t){if(t===null)return"No reset";const r=O.find(a=>a.seconds===t);return r?r.label:t%j===0?`Every ${t/j} days`:t%W===0?`Every ${t/W} hours`:`Every ${t}s`}function q(t){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function De(t){const r=t.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function Y(t){return t!==null&&t%j===0?String(t/j):""}function Be({value:t,onChange:r,onInvalidChange:a}){const o=O.some(s=>s.seconds===t),[l,g]=i.useState(!o),[h,d]=i.useState(()=>Y(t)),p=h.trim(),c=Number(p),m=p!==""&&(!Number.isSafeInteger(c)||c<=0);return i.useEffect(()=>{a==null||a(m)},[m,a]),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.map(s=>e.jsx(x,{size:"sm",variant:!l&&t===s.seconds?"primary":"outline",onPress:()=>{g(!1),d(Y(s.seconds)),r(s.seconds)},children:s.label},s.label)),e.jsx(x,{size:"sm",variant:l?"primary":"outline",onPress:()=>g(!0),children:"Custom"})]}),l?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx($,{label:"Every N days",value:h,onChange:s=>{d(s);const u=Number(s.trim());r(s.trim()===""||!Number.isSafeInteger(u)||u<=0?null:u*j)},placeholder:"14",description:m?e.jsx("span",{className:"text-red-700",children:"Enter a whole number of days."}):"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function G({title:t,submitLabel:r,initial:a,error:o,isPending:l,onSubmit:g,onClose:h,assignUsers:d}){const[p,c]=i.useState(a.name??""),[m,s]=i.useState(a.max_budget===null?"":String(a.max_budget)),[u,b]=i.useState(a.budget_duration_sec),[S,v]=i.useState(!1),[B,P]=i.useState([]),f=De(m),A=!l&&f.valid&&!S,C=()=>{A&&g({name:p.trim()||null,max_budget:f.value,budget_duration_sec:u},B)};return e.jsx(k,{children:e.jsxs(k.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(T,{error:o}),e.jsx($,{label:"Name (optional)",value:p,onChange:c,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx($,{label:"Spending limit (USD)",value:m,onChange:s,placeholder:"100.00",description:f.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(Be,{value:u,onChange:b,onInvalidChange:v}),d?e.jsx(_e,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:B,onChange:P,users:d}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:!A,onPress:C,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:h,children:"Cancel"})]})]})})}function Pe({budget:t}){if(t.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=t.total_spend;if(t.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[D(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=t.max_budget*t.user_count,o=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:D(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",D(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(o,l?100:2)}%`}})})]})}function Ae({budgetId:t}){const r=xe(t);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(Ne,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:o.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:D(o.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:q(o.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:q(o.next_reset_at)})]},o.id))})]})})}function Ee({label:t,isPending:r,onConfirm:a}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:t}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}const ke=t=>t.budget_id;function Q(t){return t.split("-")[0]}function z(t){return t.name??Q(t.budget_id)}function Te(){const t=ae(),r=re(),a=le(),o=ie(),l=oe(),g=de(),[h,d]=i.useState(!1),[p,c]=i.useState(null),[m,s]=i.useState(null),[u,b]=i.useState(null),[S,v]=i.useState(null),[B,P]=i.useState(!1),f=ge(),[A,C]=i.useState(!1),[X,F]=i.useState(void 0),[J,H]=i.useState(!1),w=t.data??[],K=t.isLoading,y=w.find(n=>n.budget_id===p)??null,U=w.find(n=>n.budget_id===m)??null,L=!K&&w.length===0&&!h,Z=w.map(n=>n.budget_id),_=he(f.selectedKeys,Z),ee=async()=>{H(!0),F(void 0);try{for(const n of _)await l.mutateAsync(n);f.clear(),C(!1)}catch(n){F(n)}finally{H(!1)}},te=i.useMemo(()=>[{id:"budget",header:"Budget",isRowHeader:!0,cell:n=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:Q(n.budget_id)})]})},{id:"limit",header:"Limit (per user)",cell:n=>n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):D(n.max_budget)},{id:"reset",header:"Reset",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:we(n.budget_duration_sec)})},{id:"users",header:"Users",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:n.user_count})},{id:"usage",header:"Usage",cell:n=>e.jsx(Pe,{budget:n})},{id:"actions",header:"Actions",align:"end",cell:n=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(N=>N===n.budget_id?null:n.budget_id),children:m===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{d(!1),c(n.budget_id)},children:"Edit"}),e.jsx(Ee,{label:z(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})}],[m,l.isPending,l.mutate]),V=async(n,N)=>{P(!0),b(null);const I=await Promise.allSettled(N.map(M=>g.mutateAsync({id:M,body:{budget_id:n}})));P(!1);const R=I.flatMap((M,ne)=>M.status==="rejected"?[N[ne]]:[]);if(R.length>0){v({budgetId:n,userIds:R}),b(new Error(`Budget created, but could not assign it to: ${R.join(", ")}. Retry to try again.`));return}v(null),d(!1)},se=(n,N)=>{if(S){V(S.budgetId,S.userIds);return}b(null),a.mutate(n,{onSuccess:async I=>{if(N.length>0){await V(I.budget_id,N);return}d(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ue,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:h||L?null:e.jsx(x,{variant:"primary",onPress:()=>{c(null),b(null),v(null),d(!0)},children:"Create budget"})}),e.jsx(T,{error:t.error??a.error??o.error??l.error??g.error}),e.jsx(ce,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),L?e.jsx(me,{title:"No budgets yet",description:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit.",actionLabel:"Create your first budget",onAction:()=>{c(null),b(null),v(null),d(!0)}}):null,h?e.jsx(G,{title:"Create budget",submitLabel:S?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??u,isPending:a.isPending||B,assignUsers:r.data??[],onSubmit:se,onClose:()=>{b(null),v(null),d(!1)}}):null,y?e.jsx(G,{title:`Edit budget ${z(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:o.error,isPending:o.isPending,onSubmit:n=>o.mutate({id:y.budget_id,body:n},{onSuccess:()=>c(null)}),onClose:()=>c(null)},y.budget_id):null,_.length>0?e.jsx(pe,{selectedCount:_.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:f.clear,children:e.jsx(x,{size:"sm",variant:"danger",onPress:()=>C(!0),children:"Delete"})}):null,L?null:e.jsx(be,{ariaLabel:"Budgets",columns:te,rows:w,getRowKey:ke,isLoading:K,emptyContent:"No budgets yet. Create one to cap spending.",selectionMode:"multiple",selectedKeys:f.selectedKeys,onSelectionChange:f.onSelectionChange}),U?e.jsx(k,{children:e.jsxs(k.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsxs("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:["Reset history — ",z(U)]}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(null),children:"Close"})]}),e.jsx(Ae,{budgetId:U.budget_id})]})}):null,e.jsx(fe,{isOpen:A,onOpenChange:C,heading:"Delete budgets",body:`Delete ${_.length} ${_.length===1?"budget":"budgets"}? Users on ${_.length===1?"it":"them"} will no longer be capped.`,confirmLabel:"Delete",isPending:J,error:X,onConfirm:ee})]})}export{Te as BudgetsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{v as ae,u as re,w as le,x as ie,y as oe,z as de,P as ue,E as T,I as ce,B as me,D as xe}from"./index-C-bDZxkO.js";import{u as ge,r as he,B as pe}from"./tableSelection-CojkFPwd.js";import{C as fe}from"./ConfirmDialog-BBkZMSqE.js";import{D as be}from"./DataTable-CrQq0sYf.js";import{F as $}from"./Field-DEJ6Wjg9.js";import{C as E,I as je,a as ve,b as ye,B as x,d as k,S as Ne}from"./heroui-DZj66Arc.js";const Se=50;function _e({value:t,onChange:r,users:a,label:o,description:l}){const[g,h]=i.useState(""),d=i.useMemo(()=>a.filter(s=>!s.user_id.startsWith("apikey-")).map(s=>({id:s.user_id,label:s.alias?`${s.user_id} (${s.alias})`:s.user_id})),[a]),p=i.useMemo(()=>{const s=g.trim().toLowerCase();return d.filter(u=>!t.includes(u.id)).filter(u=>!s||u.id.toLowerCase().includes(s)||u.label.toLowerCase().includes(s)).slice(0,Se)},[d,t,g]),c=s=>{t.includes(s)||r([...t,s]),h("")},m=s=>r(t.filter(u=>u!==s));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:o}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[s,e.jsx("button",{type:"button","aria-label":`Remove ${s}`,onClick:()=>m(s),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},s))}):null,d.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:h,selectedKey:null,onSelectionChange:s=>{s!=null&&c(String(s))},className:"flex flex-col gap-1",children:[e.jsxs(E.InputGroup,{children:[e.jsx(je,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(ve,{items:p,className:"max-h-72 overflow-auto",children:s=>e.jsx(ye,{id:s.id,textValue:s.label,children:s.label})})})]})]})}const Ce=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function D(t){return Ce.format(t)}const j=86400,W=3600,O=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function we(t){if(t===null)return"No reset";const r=O.find(a=>a.seconds===t);return r?r.label:t%j===0?`Every ${t/j} days`:t%W===0?`Every ${t/W} hours`:`Every ${t}s`}function q(t){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function De(t){const r=t.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function Y(t){return t!==null&&t%j===0?String(t/j):""}function Be({value:t,onChange:r,onInvalidChange:a}){const o=O.some(s=>s.seconds===t),[l,g]=i.useState(!o),[h,d]=i.useState(()=>Y(t)),p=h.trim(),c=Number(p),m=p!==""&&(!Number.isSafeInteger(c)||c<=0);return i.useEffect(()=>{a==null||a(m)},[m,a]),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.map(s=>e.jsx(x,{size:"sm",variant:!l&&t===s.seconds?"primary":"outline",onPress:()=>{g(!1),d(Y(s.seconds)),r(s.seconds)},children:s.label},s.label)),e.jsx(x,{size:"sm",variant:l?"primary":"outline",onPress:()=>g(!0),children:"Custom"})]}),l?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx($,{label:"Every N days",value:h,onChange:s=>{d(s);const u=Number(s.trim());r(s.trim()===""||!Number.isSafeInteger(u)||u<=0?null:u*j)},placeholder:"14",description:m?e.jsx("span",{className:"text-red-700",children:"Enter a whole number of days."}):"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function G({title:t,submitLabel:r,initial:a,error:o,isPending:l,onSubmit:g,onClose:h,assignUsers:d}){const[p,c]=i.useState(a.name??""),[m,s]=i.useState(a.max_budget===null?"":String(a.max_budget)),[u,b]=i.useState(a.budget_duration_sec),[S,v]=i.useState(!1),[B,P]=i.useState([]),f=De(m),A=!l&&f.valid&&!S,C=()=>{A&&g({name:p.trim()||null,max_budget:f.value,budget_duration_sec:u},B)};return e.jsx(k,{children:e.jsxs(k.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(T,{error:o}),e.jsx($,{label:"Name (optional)",value:p,onChange:c,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx($,{label:"Spending limit (USD)",value:m,onChange:s,placeholder:"100.00",description:f.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(Be,{value:u,onChange:b,onInvalidChange:v}),d?e.jsx(_e,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:B,onChange:P,users:d}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:!A,onPress:C,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:h,children:"Cancel"})]})]})})}function Pe({budget:t}){if(t.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=t.total_spend;if(t.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[D(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=t.max_budget*t.user_count,o=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:D(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",D(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(o,l?100:2)}%`}})})]})}function Ae({budgetId:t}){const r=xe(t);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(Ne,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:o.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:D(o.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:q(o.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:q(o.next_reset_at)})]},o.id))})]})})}function Ee({label:t,isPending:r,onConfirm:a}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:t}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}const ke=t=>t.budget_id;function Q(t){return t.split("-")[0]}function z(t){return t.name??Q(t.budget_id)}function Te(){const t=ae(),r=re(),a=le(),o=ie(),l=oe(),g=de(),[h,d]=i.useState(!1),[p,c]=i.useState(null),[m,s]=i.useState(null),[u,b]=i.useState(null),[S,v]=i.useState(null),[B,P]=i.useState(!1),f=ge(),[A,C]=i.useState(!1),[X,F]=i.useState(void 0),[J,H]=i.useState(!1),w=t.data??[],K=t.isLoading,y=w.find(n=>n.budget_id===p)??null,U=w.find(n=>n.budget_id===m)??null,L=!K&&w.length===0&&!h,Z=w.map(n=>n.budget_id),_=he(f.selectedKeys,Z),ee=async()=>{H(!0),F(void 0);try{for(const n of _)await l.mutateAsync(n);f.clear(),C(!1)}catch(n){F(n)}finally{H(!1)}},te=i.useMemo(()=>[{id:"budget",header:"Budget",isRowHeader:!0,cell:n=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:Q(n.budget_id)})]})},{id:"limit",header:"Limit (per user)",cell:n=>n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):D(n.max_budget)},{id:"reset",header:"Reset",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:we(n.budget_duration_sec)})},{id:"users",header:"Users",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:n.user_count})},{id:"usage",header:"Usage",cell:n=>e.jsx(Pe,{budget:n})},{id:"actions",header:"Actions",align:"end",cell:n=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(N=>N===n.budget_id?null:n.budget_id),children:m===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{d(!1),c(n.budget_id)},children:"Edit"}),e.jsx(Ee,{label:z(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})}],[m,l.isPending,l.mutate]),V=async(n,N)=>{P(!0),b(null);const I=await Promise.allSettled(N.map(M=>g.mutateAsync({id:M,body:{budget_id:n}})));P(!1);const R=I.flatMap((M,ne)=>M.status==="rejected"?[N[ne]]:[]);if(R.length>0){v({budgetId:n,userIds:R}),b(new Error(`Budget created, but could not assign it to: ${R.join(", ")}. Retry to try again.`));return}v(null),d(!1)},se=(n,N)=>{if(S){V(S.budgetId,S.userIds);return}b(null),a.mutate(n,{onSuccess:async I=>{if(N.length>0){await V(I.budget_id,N);return}d(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ue,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:h||L?null:e.jsx(x,{variant:"primary",onPress:()=>{c(null),b(null),v(null),d(!0)},children:"Create budget"})}),e.jsx(T,{error:t.error??a.error??o.error??l.error??g.error}),e.jsx(ce,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),L?e.jsx(me,{title:"No budgets yet",description:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit.",actionLabel:"Create your first budget",onAction:()=>{c(null),b(null),v(null),d(!0)}}):null,h?e.jsx(G,{title:"Create budget",submitLabel:S?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??u,isPending:a.isPending||B,assignUsers:r.data??[],onSubmit:se,onClose:()=>{b(null),v(null),d(!1)}}):null,y?e.jsx(G,{title:`Edit budget ${z(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:o.error,isPending:o.isPending,onSubmit:n=>o.mutate({id:y.budget_id,body:n},{onSuccess:()=>c(null)}),onClose:()=>c(null)},y.budget_id):null,_.length>0?e.jsx(pe,{selectedCount:_.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:f.clear,children:e.jsx(x,{size:"sm",variant:"danger",onPress:()=>C(!0),children:"Delete"})}):null,L?null:e.jsx(be,{ariaLabel:"Budgets",columns:te,rows:w,getRowKey:ke,isLoading:K,emptyContent:"No budgets yet. Create one to cap spending.",selectionMode:"multiple",selectedKeys:f.selectedKeys,onSelectionChange:f.onSelectionChange}),U?e.jsx(k,{children:e.jsxs(k.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsxs("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:["Reset history — ",z(U)]}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(null),children:"Close"})]}),e.jsx(Ae,{budgetId:U.budget_id})]})}):null,e.jsx(fe,{isOpen:A,onOpenChange:C,heading:"Delete budgets",body:`Delete ${_.length} ${_.length===1?"budget":"budgets"}? Users on ${_.length===1?"it":"them"} will no longer be capped.`,confirmLabel:"Delete",isPending:J,error:X,onConfirm:ee})]})}export{Te as BudgetsPage}; diff --git a/src/gateway/static/dashboard/assets/ConfirmDialog-D9trL3a0.js b/src/gateway/static/dashboard/assets/ConfirmDialog-BBkZMSqE.js similarity index 92% rename from src/gateway/static/dashboard/assets/ConfirmDialog-D9trL3a0.js rename to src/gateway/static/dashboard/assets/ConfirmDialog-BBkZMSqE.js index c6b2c0fd7..54792a617 100644 --- a/src/gateway/static/dashboard/assets/ConfirmDialog-D9trL3a0.js +++ b/src/gateway/static/dashboard/assets/ConfirmDialog-BBkZMSqE.js @@ -1 +1 @@ -import{j as r}from"./tanstack-query-1t81HyiD.js";import{E as j}from"./index-gNSmom8p.js";import{A as e,B as l}from"./heroui-DZj66Arc.js";function p({isOpen:s,onOpenChange:a,heading:n,body:o,confirmLabel:t,confirmVariant:c="danger",isPending:i,error:d,onConfirm:x}){return r.jsx(e,{isOpen:s,onOpenChange:a,children:s?r.jsx(e.Backdrop,{children:r.jsx(e.Container,{placement:"center",size:"md",children:r.jsxs(e.Dialog,{children:[r.jsx(e.Header,{children:r.jsx(e.Heading,{children:n})}),r.jsxs(e.Body,{className:"flex flex-col gap-4",children:[r.jsx("div",{className:"text-sm text-[var(--otari-muted)]",children:o}),r.jsx(j,{error:d})]}),r.jsxs(e.Footer,{children:[r.jsx(l,{variant:"ghost",isDisabled:i,onPress:()=>a(!1),children:"Cancel"}),r.jsx(l,{variant:c,isPending:i,onPress:x,children:t})]})]})})}):null})}export{p as C}; +import{j as r}from"./tanstack-query-1t81HyiD.js";import{E as j}from"./index-C-bDZxkO.js";import{A as e,B as l}from"./heroui-DZj66Arc.js";function p({isOpen:s,onOpenChange:a,heading:n,body:o,confirmLabel:t,confirmVariant:c="danger",isPending:i,error:d,onConfirm:x}){return r.jsx(e,{isOpen:s,onOpenChange:a,children:s?r.jsx(e.Backdrop,{children:r.jsx(e.Container,{placement:"center",size:"md",children:r.jsxs(e.Dialog,{children:[r.jsx(e.Header,{children:r.jsx(e.Heading,{children:n})}),r.jsxs(e.Body,{className:"flex flex-col gap-4",children:[r.jsx("div",{className:"text-sm text-[var(--otari-muted)]",children:o}),r.jsx(j,{error:d})]}),r.jsxs(e.Footer,{children:[r.jsx(l,{variant:"ghost",isDisabled:i,onPress:()=>a(!1),children:"Cancel"}),r.jsx(l,{variant:c,isPending:i,onPress:x,children:t})]})]})})}):null})}export{p as C}; diff --git a/src/gateway/static/dashboard/assets/DocsPage-Dcxbdpf9.js b/src/gateway/static/dashboard/assets/DocsPage-DoYdRqgR.js similarity index 99% rename from src/gateway/static/dashboard/assets/DocsPage-Dcxbdpf9.js rename to src/gateway/static/dashboard/assets/DocsPage-DoYdRqgR.js index 4ef54e954..8164a7c3f 100644 --- a/src/gateway/static/dashboard/assets/DocsPage-Dcxbdpf9.js +++ b/src/gateway/static/dashboard/assets/DocsPage-DoYdRqgR.js @@ -1,4 +1,4 @@ -import{j as re}from"./tanstack-query-1t81HyiD.js";import{P as gi}from"./index-gNSmom8p.js";import{d as ct}from"./heroui-DZj66Arc.js";import{g as nr}from"./react-dgEcD0HR.js";function yi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi={};function ht(e,t){return(bi.jsx?xi:ki).test(e)}const wi=/[ \t\n\f\r]/g;function Si(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(wi,"")===""}class Ke{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function tr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ke(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ci=0;const L=Te(),Y=Te(),Dn=Te(),E=Te(),$=Te(),ve=Te(),te=Te();function Te(){return 2**++Ci}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:ve,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ai.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Di);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Ti,zi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function zi(e){return"-"+e.toLowerCase()}function Di(e){return e.charAt(1).toUpperCase()}const Li=tr([rr,Ei,or,ar,sr],"html"),qn=tr([rr,vi,or,ar,sr],"svg");function _i(e){return e.join(" ").trim()}var De={},mn,dt;function Ri(){if(dt)return mn;dt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=` +import{j as re}from"./tanstack-query-1t81HyiD.js";import{P as gi}from"./index-C-bDZxkO.js";import{d as ct}from"./heroui-DZj66Arc.js";import{g as nr}from"./react-dgEcD0HR.js";function yi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi={};function ht(e,t){return(bi.jsx?xi:ki).test(e)}const wi=/[ \t\n\f\r]/g;function Si(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(wi,"")===""}class Ke{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function tr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ke(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ci=0;const L=Te(),Y=Te(),Dn=Te(),E=Te(),$=Te(),ve=Te(),te=Te();function Te(){return 2**++Ci}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:ve,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ai.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Di);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Ti,zi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function zi(e){return"-"+e.toLowerCase()}function Di(e){return e.charAt(1).toUpperCase()}const Li=tr([rr,Ei,or,ar,sr],"html"),qn=tr([rr,vi,or,ar,sr],"svg");function _i(e){return e.join(" ").trim()}var De={},mn,dt;function Ri(){if(dt)return mn;dt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=` `,u="/",h="*",c="",p="comment",f="declaration";function g(S,y){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];y=y||{};var v=1,C=1;function R(D){var T=D.match(t);T&&(v+=T.length);var U=D.lastIndexOf(s);C=~U?D.length-U:C+D.length}function F(){var D={line:v,column:C};return function(T){return T.position=new b(D),j(),T}}function b(D){this.start=D,this.end={line:v,column:C},this.source=y.source}b.prototype.content=S;function M(D){var T=new Error(y.source+":"+v+":"+C+": "+D);if(T.reason=D,T.filename=y.source,T.line=v,T.column=C,T.source=S,!y.silent)throw T}function H(D){var T=D.exec(S);if(T){var U=T[0];return R(U),S=S.slice(U.length),T}}function j(){H(n)}function k(D){var T;for(D=D||[];T=A();)T!==!1&&D.push(T);return D}function A(){var D=F();if(!(u!=S.charAt(0)||h!=S.charAt(1))){for(var T=2;c!=S.charAt(T)&&(h!=S.charAt(T)||u!=S.charAt(T+1));)++T;if(T+=2,c===S.charAt(T-1))return M("End of comment missing");var U=S.slice(2,T-2);return C+=2,R(U),S=S.slice(T),C+=2,D({type:p,comment:U})}}function P(){var D=F(),T=H(r);if(T){if(A(),!H(i))return M("property missing ':'");var U=H(o),K=D({type:f,property:w(T[0].replace(e,c)),value:U?w(U[0].replace(e,c)):c});return H(l),K}}function q(){var D=[];k(D);for(var T;T=P();)T!==!1&&(D.push(T),k(D));return D}return j(),q()}function w(S){return S?S.replace(a,c):c}return mn=g,mn}var gt;function Fi(){if(gt)return De;gt=1;var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(De,"__esModule",{value:!0}),De.default=n;const t=e(Ri());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),a=typeof i=="function";return l.forEach(s=>{if(s.type!=="declaration")return;const{property:u,value:h}=s;a?i(u,h,s):h&&(o=o||{},o[u]=h)}),o}return De}var Be={},yt;function Oi(){if(yt)return Be;yt=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(u){return!u||n.test(u)||e.test(u)},l=function(u,h){return h.toUpperCase()},a=function(u,h){return"".concat(h,"-")},s=function(u,h){return h===void 0&&(h={}),o(u)?u:(u=u.toLowerCase(),h.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(t,l))};return Be.camelCase=s,Be}var je,kt;function Mi(){if(kt)return je;kt=1;var e=je&&je.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Fi()),n=Oi();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(a,s){a&&s&&(l[(0,n.camelCase)(a,o)]=s)}),l}return r.default=r,je=r,je}var Ni=Mi();const Bi=nr(Ni),ur=cr("end"),Un=cr("start");function cr(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ji(e){const t=Un(e),n=ur(e);if(t&&n)return{start:t,end:n}}function Ue(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xt(e.position):"start"in e||"end"in e?xt(e):"line"in e||"column"in e?_n(e):""}function _n(e){return bt(e&&e.line)+":"+bt(e&&e.column)}function xt(e){return _n(e&&e.start)+"-"+_n(e&&e.end)}function bt(e){return e&&typeof e=="number"?e:1}class G extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?o.ruleId=r:(o.source=r.slice(0,s),o.ruleId=r.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){const s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ue(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}G.prototype.file="";G.prototype.name="";G.prototype.reason="";G.prototype.message="";G.prototype.stack="";G.prototype.column=void 0;G.prototype.line=void 0;G.prototype.ancestors=void 0;G.prototype.cause=void 0;G.prototype.fatal=void 0;G.prototype.place=void 0;G.prototype.ruleId=void 0;G.prototype.source=void 0;const Vn={}.hasOwnProperty,Hi=new Map,qi=/[A-Z]/g,Ui=new Set(["table","tbody","thead","tfoot","tr"]),Vi=new Set(["td","th"]),hr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $i(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Zi(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ji(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qn:Li,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=fr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function fr(e,t,n){if(t.type==="element")return Wi(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Yi(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Qi(e,t,n);if(t.type==="mdxjsEsm")return Ki(e,t);if(t.type==="root")return Xi(e,t,n);if(t.type==="text")return Gi(e,t)}function Wi(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=qn,e.schema=i),e.ancestors.push(t);const o=mr(e,t.tagName,!1),l=el(e,t);let a=Wn(e,t);return Ui.has(t.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!Si(s):!0})),pr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Yi(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}We(e,t.position)}function Ki(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);We(e,t.position)}function Qi(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=qn,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:mr(e,t.name,!0),l=nl(e,t),a=Wn(e,t);return pr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Xi(e,t,n){const r={};return $n(r,Wn(e,t)),e.create(t,e.Fragment,r,n)}function Gi(e,t){return t.value}function pr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $n(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ji(e,t,n){return r;function r(i,o,l,a){const u=Array.isArray(l.children)?n:t;return a?u(o,l,a):u(o,l)}}function Zi(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),s=Un(r);return t(i,o,l,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function el(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Vn.call(t.properties,i)){const o=tl(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&Vi.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function nl(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else We(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else We(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Wn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Hi;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(ie(e,e.length,0,t),e):t}const Ct={}.hasOwnProperty;function gr(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ce(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const J=be(/[A-Za-z]/),X=be(/[\dA-Za-z]/),hl=be(/[#-'*+\--9=?A-Z^-~]/);function rn(e){return e!==null&&(e<32||e===127)}const Rn=be(/\d/),fl=be(/[\dA-Fa-f]/),pl=be(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function W(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}const sn=be(new RegExp("\\p{P}|\\p{S}","u")),Ie=be(/\s/);function be(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fe(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function B(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(s){return O(s)?(e.enter(n),a(s)):t(s)}function a(s){return O(s)&&o++l))return;const M=t.events.length;let H=M,j,k;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(j){k=t.events[H][1].end;break}j=!0}for(y(r),b=M;bC;){const F=n[R];t.containerState=F[1],F[0].exit.call(t,e)}n.length=C}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function kl(e,t,n){return B(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _e(e){if(e===null||W(e)||Ie(e))return 1;if(sn(e))return 2}function un(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};vt(c,-s),vt(p,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:s>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=le(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=le(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=le(u,un(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=le(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,u=le(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,ie(e,r-1,n-r+3,u),n=r+u.length-h-2;break}}for(n=-1;++n0&&O(b)?B(e,v,"linePrefix",o+1)(b):v(b)}function v(b){return b===null||z(b)?e.check(It,w,R)(b):(e.enter("codeFlowValue"),C(b))}function C(b){return b===null||z(b)?(e.exit("codeFlowValue"),v(b)):(e.consume(b),C)}function R(b){return e.exit("codeFenced"),t(b)}function F(b,M,H){let j=0;return k;function k(T){return b.enter("lineEnding"),b.consume(T),b.exit("lineEnding"),A}function A(T){return b.enter("codeFencedFence"),O(T)?B(b,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):P(T)}function P(T){return T===a?(b.enter("codeFencedFenceSequence"),q(T)):H(T)}function q(T){return T===a?(j++,b.consume(T),q):j>=l?(b.exit("codeFencedFenceSequence"),O(T)?B(b,D,"whitespace")(T):D(T)):H(T)}function D(T){return T===null||z(T)?(b.exit("codeFencedFence"),M(T)):H(T)}}}function zl(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const gn={name:"codeIndented",tokenize:Ll},Dl={partial:!0,tokenize:_l};function Ll(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),B(e,o,"linePrefix",5)(u)}function o(u){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?s(u):z(u)?e.attempt(Dl,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||z(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),t(u)}}function _l(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):B(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):z(l)?i(l):n(l)}}const Rl={name:"codeText",previous:Ol,resolve:Fl,tokenize:Ml};function Fl(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&He(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),He(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),He(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Sr(e,t,n,r,i,o,l,a,s){const u=s||Number.POSITIVE_INFINITY;let h=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||rn(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||z(y)?n(y):(e.consume(y),y===92?g:f)}function g(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function w(y){return!h&&(y===null||y===41||W(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):h999||f===null||f===91||f===93&&!s||f===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===null||f===91||f===93||z(f)||a++>999?(e.exit("chunkString"),h(f)):(e.consume(f),s||(s=!O(f)),f===92?p:c)}function p(f){return f===91||f===92||f===93?(e.consume(f),a++,c):c(f)}}function Er(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,s):n(p)}function s(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),s(l)):p===null?n(p):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),B(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===l||p===null||z(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:h)}function c(p){return p===l||p===92?(e.consume(p),h):h(p)}}function Ve(e,t){let n;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):O(i)?B(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const $l={name:"definition",tokenize:Yl},Wl={partial:!0,tokenize:Kl};function Yl(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),l(f)}function l(f){return Cr.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=ce(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),s):n(f)}function s(f){return W(f)?Ve(e,u)(f):u(f)}function u(f){return Sr(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function h(f){return e.attempt(Wl,c,c)(f)}function c(f){return O(f)?B(e,p,"whitespace")(f):p(f)}function p(f){return f===null||z(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function Kl(e,t,n){return r;function r(a){return W(a)?Ve(e,i)(a):n(a)}function i(a){return Er(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return O(a)?B(e,l,"whitespace")(a):l(a)}function l(a){return a===null||z(a)?t(a):n(a)}}const Ql={name:"hardBreakEscape",tokenize:Xl};function Xl(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return z(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Gl={name:"headingAtx",resolve:Jl,tokenize:Zl};function Jl(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ie(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Zl(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),o(h)}function o(h){return e.enter("atxHeadingSequence"),l(h)}function l(h){return h===35&&r++<6?(e.consume(h),l):h===null||W(h)?(e.exit("atxHeadingSequence"),a(h)):n(h)}function a(h){return h===35?(e.enter("atxHeadingSequence"),s(h)):h===null||z(h)?(e.exit("atxHeading"),t(h)):O(h)?B(e,a,"whitespace")(h):(e.enter("atxHeadingText"),u(h))}function s(h){return h===35?(e.consume(h),s):(e.exit("atxHeadingSequence"),a(h))}function u(h){return h===null||h===35||W(h)?(e.exit("atxHeadingText"),a(h)):(e.consume(h),u)}}const eo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],At=["pre","script","style","textarea"],no={concrete:!0,name:"htmlFlow",resolveTo:io,tokenize:lo},to={partial:!0,tokenize:ao},ro={partial:!0,tokenize:oo};function io(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function lo(e,t,n){const r=this;let i,o,l,a,s;return u;function u(d){return h(d)}function h(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,w):d===63?(e.consume(d),i=3,r.interrupt?t:m):J(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function p(d){return d===45?(e.consume(d),i=2,f):d===91?(e.consume(d),i=5,a=0,g):J(d)?(e.consume(d),i=4,r.interrupt?t:m):n(d)}function f(d){return d===45?(e.consume(d),r.interrupt?t:m):n(d)}function g(d){const se="CDATA[";return d===se.charCodeAt(a++)?(e.consume(d),a===se.length?r.interrupt?t:P:g):n(d)}function w(d){return J(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function S(d){if(d===null||d===47||d===62||W(d)){const se=d===47,we=l.toLowerCase();return!se&&!o&&At.includes(we)?(i=1,r.interrupt?t(d):P(d)):eo.includes(l.toLowerCase())?(i=6,se?(e.consume(d),y):r.interrupt?t(d):P(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(d):o?v(d):C(d))}return d===45||X(d)?(e.consume(d),l+=String.fromCharCode(d),S):n(d)}function y(d){return d===62?(e.consume(d),r.interrupt?t:P):n(d)}function v(d){return O(d)?(e.consume(d),v):k(d)}function C(d){return d===47?(e.consume(d),k):d===58||d===95||J(d)?(e.consume(d),R):O(d)?(e.consume(d),C):k(d)}function R(d){return d===45||d===46||d===58||d===95||X(d)?(e.consume(d),R):F(d)}function F(d){return d===61?(e.consume(d),b):O(d)?(e.consume(d),F):C(d)}function b(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),s=d,M):O(d)?(e.consume(d),b):H(d)}function M(d){return d===s?(e.consume(d),s=null,j):d===null||z(d)?n(d):(e.consume(d),M)}function H(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||W(d)?F(d):(e.consume(d),H)}function j(d){return d===47||d===62||O(d)?C(d):n(d)}function k(d){return d===62?(e.consume(d),A):n(d)}function A(d){return d===null||z(d)?P(d):O(d)?(e.consume(d),A):n(d)}function P(d){return d===45&&i===2?(e.consume(d),U):d===60&&i===1?(e.consume(d),K):d===62&&i===4?(e.consume(d),ae):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),pe):z(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(to,me,q)(d)):d===null||z(d)?(e.exit("htmlFlowData"),q(d)):(e.consume(d),P)}function q(d){return e.check(ro,D,me)(d)}function D(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),T}function T(d){return d===null||z(d)?q(d):(e.enter("htmlFlowData"),P(d))}function U(d){return d===45?(e.consume(d),m):P(d)}function K(d){return d===47?(e.consume(d),l="",oe):P(d)}function oe(d){if(d===62){const se=l.toLowerCase();return At.includes(se)?(e.consume(d),ae):P(d)}return J(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),oe):P(d)}function pe(d){return d===93?(e.consume(d),m):P(d)}function m(d){return d===62?(e.consume(d),ae):d===45&&i===2?(e.consume(d),m):P(d)}function ae(d){return d===null||z(d)?(e.exit("htmlFlowData"),me(d)):(e.consume(d),ae)}function me(d){return e.exit("htmlFlow"),t(d)}}function oo(e,t,n){const r=this;return i;function i(l){return z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ao(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Qe,t,n)}}const so={name:"htmlText",tokenize:uo};function uo(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),s}function s(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),F):m===63?(e.consume(m),C):J(m)?(e.consume(m),H):n(m)}function u(m){return m===45?(e.consume(m),h):m===91?(e.consume(m),o=0,g):J(m)?(e.consume(m),v):n(m)}function h(m){return m===45?(e.consume(m),f):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):z(m)?(l=c,K(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),f):c(m)}function f(m){return m===62?U(m):m===45?p(m):c(m)}function g(m){const ae="CDATA[";return m===ae.charCodeAt(o++)?(e.consume(m),o===ae.length?w:g):n(m)}function w(m){return m===null?n(m):m===93?(e.consume(m),S):z(m)?(l=w,K(m)):(e.consume(m),w)}function S(m){return m===93?(e.consume(m),y):w(m)}function y(m){return m===62?U(m):m===93?(e.consume(m),y):w(m)}function v(m){return m===null||m===62?U(m):z(m)?(l=v,K(m)):(e.consume(m),v)}function C(m){return m===null?n(m):m===63?(e.consume(m),R):z(m)?(l=C,K(m)):(e.consume(m),C)}function R(m){return m===62?U(m):C(m)}function F(m){return J(m)?(e.consume(m),b):n(m)}function b(m){return m===45||X(m)?(e.consume(m),b):M(m)}function M(m){return z(m)?(l=M,K(m)):O(m)?(e.consume(m),M):U(m)}function H(m){return m===45||X(m)?(e.consume(m),H):m===47||m===62||W(m)?j(m):n(m)}function j(m){return m===47?(e.consume(m),U):m===58||m===95||J(m)?(e.consume(m),k):z(m)?(l=j,K(m)):O(m)?(e.consume(m),j):U(m)}function k(m){return m===45||m===46||m===58||m===95||X(m)?(e.consume(m),k):A(m)}function A(m){return m===61?(e.consume(m),P):z(m)?(l=A,K(m)):O(m)?(e.consume(m),A):j(m)}function P(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,q):z(m)?(l=P,K(m)):O(m)?(e.consume(m),P):(e.consume(m),D)}function q(m){return m===i?(e.consume(m),i=void 0,T):m===null?n(m):z(m)?(l=q,K(m)):(e.consume(m),q)}function D(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||W(m)?j(m):(e.consume(m),D)}function T(m){return m===47||m===62||W(m)?j(m):n(m)}function U(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function K(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),oe}function oe(m){return O(m)?B(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):pe(m)}function pe(m){return e.enter("htmlTextData"),l(m)}}const Qn={name:"labelEnd",resolveAll:po,resolveTo:mo,tokenize:go},co={tokenize:yo},ho={tokenize:ko},fo={tokenize:xo};function po(e){let t=-1;const n=[];for(;++t=3&&(u===null||z(u))?(e.exit("thematicBreak"),t(u)):n(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),O(u)?B(e,a,"whitespace")(u):a(u))}}const Z={continuation:{tokenize:Po},exit:Do,name:"list",tokenize:Ao},Io={partial:!0,tokenize:Lo},To={partial:!0,tokenize:zo};function Ao(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(f){const g=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Rn(f)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(tn,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(f)}return n(f)}function s(f){return Rn(f)&&++l<10?(e.consume(f),s):(!r.interrupt||l<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Qe,r.interrupt?n:h,e.attempt(Io,p,c))}function h(f){return r.containerState.initialBlankLine=!0,o++,p(f)}function c(f){return O(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Po(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Qe,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,B(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!O(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(To,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,B(e,e.attempt(Z,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function zo(e,t,n){const r=this;return B(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function Do(e){e.exit(this.containerState.type)}function Lo(e,t,n){const r=this;return B(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!O(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Pt={name:"setextUnderline",resolveTo:_o,tokenize:Ro};function _o(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Ro(e,t,n){const r=this;let i;return o;function o(u){let h=r.events.length,c;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){c=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),O(u)?B(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||z(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Fo={tokenize:Oo};function Oo(e){const t=this,n=e.attempt(Qe,r,e.attempt(this.parser.constructs.flowInitial,i,B(e,e.attempt(this.parser.constructs.flow,i,e.attempt(jl,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Mo={resolveAll:Ir()},No=vr("string"),Bo=vr("text");function vr(e){return{resolveAll:Ir(e==="text"?jo:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(h){return u(h)?o(h):a(h)}function a(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),s}function s(h){return u(h)?(n.exit("data"),o(h)):(n.consume(h),s)}function u(h){if(h===null)return!0;const c=i[h];let p=-1;if(c)for(;++p-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Zo(e,t){let n=-1;const r=[];let i;for(;++n0){const ue=_.tokenStack[_.tokenStack.length-1];(ue[1]||Dt).call(_,void 0,ue[0])}for(I.position={start:xe(x.length>0?x[0][1].start:{line:1,column:1,offset:0}),end:xe(x.length>0?x[x.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++V=x)return o.format(Math.round(n/x),l);return o.format(n,"second")}function de(t){if(!t.expires_at)return!1;const a=new Date(t.expires_at).getTime();return!Number.isNaN(a)&&aString(r).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}T${n(a.getHours())}:${n(a.getMinutes())}`}const me=t=>(t??"").startsWith("apikey-"),K=t=>t.key_name??t.id,xe=t=>t.id;function M({label:t,value:a,multiline:n=!1,fieldRef:r}){const d=i.useRef(null),o=r??d,[l,x]=i.useState(!1),[g,p]=i.useState(!1),c=async()=>{var m,y,h;(m=o.current)==null||m.focus(),(y=o.current)==null||y.select();try{if((h=navigator.clipboard)!=null&&h.writeText){await navigator.clipboard.writeText(a),x(!0),p(!1),window.setTimeout(()=>x(!1),2e3);return}}catch{}p(!0)},u="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(f,{size:"sm",variant:"outline",onPress:c,children:l?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:o,readOnly:!0,rows:a.split(` +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{c as Y,G as U,H as Q,J as X,P as Z,E as O,B as ee,K as te,u as V,I as se}from"./index-C-bDZxkO.js";import{u as ae,r as ne,B as re}from"./tableSelection-CojkFPwd.js";import{C as ie}from"./ConfirmDialog-BBkZMSqE.js";import{D as le}from"./DataTable-CrQq0sYf.js";import{F as A}from"./Field-DEJ6Wjg9.js";import{a as F,M as q}from"./ModelScopeControl-gV_ax1BN.js";import{U as oe}from"./UserComboBox-nt7pHfqn.js";import{f as P,B as f,d as D}from"./heroui-DZj66Arc.js";function $(t){if(!t)return"—";const a=new Date(t);return Number.isNaN(a.getTime())?"—":a.toLocaleDateString()}function ce(t){if(!t)return null;const a=new Date(t).getTime();if(Number.isNaN(a))return null;const n=Math.round((a-Date.now())/1e3),r=Math.abs(n),d=[["day",86400],["hour",3600],["minute",60]],o=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[l,x]of d)if(r>=x)return o.format(Math.round(n/x),l);return o.format(n,"second")}function de(t){if(!t.expires_at)return!1;const a=new Date(t.expires_at).getTime();return!Number.isNaN(a)&&aString(r).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}T${n(a.getHours())}:${n(a.getMinutes())}`}const me=t=>(t??"").startsWith("apikey-"),K=t=>t.key_name??t.id,xe=t=>t.id;function M({label:t,value:a,multiline:n=!1,fieldRef:r}){const d=i.useRef(null),o=r??d,[l,x]=i.useState(!1),[g,p]=i.useState(!1),c=async()=>{var m,y,h;(m=o.current)==null||m.focus(),(y=o.current)==null||y.select();try{if((h=navigator.clipboard)!=null&&h.writeText){await navigator.clipboard.writeText(a),x(!0),p(!1),window.setTimeout(()=>x(!1),2e3);return}}catch{}p(!0)},u="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(f,{size:"sm",variant:"outline",onPress:c,children:l?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:o,readOnly:!0,rows:a.split(` `).length,value:a,onFocus:m=>m.currentTarget.select(),className:`${u} resize-none whitespace-pre`}):e.jsx("input",{ref:o,readOnly:!0,value:a,onFocus:m=>m.currentTarget.select(),className:u}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-green-700",children:l?"Copied to clipboard.":""}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function he({title:t,result:a,onClose:n}){const r=i.useRef(null),d=i.useRef(null),o=typeof window<"u"?window.location.origin:"",l=a.key;i.useEffect(()=>{var c,u;(c=d.current)==null||c.focus(),(u=d.current)==null||u.select()},[]);const x=c=>{var h;if(c.key!=="Tab")return;const u=(h=r.current)==null?void 0:h.querySelectorAll('button, input, textarea, a[href], [tabindex]:not([tabindex="-1"])');if(!u||u.length===0)return;const m=u[0],y=u[u.length-1];c.shiftKey&&document.activeElement===m?(c.preventDefault(),y.focus()):!c.shiftKey&&document.activeElement===y&&(c.preventDefault(),m.focus())},g=[`curl ${o}/v1/chat/completions \\`,` -H "Otari-Key: ${l}" \\`,' -H "Content-Type: application/json" \\',` -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'`].join(` `),p=["from openai import OpenAI","",`client = OpenAI(base_url="${o}/v1", api_key="${l}")`,"resp = client.chat.completions.create(",' model="your-model",',' messages=[{"role": "user", "content": "Hello"}],',")","print(resp.choices[0].message.content)"].join(` `);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:x,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(se,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",F(a.allowed_models).text,"."]}),e.jsx(M,{label:"Secret key",value:l,fieldRef:d}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(M,{label:"curl",value:g,multiline:!0}),e.jsx(M,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(f,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function H({trigger:t,message:a,confirmLabel:n,isPending:r,onConfirm:d}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:a}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(f,{size:"sm",variant:"danger",isDisabled:r,onPress:d,children:n}),e.jsx(f,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(f,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:t})}function G({userId:t,users:a}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const r=a.find(l=>l.user_id===n);if(!r)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:d}=F(r.allowed_models),o=r.allowed_models&&r.allowed_models.length>0?r.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:d.toLowerCase()}),o?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:o}),")"]}):null,". This key inherits that, or narrows within it."]})}function J({checked:t,onChange:a}){return e.jsxs("label",{className:"flex items-start gap-2 rounded-lg border border-[var(--otari-line)] p-3 text-sm",children:[e.jsx("input",{type:"checkbox",checked:t,onChange:n=>a(n.target.checked),className:"mt-0.5 h-4 w-4 accent-[var(--otari-brand)]","aria-label":"Exempt this key from budget"}),e.jsxs("span",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:"Exempt from budget"}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Requests on this key are logged with their cost but never counted toward the owner's budget or spend, and never blocked by it."})]})]})}function fe({onClose:t,onCreated:a}){const n=te(),r=V(),[d,o]=i.useState(""),[l,x]=i.useState(""),[g,p]=i.useState(!1),[c,u]=i.useState(""),[m,y]=i.useState(null),[h,N]=i.useState(!1),[v,I]=i.useState(!0),C=l!==""&&new Date(l).getTime(){if(n.isPending||!v||w)return;const b={key_name:d.trim()||null,user_id:c.trim(),expires_at:l?new Date(l).toISOString():null,allowed_models:m,exclude_from_budget:h};n.mutate(b,{onSuccess:j=>{a(j),t()}})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(A,{label:"Expires (optional)",value:l,onChange:x,type:"datetime-local",description:C?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(oe,{value:c,onChange:u,users:r.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(b=>!b),children:g?"Hide advanced":"Advanced"}),g?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(G,{userId:c,users:r.data??[]}),e.jsx(q,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(b,j)=>{y(b),I(j)}}),e.jsx(J,{checked:h,onChange:N})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!v||w,onPress:S,children:n.isPending?"Creating…":"Create key"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ge({apiKey:t,onClose:a}){const n=U(),r=V(),[d,o]=i.useState(t.key_name??""),[l,x]=i.useState(ue(t.expires_at)),[g,p]=i.useState(t.allowed_models),[c,u]=i.useState(t.exclude_from_budget),[m,y]=i.useState(!0),h=()=>{n.isPending||!m||n.mutate({id:t.id,body:{key_name:d.trim()||null,expires_at:l?new Date(l).toISOString():null,allowed_models:g,exclude_from_budget:c}},{onSuccess:a})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot"}),e.jsx(A,{label:"Expires",value:l,onChange:x,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(G,{userId:t.user_id,users:r.data??[]}):null,e.jsx(q,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(N,v)=>{p(N),y(v)}}),e.jsx(J,{checked:c,onChange:u}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!m,onPress:h,children:n.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function pe({apiKey:t}){return t.is_active?de(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function ye({allowed:t}){const{text:a,tone:n}=F(t),r=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",d=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${r}`,title:d,children:a})}function Ae(){const t=Y(),a=U(),n=Q(),r=X(),[d,o]=i.useState(!1),[l,x]=i.useState(null),[g,p]=i.useState(null),c=t.data??[],u=t.isLoading,m=c.find(s=>s.id===l)??null,y=!u&&c.length===0&&!d,h=ae(),[N,v]=i.useState(!1),[I,C]=i.useState(void 0),[w,S]=i.useState(!1),b=c.map(s=>s.id),j=ne(h.selectedKeys,b),E=c.filter(s=>j.includes(s.id)),z=i.useCallback((s,k)=>a.mutate({id:s.id,body:{is_active:k}}),[a.mutate]),L=i.useCallback(s=>n.mutate(s.id,{onSuccess:k=>p({title:`New secret for ${K(s)}`,result:k})}),[n.mutate]),R=async(s,k,T)=>{S(!0),C(void 0);try{for(const B of s)await k(B);h.clear(),T==null||T()}catch(B){C(B)}finally{S(!1)}},W=i.useMemo(()=>[{id:"name",header:"Name",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:s.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx(ye,{allowed:s.allowed_models}),s.exclude_from_budget?e.jsx("span",{className:"inline-flex items-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] px-2 py-0.5 text-xs font-medium text-[var(--otari-brand-dark)]",title:"Requests on this key are logged with cost but never counted toward budget",children:"Budget-exempt"}):null]})]})},{id:"status",header:"Status",cell:s=>e.jsx(pe,{apiKey:s})},{id:"owner",header:"Owner",cell:s=>me(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.user_id??"—"})},{id:"key",header:"Key",cell:s=>e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.key_prefix?`${s.key_prefix}…`:"—"})},{id:"created",header:"Created",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:$(s.created_at)})},{id:"last_used",header:"Last used",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:ce(s.last_used_at)??"never"})},{id:"expires",header:"Expires",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.expires_at?new Date(s.expires_at).toLocaleString():void 0,children:s.expires_at?$(s.expires_at):"never"})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:a.isPending,onPress:()=>z(s,!s.is_active),children:s.is_active?"Disable":"Enable"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{o(!1),x(s.id)},children:"Edit"}),e.jsx(H,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:K(s)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>L(s)}),s.is_active?null:e.jsx(H,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:r.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:K(s)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>r.mutate(s.id)})]})}],[a.isPending,n.isPending,r.isPending,r.mutate,z,L]),_=E.filter(s=>!s.is_active);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:d?null:e.jsx(f,{variant:"primary",onPress:()=>{x(null),o(!0)},children:"Create key"})}),e.jsx(O,{error:t.error??a.error??n.error??r.error}),y?e.jsx(ee,{title:"No API keys yet",description:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe.",actionLabel:"Create your first key",onAction:()=>{x(null),o(!0)}}):null,d?e.jsx(fe,{onClose:()=>o(!1),onCreated:s=>p({title:"API key created",result:s})}):null,m?e.jsx(ge,{apiKey:m,onClose:()=>x(null)},m.id):null,j.length>0?e.jsxs(re,{selectedCount:j.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:h.clear,children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{is_active:!1}})),children:"Disable"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{exclude_from_budget:!0}})),children:"Budget-exempt"}),e.jsx(f,{size:"sm",variant:"danger",isDisabled:_.length===0,onPress:()=>v(!0),children:"Delete"})]}):null,y?null:e.jsx(le,{ariaLabel:"API keys",columns:W,rows:c,getRowKey:xe,isLoading:u,emptyContent:"No API keys yet. Create one to authenticate a caller.",selectionMode:"multiple",selectedKeys:h.selectedKeys,onSelectionChange:h.onSelectionChange}),e.jsx(ie,{isOpen:N,onOpenChange:v,heading:"Delete API keys",body:`Permanently delete ${_.length} disabled ${_.length===1?"key":"keys"}? This removes them and unlinks their usage history. Cannot be undone. Active keys in the selection are skipped; disable them first.`,confirmLabel:"Delete permanently",isPending:w,error:I,onConfirm:()=>void R(_,s=>r.mutateAsync(s.id),()=>v(!1))}),g?e.jsx(he,{title:g.title,result:g.result,onClose:()=>{p(null),n.reset()}}):null]})}export{Ae as KeysPage}; diff --git a/src/gateway/static/dashboard/assets/ModelScopeControl-xLQ9nHtN.js b/src/gateway/static/dashboard/assets/ModelScopeControl-gV_ax1BN.js similarity index 98% rename from src/gateway/static/dashboard/assets/ModelScopeControl-xLQ9nHtN.js rename to src/gateway/static/dashboard/assets/ModelScopeControl-gV_ax1BN.js index b18d0ad60..74861bca9 100644 --- a/src/gateway/static/dashboard/assets/ModelScopeControl-xLQ9nHtN.js +++ b/src/gateway/static/dashboard/assets/ModelScopeControl-gV_ax1BN.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{Z as A,o as $,p as P}from"./index-gNSmom8p.js";import{C as d,I as R,a as T,b as V}from"./heroui-DZj66Arc.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function W({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function X(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{W as M,X as a}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{Z as A,o as $,p as P}from"./index-C-bDZxkO.js";import{C as d,I as R,a as T,b as V}from"./heroui-DZj66Arc.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function W({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function X(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{W as M,X as a}; diff --git a/src/gateway/static/dashboard/assets/ModelsPage-DZ6zDjTj.js b/src/gateway/static/dashboard/assets/ModelsPage-DyZuS75D.js similarity index 99% rename from src/gateway/static/dashboard/assets/ModelsPage-DZ6zDjTj.js rename to src/gateway/static/dashboard/assets/ModelsPage-DyZuS75D.js index 604f5344d..b0ef231a1 100644 --- a/src/gateway/static/dashboard/assets/ModelsPage-DZ6zDjTj.js +++ b/src/gateway/static/dashboard/assets/ModelsPage-DyZuS75D.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as gt,u as vt,r as c}from"./react-dgEcD0HR.js";import{L as _t,M as bt,o as jt,O as yt,Q as je,P as Pt,E as Nt,F as B,I as St,S as se,T as Re,s as we,U as be,V as Ct,W as kt,X as E}from"./index-gNSmom8p.js";import{u as Mt,r as Wt,B as Tt}from"./tableSelection-CojkFPwd.js";import{D as It}from"./DataTable-CrQq0sYf.js";import{T as Lt,S as $t}from"./TablePagination-C-pfgcm6.js";import{B as $,d as ae,f as V}from"./heroui-DZj66Arc.js";function Oe(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function At(t,i=Date.now()){const r=new Map;for(const n of t){const l=r.get(n.model_key)??[];l.push(n),r.set(n.model_key,l)}const a=[];for(const n of r.values()){const l=[...n].sort((p,u)=>Date.parse(p.effective_at)-Date.parse(u.effective_at)),m=[...l].reverse().find(p=>Date.parse(p.effective_at)<=i);a.push(m??l[0])}return a.sort((n,l)=>n.model_key.localeCompare(l.model_key))}const Et="otari",De=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],Ot=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Fe={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Dt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],Ft=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Bt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],Kt=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Rt=1440*60*1e3,wt=t=>t.key;function Be(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function Ke(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const a=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,l)=>l.min_input_tokens-n.min_input_tokens)[0];return a?{inputPrice:a.input_price_per_million??r.inputPrice,outputPrice:a.output_price_per_million??r.outputPrice,cacheReadPrice:a.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:a.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:a.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ce(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function z(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function Y(t){return t.trim()===""?null:Number(t)}function ze(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Ve(t){const i=new Set;return t.every(r=>{const a=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(l=>l.trim()!=="");return!Number.isInteger(a)||a<=0||i.has(a)||!n?!1:(i.add(a),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(z))})}function Ye(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function b({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:a=>i(a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function qe({tiers:t,onChange:i}){const r=(n,l,m)=>{i(t.map(p=>p.id===n?{...p,[l]:m}:p))},a=()=>{const n=t.reduce((l,m)=>Math.max(l,m.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx($,{size:"sm",variant:"outline",onPress:a,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:l=>r(n.id,"minInputTokens",l.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(b,{value:n.input,onChange:l=>r(n.id,"input",l),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(b,{value:n.output,onChange:l=>r(n.id,"output",l),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(b,{value:n.cacheRead,onChange:l=>r(n.id,"cacheRead",l),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(b,{value:n.cacheWrite,onChange:l=>r(n.id,"cacheWrite",l),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(b,{value:n.cacheWrite1h,onChange:l=>r(n.id,"cacheWrite1h",l),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(l=>l.id!==n.id)),children:"Remove"})]},n.id))]})}function zt({source:t}){return t==="configured"?e.jsx(V,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(V,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function oe({label:t,tone:i="info",children:r}){const a=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":a,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:a,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Vt(){const t=kt();return t.data?t.data.default_pricing?e.jsx(oe,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(oe,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function le({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Yt({row:t}){const i=je(),r=Re(),[a,n]=c.useState(!1),[l,m]=c.useState(""),[p,u]=c.useState(""),[P,j]=c.useState(""),[k,I]=c.useState(""),[y,h]=c.useState(""),[N,O]=c.useState([]),S=()=>{m(t.inputPrice==null?"":String(t.inputPrice)),u(t.outputPrice==null?"":String(t.outputPrice)),j(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),I(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),h(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),O(ze(t.pricingTiers)),n(!0)},Q=ce(l)&&ce(p)&&z(P)&&z(k)&&z(y)&&Ve(N),W=()=>{Q&&i.mutate({model_key:t.key,input_price_per_million:Number(l),output_price_per_million:Number(p),cache_read_price_per_million:Y(P),cache_write_price_per_million:Y(k),cache_write_1h_price_per_million:Y(y),pricing_tiers:Ye(N)},{onSuccess:()=>n(!1)})};return a?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(b,{value:l,onChange:m,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(b,{value:p,onChange:u,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(b,{value:P,onChange:j,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(b,{value:k,onChange:I,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(b,{value:y,onChange:h,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(qe,{tiers:N,onChange:O}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:"sm",variant:"primary",isDisabled:i.isPending||!Q,onPress:W,children:"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:be(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${E(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${E(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${E(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${E(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${E(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx($,{size:"sm",variant:"outline",onPress:S,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(we,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error)}):null]})]})}function qt({row:t,metadata:i,metadataAvailable:r,onMakeAlias:a,onClose:n}){const l=(i==null?void 0:i.input_modalities)??[],m=(i==null?void 0:i.output_modalities)??[],p=Ot.filter(({key:u})=>i==null?void 0:i[u]);return e.jsx(ae,{children:e.jsxs(ae.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(V,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(le,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Yt,{row:t},t.key),e.jsx($,{size:"sm",variant:"outline",onPress:()=>a(t.key),children:"Make an alias"})]}),e.jsxs(le,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:se(t.contextWindow)}),e.jsx(T,{label:"Max output",value:se((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:Ct(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(le,{title:"Modalities",children:l.length===0&&m.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),l.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),m.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]})]})}),e.jsx(le,{title:"Capabilities",children:p.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(({key:u,label:P})=>e.jsx(V,{size:"sm",color:"default",children:P},u))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Ut=15;function Ht({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:a=>i(a.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}const Ue="otari.dashboard.modelsSort",_e={col:"model",dir:"asc"},Gt=["model","released","input","output"];function Jt(){if(typeof window>"u")return _e;try{const t=window.localStorage.getItem(Ue);if(!t)return _e;const i=JSON.parse(t);if(Gt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return _e}function Xt({row:t,onClose:i}){const r=je(),a=Re(),[n,l]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[m,p]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[u,P]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[j,k]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[I,y]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[h,N]=c.useState(ze(t.pricingTiers)),O=ce(n)&&ce(m)&&z(u)&&z(j)&&z(I)&&Ve(h),S=()=>{O&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(m),cache_read_price_per_million:Y(u),cache_write_price_per_million:Y(j),cache_write_1h_price_per_million:Y(I),pricing_tiers:Ye(h)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(b,{value:n,onChange:l,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(b,{value:m,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(b,{value:u,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(b,{value:j,onChange:k,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(b,{value:I,onChange:y,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx($,{size:"sm",variant:"primary",isDisabled:r.isPending||!O,onPress:S,children:r.isPending?"Saving…":"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(we,{confirmLabel:"Reset",isPending:a.isPending,onConfirm:()=>a.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||a.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error??a.error)}):null]}),e.jsx(qe,{tiers:h,onChange:N})]})}function Qt({primary:t,secondary:i,rowKey:r,primaryLabel:a,secondaryLabel:n,onEdit:l}){const m=(p,u)=>e.jsx("button",{type:"button","aria-label":`Edit ${u} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:P=>{P.stopPropagation(),l()},children:p==null?"—":E(p)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[m(t,a),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),m(i,n)]})}function Zt({rates:t,rowKey:i,onEdit:r}){const a=[t.cacheReadPrice==null?null:`R ${E(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${E(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${E(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:a.length>0?a.join(" · "):"Input-rate fallback"})}function ei({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,l)=>n.min_input_tokens-l.min_input_tokens).map(n=>se(n.min_input_tokens)),a=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:a})}function ti({rows:t,isLoading:i,empty:r,sortDescriptor:a,onSortChange:n,selectedKey:l,onSelect:m,onEditPricing:p,comparisonContextTokens:u,selectedKeys:P,onSelectionChange:j}){const k=c.useMemo(()=>{const y=u==null?"Base":`at ${se(u)}`;return[{id:"model",header:"Model",isRowHeader:!0,allowsSorting:!0,cell:h=>e.jsxs("span",{className:"font-medium break-all",children:[h.model,e.jsx("span",{className:"sr-only",children:h.key})]})},{id:"provider",header:"Provider",cell:h=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:h.provider})},{id:"input",header:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[`${y} in / out $ / 1M`,e.jsx(Vt,{})]}),align:"end",allowsSorting:!0,cell:h=>{const N=Ke(h,u);return e.jsx(Qt,{primary:N.inputPrice,secondary:N.outputPrice,rowKey:h.key,primaryLabel:"input",secondaryLabel:"output",onEdit:()=>p(h.key)})}},{id:"caching",header:`Caching ${u==null?"policy":y}`,align:"end",cell:h=>e.jsx(Zt,{rates:Ke(h,u),rowKey:h.key,onEdit:()=>p(h.key)})},{id:"policy",header:"Pricing policy",align:"end",cell:h=>e.jsx(ei,{row:h,onEdit:()=>p(h.key)})}]},[u,p]),I=c.useCallback(y=>y.key===l?"bg-[var(--otari-brand-tint)]":void 0,[l]);return e.jsx(It,{ariaLabel:"Models",columns:k,rows:t,getRowKey:wt,isLoading:i,emptyContent:r,selectionMode:"multiple",selectedKeys:P,onSelectionChange:j,sortDescriptor:a,onSortChange:n,onRowAction:m,rowClassName:I})}function ii({providers:t}){if(t.length===0)return null;const i=t.filter(l=>!l.discovery_unsupported),r=t.filter(l=>l.discovery_unsupported),a=l=>l.map(m=>m.provider).join(", "),n=l=>l.length===1;return e.jsxs(St,{tone:"warning",children:[i.length>0?e.jsxs("span",{className:"block",children:["Could not list ",a(i),". Check ",n(i)?"that provider's":"those providers'"," ","credentials in config.yml; ",n(i)?"its":"their"," models are missing from the list below."]}):null,r.length>0?e.jsxs("span",{className:"block",children:[a(r)," ",n(r)?"does":"do"," not offer model discovery, so"," ",n(r)?"its":"their"," models are missing from the list below."," ",n(r)?"The provider":"They"," may still serve requests; declare the model ids"," ",n(r)?"it serves":"they serve"," under the ",e.jsx("code",{children:"models:"})," key in config.yml to list them here."]}):null]})}function pi(){var Ie,Le,$e;const t=gt(),[i]=vt(),r=_t(),a=bt(),n=jt(),l=yt(),m=je(),[p,u]=c.useState(""),[P,j]=c.useState(0),[k,I]=c.useState(Ut),[y,h]=c.useState(null),[N,O]=c.useState(null),[S,Q]=c.useState(Jt),W=Mt(),[He,ue]=c.useState(!1),[Ge,ye]=c.useState(!1),[Je,Pe]=c.useState(void 0);c.useEffect(()=>{try{window.localStorage.setItem(Ue,JSON.stringify(S))}catch{}},[S]);const[D,Ne]=c.useState(i.get("provider")||"all"),[K,Xe]=c.useState("all"),[q,Qe]=c.useState("all"),[U,Ze]=c.useState("all"),[de,et]=c.useState("0"),[Z,tt]=c.useState(""),[ee,it]=c.useState("all"),[pe,rt]=c.useState(""),F=((Ie=l.data)==null?void 0:Ie.models)??{},nt=((Le=l.data)==null?void 0:Le.available)??!1,Se=c.useMemo(()=>{var s;return new Set((((s=n.data)==null?void 0:s.providers)??[]).flatMap(x=>x.models.map(o=>o.key)))},[n.data]),lt=s=>{u(s),j(0)},R=s=>x=>{s(x),j(0)},te=c.useMemo(()=>{var M,v,_,A,L,w,Ae;const s=new Map(At(a.data??[]).map(d=>[d.model_key,d])),x=[],o=new Set,g=(d,ve,Ee,f)=>{if(o.has(d))return;o.add(d);const C=s.get(d);x.push({key:d,model:Be(ve,Ee),provider:Ee,isDiscovered:Se.has(d),contextWindow:(f==null?void 0:f.contextWindow)??null,inputPrice:C?C.input_price_per_million:(f==null?void 0:f.inputPrice)??null,outputPrice:C?C.output_price_per_million:(f==null?void 0:f.outputPrice)??null,cacheReadPrice:C?C.cache_read_price_per_million:(f==null?void 0:f.cacheReadPrice)??null,cacheWritePrice:C?C.cache_write_price_per_million:(f==null?void 0:f.cacheWritePrice)??null,cacheWrite1hPrice:C?C.cache_write_1h_price_per_million??null:(f==null?void 0:f.cacheWrite1hPrice)??null,pricingTiers:C?C.pricing_tiers??[]:(f==null?void 0:f.pricingTiers)??[],source:C?"configured":(f==null?void 0:f.source)??"none"})};for(const d of((M=r.data)==null?void 0:M.data)??[]){if(d.owned_by===Et)continue;const ve=d.pricing_source==="default"?"default":d.pricing?"configured":"none";g(d.id,d.id,d.owned_by||Oe(d.id),{key:d.id,model:d.id,provider:d.owned_by,contextWindow:d.context_window,inputPrice:((v=d.pricing)==null?void 0:v.input_price_per_million)??null,outputPrice:((_=d.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:((A=d.pricing)==null?void 0:A.cache_read_price_per_million)??null,cacheWritePrice:((L=d.pricing)==null?void 0:L.cache_write_price_per_million)??null,cacheWrite1hPrice:((w=d.pricing)==null?void 0:w.cache_write_1h_price_per_million)??null,pricingTiers:((Ae=d.pricing)==null?void 0:Ae.pricing_tiers)??[],source:ve})}for(const d of s.keys())g(d,d,Oe(d));return x},[r.data,a.data,Se]),Ce=c.useMemo(()=>new Map(te.map(s=>[s.key,s])),[te]),ie=c.useMemo(()=>{var o,g,M;const s=te.map(v=>{var _,A;return{...v,contextWindow:v.contextWindow??((_=F[v.key])==null?void 0:_.context_window)??null,releaseDate:((A=F[v.key])==null?void 0:A.release_date)??null}}),x=new Set(s.map(v=>v.key));for(const v of((o=n.data)==null?void 0:o.providers)??[])for(const _ of v.models)x.has(_.key)||(x.add(_.key),s.push({key:_.key,model:Be(_.key,v.provider),provider:v.provider,isDiscovered:!0,contextWindow:((g=F[_.key])==null?void 0:g.context_window)??null,releaseDate:((M=F[_.key])==null?void 0:M.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return s},[te,n.data,F]),st=((($e=n.data)==null?void 0:$e.providers)??[]).filter(s=>!s.ok),re=c.useMemo(()=>{const s=Array.from(new Set(ie.map(x=>x.provider))).sort((x,o)=>x.localeCompare(o));return[{value:"all",label:"All providers"},...s.map(x=>({value:x,label:x}))]},[ie]);c.useEffect(()=>{D==="all"||re.length<=1||re.some(s=>s.value===D)||Ne("all")},[re,D]);const H=p.trim().toLowerCase(),he=Number(de)||0,me=Z===""?Number.POSITIVE_INFINITY:Number(Z),at=pe===""?null:Number(pe),xe=ee==="all"?null:Date.now()-Number(ee)*Rt,G=c.useMemo(()=>{const s=o=>{if(H&&!o.key.toLowerCase().includes(H)&&!o.provider.toLowerCase().includes(H)||D!=="all"&&o.provider!==D||K==="configured"&&o.source!=="configured"||K==="default"&&o.source!=="default"||K==="priced"&&o.inputPrice==null||K==="unpriced"&&o.inputPrice!=null||q==="discovered"&&!o.isDiscovered||q==="custom"&&o.isDiscovered)return!1;if(U!=="all"){const g=De.find(v=>v.value===U),M=F[o.key];if(!g||!M||!g.test(M))return!1}if(he>0&&(o.contextWindow==null||o.contextWindowme))return!1;if(xe!=null){const g=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(g)||g{const M=S.dir==="asc"?1:-1;if(S.col==="model")return o.model.localeCompare(g.model)*M;if(S.col==="released"){const L=o.releaseDate??null,w=g.releaseDate??null;return!L&&!w?o.model.localeCompare(g.model):L?w?(Lw?1:0)*M||o.model.localeCompare(g.model):-1:1}const v=L=>S.col==="input"?L.inputPrice:L.outputPrice,_=v(o),A=v(g);return _==null&&A==null?o.model.localeCompare(g.model):_==null?1:A==null?-1:(_-A)*M||o.model.localeCompare(g.model)};return ie.filter(s).sort(x)},[ie,H,D,K,q,U,he,me,xe,F,S]),J=G.length,ct=Math.max(1,Math.ceil(J/k)),ke=Math.min(P,ct-1),Me=ke*k,fe=G.slice(Me,Me+k),ot={column:S.col,direction:S.dir==="asc"?"ascending":"descending"},ut=s=>{Q({col:String(s.column),dir:s.direction==="ascending"?"asc":"desc"}),j(0)},dt=c.useCallback(s=>h(x=>x===s?null:s),[]),ge=fe.map(s=>s.key),X=Wt(W.selectedKeys,ge),pt=ge.length>0&&X.length===ge.length&&J>X.length,ht=W.allMatching?G.map(s=>s.key):X,We=W.allMatching?J:X.length,Te=y?G.find(s=>s.key===y)??Ce.get(y)??null:null,mt=async s=>{ye(!0),Pe(void 0);try{for(const x of ht)await m.mutateAsync({model_key:x,input_price_per_million:s.input_price_per_million,output_price_per_million:s.output_price_per_million,cache_read_price_per_million:s.cache_read_price_per_million??null,cache_write_price_per_million:s.cache_write_price_per_million??null,cache_write_1h_price_per_million:null,pricing_tiers:[]});W.clear(),ue(!1)}catch(x){Pe(x)}finally{ye(!1)}},xt=r.isLoading||a.isLoading||n.isLoading,ft=H!==""||D!=="all"||K!=="all"||q!=="all"||U!=="all"||de!=="0"||Z!==""||ee!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",ne=N?G.find(s=>s.key===N)??Ce.get(N)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Pt,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(Nt,{error:r.error??a.error??n.error??l.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${ne?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ht,{value:p,onChange:lt,placeholder:"Search models…"}),e.jsx(B,{ariaLabel:"Filter by provider",value:D,onChange:R(Ne),options:re}),e.jsx(B,{ariaLabel:"Filter by pricing",value:K,onChange:R(Xe),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(B,{ariaLabel:"Filter by source",value:q,onChange:R(Qe),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(B,{ariaLabel:"Filter by capability",value:U,onChange:R(Ze),options:[{value:"all",label:"Any capability"},...De.map(s=>({value:s.value,label:s.label}))]}),e.jsx(B,{ariaLabel:"Minimum context window",value:de,onChange:R(et),options:Dt}),e.jsx(B,{ariaLabel:"Maximum input price",value:Z,onChange:R(tt),options:Ft}),e.jsx(B,{ariaLabel:"Compare prices at context",value:pe,onChange:rt,options:Bt}),e.jsx(B,{ariaLabel:"Filter by release date",value:ee,onChange:R(it),options:Kt})]}),e.jsx(ii,{providers:st}),X.length>0?e.jsx(Tt,{selectedCount:We,allMatching:W.allMatching,matchingTotal:J,canSelectAllMatching:pt,onSelectAllMatching:W.enableAllMatching,onClear:W.clear,children:e.jsx($,{size:"sm",variant:"primary",onPress:()=>ue(!0),children:"Set pricing"})}):null,e.jsx(ti,{rows:fe,isLoading:xt,empty:ft,sortDescriptor:ot,onSortChange:ut,selectedKey:N,onSelect:O,onEditPricing:dt,comparisonContextTokens:at,selectedKeys:W.selectedKeys,onSelectionChange:W.onSelectionChange}),Te?e.jsx(ae,{children:e.jsxs(ae.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Edit pricing"}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>h(null),children:"Close"})]}),e.jsx(Xt,{row:Te,onClose:()=>h(null)})]})}):null,e.jsx(Lt,{page:ke,pageSize:k,total:J,rowsOnPage:fe.length,onPageChange:j,onPageSizeChange:s=>{I(s),j(0)},pageSizeOptions:[15,25,50]})]}),ne?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(qt,{row:ne,metadata:F[ne.key],metadataAvailable:nt,onMakeAlias:s=>t(`/aliases?target=${encodeURIComponent(s)}`),onClose:()=>O(null)})}):null]}),e.jsx($t,{isOpen:He,onOpenChange:ue,targetCount:We,isPending:Ge,error:Je,onSubmit:mt,title:"Set pricing",description:s=>`Apply these per-1M rates to ${s.toLocaleString()} selected ${s===1?"model":"models"}. This replaces each model's price; pricing tiers and the 1h cache rate are cleared. Edit a single model for tiers.`})]})}export{pi as ModelsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as gt,u as vt,r as c}from"./react-dgEcD0HR.js";import{L as _t,M as bt,o as jt,O as yt,Q as je,P as Pt,E as Nt,F as B,I as St,S as se,T as Re,s as we,U as be,V as Ct,W as kt,X as E}from"./index-C-bDZxkO.js";import{u as Mt,r as Wt,B as Tt}from"./tableSelection-CojkFPwd.js";import{D as It}from"./DataTable-CrQq0sYf.js";import{T as Lt,S as $t}from"./TablePagination-0H6sFfIt.js";import{B as $,d as ae,f as V}from"./heroui-DZj66Arc.js";function Oe(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function At(t,i=Date.now()){const r=new Map;for(const n of t){const l=r.get(n.model_key)??[];l.push(n),r.set(n.model_key,l)}const a=[];for(const n of r.values()){const l=[...n].sort((p,u)=>Date.parse(p.effective_at)-Date.parse(u.effective_at)),m=[...l].reverse().find(p=>Date.parse(p.effective_at)<=i);a.push(m??l[0])}return a.sort((n,l)=>n.model_key.localeCompare(l.model_key))}const Et="otari",De=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],Ot=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Fe={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Dt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],Ft=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Bt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],Kt=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Rt=1440*60*1e3,wt=t=>t.key;function Be(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function Ke(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const a=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,l)=>l.min_input_tokens-n.min_input_tokens)[0];return a?{inputPrice:a.input_price_per_million??r.inputPrice,outputPrice:a.output_price_per_million??r.outputPrice,cacheReadPrice:a.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:a.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:a.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ce(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function z(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function Y(t){return t.trim()===""?null:Number(t)}function ze(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Ve(t){const i=new Set;return t.every(r=>{const a=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(l=>l.trim()!=="");return!Number.isInteger(a)||a<=0||i.has(a)||!n?!1:(i.add(a),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(z))})}function Ye(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function b({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:a=>i(a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function qe({tiers:t,onChange:i}){const r=(n,l,m)=>{i(t.map(p=>p.id===n?{...p,[l]:m}:p))},a=()=>{const n=t.reduce((l,m)=>Math.max(l,m.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx($,{size:"sm",variant:"outline",onPress:a,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:l=>r(n.id,"minInputTokens",l.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(b,{value:n.input,onChange:l=>r(n.id,"input",l),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(b,{value:n.output,onChange:l=>r(n.id,"output",l),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(b,{value:n.cacheRead,onChange:l=>r(n.id,"cacheRead",l),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(b,{value:n.cacheWrite,onChange:l=>r(n.id,"cacheWrite",l),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(b,{value:n.cacheWrite1h,onChange:l=>r(n.id,"cacheWrite1h",l),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(l=>l.id!==n.id)),children:"Remove"})]},n.id))]})}function zt({source:t}){return t==="configured"?e.jsx(V,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(V,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function oe({label:t,tone:i="info",children:r}){const a=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":a,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:a,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Vt(){const t=kt();return t.data?t.data.default_pricing?e.jsx(oe,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(oe,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function le({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Yt({row:t}){const i=je(),r=Re(),[a,n]=c.useState(!1),[l,m]=c.useState(""),[p,u]=c.useState(""),[P,j]=c.useState(""),[k,I]=c.useState(""),[y,h]=c.useState(""),[N,O]=c.useState([]),S=()=>{m(t.inputPrice==null?"":String(t.inputPrice)),u(t.outputPrice==null?"":String(t.outputPrice)),j(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),I(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),h(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),O(ze(t.pricingTiers)),n(!0)},Q=ce(l)&&ce(p)&&z(P)&&z(k)&&z(y)&&Ve(N),W=()=>{Q&&i.mutate({model_key:t.key,input_price_per_million:Number(l),output_price_per_million:Number(p),cache_read_price_per_million:Y(P),cache_write_price_per_million:Y(k),cache_write_1h_price_per_million:Y(y),pricing_tiers:Ye(N)},{onSuccess:()=>n(!1)})};return a?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(b,{value:l,onChange:m,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(b,{value:p,onChange:u,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(b,{value:P,onChange:j,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(b,{value:k,onChange:I,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(b,{value:y,onChange:h,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(qe,{tiers:N,onChange:O}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:"sm",variant:"primary",isDisabled:i.isPending||!Q,onPress:W,children:"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:be(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${E(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${E(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${E(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${E(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${E(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx($,{size:"sm",variant:"outline",onPress:S,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(we,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error)}):null]})]})}function qt({row:t,metadata:i,metadataAvailable:r,onMakeAlias:a,onClose:n}){const l=(i==null?void 0:i.input_modalities)??[],m=(i==null?void 0:i.output_modalities)??[],p=Ot.filter(({key:u})=>i==null?void 0:i[u]);return e.jsx(ae,{children:e.jsxs(ae.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(V,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(le,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Yt,{row:t},t.key),e.jsx($,{size:"sm",variant:"outline",onPress:()=>a(t.key),children:"Make an alias"})]}),e.jsxs(le,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:se(t.contextWindow)}),e.jsx(T,{label:"Max output",value:se((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:Ct(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(le,{title:"Modalities",children:l.length===0&&m.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),l.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),m.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]})]})}),e.jsx(le,{title:"Capabilities",children:p.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(({key:u,label:P})=>e.jsx(V,{size:"sm",color:"default",children:P},u))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Ut=15;function Ht({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:a=>i(a.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}const Ue="otari.dashboard.modelsSort",_e={col:"model",dir:"asc"},Gt=["model","released","input","output"];function Jt(){if(typeof window>"u")return _e;try{const t=window.localStorage.getItem(Ue);if(!t)return _e;const i=JSON.parse(t);if(Gt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return _e}function Xt({row:t,onClose:i}){const r=je(),a=Re(),[n,l]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[m,p]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[u,P]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[j,k]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[I,y]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[h,N]=c.useState(ze(t.pricingTiers)),O=ce(n)&&ce(m)&&z(u)&&z(j)&&z(I)&&Ve(h),S=()=>{O&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(m),cache_read_price_per_million:Y(u),cache_write_price_per_million:Y(j),cache_write_1h_price_per_million:Y(I),pricing_tiers:Ye(h)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(b,{value:n,onChange:l,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(b,{value:m,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(b,{value:u,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(b,{value:j,onChange:k,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(b,{value:I,onChange:y,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx($,{size:"sm",variant:"primary",isDisabled:r.isPending||!O,onPress:S,children:r.isPending?"Saving…":"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(we,{confirmLabel:"Reset",isPending:a.isPending,onConfirm:()=>a.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||a.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error??a.error)}):null]}),e.jsx(qe,{tiers:h,onChange:N})]})}function Qt({primary:t,secondary:i,rowKey:r,primaryLabel:a,secondaryLabel:n,onEdit:l}){const m=(p,u)=>e.jsx("button",{type:"button","aria-label":`Edit ${u} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:P=>{P.stopPropagation(),l()},children:p==null?"—":E(p)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[m(t,a),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),m(i,n)]})}function Zt({rates:t,rowKey:i,onEdit:r}){const a=[t.cacheReadPrice==null?null:`R ${E(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${E(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${E(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:a.length>0?a.join(" · "):"Input-rate fallback"})}function ei({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,l)=>n.min_input_tokens-l.min_input_tokens).map(n=>se(n.min_input_tokens)),a=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:a})}function ti({rows:t,isLoading:i,empty:r,sortDescriptor:a,onSortChange:n,selectedKey:l,onSelect:m,onEditPricing:p,comparisonContextTokens:u,selectedKeys:P,onSelectionChange:j}){const k=c.useMemo(()=>{const y=u==null?"Base":`at ${se(u)}`;return[{id:"model",header:"Model",isRowHeader:!0,allowsSorting:!0,cell:h=>e.jsxs("span",{className:"font-medium break-all",children:[h.model,e.jsx("span",{className:"sr-only",children:h.key})]})},{id:"provider",header:"Provider",cell:h=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:h.provider})},{id:"input",header:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[`${y} in / out $ / 1M`,e.jsx(Vt,{})]}),align:"end",allowsSorting:!0,cell:h=>{const N=Ke(h,u);return e.jsx(Qt,{primary:N.inputPrice,secondary:N.outputPrice,rowKey:h.key,primaryLabel:"input",secondaryLabel:"output",onEdit:()=>p(h.key)})}},{id:"caching",header:`Caching ${u==null?"policy":y}`,align:"end",cell:h=>e.jsx(Zt,{rates:Ke(h,u),rowKey:h.key,onEdit:()=>p(h.key)})},{id:"policy",header:"Pricing policy",align:"end",cell:h=>e.jsx(ei,{row:h,onEdit:()=>p(h.key)})}]},[u,p]),I=c.useCallback(y=>y.key===l?"bg-[var(--otari-brand-tint)]":void 0,[l]);return e.jsx(It,{ariaLabel:"Models",columns:k,rows:t,getRowKey:wt,isLoading:i,emptyContent:r,selectionMode:"multiple",selectedKeys:P,onSelectionChange:j,sortDescriptor:a,onSortChange:n,onRowAction:m,rowClassName:I})}function ii({providers:t}){if(t.length===0)return null;const i=t.filter(l=>!l.discovery_unsupported),r=t.filter(l=>l.discovery_unsupported),a=l=>l.map(m=>m.provider).join(", "),n=l=>l.length===1;return e.jsxs(St,{tone:"warning",children:[i.length>0?e.jsxs("span",{className:"block",children:["Could not list ",a(i),". Check ",n(i)?"that provider's":"those providers'"," ","credentials in config.yml; ",n(i)?"its":"their"," models are missing from the list below."]}):null,r.length>0?e.jsxs("span",{className:"block",children:[a(r)," ",n(r)?"does":"do"," not offer model discovery, so"," ",n(r)?"its":"their"," models are missing from the list below."," ",n(r)?"The provider":"They"," may still serve requests; declare the model ids"," ",n(r)?"it serves":"they serve"," under the ",e.jsx("code",{children:"models:"})," key in config.yml to list them here."]}):null]})}function pi(){var Ie,Le,$e;const t=gt(),[i]=vt(),r=_t(),a=bt(),n=jt(),l=yt(),m=je(),[p,u]=c.useState(""),[P,j]=c.useState(0),[k,I]=c.useState(Ut),[y,h]=c.useState(null),[N,O]=c.useState(null),[S,Q]=c.useState(Jt),W=Mt(),[He,ue]=c.useState(!1),[Ge,ye]=c.useState(!1),[Je,Pe]=c.useState(void 0);c.useEffect(()=>{try{window.localStorage.setItem(Ue,JSON.stringify(S))}catch{}},[S]);const[D,Ne]=c.useState(i.get("provider")||"all"),[K,Xe]=c.useState("all"),[q,Qe]=c.useState("all"),[U,Ze]=c.useState("all"),[de,et]=c.useState("0"),[Z,tt]=c.useState(""),[ee,it]=c.useState("all"),[pe,rt]=c.useState(""),F=((Ie=l.data)==null?void 0:Ie.models)??{},nt=((Le=l.data)==null?void 0:Le.available)??!1,Se=c.useMemo(()=>{var s;return new Set((((s=n.data)==null?void 0:s.providers)??[]).flatMap(x=>x.models.map(o=>o.key)))},[n.data]),lt=s=>{u(s),j(0)},R=s=>x=>{s(x),j(0)},te=c.useMemo(()=>{var M,v,_,A,L,w,Ae;const s=new Map(At(a.data??[]).map(d=>[d.model_key,d])),x=[],o=new Set,g=(d,ve,Ee,f)=>{if(o.has(d))return;o.add(d);const C=s.get(d);x.push({key:d,model:Be(ve,Ee),provider:Ee,isDiscovered:Se.has(d),contextWindow:(f==null?void 0:f.contextWindow)??null,inputPrice:C?C.input_price_per_million:(f==null?void 0:f.inputPrice)??null,outputPrice:C?C.output_price_per_million:(f==null?void 0:f.outputPrice)??null,cacheReadPrice:C?C.cache_read_price_per_million:(f==null?void 0:f.cacheReadPrice)??null,cacheWritePrice:C?C.cache_write_price_per_million:(f==null?void 0:f.cacheWritePrice)??null,cacheWrite1hPrice:C?C.cache_write_1h_price_per_million??null:(f==null?void 0:f.cacheWrite1hPrice)??null,pricingTiers:C?C.pricing_tiers??[]:(f==null?void 0:f.pricingTiers)??[],source:C?"configured":(f==null?void 0:f.source)??"none"})};for(const d of((M=r.data)==null?void 0:M.data)??[]){if(d.owned_by===Et)continue;const ve=d.pricing_source==="default"?"default":d.pricing?"configured":"none";g(d.id,d.id,d.owned_by||Oe(d.id),{key:d.id,model:d.id,provider:d.owned_by,contextWindow:d.context_window,inputPrice:((v=d.pricing)==null?void 0:v.input_price_per_million)??null,outputPrice:((_=d.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:((A=d.pricing)==null?void 0:A.cache_read_price_per_million)??null,cacheWritePrice:((L=d.pricing)==null?void 0:L.cache_write_price_per_million)??null,cacheWrite1hPrice:((w=d.pricing)==null?void 0:w.cache_write_1h_price_per_million)??null,pricingTiers:((Ae=d.pricing)==null?void 0:Ae.pricing_tiers)??[],source:ve})}for(const d of s.keys())g(d,d,Oe(d));return x},[r.data,a.data,Se]),Ce=c.useMemo(()=>new Map(te.map(s=>[s.key,s])),[te]),ie=c.useMemo(()=>{var o,g,M;const s=te.map(v=>{var _,A;return{...v,contextWindow:v.contextWindow??((_=F[v.key])==null?void 0:_.context_window)??null,releaseDate:((A=F[v.key])==null?void 0:A.release_date)??null}}),x=new Set(s.map(v=>v.key));for(const v of((o=n.data)==null?void 0:o.providers)??[])for(const _ of v.models)x.has(_.key)||(x.add(_.key),s.push({key:_.key,model:Be(_.key,v.provider),provider:v.provider,isDiscovered:!0,contextWindow:((g=F[_.key])==null?void 0:g.context_window)??null,releaseDate:((M=F[_.key])==null?void 0:M.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return s},[te,n.data,F]),st=((($e=n.data)==null?void 0:$e.providers)??[]).filter(s=>!s.ok),re=c.useMemo(()=>{const s=Array.from(new Set(ie.map(x=>x.provider))).sort((x,o)=>x.localeCompare(o));return[{value:"all",label:"All providers"},...s.map(x=>({value:x,label:x}))]},[ie]);c.useEffect(()=>{D==="all"||re.length<=1||re.some(s=>s.value===D)||Ne("all")},[re,D]);const H=p.trim().toLowerCase(),he=Number(de)||0,me=Z===""?Number.POSITIVE_INFINITY:Number(Z),at=pe===""?null:Number(pe),xe=ee==="all"?null:Date.now()-Number(ee)*Rt,G=c.useMemo(()=>{const s=o=>{if(H&&!o.key.toLowerCase().includes(H)&&!o.provider.toLowerCase().includes(H)||D!=="all"&&o.provider!==D||K==="configured"&&o.source!=="configured"||K==="default"&&o.source!=="default"||K==="priced"&&o.inputPrice==null||K==="unpriced"&&o.inputPrice!=null||q==="discovered"&&!o.isDiscovered||q==="custom"&&o.isDiscovered)return!1;if(U!=="all"){const g=De.find(v=>v.value===U),M=F[o.key];if(!g||!M||!g.test(M))return!1}if(he>0&&(o.contextWindow==null||o.contextWindowme))return!1;if(xe!=null){const g=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(g)||g{const M=S.dir==="asc"?1:-1;if(S.col==="model")return o.model.localeCompare(g.model)*M;if(S.col==="released"){const L=o.releaseDate??null,w=g.releaseDate??null;return!L&&!w?o.model.localeCompare(g.model):L?w?(Lw?1:0)*M||o.model.localeCompare(g.model):-1:1}const v=L=>S.col==="input"?L.inputPrice:L.outputPrice,_=v(o),A=v(g);return _==null&&A==null?o.model.localeCompare(g.model):_==null?1:A==null?-1:(_-A)*M||o.model.localeCompare(g.model)};return ie.filter(s).sort(x)},[ie,H,D,K,q,U,he,me,xe,F,S]),J=G.length,ct=Math.max(1,Math.ceil(J/k)),ke=Math.min(P,ct-1),Me=ke*k,fe=G.slice(Me,Me+k),ot={column:S.col,direction:S.dir==="asc"?"ascending":"descending"},ut=s=>{Q({col:String(s.column),dir:s.direction==="ascending"?"asc":"desc"}),j(0)},dt=c.useCallback(s=>h(x=>x===s?null:s),[]),ge=fe.map(s=>s.key),X=Wt(W.selectedKeys,ge),pt=ge.length>0&&X.length===ge.length&&J>X.length,ht=W.allMatching?G.map(s=>s.key):X,We=W.allMatching?J:X.length,Te=y?G.find(s=>s.key===y)??Ce.get(y)??null:null,mt=async s=>{ye(!0),Pe(void 0);try{for(const x of ht)await m.mutateAsync({model_key:x,input_price_per_million:s.input_price_per_million,output_price_per_million:s.output_price_per_million,cache_read_price_per_million:s.cache_read_price_per_million??null,cache_write_price_per_million:s.cache_write_price_per_million??null,cache_write_1h_price_per_million:null,pricing_tiers:[]});W.clear(),ue(!1)}catch(x){Pe(x)}finally{ye(!1)}},xt=r.isLoading||a.isLoading||n.isLoading,ft=H!==""||D!=="all"||K!=="all"||q!=="all"||U!=="all"||de!=="0"||Z!==""||ee!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",ne=N?G.find(s=>s.key===N)??Ce.get(N)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Pt,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(Nt,{error:r.error??a.error??n.error??l.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${ne?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ht,{value:p,onChange:lt,placeholder:"Search models…"}),e.jsx(B,{ariaLabel:"Filter by provider",value:D,onChange:R(Ne),options:re}),e.jsx(B,{ariaLabel:"Filter by pricing",value:K,onChange:R(Xe),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(B,{ariaLabel:"Filter by source",value:q,onChange:R(Qe),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(B,{ariaLabel:"Filter by capability",value:U,onChange:R(Ze),options:[{value:"all",label:"Any capability"},...De.map(s=>({value:s.value,label:s.label}))]}),e.jsx(B,{ariaLabel:"Minimum context window",value:de,onChange:R(et),options:Dt}),e.jsx(B,{ariaLabel:"Maximum input price",value:Z,onChange:R(tt),options:Ft}),e.jsx(B,{ariaLabel:"Compare prices at context",value:pe,onChange:rt,options:Bt}),e.jsx(B,{ariaLabel:"Filter by release date",value:ee,onChange:R(it),options:Kt})]}),e.jsx(ii,{providers:st}),X.length>0?e.jsx(Tt,{selectedCount:We,allMatching:W.allMatching,matchingTotal:J,canSelectAllMatching:pt,onSelectAllMatching:W.enableAllMatching,onClear:W.clear,children:e.jsx($,{size:"sm",variant:"primary",onPress:()=>ue(!0),children:"Set pricing"})}):null,e.jsx(ti,{rows:fe,isLoading:xt,empty:ft,sortDescriptor:ot,onSortChange:ut,selectedKey:N,onSelect:O,onEditPricing:dt,comparisonContextTokens:at,selectedKeys:W.selectedKeys,onSelectionChange:W.onSelectionChange}),Te?e.jsx(ae,{children:e.jsxs(ae.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Edit pricing"}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>h(null),children:"Close"})]}),e.jsx(Xt,{row:Te,onClose:()=>h(null)})]})}):null,e.jsx(Lt,{page:ke,pageSize:k,total:J,rowsOnPage:fe.length,onPageChange:j,onPageSizeChange:s=>{I(s),j(0)},pageSizeOptions:[15,25,50]})]}),ne?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(qt,{row:ne,metadata:F[ne.key],metadataAvailable:nt,onMakeAlias:s=>t(`/aliases?target=${encodeURIComponent(s)}`),onClose:()=>O(null)})}):null]}),e.jsx($t,{isOpen:He,onOpenChange:ue,targetCount:We,isPending:Ge,error:Je,onSubmit:mt,title:"Set pricing",description:s=>`Apply these per-1M rates to ${s.toLocaleString()} selected ${s===1?"model":"models"}. This replaces each model's price; pricing tiers and the 1h cache rate are cleared. Edit a single model for tiers.`})]})}export{pi as ModelsPage}; diff --git a/src/gateway/static/dashboard/assets/OverviewPage-gipwh9ys.js b/src/gateway/static/dashboard/assets/OverviewPage-Tme0ej_W.js similarity index 99% rename from src/gateway/static/dashboard/assets/OverviewPage-gipwh9ys.js rename to src/gateway/static/dashboard/assets/OverviewPage-Tme0ej_W.js index ef01c5750..335843469 100644 --- a/src/gateway/static/dashboard/assets/OverviewPage-gipwh9ys.js +++ b/src/gateway/static/dashboard/assets/OverviewPage-Tme0ej_W.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as y,i as st,N as Y}from"./react-dgEcD0HR.js";import{Z as nt,_ as ot,g as j,$ as it,v as lt,c as dt,u as ct,d as ut,a0 as w,P as mt,R as vt,E as V,a1 as b,a2 as D,a3 as N,a4 as R,a5 as E,a6 as ht,N as _}from"./index-gNSmom8p.js";import{S as U}from"./charts-B_hm0rXH.js";import{D as xt}from"./DataTable-CrQq0sYf.js";import{d as M,B as ft}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function K(e){return e==="neutral"?void 0:e}const pt=.02,gt=.1;function W(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,a=n>=gt?"alert":n>=pt?"warn":"ok";return{rate:n,status:a}}function bt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy+e.degraded===0?"alert":"warn"}const yt=.8;function St(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(o=>o.max_budget!==null&&o.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let a=0,l=0,r,m=-1;for(const o of n){const s=o.max_budget*o.user_count,i=s>0?o.total_spend/s:0;i>=1?a+=1:i>=yt&&(l+=1),i>m&&(m=i,r={name:o.name??o.budget_id,spent:o.total_spend,allocated:s,pct:i})}const d=a>0?"alert":l>0?"warn":"ok",h=a>0?`${a} over limit`:l>0?`${l} near limit`:"All within budget";return{status:d,label:h,overCount:a,nearCount:l,cappedCount:n.length,worst:r}}const G=864e5,I=30;function T(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function jt(){const[e,n]=y.useState(T);return y.useEffect(()=>{const a=()=>{if(document.visibilityState==="visible"){const l=T();n(r=>r===l?r:l)}};return document.addEventListener("visibilitychange",a),window.addEventListener("focus",a),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}},[]),y.useMemo(()=>{const a=Date.now(),l=new Date(a);return{today:new Date(l.getFullYear(),l.getMonth(),l.getDate()).toISOString(),periodStart:new Date(a-I*G).toISOString(),prevStart:new Date(a-2*I*G).toISOString()}},[e])}const wt={ok:"Healthy",warn:"Elevated",alert:"High"},Nt={ok:"On track",warn:"Near limit",alert:"Over budget"};function Bt(){const e=nt();return e.isLoading?t.jsx(ot,{}):t.jsx(Rt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function Rt({needsSetup:e=!1}){var $,L,A,F,P,q,B,H;const n=jt(),a=y.useMemo(()=>({start_date:n.today}),[n]),l=y.useMemo(()=>({start_date:n.periodStart}),[n]),r=y.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=j(a,"hour",_),d=j(l,"day",_),h=j(r,"day",_),o=it(),s=lt(),i=dt(),x=ct(),f=ut({},0,5),C=($=m.data)==null?void 0:$.totals,v=(L=d.data)==null?void 0:L.totals,p=(A=h.data)==null?void 0:A.totals,S=((F=d.data)==null?void 0:F.series)??[],k=S.length>1,c=W(v),O=W(p),Z=c.rate!==null&&O.rate!==null?w(c.rate,O.rate):null,u=St(s.data??[]),z=bt(o.data),J=(i.data??[]).filter(g=>g.is_active).length,Q=(x.data??[]).filter(g=>!g.blocked).length,X=(((P=f.data)==null?void 0:P.length)??0)>0,tt=e&&f.isSuccess&&!X,et=m.error??d.error??o.error??s.error??i.error??x.error,rt=()=>{m.refetch(),d.refetch(),h.refetch(),o.refetch(),s.refetch(),i.refetch(),x.refetch(),f.refetch()},at=m.isFetching||d.isFetching||h.isFetching||o.isFetching||s.isFetching||i.isFetching||x.isFetching||f.isFetching;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(mt,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway.",action:t.jsx(vt,{onRefresh:rt,isFetching:at,updatedAt:d.dataUpdatedAt})}),tt?t.jsx(_t,{}):null,t.jsx(V,{error:et}),t.jsx(Et,{providerHealth:z,healthy:((q=o.data)==null?void 0:q.healthy)??0,degraded:((B=o.data)==null?void 0:B.degraded)??0,total:((H=o.data)==null?void 0:H.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:o.isSuccess&&s.isSuccess&&d.isSuccess,failed:o.isError||s.isError||d.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(b,{label:"Spend today",value:C?D(C.cost):"—"}),t.jsx(b,{label:"Spend, last 30 days",value:v?D(v.cost):"—",hint:v?t.jsx(N,{fraction:w(v.cost,p==null?void 0:p.cost)}):null,chart:k?t.jsx(U,{values:S.map(g=>g.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Requests, last 30 days",value:v?R(v.request_count):"—",hint:v?t.jsx(N,{fraction:w(v.request_count,p==null?void 0:p.request_count)}):null,chart:k?t.jsx(U,{values:S.map(g=>g.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Error rate, last 30 days",value:c.rate===null?"—":E(c.rate),status:K(c.status),statusLabel:c.status==="neutral"?void 0:wt[c.status],hint:c.rate!==null?t.jsx(N,{fraction:Z}):null}),t.jsx(b,{label:"Budget health",value:s.data&&u.worst?E(u.worst.pct):"—",status:s.data?K(u.status):void 0,statusLabel:s.data&&u.status!=="neutral"?Nt[u.status]:void 0,hint:s.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(b,{label:"Active keys",value:i.data?R(J):"—",to:"/keys"}),t.jsx(b,{label:"Active users",value:x.data?R(Q):"—",to:"/users"})]}),t.jsx(kt,{entries:f.data??[],loading:f.isLoading,error:f.error})]})}function _t(){const e=st();return t.jsx(M,{children:t.jsxs(M.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(ft,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function Dt({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function Et({providerHealth:e,healthy:n,degraded:a,total:l,budget:r,errStatus:m,errRate:d,ready:h,failed:o}){if(o)return t.jsx(Dt,{text:"Some status data could not be loaded."});if(!h)return null;const s=[];if((e==="warn"||e==="alert")&&l>0){const i=l-n-a;i>0&&s.push({text:`${i} provider${i===1?"":"s"} unreachable`,to:"/providers"}),a>0&&s.push({text:`${a} provider${a===1?"":"s"} without model discovery`,to:"/providers"})}return r.overCount>0?s.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&s.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),m==="alert"&&d!==null&&s.push({text:`error rate ${E(d)}`,to:"/activity?status=error"}),s.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),s.map((i,x)=>t.jsxs("span",{className:"flex items-center gap-2",children:[x>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(Y,{to:i.to,className:"underline underline-offset-2 hover:text-amber-950",children:i.text})]},i.to+i.text))]})}function Ct(e){return e==="error"?"error":"ok"}function kt({entries:e,loading:n,error:a}){const l=[{id:"time",header:"Time",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(r.timestamp).toLocaleString(),children:ht(r.timestamp)})},{id:"model",header:"Model",isRowHeader:!0,cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:r.model})},{id:"cost",header:"Cost",align:"end",cell:r=>r.cost===null?"—":D(r.cost)},{id:"status",header:"Status",cell:r=>t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Ct(r.status)})}];return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(Y,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(V,{error:a}),t.jsx(xt,{ariaLabel:"Recent activity",columns:l,rows:e,getRowKey:r=>r.id,isLoading:n,emptyContent:"No requests yet. Once the gateway serves traffic, it appears here."})]})}export{Bt as OverviewIndex,Rt as OverviewPage,T as localDayKey}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as y,i as st,N as Y}from"./react-dgEcD0HR.js";import{Z as nt,_ as ot,g as j,$ as it,v as lt,c as dt,u as ct,d as ut,a0 as w,P as mt,R as vt,E as V,a1 as b,a2 as D,a3 as N,a4 as R,a5 as E,a6 as ht,N as _}from"./index-C-bDZxkO.js";import{S as U}from"./charts-B_hm0rXH.js";import{D as xt}from"./DataTable-CrQq0sYf.js";import{d as M,B as ft}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function K(e){return e==="neutral"?void 0:e}const pt=.02,gt=.1;function W(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,a=n>=gt?"alert":n>=pt?"warn":"ok";return{rate:n,status:a}}function bt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy+e.degraded===0?"alert":"warn"}const yt=.8;function St(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(o=>o.max_budget!==null&&o.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let a=0,l=0,r,m=-1;for(const o of n){const s=o.max_budget*o.user_count,i=s>0?o.total_spend/s:0;i>=1?a+=1:i>=yt&&(l+=1),i>m&&(m=i,r={name:o.name??o.budget_id,spent:o.total_spend,allocated:s,pct:i})}const d=a>0?"alert":l>0?"warn":"ok",h=a>0?`${a} over limit`:l>0?`${l} near limit`:"All within budget";return{status:d,label:h,overCount:a,nearCount:l,cappedCount:n.length,worst:r}}const G=864e5,I=30;function T(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function jt(){const[e,n]=y.useState(T);return y.useEffect(()=>{const a=()=>{if(document.visibilityState==="visible"){const l=T();n(r=>r===l?r:l)}};return document.addEventListener("visibilitychange",a),window.addEventListener("focus",a),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}},[]),y.useMemo(()=>{const a=Date.now(),l=new Date(a);return{today:new Date(l.getFullYear(),l.getMonth(),l.getDate()).toISOString(),periodStart:new Date(a-I*G).toISOString(),prevStart:new Date(a-2*I*G).toISOString()}},[e])}const wt={ok:"Healthy",warn:"Elevated",alert:"High"},Nt={ok:"On track",warn:"Near limit",alert:"Over budget"};function Bt(){const e=nt();return e.isLoading?t.jsx(ot,{}):t.jsx(Rt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function Rt({needsSetup:e=!1}){var $,L,A,F,P,q,B,H;const n=jt(),a=y.useMemo(()=>({start_date:n.today}),[n]),l=y.useMemo(()=>({start_date:n.periodStart}),[n]),r=y.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=j(a,"hour",_),d=j(l,"day",_),h=j(r,"day",_),o=it(),s=lt(),i=dt(),x=ct(),f=ut({},0,5),C=($=m.data)==null?void 0:$.totals,v=(L=d.data)==null?void 0:L.totals,p=(A=h.data)==null?void 0:A.totals,S=((F=d.data)==null?void 0:F.series)??[],k=S.length>1,c=W(v),O=W(p),Z=c.rate!==null&&O.rate!==null?w(c.rate,O.rate):null,u=St(s.data??[]),z=bt(o.data),J=(i.data??[]).filter(g=>g.is_active).length,Q=(x.data??[]).filter(g=>!g.blocked).length,X=(((P=f.data)==null?void 0:P.length)??0)>0,tt=e&&f.isSuccess&&!X,et=m.error??d.error??o.error??s.error??i.error??x.error,rt=()=>{m.refetch(),d.refetch(),h.refetch(),o.refetch(),s.refetch(),i.refetch(),x.refetch(),f.refetch()},at=m.isFetching||d.isFetching||h.isFetching||o.isFetching||s.isFetching||i.isFetching||x.isFetching||f.isFetching;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(mt,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway.",action:t.jsx(vt,{onRefresh:rt,isFetching:at,updatedAt:d.dataUpdatedAt})}),tt?t.jsx(_t,{}):null,t.jsx(V,{error:et}),t.jsx(Et,{providerHealth:z,healthy:((q=o.data)==null?void 0:q.healthy)??0,degraded:((B=o.data)==null?void 0:B.degraded)??0,total:((H=o.data)==null?void 0:H.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:o.isSuccess&&s.isSuccess&&d.isSuccess,failed:o.isError||s.isError||d.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(b,{label:"Spend today",value:C?D(C.cost):"—"}),t.jsx(b,{label:"Spend, last 30 days",value:v?D(v.cost):"—",hint:v?t.jsx(N,{fraction:w(v.cost,p==null?void 0:p.cost)}):null,chart:k?t.jsx(U,{values:S.map(g=>g.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Requests, last 30 days",value:v?R(v.request_count):"—",hint:v?t.jsx(N,{fraction:w(v.request_count,p==null?void 0:p.request_count)}):null,chart:k?t.jsx(U,{values:S.map(g=>g.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Error rate, last 30 days",value:c.rate===null?"—":E(c.rate),status:K(c.status),statusLabel:c.status==="neutral"?void 0:wt[c.status],hint:c.rate!==null?t.jsx(N,{fraction:Z}):null}),t.jsx(b,{label:"Budget health",value:s.data&&u.worst?E(u.worst.pct):"—",status:s.data?K(u.status):void 0,statusLabel:s.data&&u.status!=="neutral"?Nt[u.status]:void 0,hint:s.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(b,{label:"Active keys",value:i.data?R(J):"—",to:"/keys"}),t.jsx(b,{label:"Active users",value:x.data?R(Q):"—",to:"/users"})]}),t.jsx(kt,{entries:f.data??[],loading:f.isLoading,error:f.error})]})}function _t(){const e=st();return t.jsx(M,{children:t.jsxs(M.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(ft,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function Dt({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function Et({providerHealth:e,healthy:n,degraded:a,total:l,budget:r,errStatus:m,errRate:d,ready:h,failed:o}){if(o)return t.jsx(Dt,{text:"Some status data could not be loaded."});if(!h)return null;const s=[];if((e==="warn"||e==="alert")&&l>0){const i=l-n-a;i>0&&s.push({text:`${i} provider${i===1?"":"s"} unreachable`,to:"/providers"}),a>0&&s.push({text:`${a} provider${a===1?"":"s"} without model discovery`,to:"/providers"})}return r.overCount>0?s.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&s.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),m==="alert"&&d!==null&&s.push({text:`error rate ${E(d)}`,to:"/activity?status=error"}),s.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),s.map((i,x)=>t.jsxs("span",{className:"flex items-center gap-2",children:[x>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(Y,{to:i.to,className:"underline underline-offset-2 hover:text-amber-950",children:i.text})]},i.to+i.text))]})}function Ct(e){return e==="error"?"error":"ok"}function kt({entries:e,loading:n,error:a}){const l=[{id:"time",header:"Time",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(r.timestamp).toLocaleString(),children:ht(r.timestamp)})},{id:"model",header:"Model",isRowHeader:!0,cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:r.model})},{id:"cost",header:"Cost",align:"end",cell:r=>r.cost===null?"—":D(r.cost)},{id:"status",header:"Status",cell:r=>t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Ct(r.status)})}];return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(Y,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(V,{error:a}),t.jsx(xt,{ariaLabel:"Recent activity",columns:l,rows:e,getRowKey:r=>r.id,isLoading:n,emptyContent:"No requests yet. Once the gateway serves traffic, it appears here."})]})}export{Bt as OverviewIndex,Rt as OverviewPage,T as localDayKey}; diff --git a/src/gateway/static/dashboard/assets/ProvidersPage-Bvzss9dV.js b/src/gateway/static/dashboard/assets/ProvidersPage-B46VzXV5.js similarity index 99% rename from src/gateway/static/dashboard/assets/ProvidersPage-Bvzss9dV.js rename to src/gateway/static/dashboard/assets/ProvidersPage-B46VzXV5.js index a185c9563..b69aded97 100644 --- a/src/gateway/static/dashboard/assets/ProvidersPage-Bvzss9dV.js +++ b/src/gateway/static/dashboard/assets/ProvidersPage-B46VzXV5.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as m,L as Z}from"./react-dgEcD0HR.js";import{Z as J,a7 as Q,W as X,$ as ee,a8 as te,a9 as se,aa as ae,P as re,E as I,I as ne,ab as ie,ac as oe,a6 as q,s as de,ad as F,ae as le,U as H,af as ce,ag as ue}from"./index-gNSmom8p.js";import{F as C}from"./Field-DEJ6Wjg9.js";import{D as me}from"./DataTable-CrQq0sYf.js";import{B as j,d as w,f as xe,T as pe,L as U,I as z,D as he,S as ve,C as T,a as ge,b as fe}from"./heroui-DZj66Arc.js";function E({value:t,onChange:s,label:a,placeholder:n,description:i}){return e.jsxs(pe,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(z,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),i?e.jsx(he,{className:"text-xs text-[var(--otari-muted)]",children:i}):null]})}function M({label:t,value:s,onChange:a,description:n,placeholder:i,extra:c=[],includeCatalog:d=!0}){var k;const b=ce(),x=m.useMemo(()=>d?[...c,...(b.data??[]).map(o=>({id:o.id,name:o.name}))]:c,[b.data,c,d]),[v,u]=m.useState(()=>{var o;return((o=x.find(y=>y.id===s))==null?void 0:o.name)??""}),f=((k=x.find(o=>o.id===s))==null?void 0:k.name)??"",g=v.trim()===f.trim()?"":v.trim().toLowerCase(),l=x.filter(o=>!g||o.name.toLowerCase().includes(g)||o.id.toLowerCase().includes(g)).slice(0,50);return e.jsxs(T.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:v,onInputChange:u,onSelectionChange:o=>{var y;o!=null?(a(String(o)),u(((y=x.find(N=>N.id===String(o)))==null?void 0:y.name)??"")):(a(""),u(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(T.InputGroup,{children:[e.jsx(z,{placeholder:i??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:o=>o.currentTarget.select()}),e.jsx(T.Trigger,{})]}),e.jsx(T.Popover,{children:e.jsx(ge,{items:l,className:"max-h-72 overflow-auto",children:o=>e.jsx(fe,{id:o.id,textValue:o.name,children:o.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function Y({getPayload:t}){const s=ue(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:H(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):s.data.discovery_unsupported?e.jsxs("span",{className:"block max-w-md break-words text-xs text-amber-800",children:["This provider does not list models, so the key could not be verified here. Save it and use the provider; declare its model ids under ",e.jsx("code",{children:"models:"})," to have them show up in the catalogue. If you did not expect this, check the provider's reply below.",s.data.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:s.data.error}):null]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function je({onClose:t}){var _;const s=F(),[a,n]=m.useState(""),[i,c]=m.useState(""),[d,b]=m.useState(!1),[x,v]=m.useState(""),[u,f]=m.useState(""),g=le(a),l=((_=g.data)==null?void 0:_.id)===a?g.data:void 0;m.useEffect(()=>{l&&v(l.default_api_base??"")},[l]);const k=(l==null?void 0:l.env_key_present)??!1,o=((l==null?void 0:l.requires_api_key)??!0)&&!k,y=u.trim()!==""&&u.trim()!==a,N=/[:/]/.test(u),P=a!==""&&!N&&(!o||i.trim()!=="")&&!s.isPending,A=()=>{P&&s.mutate({instance:y?u.trim():a,provider_type:y?a:null,api_base:x.trim()||null,api_key:i.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsx(M,{label:"Provider",value:a,onChange:S=>{n(S),f(""),v("")},description:"Its endpoint is built in."}),e.jsx(E,{value:i,onChange:c,label:l&&!o?"API key (optional)":"API key",description:l?o?`${l.name}'s endpoint is built in — just add your key.`:k?`${l.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${l.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>b(S=>!S),children:d?"Hide advanced":"Advanced (API base, rename)"}),d?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"API base",value:x,onChange:v,placeholder:(l==null?void 0:l.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(C,{label:"Name",value:u,onChange:f,placeholder:a||"instance name",description:N?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!P,onPress:A,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(Y,{getPayload:()=>a===""?null:{instance:y?u.trim():a,provider_type:y?a:null,api_base:x.trim()||null,api_key:i.trim()||null}})]})]})}function be({onClose:t}){const s=F(),[a,n]=m.useState(""),[i,c]=m.useState("openai-compatible"),[d,b]=m.useState(""),[x,v]=m.useState(""),u=/[:/]/.test(a),f=a.trim()!==""&&!u&&d.trim()!==""&&!s.isPending,g=()=>{f&&s.mutate({instance:a.trim(),provider_type:i||"openai-compatible",api_base:d.trim(),api_key:x.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:u?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(M,{label:"Compatible with",value:i,onChange:c,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(C,{label:"API base",value:d,onChange:b,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(E,{value:x,onChange:v,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!f,onPress:g,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(Y,{getPayload:()=>a.trim()===""||d.trim()===""?null:{instance:a.trim(),provider_type:i||"openai-compatible",api_base:d.trim(),api_key:x.trim()||null}})]})]})}function ye({onClose:t}){const[s,a]=m.useState("known");return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,i])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:i},n))})}),s==="known"?e.jsx(je,{onClose:t}):e.jsx(be,{onClose:t})]})})}function ke({provider:t,onClose:s,onSaved:a}){const n=ie(),[i,c]=m.useState(t.provider_type??""),[d,b]=m.useState(t.api_base??""),[x,v]=m.useState(!1),[u,f]=m.useState(""),g=()=>{if(n.isPending)return;const l={provider_type:i.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};x&&u.trim()&&(l.api_key=u.trim()),n.mutate({instance:t.instance,body:l},{onSuccess:()=>{a(t.instance),s()}})};return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(I,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"Provider type",value:i,onChange:c,placeholder:"openai"}),e.jsx(C,{label:"API base",value:d,onChange:b,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:x?e.jsxs(e.Fragment,{children:[e.jsx(E,{value:u,onChange:f,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{v(!1),f("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>v(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:n.isPending,onPress:g,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Pe(t,s){const a=new Map((s??[]).map(c=>[c.instance,c])),n=new Map((t??[]).map(c=>[c.instance,c]));return[...new Set([...a.keys(),...n.keys()])].sort().map(c=>{const d=a.get(c);return{instance:c,source:d?"stored":"config",stored:d,meta:n.get(c)}})}function Ne({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(ve,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):t.discovery_unsupported?e.jsxs("span",{className:"block max-w-xs break-words text-xs text-amber-800",children:["Could not list models, so the key could not be verified. It may still work for requests.",t.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:t.error}):null]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function _e({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=!t.ok&&t.discovery_unsupported,a=t.ok?"border-green-200 bg-green-50 text-green-700":s?"border-amber-200 bg-amber-50 text-amber-800":"border-red-200 bg-red-50 text-red-700",n=t.ok?"bg-green-500":s?"bg-amber-500":"bg-red-500",i=t.checked_at?`Last checked ${q(t.checked_at)}`:"Not checked yet",c=s?`${t.error??"This provider does not list models."} Requests to it may still work.`:t.error??"Unreachable",d=t.ok?i:`${c} · ${i}`;return e.jsxs("span",{title:d,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${n}`}),t.ok?"Reachable":s?"No model discovery":"Unreachable"]})}function Se({healthy:t,degraded:s,total:a,checkedAt:n}){const c=t===a?"bg-green-500":t+s===a?"bg-amber-500":"bg-red-500",d=oe();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${c}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s>0?e.jsxs("span",{className:"text-amber-800",children:[s," without model discovery"]}):null,n?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",q(n)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:d.isPending,onPress:()=>d.mutate(),children:d.isPending?"Re-checking…":"Re-check all"})]})}function R({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ce({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n,secretKeyConfigured:i}){return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(R,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(R,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(R,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",isDisabled:!i,onPress:t,children:"Add your first provider"})})]})})}function Ke(){var D,L,O,$;const t=J(),s=Q(),a=X(),n=ee(),i=te(),c=se(),d=ae(),[b,x]=m.useState(!1),[v,u]=m.useState(null),[f,g]=m.useState({}),l=Pe((D=t.data)==null?void 0:D.providers,s.data),k=new Map((((L=n.data)==null?void 0:L.providers)??[]).map(r=>[r.instance,r])),o=t.isLoading||s.isLoading,y=((O=s.data)==null?void 0:O.find(r=>r.instance===v))??null,N=(($=a.data)==null?void 0:$.require_pricing)===!0&&a.data.default_pricing===!1,P=a.data?a.data.secret_key_configured!==!1:!a.isError,A=!o&&l.length===0&&!b,_=m.useRef({}),S=r=>{const p=(_.current[r]??0)+1;return _.current[r]=p,p},K=r=>{S(r),g(p=>{if(!Object.hasOwn(p,r))return p;const h={...p};return delete h[r],h})},B=(r,p,h)=>{_.current[r]===p&&g(G=>({...G,[r]:h}))},V=async r=>{const p=S(r);g(h=>({...h,[r]:{status:"pending"}}));try{const h=await c.mutateAsync(r);B(r,p,{status:"done",...h})}catch(h){B(r,p,{status:"done",ok:!1,model_count:0,error:H(h),discovery_unsupported:!1})}},W=[{id:"provider",header:"Provider",isRowHeader:!0,cell:r=>e.jsx(Z,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"font-medium text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})},{id:"type",header:"Type",cell:r=>{var p,h;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:((p=r.meta)==null?void 0:p.provider_type)??((h=r.stored)==null?void 0:h.provider_type)??r.instance})}},{id:"source",header:"Source",cell:r=>e.jsx(xe,{size:"sm",color:r.source==="stored"?"accent":"default",children:r.source==="stored"?"stored":"config"})},{id:"api_key",header:"API key",cell:r=>{var p,h;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:(p=r.stored)!=null&&p.last4?`••••${r.stored.last4}`:"none set"}):(h=r.meta)!=null&&h.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"})}},{id:"status",header:"Status",cell:r=>e.jsx(_e,{health:k.get(r.instance)})},{id:"actions",header:"Actions",align:"end",cell:r=>{var p,h;return r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((p=f[r.instance])==null?void 0:p.status)==="pending"||((h=r.stored)==null?void 0:h.decryptable)===!1,onPress:()=>void V(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{x(!1),u(r.instance)},children:"Edit"}),e.jsx(de,{confirmLabel:"Delete",isPending:i.isPending,onConfirm:()=>i.mutate(r.instance,{onSuccess:()=>K(r.instance)}),children:"Delete"})]}),e.jsx(Ne,{state:f[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})}}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:b||A?null:e.jsx(j,{variant:"primary",isDisabled:!P,onPress:()=>{u(null),x(!0)},children:"Add provider"})}),e.jsx(I,{error:t.error??s.error??a.error??n.error??d.error??i.error}),P?null:e.jsxs(ne,{tone:"warning",children:[e.jsx("code",{children:"OTARI_SECRET_KEY"})," is not set, so provider keys can't be encrypted at rest and adding providers from the dashboard is disabled. Set it on the server and restart to add providers here. Providers defined in"," ",e.jsx("code",{children:"config.yml"})," keep working without it."]}),A?e.jsx(Ce,{onAddProvider:()=>{u(null),x(!0)},needsPricing:N,onEnablePricing:()=>d.mutate({default_pricing:!0}),enabling:d.isPending,secretKeyConfigured:P}):null,b&&P?e.jsx(ye,{onClose:()=>x(!1)}):null,y?e.jsx(ke,{provider:y,onClose:()=>u(null),onSaved:K}):null,!o&&l.length>0&&n.data&&n.data.total>0?e.jsx(Se,{healthy:n.data.healthy,degraded:n.data.degraded,total:n.data.total,checkedAt:n.data.checked_at}):null,A?null:e.jsx(me,{ariaLabel:"Providers",columns:W,rows:l,getRowKey:r=>r.instance,isLoading:o,emptyContent:"No providers yet. Add your first provider to start serving models."})]})}export{Ke as ProvidersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as m,L as Z}from"./react-dgEcD0HR.js";import{Z as J,a7 as Q,W as X,$ as ee,a8 as te,a9 as se,aa as ae,P as re,E as I,I as ne,ab as ie,ac as oe,a6 as q,s as de,ad as F,ae as le,U as H,af as ce,ag as ue}from"./index-C-bDZxkO.js";import{F as C}from"./Field-DEJ6Wjg9.js";import{D as me}from"./DataTable-CrQq0sYf.js";import{B as j,d as w,f as xe,T as pe,L as U,I as z,D as he,S as ve,C as T,a as ge,b as fe}from"./heroui-DZj66Arc.js";function E({value:t,onChange:s,label:a,placeholder:n,description:i}){return e.jsxs(pe,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(z,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),i?e.jsx(he,{className:"text-xs text-[var(--otari-muted)]",children:i}):null]})}function M({label:t,value:s,onChange:a,description:n,placeholder:i,extra:c=[],includeCatalog:d=!0}){var k;const b=ce(),x=m.useMemo(()=>d?[...c,...(b.data??[]).map(o=>({id:o.id,name:o.name}))]:c,[b.data,c,d]),[v,u]=m.useState(()=>{var o;return((o=x.find(y=>y.id===s))==null?void 0:o.name)??""}),f=((k=x.find(o=>o.id===s))==null?void 0:k.name)??"",g=v.trim()===f.trim()?"":v.trim().toLowerCase(),l=x.filter(o=>!g||o.name.toLowerCase().includes(g)||o.id.toLowerCase().includes(g)).slice(0,50);return e.jsxs(T.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:v,onInputChange:u,onSelectionChange:o=>{var y;o!=null?(a(String(o)),u(((y=x.find(N=>N.id===String(o)))==null?void 0:y.name)??"")):(a(""),u(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(T.InputGroup,{children:[e.jsx(z,{placeholder:i??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:o=>o.currentTarget.select()}),e.jsx(T.Trigger,{})]}),e.jsx(T.Popover,{children:e.jsx(ge,{items:l,className:"max-h-72 overflow-auto",children:o=>e.jsx(fe,{id:o.id,textValue:o.name,children:o.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function Y({getPayload:t}){const s=ue(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:H(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):s.data.discovery_unsupported?e.jsxs("span",{className:"block max-w-md break-words text-xs text-amber-800",children:["This provider does not list models, so the key could not be verified here. Save it and use the provider; declare its model ids under ",e.jsx("code",{children:"models:"})," to have them show up in the catalogue. If you did not expect this, check the provider's reply below.",s.data.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:s.data.error}):null]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function je({onClose:t}){var _;const s=F(),[a,n]=m.useState(""),[i,c]=m.useState(""),[d,b]=m.useState(!1),[x,v]=m.useState(""),[u,f]=m.useState(""),g=le(a),l=((_=g.data)==null?void 0:_.id)===a?g.data:void 0;m.useEffect(()=>{l&&v(l.default_api_base??"")},[l]);const k=(l==null?void 0:l.env_key_present)??!1,o=((l==null?void 0:l.requires_api_key)??!0)&&!k,y=u.trim()!==""&&u.trim()!==a,N=/[:/]/.test(u),P=a!==""&&!N&&(!o||i.trim()!=="")&&!s.isPending,A=()=>{P&&s.mutate({instance:y?u.trim():a,provider_type:y?a:null,api_base:x.trim()||null,api_key:i.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsx(M,{label:"Provider",value:a,onChange:S=>{n(S),f(""),v("")},description:"Its endpoint is built in."}),e.jsx(E,{value:i,onChange:c,label:l&&!o?"API key (optional)":"API key",description:l?o?`${l.name}'s endpoint is built in — just add your key.`:k?`${l.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${l.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>b(S=>!S),children:d?"Hide advanced":"Advanced (API base, rename)"}),d?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"API base",value:x,onChange:v,placeholder:(l==null?void 0:l.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(C,{label:"Name",value:u,onChange:f,placeholder:a||"instance name",description:N?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!P,onPress:A,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(Y,{getPayload:()=>a===""?null:{instance:y?u.trim():a,provider_type:y?a:null,api_base:x.trim()||null,api_key:i.trim()||null}})]})]})}function be({onClose:t}){const s=F(),[a,n]=m.useState(""),[i,c]=m.useState("openai-compatible"),[d,b]=m.useState(""),[x,v]=m.useState(""),u=/[:/]/.test(a),f=a.trim()!==""&&!u&&d.trim()!==""&&!s.isPending,g=()=>{f&&s.mutate({instance:a.trim(),provider_type:i||"openai-compatible",api_base:d.trim(),api_key:x.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:u?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(M,{label:"Compatible with",value:i,onChange:c,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(C,{label:"API base",value:d,onChange:b,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(E,{value:x,onChange:v,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!f,onPress:g,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(Y,{getPayload:()=>a.trim()===""||d.trim()===""?null:{instance:a.trim(),provider_type:i||"openai-compatible",api_base:d.trim(),api_key:x.trim()||null}})]})]})}function ye({onClose:t}){const[s,a]=m.useState("known");return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,i])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:i},n))})}),s==="known"?e.jsx(je,{onClose:t}):e.jsx(be,{onClose:t})]})})}function ke({provider:t,onClose:s,onSaved:a}){const n=ie(),[i,c]=m.useState(t.provider_type??""),[d,b]=m.useState(t.api_base??""),[x,v]=m.useState(!1),[u,f]=m.useState(""),g=()=>{if(n.isPending)return;const l={provider_type:i.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};x&&u.trim()&&(l.api_key=u.trim()),n.mutate({instance:t.instance,body:l},{onSuccess:()=>{a(t.instance),s()}})};return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(I,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"Provider type",value:i,onChange:c,placeholder:"openai"}),e.jsx(C,{label:"API base",value:d,onChange:b,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:x?e.jsxs(e.Fragment,{children:[e.jsx(E,{value:u,onChange:f,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{v(!1),f("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>v(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:n.isPending,onPress:g,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Pe(t,s){const a=new Map((s??[]).map(c=>[c.instance,c])),n=new Map((t??[]).map(c=>[c.instance,c]));return[...new Set([...a.keys(),...n.keys()])].sort().map(c=>{const d=a.get(c);return{instance:c,source:d?"stored":"config",stored:d,meta:n.get(c)}})}function Ne({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(ve,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):t.discovery_unsupported?e.jsxs("span",{className:"block max-w-xs break-words text-xs text-amber-800",children:["Could not list models, so the key could not be verified. It may still work for requests.",t.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:t.error}):null]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function _e({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=!t.ok&&t.discovery_unsupported,a=t.ok?"border-green-200 bg-green-50 text-green-700":s?"border-amber-200 bg-amber-50 text-amber-800":"border-red-200 bg-red-50 text-red-700",n=t.ok?"bg-green-500":s?"bg-amber-500":"bg-red-500",i=t.checked_at?`Last checked ${q(t.checked_at)}`:"Not checked yet",c=s?`${t.error??"This provider does not list models."} Requests to it may still work.`:t.error??"Unreachable",d=t.ok?i:`${c} · ${i}`;return e.jsxs("span",{title:d,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${n}`}),t.ok?"Reachable":s?"No model discovery":"Unreachable"]})}function Se({healthy:t,degraded:s,total:a,checkedAt:n}){const c=t===a?"bg-green-500":t+s===a?"bg-amber-500":"bg-red-500",d=oe();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${c}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s>0?e.jsxs("span",{className:"text-amber-800",children:[s," without model discovery"]}):null,n?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",q(n)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:d.isPending,onPress:()=>d.mutate(),children:d.isPending?"Re-checking…":"Re-check all"})]})}function R({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ce({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n,secretKeyConfigured:i}){return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(R,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(R,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(R,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",isDisabled:!i,onPress:t,children:"Add your first provider"})})]})})}function Ke(){var D,L,O,$;const t=J(),s=Q(),a=X(),n=ee(),i=te(),c=se(),d=ae(),[b,x]=m.useState(!1),[v,u]=m.useState(null),[f,g]=m.useState({}),l=Pe((D=t.data)==null?void 0:D.providers,s.data),k=new Map((((L=n.data)==null?void 0:L.providers)??[]).map(r=>[r.instance,r])),o=t.isLoading||s.isLoading,y=((O=s.data)==null?void 0:O.find(r=>r.instance===v))??null,N=(($=a.data)==null?void 0:$.require_pricing)===!0&&a.data.default_pricing===!1,P=a.data?a.data.secret_key_configured!==!1:!a.isError,A=!o&&l.length===0&&!b,_=m.useRef({}),S=r=>{const p=(_.current[r]??0)+1;return _.current[r]=p,p},K=r=>{S(r),g(p=>{if(!Object.hasOwn(p,r))return p;const h={...p};return delete h[r],h})},B=(r,p,h)=>{_.current[r]===p&&g(G=>({...G,[r]:h}))},V=async r=>{const p=S(r);g(h=>({...h,[r]:{status:"pending"}}));try{const h=await c.mutateAsync(r);B(r,p,{status:"done",...h})}catch(h){B(r,p,{status:"done",ok:!1,model_count:0,error:H(h),discovery_unsupported:!1})}},W=[{id:"provider",header:"Provider",isRowHeader:!0,cell:r=>e.jsx(Z,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"font-medium text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})},{id:"type",header:"Type",cell:r=>{var p,h;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:((p=r.meta)==null?void 0:p.provider_type)??((h=r.stored)==null?void 0:h.provider_type)??r.instance})}},{id:"source",header:"Source",cell:r=>e.jsx(xe,{size:"sm",color:r.source==="stored"?"accent":"default",children:r.source==="stored"?"stored":"config"})},{id:"api_key",header:"API key",cell:r=>{var p,h;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:(p=r.stored)!=null&&p.last4?`••••${r.stored.last4}`:"none set"}):(h=r.meta)!=null&&h.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"})}},{id:"status",header:"Status",cell:r=>e.jsx(_e,{health:k.get(r.instance)})},{id:"actions",header:"Actions",align:"end",cell:r=>{var p,h;return r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((p=f[r.instance])==null?void 0:p.status)==="pending"||((h=r.stored)==null?void 0:h.decryptable)===!1,onPress:()=>void V(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{x(!1),u(r.instance)},children:"Edit"}),e.jsx(de,{confirmLabel:"Delete",isPending:i.isPending,onConfirm:()=>i.mutate(r.instance,{onSuccess:()=>K(r.instance)}),children:"Delete"})]}),e.jsx(Ne,{state:f[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})}}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:b||A?null:e.jsx(j,{variant:"primary",isDisabled:!P,onPress:()=>{u(null),x(!0)},children:"Add provider"})}),e.jsx(I,{error:t.error??s.error??a.error??n.error??d.error??i.error}),P?null:e.jsxs(ne,{tone:"warning",children:[e.jsx("code",{children:"OTARI_SECRET_KEY"})," is not set, so provider keys can't be encrypted at rest and adding providers from the dashboard is disabled. Set it on the server and restart to add providers here. Providers defined in"," ",e.jsx("code",{children:"config.yml"})," keep working without it."]}),A?e.jsx(Ce,{onAddProvider:()=>{u(null),x(!0)},needsPricing:N,onEnablePricing:()=>d.mutate({default_pricing:!0}),enabling:d.isPending,secretKeyConfigured:P}):null,b&&P?e.jsx(ye,{onClose:()=>x(!1)}):null,y?e.jsx(ke,{provider:y,onClose:()=>u(null),onSaved:K}):null,!o&&l.length>0&&n.data&&n.data.total>0?e.jsx(Se,{healthy:n.data.healthy,degraded:n.data.degraded,total:n.data.total,checkedAt:n.data.checked_at}):null,A?null:e.jsx(me,{ariaLabel:"Providers",columns:W,rows:l,getRowKey:r=>r.instance,isLoading:o,emptyContent:"No providers yet. Add your first provider to start serving models."})]})}export{Ke as ProvidersPage}; diff --git a/src/gateway/static/dashboard/assets/SettingsPage-DGmFxbDI.js b/src/gateway/static/dashboard/assets/SettingsPage-CMbg-FaW.js similarity index 99% rename from src/gateway/static/dashboard/assets/SettingsPage-DGmFxbDI.js rename to src/gateway/static/dashboard/assets/SettingsPage-CMbg-FaW.js index 3295ae6e1..b61875092 100644 --- a/src/gateway/static/dashboard/assets/SettingsPage-DGmFxbDI.js +++ b/src/gateway/static/dashboard/assets/SettingsPage-CMbg-FaW.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{W as R,aa as C,P,E as y,_ as E,ah as T,ai as _,aj as D,F as A,ak as O,a7 as F,al as I,I as w}from"./index-gNSmom8p.js";import{d as v,B as h,A as d,g as K,I as z}from"./heroui-DZj66Arc.js";function b(t,r){return{[t]:r}}function M(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function L(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||M(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(A,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function U({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function V({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(V,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function W({source:t}){const r=O(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:K({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(G,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function X(){var o;const t=F(),r=I(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(W,{source:t}),e.jsx(X,{})]})})]})}function Q({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=T(),r=_(),s=D(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(Q,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&L(l,n)),k=ee(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,t.isLoading?e.jsx(E,{}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(U,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,L as fieldMatches}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{W as R,aa as C,P,E as y,_ as E,ah as T,ai as _,aj as D,F as A,ak as O,a7 as F,al as I,I as w}from"./index-C-bDZxkO.js";import{d as v,B as h,A as d,g as K,I as z}from"./heroui-DZj66Arc.js";function b(t,r){return{[t]:r}}function M(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function L(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||M(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(A,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function U({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function V({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(V,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function W({source:t}){const r=O(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:K({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(G,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function X(){var o;const t=F(),r=I(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(W,{source:t}),e.jsx(X,{})]})})]})}function Q({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=T(),r=_(),s=D(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(Q,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&L(l,n)),k=ee(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,t.isLoading?e.jsx(E,{}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(U,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,L as fieldMatches}; diff --git a/src/gateway/static/dashboard/assets/TablePagination-C-pfgcm6.js b/src/gateway/static/dashboard/assets/TablePagination-0H6sFfIt.js similarity index 98% rename from src/gateway/static/dashboard/assets/TablePagination-C-pfgcm6.js rename to src/gateway/static/dashboard/assets/TablePagination-0H6sFfIt.js index 6970fb8d2..c776d5ddf 100644 --- a/src/gateway/static/dashboard/assets/TablePagination-C-pfgcm6.js +++ b/src/gateway/static/dashboard/assets/TablePagination-0H6sFfIt.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{I as w,E as M,F as D}from"./index-gNSmom8p.js";import{A as o,B as x,T as F,L as $,I as T,S as y}from"./heroui-DZj66Arc.js";function _({label:t,value:r,onChange:a,isRequired:c,autoFocus:i}){return e.jsxs(F,{value:r,onChange:a,isRequired:c,className:"flex flex-col gap-1",children:[e.jsx($,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsx(T,{inputMode:"decimal",placeholder:"0.00",autoFocus:i})]})}function R(t){const r=t.trim();if(r==="")return null;const a=Number(r);return Number.isFinite(a)&&a>=0?a:Number.NaN}const C=t=>`Recompute cost for ${t.toLocaleString()} imported ${t===1?"row":"rows"} from each row's own token counts at these per-1M rates. Enforced gateway rows are never affected.`;function W({isOpen:t,onOpenChange:r,targetCount:a,isPending:c,error:i,onSubmit:E,title:I="Set price",description:L=C}){const[j,p]=u.useState(""),[n,h]=u.useState(""),[b,N]=u.useState(""),[f,v]=u.useState("");u.useEffect(()=>{t&&(p(""),h(""),N(""),v(""))},[t]);const m=R(j),l=R(n),d=R(b),s=R(f),g=m===null||Number.isNaN(m)||l===null||Number.isNaN(l)||Number.isNaN(d??0)||Number.isNaN(s??0),S=()=>{g||m===null||l===null||E({input_price_per_million:m,output_price_per_million:l,...d!==null&&!Number.isNaN(d)?{cache_read_price_per_million:d}:{},...s!==null&&!Number.isNaN(s)?{cache_write_price_per_million:s}:{}})};return e.jsx(o,{isOpen:t,onOpenChange:r,children:t?e.jsx(o.Backdrop,{children:e.jsx(o.Container,{placement:"center",size:"lg",children:e.jsxs(o.Dialog,{children:[e.jsx(o.Header,{children:e.jsx(o.Heading,{children:I})}),e.jsxs(o.Body,{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:L(a)}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(_,{label:"Input $ / 1M",value:j,onChange:p,isRequired:!0,autoFocus:!0}),e.jsx(_,{label:"Output $ / 1M",value:n,onChange:h,isRequired:!0}),e.jsx(_,{label:"Cache read $ / 1M",value:b,onChange:N}),e.jsx(_,{label:"Cache write $ / 1M",value:f,onChange:v})]}),e.jsx(w,{tone:"info",children:"Leave a cache rate blank to bill those tokens at the input rate."}),e.jsx(M,{error:i})]}),e.jsxs(o.Footer,{children:[e.jsx(x,{variant:"ghost",isDisabled:c,onPress:()=>r(!1),children:"Cancel"}),e.jsx(x,{variant:"primary",isDisabled:g,isPending:c,onPress:S,children:"Set price"})]})]})})}):null})}const P=[25,50,100];function q({page:t,pageSize:r,total:a,rowsOnPage:c,onPageChange:i,onPageSizeChange:E,pageSizeOptions:I=P,isFetching:L=!1,hasNextFallback:j=!1}){const p=u.useId(),n=a!=null?Math.max(1,Math.ceil(a/r)):null,h=t===0,b=n!=null?t>=n-1:!j,N=c>0?t*r+1:0,f=t*r+c,v=a!=null?a===0?"0 of 0":`${N.toLocaleString()}–${f.toLocaleString()} of ${a.toLocaleString()}`:c>0?`${N.toLocaleString()}–${f.toLocaleString()}`:"0",[m,l]=u.useState(String(t+1));u.useEffect(()=>{l(String(t+1))},[t]);const d=()=>{const s=Number.parseInt(m,10);if(Number.isNaN(s)){l(String(t+1));return}const g=n??Number.MAX_SAFE_INTEGER,S=Math.min(Math.max(s,1),g);S-1!==t?i(S-1):l(String(t+1))};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:p,className:"text-sm text-[var(--otari-muted)]",children:"Rows"}),e.jsx(D,{id:p,ariaLabel:"Rows per page",value:String(r),onChange:s=>E(Number.parseInt(s,10)),options:I.map(s=>({value:String(s),label:String(s)}))}),L?e.jsx(y,{size:"sm"}):null]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[var(--otari-muted)] tabular-nums",children:v}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"outline","aria-label":"First page",isDisabled:h,onPress:()=>i(0),children:"«"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Previous page",isDisabled:h,onPress:()=>i(t-1),children:"‹"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{"aria-label":"Page number",inputMode:"numeric",value:m,onChange:s=>l(s.target.value.replace(/[^0-9]/g,"")),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()},onBlur:d,className:"w-12 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-2 py-1 text-center text-sm text-[var(--otari-ink)] tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"}),n!=null?e.jsxs("span",{className:"tabular-nums",children:["/ ",n.toLocaleString()]}):null]}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Next page",isDisabled:b,onPress:()=>i(t+1),children:"›"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Last page",isDisabled:n==null||b,onPress:()=>n!=null&&i(n-1),children:"»"})]})]})]})}export{P,W as S,q as T}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{I as w,E as M,F as D}from"./index-C-bDZxkO.js";import{A as o,B as x,T as F,L as $,I as T,S as y}from"./heroui-DZj66Arc.js";function _({label:t,value:r,onChange:a,isRequired:c,autoFocus:i}){return e.jsxs(F,{value:r,onChange:a,isRequired:c,className:"flex flex-col gap-1",children:[e.jsx($,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsx(T,{inputMode:"decimal",placeholder:"0.00",autoFocus:i})]})}function R(t){const r=t.trim();if(r==="")return null;const a=Number(r);return Number.isFinite(a)&&a>=0?a:Number.NaN}const C=t=>`Recompute cost for ${t.toLocaleString()} imported ${t===1?"row":"rows"} from each row's own token counts at these per-1M rates. Enforced gateway rows are never affected.`;function W({isOpen:t,onOpenChange:r,targetCount:a,isPending:c,error:i,onSubmit:E,title:I="Set price",description:L=C}){const[j,p]=u.useState(""),[n,h]=u.useState(""),[b,N]=u.useState(""),[f,v]=u.useState("");u.useEffect(()=>{t&&(p(""),h(""),N(""),v(""))},[t]);const m=R(j),l=R(n),d=R(b),s=R(f),g=m===null||Number.isNaN(m)||l===null||Number.isNaN(l)||Number.isNaN(d??0)||Number.isNaN(s??0),S=()=>{g||m===null||l===null||E({input_price_per_million:m,output_price_per_million:l,...d!==null&&!Number.isNaN(d)?{cache_read_price_per_million:d}:{},...s!==null&&!Number.isNaN(s)?{cache_write_price_per_million:s}:{}})};return e.jsx(o,{isOpen:t,onOpenChange:r,children:t?e.jsx(o.Backdrop,{children:e.jsx(o.Container,{placement:"center",size:"lg",children:e.jsxs(o.Dialog,{children:[e.jsx(o.Header,{children:e.jsx(o.Heading,{children:I})}),e.jsxs(o.Body,{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:L(a)}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(_,{label:"Input $ / 1M",value:j,onChange:p,isRequired:!0,autoFocus:!0}),e.jsx(_,{label:"Output $ / 1M",value:n,onChange:h,isRequired:!0}),e.jsx(_,{label:"Cache read $ / 1M",value:b,onChange:N}),e.jsx(_,{label:"Cache write $ / 1M",value:f,onChange:v})]}),e.jsx(w,{tone:"info",children:"Leave a cache rate blank to bill those tokens at the input rate."}),e.jsx(M,{error:i})]}),e.jsxs(o.Footer,{children:[e.jsx(x,{variant:"ghost",isDisabled:c,onPress:()=>r(!1),children:"Cancel"}),e.jsx(x,{variant:"primary",isDisabled:g,isPending:c,onPress:S,children:"Set price"})]})]})})}):null})}const P=[25,50,100];function q({page:t,pageSize:r,total:a,rowsOnPage:c,onPageChange:i,onPageSizeChange:E,pageSizeOptions:I=P,isFetching:L=!1,hasNextFallback:j=!1}){const p=u.useId(),n=a!=null?Math.max(1,Math.ceil(a/r)):null,h=t===0,b=n!=null?t>=n-1:!j,N=c>0?t*r+1:0,f=t*r+c,v=a!=null?a===0?"0 of 0":`${N.toLocaleString()}–${f.toLocaleString()} of ${a.toLocaleString()}`:c>0?`${N.toLocaleString()}–${f.toLocaleString()}`:"0",[m,l]=u.useState(String(t+1));u.useEffect(()=>{l(String(t+1))},[t]);const d=()=>{const s=Number.parseInt(m,10);if(Number.isNaN(s)){l(String(t+1));return}const g=n??Number.MAX_SAFE_INTEGER,S=Math.min(Math.max(s,1),g);S-1!==t?i(S-1):l(String(t+1))};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:p,className:"text-sm text-[var(--otari-muted)]",children:"Rows"}),e.jsx(D,{id:p,ariaLabel:"Rows per page",value:String(r),onChange:s=>E(Number.parseInt(s,10)),options:I.map(s=>({value:String(s),label:String(s)}))}),L?e.jsx(y,{size:"sm"}):null]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[var(--otari-muted)] tabular-nums",children:v}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"outline","aria-label":"First page",isDisabled:h,onPress:()=>i(0),children:"«"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Previous page",isDisabled:h,onPress:()=>i(t-1),children:"‹"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{"aria-label":"Page number",inputMode:"numeric",value:m,onChange:s=>l(s.target.value.replace(/[^0-9]/g,"")),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()},onBlur:d,className:"w-12 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-2 py-1 text-center text-sm text-[var(--otari-ink)] tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"}),n!=null?e.jsxs("span",{className:"tabular-nums",children:["/ ",n.toLocaleString()]}):null]}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Next page",isDisabled:b,onPress:()=>i(t+1),children:"›"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Last page",isDisabled:n==null||b,onPress:()=>n!=null&&i(n-1),children:"»"})]})]})]})}export{P,W as S,q as T}; diff --git a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-CSEh0CuT.js b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-DkLhKtcA.js similarity index 99% rename from src/gateway/static/dashboard/assets/ToolsGuardrailsPage-CSEh0CuT.js rename to src/gateway/static/dashboard/assets/ToolsGuardrailsPage-DkLhKtcA.js index f2100e659..fd5c96705 100644 --- a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-CSEh0CuT.js +++ b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-DkLhKtcA.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x}from"./react-dgEcD0HR.js";import{am as L,an as C,P,E,_ as R,U as w,ao as D,F as U}from"./index-gNSmom8p.js";import{d as N,B as g}from"./heroui-DZj66Arc.js";function M(s,t){return{[s]:t}}const B=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=x.useState(null),a=x.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function z({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",b="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r),[m,p]=x.useState(null),c=D();x.useEffect(()=>{i(r)},[r]);const o=l.trim()!==r,d=l.trim(),h=m!==null&&m===d;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:l,disabled:n,placeholder:"unset",onChange:v=>{i(v.target.value),c.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(d===""?null:d),children:"Save"}),e.jsx(g,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:d===""||c.isPending,onPress:()=>{p(d),c.mutate({service:s.service,url:d})},children:c.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:c.isPending||!h?null:c.error?e.jsx("span",{className:"text-red-700",children:w(c.error)}):c.data?e.jsx("span",{className:c.data.ok?"font-medium text-green-700":"text-red-700",children:c.data.reason}):null}),e.jsx(j,{message:a})]})]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:p=>i(p.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(l.trim()===""?null:l.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l.trim(),p=Number(m),o=(m===""||Number.isInteger(p)&&p>=1)&&m!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:d=>i(d.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(m===""?null:p),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(U,{ariaLabel:s.key,value:r,onChange:l=>t(l==="default"?null:l==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function O({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(F,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n})}function V(){const s=L(),t=C(),[a,n]=$(),[r,l]=x.useState({}),i=s.data,m=!i||t.isPending,p=new Map(((i==null?void 0:i.fields)??[]).map(o=>[o.key,o])),c=(o,d)=>{l(h=>{const{[o.key]:v,...u}=h;return u}),t.mutate(M(o.key,d),{onSuccess:()=>n(`${o.key} saved`),onError:h=>l(v=>({...v,[o.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(E,{error:s.error}),s.isLoading?e.jsx(R,{}):null,B.map(o=>{const d=o.order.map(u=>p.get(u)).filter(u=>u!==void 0),h=((i==null?void 0:i.fields)??[]).filter(u=>u.service===o.key&&!o.order.includes(u.key)),v=[...d,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:o.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:o.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(O,{field:u,onSave:T=>c(u,T),saveError:r[u.key],disabled:m},u.key))})})]},o.key)}),e.jsx(z,{message:a})]})}export{V as ToolsGuardrailsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x}from"./react-dgEcD0HR.js";import{am as L,an as C,P,E,_ as R,U as w,ao as D,F as U}from"./index-C-bDZxkO.js";import{d as N,B as g}from"./heroui-DZj66Arc.js";function M(s,t){return{[s]:t}}const B=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=x.useState(null),a=x.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function z({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",b="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r),[m,p]=x.useState(null),c=D();x.useEffect(()=>{i(r)},[r]);const o=l.trim()!==r,d=l.trim(),h=m!==null&&m===d;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:l,disabled:n,placeholder:"unset",onChange:v=>{i(v.target.value),c.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(d===""?null:d),children:"Save"}),e.jsx(g,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:d===""||c.isPending,onPress:()=>{p(d),c.mutate({service:s.service,url:d})},children:c.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:c.isPending||!h?null:c.error?e.jsx("span",{className:"text-red-700",children:w(c.error)}):c.data?e.jsx("span",{className:c.data.ok?"font-medium text-green-700":"text-red-700",children:c.data.reason}):null}),e.jsx(j,{message:a})]})]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:p=>i(p.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(l.trim()===""?null:l.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l.trim(),p=Number(m),o=(m===""||Number.isInteger(p)&&p>=1)&&m!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:d=>i(d.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(m===""?null:p),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(U,{ariaLabel:s.key,value:r,onChange:l=>t(l==="default"?null:l==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function O({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(F,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n})}function V(){const s=L(),t=C(),[a,n]=$(),[r,l]=x.useState({}),i=s.data,m=!i||t.isPending,p=new Map(((i==null?void 0:i.fields)??[]).map(o=>[o.key,o])),c=(o,d)=>{l(h=>{const{[o.key]:v,...u}=h;return u}),t.mutate(M(o.key,d),{onSuccess:()=>n(`${o.key} saved`),onError:h=>l(v=>({...v,[o.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(E,{error:s.error}),s.isLoading?e.jsx(R,{}):null,B.map(o=>{const d=o.order.map(u=>p.get(u)).filter(u=>u!==void 0),h=((i==null?void 0:i.fields)??[]).filter(u=>u.service===o.key&&!o.order.includes(u.key)),v=[...d,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:o.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:o.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(O,{field:u,onSave:T=>c(u,T),saveError:r[u.key],disabled:m},u.key))})})]},o.key)}),e.jsx(z,{message:a})]})}export{V as ToolsGuardrailsPage}; diff --git a/src/gateway/static/dashboard/assets/UsagePage-4kYrVw0Z.js b/src/gateway/static/dashboard/assets/UsagePage-CjaSd7XG.js similarity index 99% rename from src/gateway/static/dashboard/assets/UsagePage-4kYrVw0Z.js rename to src/gateway/static/dashboard/assets/UsagePage-CjaSd7XG.js index c38fcccd9..0337f4fa4 100644 --- a/src/gateway/static/dashboard/assets/UsagePage-4kYrVw0Z.js +++ b/src/gateway/static/dashboard/assets/UsagePage-CjaSd7XG.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{i as ht,r as d}from"./react-dgEcD0HR.js";import{u as pt,c as vt,n as pe,i as kt,g as ve,ap as _t,aq as yt,a0 as X,ar as Ie,P as bt,E as xt,m as ke,f as gt,R as ft,as as Ke,B as jt,a1 as $,a3 as J,a2 as ye,a5 as Ae,at as I,F as St,h as wt,N as Nt,r as Ct}from"./index-gNSmom8p.js";import{S as ee,C as Et,T as Lt}from"./charts-B_hm0rXH.js";import{D as Tt}from"./DataTable-CrQq0sYf.js";import{F as Ft}from"./FilterChips-BLdhUEZK.js";import{B as O,S as Pe}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function te(l){return l.toLocaleString()}function Rt(l){return l===null?"—":l<1e3?`${Math.round(l)} ms`:`${(l/1e3).toFixed(2)} s`}function Ot(l,x){const g=new Date(l);return Number.isNaN(g.getTime())?l:x==="hour"?g.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):g.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const qe=wt(Ke,Ie),_e=15,De=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}],At=[{value:"",label:"None"},{value:"model",label:"Model"},{value:"user_id",label:"User"},{value:"api_key_id",label:"API key"},{value:"source",label:"Source"}],Pt=[{key:"fresh",label:"Fresh input",color:"var(--otari-ink)"},{key:"cache_read",label:"Cache read",color:"var(--otari-brand)"},{key:"cache_write",label:"Cache write",color:"var(--otari-brand-soft)"},{key:"output",label:"Output",color:"var(--otari-brand-dark)"}],qt=[{key:"success",label:"Succeeded",color:"var(--otari-brand)"},{key:"errors",label:"Failed",color:"var(--otari-danger)"}],Be=["var(--otari-cat-1)","var(--otari-cat-2)","var(--otari-cat-3)","var(--otari-cat-4)","var(--otari-cat-5)","var(--otari-cat-6)","var(--otari-cat-7)","var(--otari-cat-8)"],Dt="var(--otari-cat-other)";function Bt(l){return l==="cost"?ye:l==="tokens"?I:te}const Ue="__other__",Me="__unknown__";function $e({dimensionLabel:l,rows:x,totalCost:g,emptyLabel:b,unknownLabel:se="(unknown)",labelFor:f,onDrill:K,loading:p}){const[D,z]=d.useState(!1),B=D?x:x.slice(0,_e),ae=x.length-B.length,G=o=>o.is_other?Ue:o.key??Me,u=[{id:"name",header:l,isRowHeader:!0,cell:o=>{const v=g>0?o.cost/g:0;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"truncate text-[var(--otari-ink)]",children:o.is_other?`Other (${o.requests.toLocaleString()} req)`:o.key===null?se:(f==null?void 0:f(o.key))??o.key}),t.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:t.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,v*100)}%`}})})]})}},{id:"requests",header:"Requests",align:"end",cell:o=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:te(o.requests)})},{id:"tokens",header:"Tokens",align:"end",cell:o=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:I(o.tokens)})},{id:"spend",header:"Spend",align:"end",cell:o=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:ye(o.cost)})}];return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(Tt,{ariaLabel:`Spend by ${l.toLowerCase()}`,columns:u,rows:B,getRowKey:G,isLoading:p,emptyContent:b,onRowAction:o=>{o!==Ue&&o!==Me&&K(o)}}),!p&&ae>0?t.jsxs(O,{size:"sm",variant:"ghost",onPress:()=>z(!0),children:["Show all ",x.length]}):null,!p&&D&&x.length>_e?t.jsxs(O,{size:"sm",variant:"ghost",onPress:()=>z(!1),children:["Show top ",_e]}):null]})}const Ut=["model","user","source_label","endpoint","provider","source"],Mt=["model"];function Zt(){var Te,Fe,Re;const l=ht(),x=pt(),g=vt(),[b,se]=d.useState(qe),[f,K]=d.useState(()=>pe(qe.seconds??0)),[p,D]=d.useState(!1),[z,B]=d.useState(),[ae,G]=d.useState(),[u,o]=d.useState(""),[v,re]=d.useState(""),[_,oe]=d.useState(""),[h,ze]=d.useState("cost"),[T,Ge]=d.useState(""),y=p?z:f,j=p?ae:void 0,N=p?y?kt(y,j):"day":b.bucket,C=d.useMemo(()=>({start_date:y,end_date:j,model:u.trim()||void 0,user_id:v||void 0,api_key_id:_||void 0}),[y,j,u,v,_]),H=d.useMemo(()=>{if(p){if(!y||!j)return null;const e=new Date(j).getTime()-new Date(y).getTime();return e>0?{...C,start_date:new Date(new Date(y).getTime()-e).toISOString(),end_date:y}:null}return!f||b.seconds===null?null:{...C,start_date:new Date(new Date(f).getTime()-b.seconds*1e3).toISOString(),end_date:f}},[p,y,j,C,b.seconds,f]),S=ve(C,N,Ut),be=ve(H??C,N,Nt,H!==null),E=_t(C,N,T||null),ne=T!==""&&E.error instanceof yt&&E.error.status===404,F=ne?"":T,a=S.data,s=a==null?void 0:a.totals,i=H!==null?(Te=be.data)==null?void 0:Te.totals:void 0,xe=s?X(s.cost,i==null?void 0:i.cost):null,He=d.useMemo(()=>({...C,model:void 0}),[C]),ge=ve(He,N,Mt),le=((Re=(Fe=ge.data)==null?void 0:Fe.by_model)==null?void 0:Re.filter(e=>!e.is_other&&e.key!==null).map(e=>e.key))??[],fe=(x.data??[]).map(e=>({value:e.user_id,label:e.alias?`${e.alias} (${e.user_id})`:e.user_id})),ie=(g.data??[]).map(e=>({value:e.id,label:e.key_name??`${e.id.slice(0,8)}…`})),We=e=>{var c;return((c=ie.find(m=>m.value===e))==null?void 0:c.label)??e},Ye=(u&&!le.includes(u)?[u,...le]:le).map(e=>({value:e,label:e})),Ze=p||b.key!==Ie,ce=!!(u.trim()||v||_||Ze),je=(e,c)=>{var m;return((m=e.find(r=>r.value===c))==null?void 0:m.label)??c},Qe=()=>{o(""),re(""),oe("")},Ve=[...v?[{key:"user",label:"User",value:je(fe,v),onClear:()=>re("")}]:[],...u.trim()?[{key:"model",label:"Model",value:u.trim(),onClear:()=>o("")}]:[],..._?[{key:"key",label:"API key",value:je(ie,_),onClear:()=>oe("")}]:[]],Xe=!!(a&&s&&s.request_count===0&&!ce),Je=(a==null?void 0:a.start_date)??y,et=(a==null?void 0:a.end_date)??j,Se=e=>{D(!1),se(e),K(pe(e.seconds??0)),B(void 0),G(void 0)},tt=(e,c)=>{D(!0),B(e),G(c)},st=()=>{p||K(pe(b.seconds??0)),S.refetch(),ge.refetch(),H!==null&&be.refetch(),T&&E.refetch()},A=e=>{const c=new URLSearchParams;y&&c.set("start_date",y),j&&c.set("end_date",j);for(const[m,r]of Object.entries(e))r&&c.set(m,r);l(`/activity?${c.toString()}`)},at=s&&s.request_count>0?s.error_count/s.request_count:0,we=((a==null?void 0:a.by_source)??[]).filter(e=>!e.is_other).length>1,rt=we||T==="source",k=(a==null?void 0:a.series)??[],W=k.length>1,U=s==null?void 0:s.billed_input_tokens,Y=s===void 0?null:U!==void 0?U+(s.billed_output_tokens??s.completion_tokens):s.total_tokens,ot=i===void 0?null:i.billed_input_tokens!==void 0?i.billed_input_tokens+(i.billed_output_tokens??i.completion_tokens):i.total_tokens,Z=U!==void 0&&U>0&&s?s.cache_read_tokens/U:null,Ne=(i==null?void 0:i.billed_input_tokens)!==void 0&&i.billed_input_tokens>0?i.cache_read_tokens/i.billed_input_tokens:void 0,Ce=e=>e.input_tokens!==void 0?e.input_tokens+(e.output_tokens??0):e.tokens,de=k.some(e=>(e.input_tokens??0)>0),Ee=k.some(e=>(e.errors??0)>0),L=d.useMemo(()=>{var m;const e=k.map(r=>r.bucket_start);if(F){const r=E.data;if(!r)return{series:[],data:[]};const R=r.groups.map((n,w)=>({key:`g${w}`,label:n.is_other?"Other":n.key===null?"(unknown)":F==="api_key_id"?We(n.key):n.key,color:n.is_other?Dt:Be[w%Be.length]})),V=new Map(r.groups.map((n,w)=>[`${n.is_other}|${n.key}`,`g${w}`])),M=new Map(e.map(n=>[n,{x:n,...Object.fromEntries(R.map(w=>[w.key,0]))}]));for(const n of r.points){const w=V.get(`${n.is_other}|${n.key}`),Oe=M.get(n.bucket_start);!w||!Oe||(Oe[w]=h==="cost"?n.cost:h==="tokens"?n.tokens:n.requests)}return{series:R,data:[...M.values()]}}return h==="tokens"&&de?{series:Pt,data:k.map(r=>{const R=r.input_tokens??0,V=r.cache_read_tokens??0,M=r.cache_write_tokens??0;return{x:r.bucket_start,fresh:Math.max(0,R-V-M),cache_read:V,cache_write:M,output:r.output_tokens??0}})}:h==="requests"&&Ee?{series:qt,data:k.map(r=>{const R=Math.min(r.errors??0,r.requests);return{x:r.bucket_start,success:r.requests-R,errors:R}})}:{series:[{key:h,label:((m=De.find(r=>r.key===h))==null?void 0:m.label)??h,color:"var(--otari-brand)"}],data:k.map(r=>({x:r.bucket_start,[h]:h==="cost"?r.cost:h==="tokens"?Ce(r):r.requests}))}},[k,F,E.data,h,de,Ee,g.data]),Le=Bt(h),nt=S.isLoading||!!F&&E.isLoading,lt=L.data.length?Math.max(...L.data.map(e=>L.series.reduce((c,m)=>c+(typeof e[m.key]=="number"?e[m.key]:0),0))):0,it=k.map(e=>e.bucket_start),ct=(e,c)=>{const m=Ct(it,e,c,N);m&&tt(m.startIso,m.endIso)},ue=[{key:"model",label:"Model",rows:(a==null?void 0:a.by_model)??[],drill:e=>A({model:e,user_id:v||void 0,api_key_id:_||void 0})},{key:"user",label:"User",rows:(a==null?void 0:a.by_user)??[],drill:e=>A({user_id:e,model:u.trim()||void 0,api_key_id:_||void 0})}],dt=[{key:"source_label",label:"Session",rows:(a==null?void 0:a.by_source_label)??[],unknownLabel:"(no session)",drill:e=>A({source_label:e,model:u.trim()||void 0,user_id:v||void 0,api_key_id:_||void 0})},{key:"endpoint",label:"Endpoint",rows:(a==null?void 0:a.by_endpoint)??[],drill:e=>A({endpoint:e,model:u.trim()||void 0,user_id:v||void 0,api_key_id:_||void 0})},{key:"provider",label:"Provider",rows:(a==null?void 0:a.by_provider)??[],drill:e=>A({provider:e,model:u.trim()||void 0,user_id:v||void 0,api_key_id:_||void 0})},{key:"source",label:"Source",rows:(a==null?void 0:a.by_source)??[],drill:e=>A({source:e,model:u.trim()||void 0,user_id:v||void 0,api_key_id:_||void 0})}],[me,ut]=d.useState("model"),[Q,mt]=d.useState("source_label"),P=ue.find(e=>e.key===me)??ue[0],he=dt.filter(e=>e.key!=="source"||we||Q==="source"),q=he.find(e=>e.key===Q)??he[0];return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(bt,{title:"Usage & analytics",description:"Spend, tokens, cache use, and request volume over time. Group the chart by model, user, key, or source, and click a breakdown row to drill into the request log."}),t.jsx(xt,{error:S.error??(T!==""&&!ne?E.error:null)}),t.jsxs(Ft,{chips:Ve,onClearAll:Qe,start:Ke.map(e=>t.jsx(O,{size:"sm",variant:!p&&b.key===e.key?"primary":"outline",onPress:()=>Se(e),children:e.label},e.key)),end:t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",gt(Je,et)," · UTC"]}),t.jsx(ft,{onRefresh:st,isFetching:S.isFetching,updatedAt:S.dataUpdatedAt})]}),children:[t.jsx(ke,{label:"User",value:v,onChange:re,options:fe,placeholder:"All users"}),t.jsx(ke,{label:"Model",value:u,onChange:o,options:Ye,placeholder:"All models"}),t.jsx(ke,{label:"API key",value:_,onChange:oe,options:ie,placeholder:"All keys"})]}),Xe?t.jsx(jt,{title:"No usage yet",description:"Once the gateway serves requests, spend and volume appear here."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-5",children:[t.jsx($,{label:"Tracked cost",value:s?ye(s.cost):"—",hint:s?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t.jsx(J,{fraction:xe}),s.unpriced_requests?`${xe!==null?" · ":""}${te(s.unpriced_requests)} unpriced`:null]}):null,chart:W?t.jsx(ee,{values:k.map(e=>e.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),t.jsx($,{label:"Requests",value:s?te(s.request_count):"—",hint:s?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Ae(at)," errors",i?t.jsxs(t.Fragment,{children:[" · ",t.jsx(J,{fraction:X(s.request_count,i.request_count)})]}):null]}):null,chart:W?t.jsx(ee,{values:k.map(e=>e.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),t.jsx($,{label:"Tokens (billed)",value:Y!==null?I(Y):"—",hint:Y!==null?t.jsx(J,{fraction:X(Y,ot??void 0)}):null,chart:W?t.jsx(ee,{values:k.map(Ce),ariaLabel:"Billed token trend over the selected window"}):void 0}),t.jsx($,{label:"Cache hit rate",value:Z!==null?Ae(Z):"—",hint:s?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Z!==null&&Ne!==void 0?t.jsxs(t.Fragment,{children:[t.jsx(J,{fraction:X(Z,Ne)})," · "]}):null,I(s.cache_read_tokens)," read · ",I(s.cache_write_tokens)," written"]}):null,chart:W&&de?t.jsx(ee,{values:k.map(e=>(e.input_tokens??0)>0?(e.cache_read_tokens??0)/(e.input_tokens??1):0),ariaLabel:"Cache hit rate trend over the selected window"}):void 0}),t.jsx($,{label:"Avg latency",value:s?Rt(s.avg_latency_ms):"—"})]}),t.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("div",{className:"inline-flex gap-1.5",children:De.map(e=>t.jsx(O,{size:"sm",variant:h===e.key?"primary":"outline","aria-pressed":h===e.key,onPress:()=>ze(e.key),children:e.label},e.key))}),t.jsxs("div",{className:"flex items-center gap-2",children:[p?t.jsx(O,{size:"sm",variant:"ghost",onPress:()=>Se(b),children:"Reset zoom"}):null,S.isFetching||F&&E.isFetching?t.jsx(Pe,{size:"sm"}):null,t.jsx(St,{ariaLabel:"Group by",value:T,onChange:e=>Ge(e),options:At.filter(e=>e.value!=="source"||rt).map(e=>({value:e.value,label:e.value?`By ${e.label.toLowerCase()}`:"No grouping"}))})]})]}),ne?t.jsx("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:"The running gateway predates grouped series, so the chart shows ungrouped totals. Restart the gateway on this build to enable grouping."}):null,t.jsx(Et,{series:L.series}),nt?t.jsx("div",{className:"flex h-64 items-center justify-center",children:t.jsx(Pe,{size:"sm"})}):L.data.length===0?t.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):t.jsxs("figure",{className:"flex flex-col gap-2",children:[t.jsx(Lt,{data:L.data,series:L.series,formatValue:Le,formatXTick:e=>Ot(e,N),ariaLabel:`${h} per ${N}${F?`, grouped by ${F}`:""}`,height:260,showYAxis:!0,showTotal:!0,onSelectRange:ct}),t.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[Le(lt)," peak · ",L.data.length," ",N==="hour"?"hours":"days"," (times in UTC) · drag across the chart to zoom"]})]})]}),t.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Spend by ",P.label.toLowerCase()]}),t.jsx("div",{className:"inline-flex gap-1.5",children:ue.map(e=>t.jsx(O,{size:"sm",variant:me===e.key?"primary":"outline","aria-pressed":me===e.key,onPress:()=>ut(e.key),children:e.label},e.key))})]}),t.jsx($e,{dimensionLabel:P.label,rows:P.rows,totalCost:(s==null?void 0:s.cost)??0,emptyLabel:ce?"No usage matches these filters.":"No usage recorded yet.",unknownLabel:P.unknownLabel,labelFor:P.labelFor,onDrill:P.drill,loading:S.isLoading})]}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Spend by ",q.label.toLowerCase()]}),t.jsx("div",{className:"inline-flex gap-1.5",children:he.map(e=>t.jsx(O,{size:"sm",variant:Q===e.key?"primary":"outline","aria-pressed":Q===e.key,onPress:()=>mt(e.key),children:e.label},e.key))})]}),t.jsx($e,{dimensionLabel:q.label,rows:q.rows,totalCost:(s==null?void 0:s.cost)??0,emptyLabel:ce?"No usage matches these filters.":"No usage recorded yet.",unknownLabel:q.unknownLabel,labelFor:q.labelFor,onDrill:q.drill,loading:S.isLoading})]})]})]})]})}export{Zt as UsagePage}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{i as ht,r as d}from"./react-dgEcD0HR.js";import{u as pt,c as vt,n as pe,i as kt,g as ve,ap as _t,aq as yt,a0 as X,ar as Ie,P as bt,E as xt,m as ke,f as gt,R as ft,as as Ke,B as jt,a1 as $,a3 as J,a2 as ye,a5 as Ae,at as I,F as St,h as wt,N as Nt,r as Ct}from"./index-C-bDZxkO.js";import{S as ee,C as Et,T as Lt}from"./charts-B_hm0rXH.js";import{D as Tt}from"./DataTable-CrQq0sYf.js";import{F as Ft}from"./FilterChips-BLdhUEZK.js";import{B as O,S as Pe}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function te(l){return l.toLocaleString()}function Rt(l){return l===null?"—":l<1e3?`${Math.round(l)} ms`:`${(l/1e3).toFixed(2)} s`}function Ot(l,x){const g=new Date(l);return Number.isNaN(g.getTime())?l:x==="hour"?g.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):g.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const qe=wt(Ke,Ie),_e=15,De=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}],At=[{value:"",label:"None"},{value:"model",label:"Model"},{value:"user_id",label:"User"},{value:"api_key_id",label:"API key"},{value:"source",label:"Source"}],Pt=[{key:"fresh",label:"Fresh input",color:"var(--otari-ink)"},{key:"cache_read",label:"Cache read",color:"var(--otari-brand)"},{key:"cache_write",label:"Cache write",color:"var(--otari-brand-soft)"},{key:"output",label:"Output",color:"var(--otari-brand-dark)"}],qt=[{key:"success",label:"Succeeded",color:"var(--otari-brand)"},{key:"errors",label:"Failed",color:"var(--otari-danger)"}],Be=["var(--otari-cat-1)","var(--otari-cat-2)","var(--otari-cat-3)","var(--otari-cat-4)","var(--otari-cat-5)","var(--otari-cat-6)","var(--otari-cat-7)","var(--otari-cat-8)"],Dt="var(--otari-cat-other)";function Bt(l){return l==="cost"?ye:l==="tokens"?I:te}const Ue="__other__",Me="__unknown__";function $e({dimensionLabel:l,rows:x,totalCost:g,emptyLabel:b,unknownLabel:se="(unknown)",labelFor:f,onDrill:K,loading:p}){const[D,z]=d.useState(!1),B=D?x:x.slice(0,_e),ae=x.length-B.length,G=o=>o.is_other?Ue:o.key??Me,u=[{id:"name",header:l,isRowHeader:!0,cell:o=>{const v=g>0?o.cost/g:0;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"truncate text-[var(--otari-ink)]",children:o.is_other?`Other (${o.requests.toLocaleString()} req)`:o.key===null?se:(f==null?void 0:f(o.key))??o.key}),t.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:t.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,v*100)}%`}})})]})}},{id:"requests",header:"Requests",align:"end",cell:o=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:te(o.requests)})},{id:"tokens",header:"Tokens",align:"end",cell:o=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:I(o.tokens)})},{id:"spend",header:"Spend",align:"end",cell:o=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:ye(o.cost)})}];return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(Tt,{ariaLabel:`Spend by ${l.toLowerCase()}`,columns:u,rows:B,getRowKey:G,isLoading:p,emptyContent:b,onRowAction:o=>{o!==Ue&&o!==Me&&K(o)}}),!p&&ae>0?t.jsxs(O,{size:"sm",variant:"ghost",onPress:()=>z(!0),children:["Show all ",x.length]}):null,!p&&D&&x.length>_e?t.jsxs(O,{size:"sm",variant:"ghost",onPress:()=>z(!1),children:["Show top ",_e]}):null]})}const Ut=["model","user","source_label","endpoint","provider","source"],Mt=["model"];function Zt(){var Te,Fe,Re;const l=ht(),x=pt(),g=vt(),[b,se]=d.useState(qe),[f,K]=d.useState(()=>pe(qe.seconds??0)),[p,D]=d.useState(!1),[z,B]=d.useState(),[ae,G]=d.useState(),[u,o]=d.useState(""),[v,re]=d.useState(""),[_,oe]=d.useState(""),[h,ze]=d.useState("cost"),[T,Ge]=d.useState(""),y=p?z:f,j=p?ae:void 0,N=p?y?kt(y,j):"day":b.bucket,C=d.useMemo(()=>({start_date:y,end_date:j,model:u.trim()||void 0,user_id:v||void 0,api_key_id:_||void 0}),[y,j,u,v,_]),H=d.useMemo(()=>{if(p){if(!y||!j)return null;const e=new Date(j).getTime()-new Date(y).getTime();return e>0?{...C,start_date:new Date(new Date(y).getTime()-e).toISOString(),end_date:y}:null}return!f||b.seconds===null?null:{...C,start_date:new Date(new Date(f).getTime()-b.seconds*1e3).toISOString(),end_date:f}},[p,y,j,C,b.seconds,f]),S=ve(C,N,Ut),be=ve(H??C,N,Nt,H!==null),E=_t(C,N,T||null),ne=T!==""&&E.error instanceof yt&&E.error.status===404,F=ne?"":T,a=S.data,s=a==null?void 0:a.totals,i=H!==null?(Te=be.data)==null?void 0:Te.totals:void 0,xe=s?X(s.cost,i==null?void 0:i.cost):null,He=d.useMemo(()=>({...C,model:void 0}),[C]),ge=ve(He,N,Mt),le=((Re=(Fe=ge.data)==null?void 0:Fe.by_model)==null?void 0:Re.filter(e=>!e.is_other&&e.key!==null).map(e=>e.key))??[],fe=(x.data??[]).map(e=>({value:e.user_id,label:e.alias?`${e.alias} (${e.user_id})`:e.user_id})),ie=(g.data??[]).map(e=>({value:e.id,label:e.key_name??`${e.id.slice(0,8)}…`})),We=e=>{var c;return((c=ie.find(m=>m.value===e))==null?void 0:c.label)??e},Ye=(u&&!le.includes(u)?[u,...le]:le).map(e=>({value:e,label:e})),Ze=p||b.key!==Ie,ce=!!(u.trim()||v||_||Ze),je=(e,c)=>{var m;return((m=e.find(r=>r.value===c))==null?void 0:m.label)??c},Qe=()=>{o(""),re(""),oe("")},Ve=[...v?[{key:"user",label:"User",value:je(fe,v),onClear:()=>re("")}]:[],...u.trim()?[{key:"model",label:"Model",value:u.trim(),onClear:()=>o("")}]:[],..._?[{key:"key",label:"API key",value:je(ie,_),onClear:()=>oe("")}]:[]],Xe=!!(a&&s&&s.request_count===0&&!ce),Je=(a==null?void 0:a.start_date)??y,et=(a==null?void 0:a.end_date)??j,Se=e=>{D(!1),se(e),K(pe(e.seconds??0)),B(void 0),G(void 0)},tt=(e,c)=>{D(!0),B(e),G(c)},st=()=>{p||K(pe(b.seconds??0)),S.refetch(),ge.refetch(),H!==null&&be.refetch(),T&&E.refetch()},A=e=>{const c=new URLSearchParams;y&&c.set("start_date",y),j&&c.set("end_date",j);for(const[m,r]of Object.entries(e))r&&c.set(m,r);l(`/activity?${c.toString()}`)},at=s&&s.request_count>0?s.error_count/s.request_count:0,we=((a==null?void 0:a.by_source)??[]).filter(e=>!e.is_other).length>1,rt=we||T==="source",k=(a==null?void 0:a.series)??[],W=k.length>1,U=s==null?void 0:s.billed_input_tokens,Y=s===void 0?null:U!==void 0?U+(s.billed_output_tokens??s.completion_tokens):s.total_tokens,ot=i===void 0?null:i.billed_input_tokens!==void 0?i.billed_input_tokens+(i.billed_output_tokens??i.completion_tokens):i.total_tokens,Z=U!==void 0&&U>0&&s?s.cache_read_tokens/U:null,Ne=(i==null?void 0:i.billed_input_tokens)!==void 0&&i.billed_input_tokens>0?i.cache_read_tokens/i.billed_input_tokens:void 0,Ce=e=>e.input_tokens!==void 0?e.input_tokens+(e.output_tokens??0):e.tokens,de=k.some(e=>(e.input_tokens??0)>0),Ee=k.some(e=>(e.errors??0)>0),L=d.useMemo(()=>{var m;const e=k.map(r=>r.bucket_start);if(F){const r=E.data;if(!r)return{series:[],data:[]};const R=r.groups.map((n,w)=>({key:`g${w}`,label:n.is_other?"Other":n.key===null?"(unknown)":F==="api_key_id"?We(n.key):n.key,color:n.is_other?Dt:Be[w%Be.length]})),V=new Map(r.groups.map((n,w)=>[`${n.is_other}|${n.key}`,`g${w}`])),M=new Map(e.map(n=>[n,{x:n,...Object.fromEntries(R.map(w=>[w.key,0]))}]));for(const n of r.points){const w=V.get(`${n.is_other}|${n.key}`),Oe=M.get(n.bucket_start);!w||!Oe||(Oe[w]=h==="cost"?n.cost:h==="tokens"?n.tokens:n.requests)}return{series:R,data:[...M.values()]}}return h==="tokens"&&de?{series:Pt,data:k.map(r=>{const R=r.input_tokens??0,V=r.cache_read_tokens??0,M=r.cache_write_tokens??0;return{x:r.bucket_start,fresh:Math.max(0,R-V-M),cache_read:V,cache_write:M,output:r.output_tokens??0}})}:h==="requests"&&Ee?{series:qt,data:k.map(r=>{const R=Math.min(r.errors??0,r.requests);return{x:r.bucket_start,success:r.requests-R,errors:R}})}:{series:[{key:h,label:((m=De.find(r=>r.key===h))==null?void 0:m.label)??h,color:"var(--otari-brand)"}],data:k.map(r=>({x:r.bucket_start,[h]:h==="cost"?r.cost:h==="tokens"?Ce(r):r.requests}))}},[k,F,E.data,h,de,Ee,g.data]),Le=Bt(h),nt=S.isLoading||!!F&&E.isLoading,lt=L.data.length?Math.max(...L.data.map(e=>L.series.reduce((c,m)=>c+(typeof e[m.key]=="number"?e[m.key]:0),0))):0,it=k.map(e=>e.bucket_start),ct=(e,c)=>{const m=Ct(it,e,c,N);m&&tt(m.startIso,m.endIso)},ue=[{key:"model",label:"Model",rows:(a==null?void 0:a.by_model)??[],drill:e=>A({model:e,user_id:v||void 0,api_key_id:_||void 0})},{key:"user",label:"User",rows:(a==null?void 0:a.by_user)??[],drill:e=>A({user_id:e,model:u.trim()||void 0,api_key_id:_||void 0})}],dt=[{key:"source_label",label:"Session",rows:(a==null?void 0:a.by_source_label)??[],unknownLabel:"(no session)",drill:e=>A({source_label:e,model:u.trim()||void 0,user_id:v||void 0,api_key_id:_||void 0})},{key:"endpoint",label:"Endpoint",rows:(a==null?void 0:a.by_endpoint)??[],drill:e=>A({endpoint:e,model:u.trim()||void 0,user_id:v||void 0,api_key_id:_||void 0})},{key:"provider",label:"Provider",rows:(a==null?void 0:a.by_provider)??[],drill:e=>A({provider:e,model:u.trim()||void 0,user_id:v||void 0,api_key_id:_||void 0})},{key:"source",label:"Source",rows:(a==null?void 0:a.by_source)??[],drill:e=>A({source:e,model:u.trim()||void 0,user_id:v||void 0,api_key_id:_||void 0})}],[me,ut]=d.useState("model"),[Q,mt]=d.useState("source_label"),P=ue.find(e=>e.key===me)??ue[0],he=dt.filter(e=>e.key!=="source"||we||Q==="source"),q=he.find(e=>e.key===Q)??he[0];return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(bt,{title:"Usage & analytics",description:"Spend, tokens, cache use, and request volume over time. Group the chart by model, user, key, or source, and click a breakdown row to drill into the request log."}),t.jsx(xt,{error:S.error??(T!==""&&!ne?E.error:null)}),t.jsxs(Ft,{chips:Ve,onClearAll:Qe,start:Ke.map(e=>t.jsx(O,{size:"sm",variant:!p&&b.key===e.key?"primary":"outline",onPress:()=>Se(e),children:e.label},e.key)),end:t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",gt(Je,et)," · UTC"]}),t.jsx(ft,{onRefresh:st,isFetching:S.isFetching,updatedAt:S.dataUpdatedAt})]}),children:[t.jsx(ke,{label:"User",value:v,onChange:re,options:fe,placeholder:"All users"}),t.jsx(ke,{label:"Model",value:u,onChange:o,options:Ye,placeholder:"All models"}),t.jsx(ke,{label:"API key",value:_,onChange:oe,options:ie,placeholder:"All keys"})]}),Xe?t.jsx(jt,{title:"No usage yet",description:"Once the gateway serves requests, spend and volume appear here."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-5",children:[t.jsx($,{label:"Tracked cost",value:s?ye(s.cost):"—",hint:s?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t.jsx(J,{fraction:xe}),s.unpriced_requests?`${xe!==null?" · ":""}${te(s.unpriced_requests)} unpriced`:null]}):null,chart:W?t.jsx(ee,{values:k.map(e=>e.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),t.jsx($,{label:"Requests",value:s?te(s.request_count):"—",hint:s?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Ae(at)," errors",i?t.jsxs(t.Fragment,{children:[" · ",t.jsx(J,{fraction:X(s.request_count,i.request_count)})]}):null]}):null,chart:W?t.jsx(ee,{values:k.map(e=>e.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),t.jsx($,{label:"Tokens (billed)",value:Y!==null?I(Y):"—",hint:Y!==null?t.jsx(J,{fraction:X(Y,ot??void 0)}):null,chart:W?t.jsx(ee,{values:k.map(Ce),ariaLabel:"Billed token trend over the selected window"}):void 0}),t.jsx($,{label:"Cache hit rate",value:Z!==null?Ae(Z):"—",hint:s?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Z!==null&&Ne!==void 0?t.jsxs(t.Fragment,{children:[t.jsx(J,{fraction:X(Z,Ne)})," · "]}):null,I(s.cache_read_tokens)," read · ",I(s.cache_write_tokens)," written"]}):null,chart:W&&de?t.jsx(ee,{values:k.map(e=>(e.input_tokens??0)>0?(e.cache_read_tokens??0)/(e.input_tokens??1):0),ariaLabel:"Cache hit rate trend over the selected window"}):void 0}),t.jsx($,{label:"Avg latency",value:s?Rt(s.avg_latency_ms):"—"})]}),t.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("div",{className:"inline-flex gap-1.5",children:De.map(e=>t.jsx(O,{size:"sm",variant:h===e.key?"primary":"outline","aria-pressed":h===e.key,onPress:()=>ze(e.key),children:e.label},e.key))}),t.jsxs("div",{className:"flex items-center gap-2",children:[p?t.jsx(O,{size:"sm",variant:"ghost",onPress:()=>Se(b),children:"Reset zoom"}):null,S.isFetching||F&&E.isFetching?t.jsx(Pe,{size:"sm"}):null,t.jsx(St,{ariaLabel:"Group by",value:T,onChange:e=>Ge(e),options:At.filter(e=>e.value!=="source"||rt).map(e=>({value:e.value,label:e.value?`By ${e.label.toLowerCase()}`:"No grouping"}))})]})]}),ne?t.jsx("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:"The running gateway predates grouped series, so the chart shows ungrouped totals. Restart the gateway on this build to enable grouping."}):null,t.jsx(Et,{series:L.series}),nt?t.jsx("div",{className:"flex h-64 items-center justify-center",children:t.jsx(Pe,{size:"sm"})}):L.data.length===0?t.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):t.jsxs("figure",{className:"flex flex-col gap-2",children:[t.jsx(Lt,{data:L.data,series:L.series,formatValue:Le,formatXTick:e=>Ot(e,N),ariaLabel:`${h} per ${N}${F?`, grouped by ${F}`:""}`,height:260,showYAxis:!0,showTotal:!0,onSelectRange:ct}),t.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[Le(lt)," peak · ",L.data.length," ",N==="hour"?"hours":"days"," (times in UTC) · drag across the chart to zoom"]})]})]}),t.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Spend by ",P.label.toLowerCase()]}),t.jsx("div",{className:"inline-flex gap-1.5",children:ue.map(e=>t.jsx(O,{size:"sm",variant:me===e.key?"primary":"outline","aria-pressed":me===e.key,onPress:()=>ut(e.key),children:e.label},e.key))})]}),t.jsx($e,{dimensionLabel:P.label,rows:P.rows,totalCost:(s==null?void 0:s.cost)??0,emptyLabel:ce?"No usage matches these filters.":"No usage recorded yet.",unknownLabel:P.unknownLabel,labelFor:P.labelFor,onDrill:P.drill,loading:S.isLoading})]}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Spend by ",q.label.toLowerCase()]}),t.jsx("div",{className:"inline-flex gap-1.5",children:he.map(e=>t.jsx(O,{size:"sm",variant:Q===e.key?"primary":"outline","aria-pressed":Q===e.key,onPress:()=>mt(e.key),children:e.label},e.key))})]}),t.jsx($e,{dimensionLabel:q.label,rows:q.rows,totalCost:(s==null?void 0:s.cost)??0,emptyLabel:ce?"No usage matches these filters.":"No usage recorded yet.",unknownLabel:q.unknownLabel,labelFor:q.labelFor,onDrill:q.drill,loading:S.isLoading})]})]})]})]})}export{Zt as UsagePage}; diff --git a/src/gateway/static/dashboard/assets/UsersPage-Ch4B0UUJ.js b/src/gateway/static/dashboard/assets/UsersPage-Cfif2r2r.js similarity index 98% rename from src/gateway/static/dashboard/assets/UsersPage-Ch4B0UUJ.js rename to src/gateway/static/dashboard/assets/UsersPage-Cfif2r2r.js index f299d095d..a8aa4cb6d 100644 --- a/src/gateway/static/dashboard/assets/UsersPage-Ch4B0UUJ.js +++ b/src/gateway/static/dashboard/assets/UsersPage-Cfif2r2r.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r}from"./react-dgEcD0HR.js";import{u as Q,v as M,z as K,au as X,P as Y,E as A,B as Z,av as ee,F as se}from"./index-gNSmom8p.js";import{u as te,r as ae,B as ne}from"./tableSelection-CojkFPwd.js";import{C as re}from"./ConfirmDialog-D9trL3a0.js";import{D as le}from"./DataTable-CrQq0sYf.js";import{F as D}from"./Field-DEJ6Wjg9.js";import{a as ie,M as R}from"./ModelScopeControl-xLQ9nHtN.js";import{f as I,B as d,d as S,A as f}from"./heroui-DZj66Arc.js";const de=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return de.format(t)}const oe=t=>t.user_id,B=t=>t.startsWith("apikey-");function H(t){return t.split("-")[0]}function z(t){return t.name??H(t.budget_id)}function $({value:t,onChange:l,budgets:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>l(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),n.map(a=>e.jsxs("option",{value:a.budget_id,children:[z(a),a.max_budget===null?" · no limit":` · ${U(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function ce({onClose:t}){const l=ee(),n=M(),[a,i]=r.useState(""),[o,u]=r.useState(""),[c,g]=r.useState(null),[p,m]=r.useState(null),[b,j]=r.useState(!0),x=()=>{if(l.isPending||!b||a.trim()==="")return;const h={user_id:a.trim(),alias:o.trim()||null,budget_id:c,allowed_models:p};l.mutate(h,{onSuccess:t})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:l.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(D,{label:"User ID",value:a,onChange:i,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(D,{label:"Alias (optional)",value:o,onChange:u,placeholder:"Alice"})]}),e.jsx($,{value:c,onChange:g,budgets:n.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{m(h),j(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:l.isPending||!b||a.trim()==="",onPress:x,children:l.isPending?"Creating…":"Create user"}),e.jsx(d,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ue({user:t,onClose:l}){const n=K(),a=M(),[i,o]=r.useState(t.alias??""),[u,c]=r.useState(t.budget_id),[g,p]=r.useState(t.allowed_models),[m,b]=r.useState(!0),j=()=>{if(n.isPending||!m)return;const x={alias:i.trim()||null,budget_id:u,allowed_models:g};n.mutate({id:t.user_id,body:x},{onSuccess:l})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:n.error}),e.jsx(D,{label:"Alias",value:i,onChange:o,placeholder:"Alice"}),e.jsx($,{value:u,onChange:c,budgets:a.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(x,h)=>{p(x),b(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:n.isPending||!m,onPress:j,children:n.isPending?"Saving…":"Save changes"}),e.jsx(d,{variant:"ghost",onPress:l,children:"Cancel"})]})]})})}function ge({trigger:t,message:l,confirmLabel:n,isPending:a,onConfirm:i}){const[o,u]=r.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:l}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(d,{size:"sm",variant:"danger",isDisabled:a,onPress:i,children:n}),e.jsx(d,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>u(!1),children:"Cancel"})]})]}):e.jsx(d,{size:"sm",variant:"danger-soft",onPress:()=>u(!0),children:t})}function me({user:t}){return t.blocked?e.jsx(I,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(I,{size:"sm",color:"accent",children:"Active"})}function xe({allowed:t}){const{text:l,tone:n}=ie(t),a=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",i=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:i,children:l})}function he({isOpen:t,onOpenChange:l,budgets:n,count:a,isPending:i,error:o,onAssign:u}){const[c,g]=r.useState("");return r.useEffect(()=>{t&&g("")},[t]),e.jsx(f,{isOpen:t,onOpenChange:l,children:t?e.jsx(f.Backdrop,{children:e.jsx(f.Container,{placement:"center",size:"md",children:e.jsxs(f.Dialog,{children:[e.jsx(f.Header,{children:e.jsx(f.Heading,{children:"Assign budget"})}),e.jsxs(f.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Assign a budget to ",a," selected ",a===1?"user":"users","."]}),e.jsx(se,{label:"Budget",value:c,onChange:g,options:[{value:"",label:"Select a budget…"},...n.map(p=>({value:p.budget_id,label:z(p)}))]}),e.jsx(A,{error:o})]}),e.jsxs(f.Footer,{children:[e.jsx(d,{variant:"ghost",isDisabled:i,onPress:()=>l(!1),children:"Cancel"}),e.jsx(d,{variant:"primary",isDisabled:!c,isPending:i,onPress:()=>u(c),children:"Assign"})]})]})})}):null})}function Ae(){const t=Q(),l=M(),n=K(),a=X(),[i,o]=r.useState(!1),[u,c]=r.useState(null),[g,p]=r.useState(!1),m=t.data??[],b=t.isLoading,j=m.filter(s=>B(s.user_id)).length,x=g?m:m.filter(s=>!B(s.user_id)),h=m.find(s=>s.user_id===u)??null,C=!b&&x.length===0&&!i,P=r.useMemo(()=>new Map((l.data??[]).map(s=>[s.budget_id,s])),[l.data]),y=te(),[q,_]=r.useState(!1),[W,N]=r.useState(!1),[E,F]=r.useState(void 0),[T,L]=r.useState(!1),G=x.map(s=>s.user_id),v=ae(y.selectedKeys,G),O=r.useCallback((s,k)=>n.mutate({id:s.user_id,body:{blocked:k}}),[n.mutate]),V=async(s,k)=>{L(!0),F(void 0);try{for(const w of v)await s(w);y.clear(),k()}catch(w){F(w)}finally{L(!1)}},J=r.useMemo(()=>[{id:"user",header:"User",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-medium text-[var(--otari-ink)]",children:s.user_id}),B(s.user_id)?e.jsx(I,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})},{id:"status",header:"Status",cell:s=>e.jsx(me,{user:s})},{id:"budget",header:"Budget",cell:s=>s.budget_id?e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.budget_id,children:P.get(s.budget_id)?z(P.get(s.budget_id)):H(s.budget_id)}):e.jsx("span",{className:"text-[var(--otari-muted)]",children:"—"})},{id:"spend",header:"Spend",cell:s=>e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[U(s.spend),s.reserved>0?e.jsxs("span",{children:[" (+",U(s.reserved)," held)"]}):null]})},{id:"access",header:"Model access",cell:s=>e.jsx(xe,{allowed:s.allowed_models})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(d,{size:"sm",variant:"outline",isDisabled:n.isPending,onPress:()=>O(s,!s.blocked),children:s.blocked?"Unblock":"Block"}),e.jsx(d,{size:"sm",variant:"ghost",onPress:()=>{o(!1),c(s.user_id)},children:"Edit"}),e.jsx(ge,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})}],[P,n.isPending,a.isPending,a.mutate,O]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:i?null:e.jsx(d,{variant:"primary",onPress:()=>{c(null),o(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??n.error??a.error}),C?e.jsx(Z,{title:"No users yet",description:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page.",actionLabel:"Create your first user",onAction:()=>{c(null),o(!0)}}):null,j>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>p(s.target.checked)}),"Show auto-created (virtual) users (",j,")"]}):null,i?e.jsx(ce,{onClose:()=>o(!1)}):null,h?e.jsx(ue,{user:h,onClose:()=>c(null)},h.user_id):null,v.length>0?e.jsxs(ne,{selectedCount:v.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:y.clear,children:[e.jsx(d,{size:"sm",variant:"primary",onPress:()=>N(!0),children:"Assign budget"}),e.jsx(d,{size:"sm",variant:"danger",onPress:()=>_(!0),children:"Delete"})]}):null,C?null:e.jsx(le,{ariaLabel:"Users",columns:J,rows:x,getRowKey:oe,isLoading:b,emptyContent:"No users yet. Create one, or create an API key to auto-create one.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange}),e.jsx(re,{isOpen:q,onOpenChange:_,heading:"Delete users",body:`Delete ${v.length} ${v.length===1?"user":"users"}? This deactivates their API keys and hides them; usage history is preserved.`,confirmLabel:"Delete",isPending:T,error:E,onConfirm:()=>V(s=>a.mutateAsync(s),()=>_(!1))}),e.jsx(he,{isOpen:W,onOpenChange:N,budgets:l.data??[],count:v.length,isPending:T,error:E,onAssign:s=>V(k=>n.mutateAsync({id:k,body:{budget_id:s}}),()=>N(!1))})]})}export{Ae as UsersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r}from"./react-dgEcD0HR.js";import{u as Q,v as M,z as K,au as X,P as Y,E as A,B as Z,av as ee,F as se}from"./index-C-bDZxkO.js";import{u as te,r as ae,B as ne}from"./tableSelection-CojkFPwd.js";import{C as re}from"./ConfirmDialog-BBkZMSqE.js";import{D as le}from"./DataTable-CrQq0sYf.js";import{F as D}from"./Field-DEJ6Wjg9.js";import{a as ie,M as R}from"./ModelScopeControl-gV_ax1BN.js";import{f as I,B as d,d as S,A as f}from"./heroui-DZj66Arc.js";const de=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return de.format(t)}const oe=t=>t.user_id,B=t=>t.startsWith("apikey-");function H(t){return t.split("-")[0]}function z(t){return t.name??H(t.budget_id)}function $({value:t,onChange:l,budgets:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>l(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),n.map(a=>e.jsxs("option",{value:a.budget_id,children:[z(a),a.max_budget===null?" · no limit":` · ${U(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function ce({onClose:t}){const l=ee(),n=M(),[a,i]=r.useState(""),[o,u]=r.useState(""),[c,g]=r.useState(null),[p,m]=r.useState(null),[b,j]=r.useState(!0),x=()=>{if(l.isPending||!b||a.trim()==="")return;const h={user_id:a.trim(),alias:o.trim()||null,budget_id:c,allowed_models:p};l.mutate(h,{onSuccess:t})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:l.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(D,{label:"User ID",value:a,onChange:i,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(D,{label:"Alias (optional)",value:o,onChange:u,placeholder:"Alice"})]}),e.jsx($,{value:c,onChange:g,budgets:n.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{m(h),j(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:l.isPending||!b||a.trim()==="",onPress:x,children:l.isPending?"Creating…":"Create user"}),e.jsx(d,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ue({user:t,onClose:l}){const n=K(),a=M(),[i,o]=r.useState(t.alias??""),[u,c]=r.useState(t.budget_id),[g,p]=r.useState(t.allowed_models),[m,b]=r.useState(!0),j=()=>{if(n.isPending||!m)return;const x={alias:i.trim()||null,budget_id:u,allowed_models:g};n.mutate({id:t.user_id,body:x},{onSuccess:l})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:n.error}),e.jsx(D,{label:"Alias",value:i,onChange:o,placeholder:"Alice"}),e.jsx($,{value:u,onChange:c,budgets:a.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(x,h)=>{p(x),b(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:n.isPending||!m,onPress:j,children:n.isPending?"Saving…":"Save changes"}),e.jsx(d,{variant:"ghost",onPress:l,children:"Cancel"})]})]})})}function ge({trigger:t,message:l,confirmLabel:n,isPending:a,onConfirm:i}){const[o,u]=r.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:l}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(d,{size:"sm",variant:"danger",isDisabled:a,onPress:i,children:n}),e.jsx(d,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>u(!1),children:"Cancel"})]})]}):e.jsx(d,{size:"sm",variant:"danger-soft",onPress:()=>u(!0),children:t})}function me({user:t}){return t.blocked?e.jsx(I,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(I,{size:"sm",color:"accent",children:"Active"})}function xe({allowed:t}){const{text:l,tone:n}=ie(t),a=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",i=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:i,children:l})}function he({isOpen:t,onOpenChange:l,budgets:n,count:a,isPending:i,error:o,onAssign:u}){const[c,g]=r.useState("");return r.useEffect(()=>{t&&g("")},[t]),e.jsx(f,{isOpen:t,onOpenChange:l,children:t?e.jsx(f.Backdrop,{children:e.jsx(f.Container,{placement:"center",size:"md",children:e.jsxs(f.Dialog,{children:[e.jsx(f.Header,{children:e.jsx(f.Heading,{children:"Assign budget"})}),e.jsxs(f.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Assign a budget to ",a," selected ",a===1?"user":"users","."]}),e.jsx(se,{label:"Budget",value:c,onChange:g,options:[{value:"",label:"Select a budget…"},...n.map(p=>({value:p.budget_id,label:z(p)}))]}),e.jsx(A,{error:o})]}),e.jsxs(f.Footer,{children:[e.jsx(d,{variant:"ghost",isDisabled:i,onPress:()=>l(!1),children:"Cancel"}),e.jsx(d,{variant:"primary",isDisabled:!c,isPending:i,onPress:()=>u(c),children:"Assign"})]})]})})}):null})}function Ae(){const t=Q(),l=M(),n=K(),a=X(),[i,o]=r.useState(!1),[u,c]=r.useState(null),[g,p]=r.useState(!1),m=t.data??[],b=t.isLoading,j=m.filter(s=>B(s.user_id)).length,x=g?m:m.filter(s=>!B(s.user_id)),h=m.find(s=>s.user_id===u)??null,C=!b&&x.length===0&&!i,P=r.useMemo(()=>new Map((l.data??[]).map(s=>[s.budget_id,s])),[l.data]),y=te(),[q,_]=r.useState(!1),[W,N]=r.useState(!1),[E,F]=r.useState(void 0),[T,L]=r.useState(!1),G=x.map(s=>s.user_id),v=ae(y.selectedKeys,G),O=r.useCallback((s,k)=>n.mutate({id:s.user_id,body:{blocked:k}}),[n.mutate]),V=async(s,k)=>{L(!0),F(void 0);try{for(const w of v)await s(w);y.clear(),k()}catch(w){F(w)}finally{L(!1)}},J=r.useMemo(()=>[{id:"user",header:"User",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-medium text-[var(--otari-ink)]",children:s.user_id}),B(s.user_id)?e.jsx(I,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})},{id:"status",header:"Status",cell:s=>e.jsx(me,{user:s})},{id:"budget",header:"Budget",cell:s=>s.budget_id?e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.budget_id,children:P.get(s.budget_id)?z(P.get(s.budget_id)):H(s.budget_id)}):e.jsx("span",{className:"text-[var(--otari-muted)]",children:"—"})},{id:"spend",header:"Spend",cell:s=>e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[U(s.spend),s.reserved>0?e.jsxs("span",{children:[" (+",U(s.reserved)," held)"]}):null]})},{id:"access",header:"Model access",cell:s=>e.jsx(xe,{allowed:s.allowed_models})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(d,{size:"sm",variant:"outline",isDisabled:n.isPending,onPress:()=>O(s,!s.blocked),children:s.blocked?"Unblock":"Block"}),e.jsx(d,{size:"sm",variant:"ghost",onPress:()=>{o(!1),c(s.user_id)},children:"Edit"}),e.jsx(ge,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})}],[P,n.isPending,a.isPending,a.mutate,O]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:i?null:e.jsx(d,{variant:"primary",onPress:()=>{c(null),o(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??n.error??a.error}),C?e.jsx(Z,{title:"No users yet",description:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page.",actionLabel:"Create your first user",onAction:()=>{c(null),o(!0)}}):null,j>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>p(s.target.checked)}),"Show auto-created (virtual) users (",j,")"]}):null,i?e.jsx(ce,{onClose:()=>o(!1)}):null,h?e.jsx(ue,{user:h,onClose:()=>c(null)},h.user_id):null,v.length>0?e.jsxs(ne,{selectedCount:v.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:y.clear,children:[e.jsx(d,{size:"sm",variant:"primary",onPress:()=>N(!0),children:"Assign budget"}),e.jsx(d,{size:"sm",variant:"danger",onPress:()=>_(!0),children:"Delete"})]}):null,C?null:e.jsx(le,{ariaLabel:"Users",columns:J,rows:x,getRowKey:oe,isLoading:b,emptyContent:"No users yet. Create one, or create an API key to auto-create one.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange}),e.jsx(re,{isOpen:q,onOpenChange:_,heading:"Delete users",body:`Delete ${v.length} ${v.length===1?"user":"users"}? This deactivates their API keys and hides them; usage history is preserved.`,confirmLabel:"Delete",isPending:T,error:E,onConfirm:()=>V(s=>a.mutateAsync(s),()=>_(!1))}),e.jsx(he,{isOpen:W,onOpenChange:N,budgets:l.data??[],count:v.length,isPending:T,error:E,onAssign:s=>V(k=>n.mutateAsync({id:k,body:{budget_id:s}}),()=>N(!1))})]})}export{Ae as UsersPage}; diff --git a/src/gateway/static/dashboard/assets/index-gNSmom8p.js b/src/gateway/static/dashboard/assets/index-C-bDZxkO.js similarity index 96% rename from src/gateway/static/dashboard/assets/index-gNSmom8p.js rename to src/gateway/static/dashboard/assets/index-C-bDZxkO.js index d1c209fec..a1b9d41ef 100644 --- a/src/gateway/static/dashboard/assets/index-gNSmom8p.js +++ b/src/gateway/static/dashboard/assets/index-C-bDZxkO.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-B_xlQB4w.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/charts-B_hm0rXH.js","assets/recharts-BwTTRGtj.js","assets/heroui-DZj66Arc.js","assets/tableSelection-CojkFPwd.js","assets/ConfirmDialog-D9trL3a0.js","assets/DataTable-CrQq0sYf.js","assets/FilterChips-BLdhUEZK.js","assets/TablePagination-C-pfgcm6.js","assets/AliasesPage-CoIJBCqd.js","assets/Field-DEJ6Wjg9.js","assets/UserComboBox-nt7pHfqn.js","assets/BudgetsPage-C3pAx2YI.js","assets/DocsPage-Dcxbdpf9.js","assets/KeysPage-CbATIDtN.js","assets/ModelScopeControl-xLQ9nHtN.js","assets/ModelsPage-DZ6zDjTj.js","assets/OverviewPage-gipwh9ys.js","assets/ProvidersPage-Bvzss9dV.js","assets/SettingsPage-DGmFxbDI.js","assets/ToolsGuardrailsPage-CSEh0CuT.js","assets/UsagePage-4kYrVw0Z.js","assets/UsersPage-Ch4B0UUJ.js"])))=>i.map(i=>d[i]); -var Ie=Object.defineProperty;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>qe(e,typeof t!="symbol"?t+"":t,r);import{u as g,j as n,a as p,b as x,k as z,Q as Re,c as Oe}from"./tanstack-query-1t81HyiD.js";import{d as Me,r as o,N as ee,L as Fe,O as Ue,H as Ke,e as Be,f as j,h as $e}from"./react-dgEcD0HR.js";import{B as C,C as K,L as xe,I as ye,a as ze,b as Qe,d as I,S as Ve,c as _,T as We,e as He}from"./heroui-DZj66Arc.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ge=Me();const Je="modulepreload",Ye=function(e){return"/"+e},ue={},P=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let u=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(r.map(y=>{if(y=Ye(y),y in ue)return;ue[y]=!0;const h=y.endsWith(".css"),b=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Je,h||(m.as="script"),m.crossOrigin="",m.href=y,f&&m.setAttribute("nonce",f),document.head.appendChild(m),h)return new Promise((N,M)=>{m.addEventListener("load",N),m.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};class L extends Error{constructor(r,s){super(s);ce(this,"status");this.name="ApiError",this.status=r}}let B=null;function de(e){B=e}async function te(e){try{const t=await e.json();if(typeof t.detail=="string")return t.detail;if(t.detail!=null)return JSON.stringify(t.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Xe(e){let t;try{t=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(t.status===401||t.status===403)return!1;if(!t.ok)throw new L(t.status,await te(t));return!0}async function Ze(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function l(e,t={}){const r=new Headers(t.headers);r.set("Accept","application/json"),t.body!=null&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let s;try{s=await fetch(e,{...t,headers:r})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(s.status===401||s.status===403)throw B==null||B(),new L(s.status,await te(s));if(!s.ok)throw new L(s.status,await te(s));if(s.status!==204)return await s.json()}const ne="otari.dashboard.hasSession",ve=o.createContext(null);function et(){try{return window.localStorage.getItem(ne)==="1"}catch{return!1}}function tt({children:e}){const t=g(),[r,s]=o.useState(et),a=o.useCallback(()=>{Ze(),s(!1),t.clear();try{window.localStorage.removeItem(ne)}catch{}},[t]),i=o.useCallback(()=>{t.clear(),s(!0);try{window.localStorage.setItem(ne,"1")}catch{}},[t]);o.useEffect(()=>(de(a),()=>de(null)),[a]);const u=o.useMemo(()=>({isAuthenticated:r,login:i,logout:a}),[r,i,a]);return n.jsx(ve.Provider,{value:u,children:e})}function re(){const e=o.useContext(ve);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function nt(e){return e instanceof L&&e.status===0}function rt(){const e=g(),[t,r]=o.useState(!1);return o.useEffect(()=>{const s=e.getQueryCache(),a=()=>s.getAll().some(i=>i.state.status==="error"&&nt(i.state.error));return r(a()),s.subscribe(()=>r(a()))},[e]),t}function st(){return rt()?n.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const Q=3600,T=86400,at=365*T,dn=[{key:"1h",label:"Last hour",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:T,bucket:"hour"},{key:"7d",label:"7d",seconds:7*T,bucket:"day"},{key:"30d",label:"30d",seconds:30*T,bucket:"day"},{key:"90d",label:"90d",seconds:90*T,bucket:"day"},{key:"12mo",label:"12mo",seconds:at,bucket:"day"}],mn="30d",fn=[{key:"1h",label:"1h",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:T,bucket:"hour"},{key:"7d",label:"7d",seconds:7*T,bucket:"day"},{key:"30d",label:"30d",seconds:30*T,bucket:"day"},{key:"all",label:"All",seconds:null,bucket:"day"}],hn="24h",xn="custom";function yn(e,t){return e.find(r=>r.key===t)}function it(e,t=Date.now()){return new Date(t-e*1e3).toISOString()}function ot(e){return(e==="hour"?Q:T)*1e3}function vn(e,t,r=Date.now()){const s=new Date(e).getTime();return(t?new Date(t).getTime():r)-s<=T*1e3?"hour":"day"}function gn(e,t,r,s){if(e.length===0)return null;const a=Math.max(0,Math.min(t,r)),i=Math.min(e.length-1,Math.max(t,r)),u=new Date(e[a]).getTime(),d=new Date(e[i]).getTime()+ot(s);return{startIso:new Date(u).toISOString(),endIso:new Date(d).toISOString()}}function pn(e,t,r){const s=e.length;if(s===0)return{startIndex:0,endIndex:0};const a=e.map(d=>new Date(d).getTime());let i=0;if(t){const d=new Date(t).getTime();for(let f=0;fl("/v1/models"),staleTime:6e4})}function dt(){return p({queryKey:[ct],queryFn:()=>l("/dashboard-build.json"),refetchInterval:ut,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function jn(){return p({queryKey:[ae],queryFn:()=>l("/v1/models/discoverable"),staleTime:5*6e4})}function Sn(){return p({queryKey:[ie],queryFn:()=>l("/v1/providers"),staleTime:5*6e4})}function kn(){return p({queryKey:["provider-catalog"],queryFn:()=>l("/v1/providers/catalog"),staleTime:1/0})}function En(e){return p({queryKey:["provider-catalog",e],queryFn:()=>l(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Pn(){return p({queryKey:[oe],queryFn:()=>l("/v1/providers/health"),staleTime:me,refetchInterval:me})}function Nn(){const e=g();return x({mutationFn:()=>l("/v1/providers/health?refresh=true"),onSuccess:t=>e.setQueryData([oe],t)})}function Cn(){return p({queryKey:[be],queryFn:()=>l("/v1/provider-credentials"),staleTime:6e4})}function W(e){e.invalidateQueries({queryKey:[be]}),e.invalidateQueries({queryKey:[ie]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]}),e.invalidateQueries({queryKey:[oe]})}function _n(){const e=g();return x({mutationFn:t=>l("/v1/provider-credentials",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>W(e)})}function Tn(){const e=g();return x({mutationFn:({instance:t,body:r})=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>W(e)})}function Ln(){const e=g();return x({mutationFn:t=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>W(e)})}function Dn(){const e=g();return x({mutationFn:()=>l("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>W(e)})}function An(){return x({mutationFn:e=>l(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function In(){return x({mutationFn:e=>l("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function qn(){return p({queryKey:[lt],queryFn:()=>l("/v1/models/metadata"),staleTime:10*6e4})}function Rn(){return p({queryKey:[se],queryFn:()=>l("/v1/aliases"),staleTime:6e4})}function On(){const e=g();return x({mutationFn:t=>l("/v1/aliases",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function Mn(){const e=g();return x({mutationFn:({name:t,userId:r})=>{const s=r==null?"":`?user_id=${encodeURIComponent(r)}`;return l(`/v1/aliases/${encodeURIComponent(t)}${s}`,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function mt(){return p({queryKey:[ge],queryFn:()=>l("/v1/settings"),staleTime:6e4})}function ft(){const e=g();return x({mutationFn:t=>l("/v1/settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([ge],t),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]})}})}function Fn(){return x({mutationFn:()=>l("/v1/settings/master-key/rotate",{method:"POST"})})}function Un(){return p({queryKey:[pe],queryFn:()=>l("/v1/tool-settings"),staleTime:6e4})}function Kn(){const e=g();return x({mutationFn:t=>l("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([pe],t)}})}function Bn(){return x({mutationFn:({service:e,url:t})=>l(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:t})})})}const G=1e3,ht=100;async function xt(){const e=[];for(let t=0;tl("/v1/pricing",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Qn(){const e=g();return x({mutationFn:t=>l(`/v1/pricing/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Vn(){return x({mutationFn:()=>l("/v1/pricing/refresh",{method:"POST"})})}function Wn(){const e=g();return x({mutationFn:()=>l("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ie]})}})}function Hn(){return x({mutationFn:()=>l("/v1/pricing/refresh/reject",{method:"POST"})})}const J=1e3,yt=100;async function vt(){const e=[];for(let t=0;tl("/v1/keys",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Yn(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Xn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Zn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}const Y=1e3,gt=100;async function pt(){const e=[];for(let t=0;tl(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function nr(){const e=g();return x({mutationFn:t=>l("/v1/budgets",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function rr(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function sr(){const e=g();return x({mutationFn:t=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}const X=1e3,bt=100;async function wt(){const e=[];for(let t=0;tl("/v1/users",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>le(e)})}function or(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>le(e)})}function lr(){const e=g();return x({mutationFn:t=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{le(e),e.invalidateQueries({queryKey:[R]})}})}function U(e){const t=new URLSearchParams;return e.start_date&&t.set("start_date",e.start_date),e.end_date&&t.set("end_date",e.end_date),e.status&&t.set("status",e.status),e.model&&t.set("model",e.model),e.endpoint&&t.set("endpoint",e.endpoint),e.provider&&t.set("provider",e.provider),e.user_id&&t.set("user_id",e.user_id),e.api_key_id&&t.set("api_key_id",e.api_key_id),e.source&&t.set("source",e.source),e.source_label&&t.set("source_label",e.source_label),e.priced!==void 0&&t.set("priced",String(e.priced)),e.counts_toward_budget!==void 0&&t.set("counts_toward_budget",String(e.counts_toward_budget)),t}function cr(e,t,r){return p({queryKey:[q,"list",e,t,r],queryFn:()=>{const s=U(e);return s.set("skip",String(t*r)),s.set("limit",String(r)),l(`/v1/usage?${s.toString()}`)},placeholderData:z,staleTime:1e4})}function ur(e,t=!0){return p({queryKey:[q,"count",e],queryFn:()=>l(`/v1/usage/count?${U(e).toString()}`),enabled:t,placeholderData:z,staleTime:1e4})}const jt=6e4;function St(e,t=!0){return p({queryKey:[q,"count","failures",e],queryFn:()=>{const r={status:"error",source:"gateway",start_date:it(e)};return l(`/v1/usage/count?${U(r).toString()}`)},enabled:t,refetchInterval:jt,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function dr(){const e=g();return x({mutationFn:t=>l("/v1/usage",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}function mr(){const e=g();return x({mutationFn:t=>l("/v1/usage/set-price",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}const fr=[];function hr(e,t,r,s=!0){return p({queryKey:[q,"summary",e,t,r??"all"],queryFn:()=>{const a=U(e);if(a.set("bucket",t),r)for(const i of r.length>0?r:["none"])a.append("dimensions",i);return l(`/v1/usage/summary?${a.toString()}`)},enabled:s,placeholderData:z,staleTime:3e4})}function xr(e,t,r,s=!0){return p({queryKey:[q,"series",e,t,r],queryFn:()=>{const a=U(e);return a.set("bucket",t),a.set("group_by",r),l(`/v1/usage/series?${a.toString()}`)},enabled:s&&r!==null,placeholderData:z,staleTime:3e4,retry:(a,i)=>!(i instanceof L&&i.status===404)&&a<3})}function yr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function vr(e){if(e==null)return"$0.00";const t=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}function gr(e){if(e==null)return"—";if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){const t=Math.round(e/1e3);return t>=1e3?"1M":`${t}K`}return String(e)}const kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pr(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})/.exec(e);if(!t)return e;const r=Number(t[2])-1;return r<0||r>11?t[1]:`${kt[r]} ${t[1]}`}const Et=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function br(e){return Et.format(e)}function wr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Pt(e){return`${(e*100).toFixed(1)}%`}function jr(e,t){return t===void 0||t===0?null:(e-t)/t}function Nt(e,t=Date.now()){if(!e)return"never";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const s=Math.round((t-r.getTime())/1e3),a=s<0,i=Math.abs(s),u=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let d=i,f="second";for(const[h,b]of u){if(f=h,d0?"▲":e<0?"▼":"•";return n.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t," ",Pt(Math.abs(e))," vs prev"]})}function Ct(e){return e instanceof L||e instanceof Error?e.message:"Something went wrong."}function _t({error:e}){return e?n.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:Ct(e)}):null}function Tt({tone:e="info",children:t}){const r=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return n.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${r}`,children:t})}function Er({title:e,description:t,action:r}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),r?n.jsx("div",{className:"flex flex-wrap gap-2",children:r}):null]})}function Lt(e){const[t,r]=o.useState(()=>Date.now());return o.useEffect(()=>{let s;const a=()=>{s===void 0&&(s=setInterval(()=>r(Date.now()),e))},i=()=>{s!==void 0&&(clearInterval(s),s=void 0)},u=()=>{r(Date.now()),document.visibilityState==="visible"?a():i()};return u(),document.addEventListener("visibilitychange",u),()=>{i(),document.removeEventListener("visibilitychange",u)}},[e]),t}function Pr({onRefresh:e,isFetching:t=!1,updatedAt:r,label:s="Refresh"}){const a=Lt(15e3),i=r?Nt(new Date(r).toISOString(),a):null;return n.jsxs("span",{className:"inline-flex items-center gap-2",children:[i?n.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Updated ",i]}):null,n.jsx(C,{variant:"outline",size:"sm",isIconOnly:!0,isDisabled:t,onPress:e,"aria-label":s,children:n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`h-4 w-4 ${t?"animate-spin":""}`,"aria-hidden":"true",children:[n.jsx("path",{d:"M20 11a8 8 0 1 0-.5 4",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M20 4v5h-5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function Nr({title:e,description:t,actionLabel:r,onAction:s,isActionDisabled:a,children:i}){return n.jsx(I,{children:n.jsxs(I.Content,{className:"flex flex-col gap-4 p-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),i,r&&s?n.jsx("div",{children:n.jsx(C,{variant:"primary",isDisabled:a,onPress:s,children:r})}):null]})})}function Cr({label:e="Loading…"}){return n.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 px-4 py-10 text-sm text-[var(--otari-muted)]",children:[n.jsx(Ve,{size:"sm"}),n.jsx("span",{children:e})]})}function _r({children:e,confirmLabel:t,onConfirm:r,isPending:s}){const[a,i]=o.useState(!1);return a?n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(C,{size:"sm",variant:"danger",isDisabled:s,onPress:r,children:t}),n.jsx(C,{size:"sm",variant:"ghost",isDisabled:s,onPress:()=>i(!1),children:"Cancel"})]}):n.jsx(C,{size:"sm",variant:"danger-soft",onPress:()=>i(!0),children:e})}const Dt="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Tr({id:e,label:t,ariaLabel:r,value:s,onChange:a,options:i,children:u,disabled:d}){const f=o.useId(),y=e??(t?f:void 0),h=n.jsx("select",{id:y,"aria-label":t?void 0:r,value:s,disabled:d,onChange:b=>a(b.target.value),className:Dt,children:i?i.map(b=>n.jsx("option",{value:b.value,children:b.label},b.value)):u});return t?n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),h]}):h}function Lr({label:e,value:t,onChange:r,options:s,placeholder:a,maxVisible:i=50,allowsCustom:u=!1}){const d=m=>{var N;return((N=s.find(M=>M.value===m))==null?void 0:N.label)??m},[f,y]=o.useState(()=>d(t));o.useEffect(()=>{y(d(t))},[t]);const h=f.trim().toLowerCase(),b=s.filter(m=>!h||m.value.toLowerCase().includes(h)||m.label.toLowerCase().includes(h)).slice(0,i);return n.jsxs(K.Root,{allowsEmptyCollection:!0,allowsCustomValue:u,menuTrigger:"focus",inputValue:f,onInputChange:m=>{y(m),u?r(m.trim()):m.trim()===""&&r("")},onSelectionChange:m=>{m!=null&&r(String(m))},className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),n.jsxs(K.InputGroup,{children:[n.jsx(ye,{placeholder:a,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),n.jsx(K.Trigger,{})]}),n.jsx(K.Popover,{children:n.jsx(ze,{items:b,className:"max-h-72 overflow-auto",children:m=>n.jsx(Qe,{id:m.value,textValue:m.label,children:m.label})})})]})}function At(){var f,y;const e=mt(),t=ft(),[r,s]=o.useState(!1),i=((f=e.data)==null?void 0:f.require_pricing)===!0&&e.data.default_pricing===!1&&!r,d=((y=St(Q,i).data)==null?void 0:y.total)??0;return i?n.jsx("div",{className:"shrink-0 px-6 pt-3",children:n.jsx(Tt,{tone:"warning",children:n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("span",{children:["Requests are rejected until pricing is set (",n.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away.",d>0?n.jsxs(n.Fragment,{children:[" ",n.jsxs("strong",{className:"font-semibold",children:[d.toLocaleString()," ",d===1?"request":"requests"," failed in the last hour."]})," ",n.jsx(Fe,{to:"/activity?status=error&range=1h&source=gateway",className:"underline underline-offset-2",children:"View failed requests"})]}):null]}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(C,{size:"sm",variant:"primary",isDisabled:t.isPending,onPress:()=>t.mutate({default_pricing:!0}),children:t.isPending?"Enabling…":"Enable default pricing"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Dismiss"})]})]})})}):null}function It(){const{data:e}=dt(),t=o.useRef(null);return e&&t.current===null&&(t.current=e.build),e!=null&&t.current!=null&&e.build!==t.current}function qt(){const e=It(),[t,r]=o.useState(!1);return!e||t?null:n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:n.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),n.jsx(C,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>r(!0),children:"Later"})]})})}const je=200,Se=480,Z=240,Rt=60,ke="otari.dashboard.sidebarWidth",Ee="otari.dashboard.sidebarCollapsed",he=16,Pe="(max-width: 767px)",$=e=>Math.min(Se,Math.max(je,e));function Ot(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(Pe).matches}const Mt='a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ft(e){return e?Array.from(e.querySelectorAll(Mt)).filter(t=>t.offsetParent!==null||t===document.activeElement):[]}function Ut(){if(typeof window>"u")return Z;try{const e=window.localStorage.getItem(ke),t=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(t)?Z:$(t)}catch{return Z}}function Kt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ee)==="1"}catch{return!1}}const Bt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],$t=[{to:"/",section:"home",label:"Overview",end:!0,icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),n.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),n.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),n.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),n.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function zt(){const{logout:e}=re(),t=o.useRef(null),r=o.useRef(null),s=o.useRef(null),[a,i]=o.useState(Ut),[u,d]=o.useState(Kt),[f,y]=o.useState(!1),[h,b]=o.useState(Ot),[m,N]=o.useState(!1);o.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const c=window.matchMedia(Pe),v=w=>{b(w.matches),w.matches||N(!1)};return typeof c.addEventListener=="function"?(c.addEventListener("change",v),()=>c.removeEventListener("change",v)):(c.addListener(v),()=>c.removeListener(v))},[]),o.useEffect(()=>{if(!m)return;const c=v=>{v.key==="Escape"&&N(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[m]),o.useEffect(()=>{var c,v,w;h&&(m?(c=t.current)==null||c.focus():(v=t.current)!=null&&v.contains(document.activeElement)&&((w=s.current)==null||w.focus()))},[h,m]);const M=o.useCallback(c=>{if(c.key!=="Tab")return;const v=Ft(t.current);if(v.length===0)return;const w=v[0],k=v[v.length-1],F=document.activeElement;c.shiftKey&&(F===w||F===t.current)?(c.preventDefault(),k.focus()):!c.shiftKey&&F===k&&(c.preventDefault(),w.focus())},[]);o.useEffect(()=>{const c=window.setTimeout(()=>{try{window.localStorage.setItem(ke,String(Math.round(a)))}catch{}},200);return()=>window.clearTimeout(c)},[a]),o.useEffect(()=>{try{window.localStorage.setItem(Ee,u?"1":"0")}catch{}},[u]);const Ce=o.useCallback(c=>{c.preventDefault(),c.currentTarget.setPointerCapture(c.pointerId),y(!0)},[]),_e=o.useCallback(c=>{var w;if(!c.currentTarget.hasPointerCapture(c.pointerId))return;const v=((w=t.current)==null?void 0:w.getBoundingClientRect().left)??0;i($(c.clientX-v))},[]),Te=o.useCallback(c=>{c.currentTarget.hasPointerCapture(c.pointerId)&&c.currentTarget.releasePointerCapture(c.pointerId),y(!1)},[]),Le=o.useCallback(c=>{var v;c.preventDefault(),(v=r.current)==null||v.focus()},[]),De=o.useCallback(c=>{c.key==="ArrowLeft"?(c.preventDefault(),i(v=>$(v-he))):c.key==="ArrowRight"&&(c.preventDefault(),i(v=>$(v+he)))},[]),Ae=u?Rt:a,S=h?!1:u,H=h&&m?!0:void 0;return n.jsxs("div",{className:_("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[n.jsx("button",{type:"button",inert:H,onClick:Le,className:"sr-only focus:not-sr-only focus:absolute focus:top-3 focus:left-3 focus:z-50 focus:rounded-lg focus:border focus:border-[var(--otari-brand)] focus:bg-[var(--otari-surface)] focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-[var(--otari-brand-dark)] focus:shadow-md focus:outline-none",children:"Skip to main content"}),n.jsxs("header",{inert:H,className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("button",{type:"button",ref:s,onClick:()=>N(c=>!c),"aria-label":m?"Close navigation":"Open navigation","aria-expanded":m,"aria-controls":"app-sidebar",className:"-ml-1 flex h-8 w-8 items-center justify-center rounded-lg text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)] md:hidden",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5",children:n.jsx("path",{d:"M4 6h16M4 12h16M4 18h16",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),n.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),n.jsx(C,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),n.jsx(qt,{}),n.jsx(st,{}),n.jsx(At,{}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[h&&m?n.jsx("div",{"aria-hidden":"true",onClick:()=>N(!1),className:"fixed inset-0 z-30 bg-black/40 md:hidden"}):null,n.jsxs("aside",{ref:t,id:"app-sidebar",role:h?"dialog":void 0,"aria-modal":h&&m?!0:void 0,"aria-label":h?"Navigation":void 0,tabIndex:h?-1:void 0,inert:h&&!m?!0:void 0,onKeyDown:h&&m?M:void 0,style:h?void 0:{width:Ae},className:_("flex flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)] focus:outline-none",h?_("fixed inset-y-0 left-0 z-40 w-[17rem] shadow-xl transition-transform duration-200",m?"translate-x-0":"-translate-x-full"):_("relative shrink-0",!f&&"transition-[width] duration-150")),children:[n.jsx("button",{type:"button",onClick:()=>d(c=>!c),"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-pressed":u,title:u?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 hidden h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)] md:flex",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:_("h-3.5 w-3.5 transition-transform",u&&"rotate-180"),children:n.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("nav",{className:_("flex flex-col py-4",S?"px-2":"px-3"),children:Bt.map((c,v)=>{const w=$t.filter(k=>k.section===c.key);return w.length===0?null:n.jsxs("div",{className:v>0?"mt-4":void 0,children:[!S&&c.label?n.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:c.label}):null,v>0&&(S||!c.label)?n.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,n.jsx("div",{className:"flex flex-col gap-1",children:w.map(k=>n.jsxs(ee,{to:k.to,end:k.end,onClick:()=>N(!1),"aria-label":S?k.label:void 0,title:S?k.label:void 0,className:({isActive:F})=>_("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"justify-center px-0":"gap-3 px-3",F?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,S?null:k.label]},k.to))})]},c.key)})}),n.jsxs("div",{className:"mt-auto flex flex-col gap-1 pb-3",children:[n.jsxs(ee,{to:"/docs",onClick:()=>N(!1),"aria-label":S?"User guide":void 0,title:S?"User guide":void 0,className:({isActive:c})=>_("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"mx-2 justify-center px-0":"mx-3 gap-3 px-3",c?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[n.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.5V18c4 0 6.5.5 8 2 1.5-1.5 4-2 8-2V4.5c-4 0-6.5.5-8 2z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 6.5V20",strokeLinecap:"round"})]}),S?null:"User guide"]}),n.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai: the hosted Otari gateway",className:_("flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",S?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),S?null:n.jsxs("span",{className:"flex-1",children:["otari.ai ",n.jsx("span",{"aria-hidden":!0,children:"↗"})]})]})]}),u||h?null:n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(a),"aria-valuemin":je,"aria-valuemax":Se,tabIndex:0,onPointerDown:Ce,onPointerMove:_e,onPointerUp:Te,onKeyDown:De,className:_("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),n.jsx("main",{ref:r,id:"main-content",tabIndex:-1,inert:H,className:"flex-1 overflow-y-auto focus:outline-none",children:n.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-4 py-5 md:px-6 md:py-6",children:n.jsx(Ue,{})})})]})]})}function Qt(){const{login:e}=re(),[t,r]=o.useState(""),[s,a]=o.useState(null),[i,u]=o.useState(!1),d=async()=>{const f=t.trim();if(!(!f||i)){u(!0),a(null);try{await Xe(f)?e():a(new Error("Invalid master key."))}catch(y){a(y)}finally{u(!1)}}};return n.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:n.jsx(I,{className:"w-full max-w-md",children:n.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),n.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),d()},children:[n.jsxs(We,{value:t,onChange:f=>{r(f),s&&a(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),n.jsx(ye,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),n.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[n.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),n.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",n.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",n.jsx("code",{children:"Your master key:"})," (for example, run"," ",n.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),n.jsx(_t,{error:s}),n.jsx(C,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!t.trim()||i,children:i?"Signing in…":"Sign in"})]}),n.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),n.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:n.jsx(He,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const Vt=o.lazy(async()=>({default:(await P(async()=>{const{ActivityPage:e}=await import("./ActivityPage-B_xlQB4w.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))).ActivityPage})),Wt=o.lazy(async()=>({default:(await P(async()=>{const{AliasesPage:e}=await import("./AliasesPage-CoIJBCqd.js");return{AliasesPage:e}},__vite__mapDeps([11,1,2,6,5,7,8,12,13]))).AliasesPage})),Ht=o.lazy(async()=>({default:(await P(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-C3pAx2YI.js");return{BudgetsPage:e}},__vite__mapDeps([14,1,2,6,5,7,8,12]))).BudgetsPage})),Gt=o.lazy(async()=>({default:(await P(async()=>{const{DocsPage:e}=await import("./DocsPage-Dcxbdpf9.js");return{DocsPage:e}},__vite__mapDeps([15,1,2,5]))).DocsPage})),Jt=o.lazy(async()=>({default:(await P(async()=>{const{KeysPage:e}=await import("./KeysPage-CbATIDtN.js");return{KeysPage:e}},__vite__mapDeps([16,1,2,6,5,7,8,12,17,13]))).KeysPage})),Yt=o.lazy(async()=>({default:(await P(async()=>{const{ModelsPage:e}=await import("./ModelsPage-DZ6zDjTj.js");return{ModelsPage:e}},__vite__mapDeps([18,1,2,6,5,8,10]))).ModelsPage})),Xt=o.lazy(async()=>({default:(await P(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-gipwh9ys.js");return{OverviewIndex:e}},__vite__mapDeps([19,1,2,3,4,5,8]))).OverviewIndex})),Zt=o.lazy(async()=>({default:(await P(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-Bvzss9dV.js");return{ProvidersPage:e}},__vite__mapDeps([20,1,2,12,5,8]))).ProvidersPage})),en=o.lazy(async()=>({default:(await P(async()=>{const{SettingsPage:e}=await import("./SettingsPage-DGmFxbDI.js");return{SettingsPage:e}},__vite__mapDeps([21,1,2,5]))).SettingsPage})),tn=o.lazy(async()=>({default:(await P(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-CSEh0CuT.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([22,1,2,5]))).ToolsGuardrailsPage})),nn=o.lazy(async()=>({default:(await P(async()=>{const{UsagePage:e}=await import("./UsagePage-4kYrVw0Z.js");return{UsagePage:e}},__vite__mapDeps([23,1,2,3,4,5,8,9]))).UsagePage})),rn=o.lazy(async()=>({default:(await P(async()=>{const{UsersPage:e}=await import("./UsersPage-Ch4B0UUJ.js");return{UsersPage:e}},__vite__mapDeps([24,1,2,6,5,7,8,12,17]))).UsersPage}));function E(e){return n.jsx(o.Suspense,{fallback:n.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function sn(){const{isAuthenticated:e}=re();return e?n.jsx(Ke,{children:n.jsx(Be,{children:n.jsxs(j,{element:n.jsx(zt,{}),children:[n.jsx(j,{index:!0,element:E(n.jsx(Xt,{}))}),n.jsx(j,{path:"providers",element:E(n.jsx(Zt,{}))}),n.jsx(j,{path:"keys",element:E(n.jsx(Jt,{}))}),n.jsx(j,{path:"users",element:E(n.jsx(rn,{}))}),n.jsx(j,{path:"budgets",element:E(n.jsx(Ht,{}))}),n.jsx(j,{path:"activity",element:E(n.jsx(Vt,{}))}),n.jsx(j,{path:"usage",element:E(n.jsx(nn,{}))}),n.jsx(j,{path:"models",element:E(n.jsx(Yt,{}))}),n.jsx(j,{path:"aliases",element:E(n.jsx(Wt,{}))}),n.jsx(j,{path:"tools",element:E(n.jsx(tn,{}))}),n.jsx(j,{path:"settings",element:E(n.jsx(en,{}))}),n.jsx(j,{path:"docs",element:E(n.jsx(Gt,{}))}),n.jsx(j,{path:"*",element:n.jsx($e,{to:"/",replace:!0})})]})})}):n.jsx(Qt,{})}function an({children:e}){const[t]=o.useState(()=>new Re({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(r,s)=>s instanceof L&&(s.status===401||s.status===403)?!1:r<2}}}));return n.jsx(Oe,{client:t,children:n.jsx(tt,{children:e})})}const Ne=document.getElementById("root");if(!Ne)throw new Error("Root element #root not found");Ge.createRoot(Ne).render(n.jsx(o.StrictMode,{children:n.jsx(an,{children:n.jsx(sn,{})})}));export{Pn as $,hn as A,Nr as B,xn as C,tr as D,_t as E,Tr as F,Yn as G,Xn as H,Tt as I,Zn as J,Jn as K,wn as L,$n as M,fr as N,qn as O,Er as P,zn as Q,Pr as R,gr as S,Qn as T,Ct as U,pr as V,mt as W,vr as X,at as Y,Sn as Z,Cr as _,ot as a,jr as a0,Sr as a1,br as a2,kr as a3,yr as a4,Pt as a5,Nt as a6,Cn as a7,Ln as a8,An as a9,ft as aa,Tn as ab,Nn as ac,_n as ad,En as ae,kn as af,In as ag,Vn as ah,Wn as ai,Hn as aj,Fn as ak,Dn as al,Un as am,Kn as an,Bn as ao,xr as ap,L as aq,mn as ar,dn as as,wr as at,lr as au,ir as av,pn as b,Gn as c,cr as d,ur as e,bn as f,hr as g,yn as h,vn as i,dr as j,mr as k,fn as l,Lr as m,it as n,jn as o,Rn as p,Mn as q,gn as r,_r as s,On as t,ar as u,er as v,nr as w,rr as x,sr as y,or as z}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-BENT_1o4.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/charts-B_hm0rXH.js","assets/recharts-BwTTRGtj.js","assets/heroui-DZj66Arc.js","assets/tableSelection-CojkFPwd.js","assets/ConfirmDialog-BBkZMSqE.js","assets/DataTable-CrQq0sYf.js","assets/FilterChips-BLdhUEZK.js","assets/TablePagination-0H6sFfIt.js","assets/AliasesPage-CtStwRk-.js","assets/Field-DEJ6Wjg9.js","assets/UserComboBox-nt7pHfqn.js","assets/BudgetsPage-0J25eK0m.js","assets/DocsPage-DoYdRqgR.js","assets/KeysPage-JwzirK0P.js","assets/ModelScopeControl-gV_ax1BN.js","assets/ModelsPage-DyZuS75D.js","assets/OverviewPage-Tme0ej_W.js","assets/ProvidersPage-B46VzXV5.js","assets/SettingsPage-CMbg-FaW.js","assets/ToolsGuardrailsPage-DkLhKtcA.js","assets/UsagePage-CjaSd7XG.js","assets/UsersPage-Cfif2r2r.js"])))=>i.map(i=>d[i]); +var Ie=Object.defineProperty;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>qe(e,typeof t!="symbol"?t+"":t,r);import{u as g,j as n,a as p,b as x,k as z,Q as Re,c as Oe}from"./tanstack-query-1t81HyiD.js";import{d as Me,r as o,N as ee,L as Fe,O as Ue,H as Ke,e as Be,f as j,h as $e}from"./react-dgEcD0HR.js";import{B as C,C as K,L as xe,I as ye,a as ze,b as Qe,d as I,S as Ve,c as _,T as We,e as He}from"./heroui-DZj66Arc.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ge=Me();const Je="modulepreload",Ye=function(e){return"/"+e},ue={},P=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let u=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(r.map(y=>{if(y=Ye(y),y in ue)return;ue[y]=!0;const h=y.endsWith(".css"),b=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Je,h||(m.as="script"),m.crossOrigin="",m.href=y,f&&m.setAttribute("nonce",f),document.head.appendChild(m),h)return new Promise((N,M)=>{m.addEventListener("load",N),m.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};class L extends Error{constructor(r,s){super(s);ce(this,"status");this.name="ApiError",this.status=r}}let B=null;function de(e){B=e}async function te(e){try{const t=await e.json();if(typeof t.detail=="string")return t.detail;if(t.detail!=null)return JSON.stringify(t.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Xe(e){let t;try{t=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(t.status===401||t.status===403)return!1;if(!t.ok)throw new L(t.status,await te(t));return!0}async function Ze(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function l(e,t={}){const r=new Headers(t.headers);r.set("Accept","application/json"),t.body!=null&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let s;try{s=await fetch(e,{...t,headers:r})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(s.status===401||s.status===403)throw B==null||B(),new L(s.status,await te(s));if(!s.ok)throw new L(s.status,await te(s));if(s.status!==204)return await s.json()}const ne="otari.dashboard.hasSession",ve=o.createContext(null);function et(){try{return window.localStorage.getItem(ne)==="1"}catch{return!1}}function tt({children:e}){const t=g(),[r,s]=o.useState(et),a=o.useCallback(()=>{Ze(),s(!1),t.clear();try{window.localStorage.removeItem(ne)}catch{}},[t]),i=o.useCallback(()=>{t.clear(),s(!0);try{window.localStorage.setItem(ne,"1")}catch{}},[t]);o.useEffect(()=>(de(a),()=>de(null)),[a]);const u=o.useMemo(()=>({isAuthenticated:r,login:i,logout:a}),[r,i,a]);return n.jsx(ve.Provider,{value:u,children:e})}function re(){const e=o.useContext(ve);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function nt(e){return e instanceof L&&e.status===0}function rt(){const e=g(),[t,r]=o.useState(!1);return o.useEffect(()=>{const s=e.getQueryCache(),a=()=>s.getAll().some(i=>i.state.status==="error"&&nt(i.state.error));return r(a()),s.subscribe(()=>r(a()))},[e]),t}function st(){return rt()?n.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const Q=3600,T=86400,at=365*T,dn=[{key:"1h",label:"Last hour",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:T,bucket:"hour"},{key:"7d",label:"7d",seconds:7*T,bucket:"day"},{key:"30d",label:"30d",seconds:30*T,bucket:"day"},{key:"90d",label:"90d",seconds:90*T,bucket:"day"},{key:"12mo",label:"12mo",seconds:at,bucket:"day"}],mn="30d",fn=[{key:"1h",label:"1h",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:T,bucket:"hour"},{key:"7d",label:"7d",seconds:7*T,bucket:"day"},{key:"30d",label:"30d",seconds:30*T,bucket:"day"},{key:"all",label:"All",seconds:null,bucket:"day"}],hn="24h",xn="custom";function yn(e,t){return e.find(r=>r.key===t)}function it(e,t=Date.now()){return new Date(t-e*1e3).toISOString()}function ot(e){return(e==="hour"?Q:T)*1e3}function vn(e,t,r=Date.now()){const s=new Date(e).getTime();return(t?new Date(t).getTime():r)-s<=T*1e3?"hour":"day"}function gn(e,t,r,s){if(e.length===0)return null;const a=Math.max(0,Math.min(t,r)),i=Math.min(e.length-1,Math.max(t,r)),u=new Date(e[a]).getTime(),d=new Date(e[i]).getTime()+ot(s);return{startIso:new Date(u).toISOString(),endIso:new Date(d).toISOString()}}function pn(e,t,r){const s=e.length;if(s===0)return{startIndex:0,endIndex:0};const a=e.map(d=>new Date(d).getTime());let i=0;if(t){const d=new Date(t).getTime();for(let f=0;fl("/v1/models"),staleTime:6e4})}function dt(){return p({queryKey:[ct],queryFn:()=>l("/dashboard-build.json"),refetchInterval:ut,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function jn(){return p({queryKey:[ae],queryFn:()=>l("/v1/models/discoverable"),staleTime:5*6e4})}function Sn(){return p({queryKey:[ie],queryFn:()=>l("/v1/providers"),staleTime:5*6e4})}function kn(){return p({queryKey:["provider-catalog"],queryFn:()=>l("/v1/providers/catalog"),staleTime:1/0})}function En(e){return p({queryKey:["provider-catalog",e],queryFn:()=>l(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Pn(){return p({queryKey:[oe],queryFn:()=>l("/v1/providers/health"),staleTime:me,refetchInterval:me})}function Nn(){const e=g();return x({mutationFn:()=>l("/v1/providers/health?refresh=true"),onSuccess:t=>e.setQueryData([oe],t)})}function Cn(){return p({queryKey:[be],queryFn:()=>l("/v1/provider-credentials"),staleTime:6e4})}function W(e){e.invalidateQueries({queryKey:[be]}),e.invalidateQueries({queryKey:[ie]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]}),e.invalidateQueries({queryKey:[oe]})}function _n(){const e=g();return x({mutationFn:t=>l("/v1/provider-credentials",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>W(e)})}function Tn(){const e=g();return x({mutationFn:({instance:t,body:r})=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>W(e)})}function Ln(){const e=g();return x({mutationFn:t=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>W(e)})}function Dn(){const e=g();return x({mutationFn:()=>l("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>W(e)})}function An(){return x({mutationFn:e=>l(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function In(){return x({mutationFn:e=>l("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function qn(){return p({queryKey:[lt],queryFn:()=>l("/v1/models/metadata"),staleTime:10*6e4})}function Rn(){return p({queryKey:[se],queryFn:()=>l("/v1/aliases"),staleTime:6e4})}function On(){const e=g();return x({mutationFn:t=>l("/v1/aliases",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function Mn(){const e=g();return x({mutationFn:({name:t,userId:r})=>{const s=r==null?"":`?user_id=${encodeURIComponent(r)}`;return l(`/v1/aliases/${encodeURIComponent(t)}${s}`,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function mt(){return p({queryKey:[ge],queryFn:()=>l("/v1/settings"),staleTime:6e4})}function ft(){const e=g();return x({mutationFn:t=>l("/v1/settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([ge],t),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]})}})}function Fn(){return x({mutationFn:()=>l("/v1/settings/master-key/rotate",{method:"POST"})})}function Un(){return p({queryKey:[pe],queryFn:()=>l("/v1/tool-settings"),staleTime:6e4})}function Kn(){const e=g();return x({mutationFn:t=>l("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([pe],t)}})}function Bn(){return x({mutationFn:({service:e,url:t})=>l(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:t})})})}const G=1e3,ht=100;async function xt(){const e=[];for(let t=0;tl("/v1/pricing",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Qn(){const e=g();return x({mutationFn:t=>l(`/v1/pricing/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Vn(){return x({mutationFn:()=>l("/v1/pricing/refresh",{method:"POST"})})}function Wn(){const e=g();return x({mutationFn:()=>l("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ie]})}})}function Hn(){return x({mutationFn:()=>l("/v1/pricing/refresh/reject",{method:"POST"})})}const J=1e3,yt=100;async function vt(){const e=[];for(let t=0;tl("/v1/keys",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Yn(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Xn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Zn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}const Y=1e3,gt=100;async function pt(){const e=[];for(let t=0;tl(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function nr(){const e=g();return x({mutationFn:t=>l("/v1/budgets",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function rr(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function sr(){const e=g();return x({mutationFn:t=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}const X=1e3,bt=100;async function wt(){const e=[];for(let t=0;tl("/v1/users",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>le(e)})}function or(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>le(e)})}function lr(){const e=g();return x({mutationFn:t=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{le(e),e.invalidateQueries({queryKey:[R]})}})}function U(e){const t=new URLSearchParams;return e.start_date&&t.set("start_date",e.start_date),e.end_date&&t.set("end_date",e.end_date),e.status&&t.set("status",e.status),e.model&&t.set("model",e.model),e.endpoint&&t.set("endpoint",e.endpoint),e.provider&&t.set("provider",e.provider),e.user_id&&t.set("user_id",e.user_id),e.api_key_id&&t.set("api_key_id",e.api_key_id),e.source&&t.set("source",e.source),e.source_label&&t.set("source_label",e.source_label),e.priced!==void 0&&t.set("priced",String(e.priced)),e.counts_toward_budget!==void 0&&t.set("counts_toward_budget",String(e.counts_toward_budget)),t}function cr(e,t,r){return p({queryKey:[q,"list",e,t,r],queryFn:()=>{const s=U(e);return s.set("skip",String(t*r)),s.set("limit",String(r)),l(`/v1/usage?${s.toString()}`)},placeholderData:z,staleTime:1e4})}function ur(e,t=!0){return p({queryKey:[q,"count",e],queryFn:()=>l(`/v1/usage/count?${U(e).toString()}`),enabled:t,placeholderData:z,staleTime:1e4})}const jt=6e4;function St(e,t=!0){return p({queryKey:[q,"count","failures",e],queryFn:()=>{const r={status:"error",source:"gateway",start_date:it(e)};return l(`/v1/usage/count?${U(r).toString()}`)},enabled:t,refetchInterval:jt,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function dr(){const e=g();return x({mutationFn:t=>l("/v1/usage",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}function mr(){const e=g();return x({mutationFn:t=>l("/v1/usage/set-price",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}const fr=[];function hr(e,t,r,s=!0){return p({queryKey:[q,"summary",e,t,r??"all"],queryFn:()=>{const a=U(e);if(a.set("bucket",t),r)for(const i of r.length>0?r:["none"])a.append("dimensions",i);return l(`/v1/usage/summary?${a.toString()}`)},enabled:s,placeholderData:z,staleTime:3e4})}function xr(e,t,r,s=!0){return p({queryKey:[q,"series",e,t,r],queryFn:()=>{const a=U(e);return a.set("bucket",t),a.set("group_by",r),l(`/v1/usage/series?${a.toString()}`)},enabled:s&&r!==null,placeholderData:z,staleTime:3e4,retry:(a,i)=>!(i instanceof L&&i.status===404)&&a<3})}function yr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function vr(e){if(e==null)return"$0.00";const t=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}function gr(e){if(e==null)return"—";if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){const t=Math.round(e/1e3);return t>=1e3?"1M":`${t}K`}return String(e)}const kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pr(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})/.exec(e);if(!t)return e;const r=Number(t[2])-1;return r<0||r>11?t[1]:`${kt[r]} ${t[1]}`}const Et=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function br(e){return Et.format(e)}function wr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Pt(e){return`${(e*100).toFixed(1)}%`}function jr(e,t){return t===void 0||t===0?null:(e-t)/t}function Nt(e,t=Date.now()){if(!e)return"never";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const s=Math.round((t-r.getTime())/1e3),a=s<0,i=Math.abs(s),u=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let d=i,f="second";for(const[h,b]of u){if(f=h,d0?"▲":e<0?"▼":"•";return n.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t," ",Pt(Math.abs(e))," vs prev"]})}function Ct(e){return e instanceof L||e instanceof Error?e.message:"Something went wrong."}function _t({error:e}){return e?n.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:Ct(e)}):null}function Tt({tone:e="info",children:t}){const r=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return n.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${r}`,children:t})}function Er({title:e,description:t,action:r}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),r?n.jsx("div",{className:"flex flex-wrap gap-2",children:r}):null]})}function Lt(e){const[t,r]=o.useState(()=>Date.now());return o.useEffect(()=>{let s;const a=()=>{s===void 0&&(s=setInterval(()=>r(Date.now()),e))},i=()=>{s!==void 0&&(clearInterval(s),s=void 0)},u=()=>{r(Date.now()),document.visibilityState==="visible"?a():i()};return u(),document.addEventListener("visibilitychange",u),()=>{i(),document.removeEventListener("visibilitychange",u)}},[e]),t}function Pr({onRefresh:e,isFetching:t=!1,updatedAt:r,label:s="Refresh"}){const a=Lt(15e3),i=r?Nt(new Date(r).toISOString(),a):null;return n.jsxs("span",{className:"inline-flex items-center gap-2",children:[i?n.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Updated ",i]}):null,n.jsx(C,{variant:"outline",size:"sm",isIconOnly:!0,isDisabled:t,onPress:e,"aria-label":s,children:n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`h-4 w-4 ${t?"animate-spin":""}`,"aria-hidden":"true",children:[n.jsx("path",{d:"M20 11a8 8 0 1 0-.5 4",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M20 4v5h-5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function Nr({title:e,description:t,actionLabel:r,onAction:s,isActionDisabled:a,children:i}){return n.jsx(I,{children:n.jsxs(I.Content,{className:"flex flex-col gap-4 p-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),i,r&&s?n.jsx("div",{children:n.jsx(C,{variant:"primary",isDisabled:a,onPress:s,children:r})}):null]})})}function Cr({label:e="Loading…"}){return n.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 px-4 py-10 text-sm text-[var(--otari-muted)]",children:[n.jsx(Ve,{size:"sm"}),n.jsx("span",{children:e})]})}function _r({children:e,confirmLabel:t,onConfirm:r,isPending:s}){const[a,i]=o.useState(!1);return a?n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(C,{size:"sm",variant:"danger",isDisabled:s,onPress:r,children:t}),n.jsx(C,{size:"sm",variant:"ghost",isDisabled:s,onPress:()=>i(!1),children:"Cancel"})]}):n.jsx(C,{size:"sm",variant:"danger-soft",onPress:()=>i(!0),children:e})}const Dt="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Tr({id:e,label:t,ariaLabel:r,value:s,onChange:a,options:i,children:u,disabled:d}){const f=o.useId(),y=e??(t?f:void 0),h=n.jsx("select",{id:y,"aria-label":t?void 0:r,value:s,disabled:d,onChange:b=>a(b.target.value),className:Dt,children:i?i.map(b=>n.jsx("option",{value:b.value,children:b.label},b.value)):u});return t?n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),h]}):h}function Lr({label:e,value:t,onChange:r,options:s,placeholder:a,maxVisible:i=50,allowsCustom:u=!1}){const d=m=>{var N;return((N=s.find(M=>M.value===m))==null?void 0:N.label)??m},[f,y]=o.useState(()=>d(t));o.useEffect(()=>{y(d(t))},[t]);const h=f.trim().toLowerCase(),b=s.filter(m=>!h||m.value.toLowerCase().includes(h)||m.label.toLowerCase().includes(h)).slice(0,i);return n.jsxs(K.Root,{allowsEmptyCollection:!0,allowsCustomValue:u,menuTrigger:"focus",inputValue:f,onInputChange:m=>{y(m),u?r(m.trim()):m.trim()===""&&r("")},onSelectionChange:m=>{m!=null&&r(String(m))},className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),n.jsxs(K.InputGroup,{children:[n.jsx(ye,{placeholder:a,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),n.jsx(K.Trigger,{})]}),n.jsx(K.Popover,{children:n.jsx(ze,{items:b,className:"max-h-72 overflow-auto",children:m=>n.jsx(Qe,{id:m.value,textValue:m.label,children:m.label})})})]})}function At(){var f,y;const e=mt(),t=ft(),[r,s]=o.useState(!1),i=((f=e.data)==null?void 0:f.require_pricing)===!0&&e.data.default_pricing===!1&&!r,d=((y=St(Q,i).data)==null?void 0:y.total)??0;return i?n.jsx("div",{className:"shrink-0 px-6 pt-3",children:n.jsx(Tt,{tone:"warning",children:n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("span",{children:["Requests are rejected until pricing is set (",n.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away.",d>0?n.jsxs(n.Fragment,{children:[" ",n.jsxs("strong",{className:"font-semibold",children:[d.toLocaleString()," ",d===1?"request":"requests"," failed in the last hour."]})," ",n.jsx(Fe,{to:"/activity?status=error&range=1h&source=gateway",className:"underline underline-offset-2",children:"View failed requests"})]}):null]}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(C,{size:"sm",variant:"primary",isDisabled:t.isPending,onPress:()=>t.mutate({default_pricing:!0}),children:t.isPending?"Enabling…":"Enable default pricing"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Dismiss"})]})]})})}):null}function It(){const{data:e}=dt(),t=o.useRef(null);return e&&t.current===null&&(t.current=e.build),e!=null&&t.current!=null&&e.build!==t.current}function qt(){const e=It(),[t,r]=o.useState(!1);return!e||t?null:n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:n.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),n.jsx(C,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>r(!0),children:"Later"})]})})}const je=200,Se=480,Z=240,Rt=60,ke="otari.dashboard.sidebarWidth",Ee="otari.dashboard.sidebarCollapsed",he=16,Pe="(max-width: 767px)",$=e=>Math.min(Se,Math.max(je,e));function Ot(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(Pe).matches}const Mt='a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ft(e){return e?Array.from(e.querySelectorAll(Mt)).filter(t=>t.offsetParent!==null||t===document.activeElement):[]}function Ut(){if(typeof window>"u")return Z;try{const e=window.localStorage.getItem(ke),t=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(t)?Z:$(t)}catch{return Z}}function Kt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ee)==="1"}catch{return!1}}const Bt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],$t=[{to:"/",section:"home",label:"Overview",end:!0,icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),n.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),n.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),n.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),n.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function zt(){const{logout:e}=re(),t=o.useRef(null),r=o.useRef(null),s=o.useRef(null),[a,i]=o.useState(Ut),[u,d]=o.useState(Kt),[f,y]=o.useState(!1),[h,b]=o.useState(Ot),[m,N]=o.useState(!1);o.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const c=window.matchMedia(Pe),v=w=>{b(w.matches),w.matches||N(!1)};return typeof c.addEventListener=="function"?(c.addEventListener("change",v),()=>c.removeEventListener("change",v)):(c.addListener(v),()=>c.removeListener(v))},[]),o.useEffect(()=>{if(!m)return;const c=v=>{v.key==="Escape"&&N(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[m]),o.useEffect(()=>{var c,v,w;h&&(m?(c=t.current)==null||c.focus():(v=t.current)!=null&&v.contains(document.activeElement)&&((w=s.current)==null||w.focus()))},[h,m]);const M=o.useCallback(c=>{if(c.key!=="Tab")return;const v=Ft(t.current);if(v.length===0)return;const w=v[0],k=v[v.length-1],F=document.activeElement;c.shiftKey&&(F===w||F===t.current)?(c.preventDefault(),k.focus()):!c.shiftKey&&F===k&&(c.preventDefault(),w.focus())},[]);o.useEffect(()=>{const c=window.setTimeout(()=>{try{window.localStorage.setItem(ke,String(Math.round(a)))}catch{}},200);return()=>window.clearTimeout(c)},[a]),o.useEffect(()=>{try{window.localStorage.setItem(Ee,u?"1":"0")}catch{}},[u]);const Ce=o.useCallback(c=>{c.preventDefault(),c.currentTarget.setPointerCapture(c.pointerId),y(!0)},[]),_e=o.useCallback(c=>{var w;if(!c.currentTarget.hasPointerCapture(c.pointerId))return;const v=((w=t.current)==null?void 0:w.getBoundingClientRect().left)??0;i($(c.clientX-v))},[]),Te=o.useCallback(c=>{c.currentTarget.hasPointerCapture(c.pointerId)&&c.currentTarget.releasePointerCapture(c.pointerId),y(!1)},[]),Le=o.useCallback(c=>{var v;c.preventDefault(),(v=r.current)==null||v.focus()},[]),De=o.useCallback(c=>{c.key==="ArrowLeft"?(c.preventDefault(),i(v=>$(v-he))):c.key==="ArrowRight"&&(c.preventDefault(),i(v=>$(v+he)))},[]),Ae=u?Rt:a,S=h?!1:u,H=h&&m?!0:void 0;return n.jsxs("div",{className:_("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[n.jsx("button",{type:"button",inert:H,onClick:Le,className:"sr-only focus:not-sr-only focus:absolute focus:top-3 focus:left-3 focus:z-50 focus:rounded-lg focus:border focus:border-[var(--otari-brand)] focus:bg-[var(--otari-surface)] focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-[var(--otari-brand-dark)] focus:shadow-md focus:outline-none",children:"Skip to main content"}),n.jsxs("header",{inert:H,className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("button",{type:"button",ref:s,onClick:()=>N(c=>!c),"aria-label":m?"Close navigation":"Open navigation","aria-expanded":m,"aria-controls":"app-sidebar",className:"-ml-1 flex h-8 w-8 items-center justify-center rounded-lg text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)] md:hidden",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5",children:n.jsx("path",{d:"M4 6h16M4 12h16M4 18h16",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),n.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),n.jsx(C,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),n.jsx(qt,{}),n.jsx(st,{}),n.jsx(At,{}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[h&&m?n.jsx("div",{"aria-hidden":"true",onClick:()=>N(!1),className:"fixed inset-0 z-30 bg-black/40 md:hidden"}):null,n.jsxs("aside",{ref:t,id:"app-sidebar",role:h?"dialog":void 0,"aria-modal":h&&m?!0:void 0,"aria-label":h?"Navigation":void 0,tabIndex:h?-1:void 0,inert:h&&!m?!0:void 0,onKeyDown:h&&m?M:void 0,style:h?void 0:{width:Ae},className:_("flex flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)] focus:outline-none",h?_("fixed inset-y-0 left-0 z-40 w-[17rem] shadow-xl transition-transform duration-200",m?"translate-x-0":"-translate-x-full"):_("relative shrink-0",!f&&"transition-[width] duration-150")),children:[n.jsx("button",{type:"button",onClick:()=>d(c=>!c),"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-pressed":u,title:u?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 hidden h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)] md:flex",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:_("h-3.5 w-3.5 transition-transform",u&&"rotate-180"),children:n.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("nav",{className:_("flex flex-col py-4",S?"px-2":"px-3"),children:Bt.map((c,v)=>{const w=$t.filter(k=>k.section===c.key);return w.length===0?null:n.jsxs("div",{className:v>0?"mt-4":void 0,children:[!S&&c.label?n.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:c.label}):null,v>0&&(S||!c.label)?n.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,n.jsx("div",{className:"flex flex-col gap-1",children:w.map(k=>n.jsxs(ee,{to:k.to,end:k.end,onClick:()=>N(!1),"aria-label":S?k.label:void 0,title:S?k.label:void 0,className:({isActive:F})=>_("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"justify-center px-0":"gap-3 px-3",F?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,S?null:k.label]},k.to))})]},c.key)})}),n.jsxs("div",{className:"mt-auto flex flex-col gap-1 pb-3",children:[n.jsxs(ee,{to:"/docs",onClick:()=>N(!1),"aria-label":S?"User guide":void 0,title:S?"User guide":void 0,className:({isActive:c})=>_("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"mx-2 justify-center px-0":"mx-3 gap-3 px-3",c?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[n.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.5V18c4 0 6.5.5 8 2 1.5-1.5 4-2 8-2V4.5c-4 0-6.5.5-8 2z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 6.5V20",strokeLinecap:"round"})]}),S?null:"User guide"]}),n.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai: the hosted Otari gateway",className:_("flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",S?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),S?null:n.jsxs("span",{className:"flex-1",children:["otari.ai ",n.jsx("span",{"aria-hidden":!0,children:"↗"})]})]})]}),u||h?null:n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(a),"aria-valuemin":je,"aria-valuemax":Se,tabIndex:0,onPointerDown:Ce,onPointerMove:_e,onPointerUp:Te,onKeyDown:De,className:_("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),n.jsx("main",{ref:r,id:"main-content",tabIndex:-1,inert:H,className:"flex-1 overflow-y-auto focus:outline-none",children:n.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-4 py-5 md:px-6 md:py-6",children:n.jsx(Ue,{})})})]})]})}function Qt(){const{login:e}=re(),[t,r]=o.useState(""),[s,a]=o.useState(null),[i,u]=o.useState(!1),d=async()=>{const f=t.trim();if(!(!f||i)){u(!0),a(null);try{await Xe(f)?e():a(new Error("Invalid master key."))}catch(y){a(y)}finally{u(!1)}}};return n.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:n.jsx(I,{className:"w-full max-w-md",children:n.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),n.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),d()},children:[n.jsxs(We,{value:t,onChange:f=>{r(f),s&&a(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),n.jsx(ye,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),n.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[n.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),n.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",n.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",n.jsx("code",{children:"Your master key:"})," (for example, run"," ",n.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),n.jsx(_t,{error:s}),n.jsx(C,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!t.trim()||i,children:i?"Signing in…":"Sign in"})]}),n.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),n.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:n.jsx(He,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const Vt=o.lazy(async()=>({default:(await P(async()=>{const{ActivityPage:e}=await import("./ActivityPage-BENT_1o4.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))).ActivityPage})),Wt=o.lazy(async()=>({default:(await P(async()=>{const{AliasesPage:e}=await import("./AliasesPage-CtStwRk-.js");return{AliasesPage:e}},__vite__mapDeps([11,1,2,6,5,7,8,12,13]))).AliasesPage})),Ht=o.lazy(async()=>({default:(await P(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-0J25eK0m.js");return{BudgetsPage:e}},__vite__mapDeps([14,1,2,6,5,7,8,12]))).BudgetsPage})),Gt=o.lazy(async()=>({default:(await P(async()=>{const{DocsPage:e}=await import("./DocsPage-DoYdRqgR.js");return{DocsPage:e}},__vite__mapDeps([15,1,2,5]))).DocsPage})),Jt=o.lazy(async()=>({default:(await P(async()=>{const{KeysPage:e}=await import("./KeysPage-JwzirK0P.js");return{KeysPage:e}},__vite__mapDeps([16,1,2,6,5,7,8,12,17,13]))).KeysPage})),Yt=o.lazy(async()=>({default:(await P(async()=>{const{ModelsPage:e}=await import("./ModelsPage-DyZuS75D.js");return{ModelsPage:e}},__vite__mapDeps([18,1,2,6,5,8,10]))).ModelsPage})),Xt=o.lazy(async()=>({default:(await P(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-Tme0ej_W.js");return{OverviewIndex:e}},__vite__mapDeps([19,1,2,3,4,5,8]))).OverviewIndex})),Zt=o.lazy(async()=>({default:(await P(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-B46VzXV5.js");return{ProvidersPage:e}},__vite__mapDeps([20,1,2,12,5,8]))).ProvidersPage})),en=o.lazy(async()=>({default:(await P(async()=>{const{SettingsPage:e}=await import("./SettingsPage-CMbg-FaW.js");return{SettingsPage:e}},__vite__mapDeps([21,1,2,5]))).SettingsPage})),tn=o.lazy(async()=>({default:(await P(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-DkLhKtcA.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([22,1,2,5]))).ToolsGuardrailsPage})),nn=o.lazy(async()=>({default:(await P(async()=>{const{UsagePage:e}=await import("./UsagePage-CjaSd7XG.js");return{UsagePage:e}},__vite__mapDeps([23,1,2,3,4,5,8,9]))).UsagePage})),rn=o.lazy(async()=>({default:(await P(async()=>{const{UsersPage:e}=await import("./UsersPage-Cfif2r2r.js");return{UsersPage:e}},__vite__mapDeps([24,1,2,6,5,7,8,12,17]))).UsersPage}));function E(e){return n.jsx(o.Suspense,{fallback:n.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function sn(){const{isAuthenticated:e}=re();return e?n.jsx(Ke,{children:n.jsx(Be,{children:n.jsxs(j,{element:n.jsx(zt,{}),children:[n.jsx(j,{index:!0,element:E(n.jsx(Xt,{}))}),n.jsx(j,{path:"providers",element:E(n.jsx(Zt,{}))}),n.jsx(j,{path:"keys",element:E(n.jsx(Jt,{}))}),n.jsx(j,{path:"users",element:E(n.jsx(rn,{}))}),n.jsx(j,{path:"budgets",element:E(n.jsx(Ht,{}))}),n.jsx(j,{path:"activity",element:E(n.jsx(Vt,{}))}),n.jsx(j,{path:"usage",element:E(n.jsx(nn,{}))}),n.jsx(j,{path:"models",element:E(n.jsx(Yt,{}))}),n.jsx(j,{path:"aliases",element:E(n.jsx(Wt,{}))}),n.jsx(j,{path:"tools",element:E(n.jsx(tn,{}))}),n.jsx(j,{path:"settings",element:E(n.jsx(en,{}))}),n.jsx(j,{path:"docs",element:E(n.jsx(Gt,{}))}),n.jsx(j,{path:"*",element:n.jsx($e,{to:"/",replace:!0})})]})})}):n.jsx(Qt,{})}function an({children:e}){const[t]=o.useState(()=>new Re({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(r,s)=>s instanceof L&&(s.status===401||s.status===403)?!1:r<2}}}));return n.jsx(Oe,{client:t,children:n.jsx(tt,{children:e})})}const Ne=document.getElementById("root");if(!Ne)throw new Error("Root element #root not found");Ge.createRoot(Ne).render(n.jsx(o.StrictMode,{children:n.jsx(an,{children:n.jsx(sn,{})})}));export{Pn as $,hn as A,Nr as B,xn as C,tr as D,_t as E,Tr as F,Yn as G,Xn as H,Tt as I,Zn as J,Jn as K,wn as L,$n as M,fr as N,qn as O,Er as P,zn as Q,Pr as R,gr as S,Qn as T,Ct as U,pr as V,mt as W,vr as X,at as Y,Sn as Z,Cr as _,ot as a,jr as a0,Sr as a1,br as a2,kr as a3,yr as a4,Pt as a5,Nt as a6,Cn as a7,Ln as a8,An as a9,ft as aa,Tn as ab,Nn as ac,_n as ad,En as ae,kn as af,In as ag,Vn as ah,Wn as ai,Hn as aj,Fn as ak,Dn as al,Un as am,Kn as an,Bn as ao,xr as ap,L as aq,mn as ar,dn as as,wr as at,lr as au,ir as av,pn as b,Gn as c,cr as d,ur as e,bn as f,hr as g,yn as h,vn as i,dr as j,mr as k,fn as l,Lr as m,it as n,jn as o,Rn as p,Mn as q,gn as r,_r as s,On as t,ar as u,er as v,nr as w,rr as x,sr as y,or as z}; diff --git a/src/gateway/static/dashboard/index.html b/src/gateway/static/dashboard/index.html index b835a9332..63dbe4bd9 100644 --- a/src/gateway/static/dashboard/index.html +++ b/src/gateway/static/dashboard/index.html @@ -19,7 +19,7 @@ insets to sit out of the way. --> Otari Dashboard - + diff --git a/web/src/pages/ActivityPage.test.tsx b/web/src/pages/ActivityPage.test.tsx index 6dc203477..13475fd88 100644 --- a/web/src/pages/ActivityPage.test.tsx +++ b/web/src/pages/ActivityPage.test.tsx @@ -341,6 +341,24 @@ describe("ActivityPage", () => { expect(select).toHaveValue("codex"); }); + it("surfaces a timeline summary failure instead of an empty strip", async () => { + // If the series query fails, "No activity in this range" would misread as a + // quiet gateway; the error banner must carry the failure. + vi.spyOn(globalThis, "fetch").mockImplementation(async (input) => { + const url = String(input); + if (url.includes("/v1/usage/summary")) { + return jsonResponse({ detail: "summary exploded" }, 500); + } + if (url.includes("/v1/usage/count")) return jsonResponse({ total: 1 }); + if (url.includes("/v1/usage")) return jsonResponse([entry()]); + return jsonResponse([]); + }); + renderPage(); + await screen.findByText("gpt-4o"); + + expect(await screen.findByText(/summary exploded/)).toBeInTheDocument(); + }); + it("hides the source picker while only one source exists", async () => { // Most gateways only ever see their own traffic; a provenance select with a // single option is noise, so it only appears once a second source shows up. diff --git a/web/src/pages/ActivityPage.tsx b/web/src/pages/ActivityPage.tsx index 7ad27adc6..5dc9fd57a 100644 --- a/web/src/pages/ActivityPage.tsx +++ b/web/src/pages/ActivityPage.tsx @@ -807,7 +807,9 @@ export function ActivityPage() { description="A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored." /> - + {/* The timeline's summary error is included so a failed series request + reads as a failure, not as an empty "No activity in this range" strip. */} +
Date: Tue, 4 Aug 2026 09:43:33 +0000 Subject: [PATCH 8/9] fix(usage): address the review findings on filter parity, drag safety, and tile consistency From khaledosman's review: /v1/usage/series now accepts the same provider, source_label, and status_code filters as /summary (it claimed parity while silently dropping them, letting the stacked chart diverge from the tiles) and rejects an hourly grid wider than the summary's series cap instead of ballooning the payload. TrendChart clamps the drag indices like it already clamped the window prop, presents as a labelled group rather than an image while it owns drag selection, and wires the same drag to touch events so the PWA keeps a zoom affordance. The cache hit rate tile reads the meter-normalized series composition (the numbers its own sparkline uses) instead of mixing a raw numerator into a normalized denominator. Dead labelFor plumbing and a stale duplicated comment are gone, the source-suggestion asymmetry on the Activity page is documented as deliberate, and the JSON-extraction cost note points at the jsonb / persisted-columns escape hatches. Co-Authored-By: Claude Opus 5 (1M context) --- docs/public/openapi.json | 56 ++++++++++++++++++- docs/public/otari.postman_collection.json | 22 +++++++- src/gateway/api/routes/usage.py | 37 ++++++++++-- ...e-BENT_1o4.js => ActivityPage-CcRVRd0J.js} | 2 +- ...ge-CtStwRk-.js => AliasesPage-CXPQdDm6.js} | 2 +- ...ge-0J25eK0m.js => BudgetsPage-Cnrtd_az.js} | 2 +- ...-BBkZMSqE.js => ConfirmDialog-D3P-vj-t.js} | 2 +- ...sPage-DoYdRqgR.js => DocsPage-BgBskDDe.js} | 2 +- ...sPage-JwzirK0P.js => KeysPage-D9JSwodo.js} | 2 +- ...ax1BN.js => ModelScopeControl-wPC6RjBJ.js} | 2 +- ...age-DyZuS75D.js => ModelsPage-CH43id2j.js} | 2 +- ...e-Tme0ej_W.js => OverviewPage-BOO3r0BN.js} | 2 +- ...-B46VzXV5.js => ProvidersPage-enPv456e.js} | 2 +- ...e-CMbg-FaW.js => SettingsPage-VWHKo1Ho.js} | 2 +- ...H6sFfIt.js => TablePagination-D_2uYqKa.js} | 2 +- ...tcA.js => ToolsGuardrailsPage-CBa0KCZv.js} | 2 +- .../dashboard/assets/UsagePage-5U02HhO3.js | 1 + .../dashboard/assets/UsagePage-CjaSd7XG.js | 1 - ...Page-Cfif2r2r.js => UsersPage-AJZgT8Wn.js} | 2 +- .../dashboard/assets/charts-B_hm0rXH.js | 1 - .../dashboard/assets/charts-DNysd9jl.js | 1 + .../{index-C-bDZxkO.js => index-DMrbj_xn.js} | 4 +- src/gateway/static/dashboard/index.html | 2 +- tests/integration/test_usage_summary.py | 56 +++++++++++++++++++ web/src/components/charts.tsx | 41 ++++++++++---- web/src/pages/ActivityPage.tsx | 3 + web/src/pages/UsagePage.test.tsx | 22 +++++--- web/src/pages/UsagePage.tsx | 40 +++++++------ 28 files changed, 251 insertions(+), 64 deletions(-) rename src/gateway/static/dashboard/assets/{ActivityPage-BENT_1o4.js => ActivityPage-CcRVRd0J.js} (98%) rename src/gateway/static/dashboard/assets/{AliasesPage-CtStwRk-.js => AliasesPage-CXPQdDm6.js} (98%) rename src/gateway/static/dashboard/assets/{BudgetsPage-0J25eK0m.js => BudgetsPage-Cnrtd_az.js} (99%) rename src/gateway/static/dashboard/assets/{ConfirmDialog-BBkZMSqE.js => ConfirmDialog-D3P-vj-t.js} (92%) rename src/gateway/static/dashboard/assets/{DocsPage-DoYdRqgR.js => DocsPage-BgBskDDe.js} (99%) rename src/gateway/static/dashboard/assets/{KeysPage-JwzirK0P.js => KeysPage-D9JSwodo.js} (98%) rename src/gateway/static/dashboard/assets/{ModelScopeControl-gV_ax1BN.js => ModelScopeControl-wPC6RjBJ.js} (98%) rename src/gateway/static/dashboard/assets/{ModelsPage-DyZuS75D.js => ModelsPage-CH43id2j.js} (99%) rename src/gateway/static/dashboard/assets/{OverviewPage-Tme0ej_W.js => OverviewPage-BOO3r0BN.js} (98%) rename src/gateway/static/dashboard/assets/{ProvidersPage-B46VzXV5.js => ProvidersPage-enPv456e.js} (99%) rename src/gateway/static/dashboard/assets/{SettingsPage-CMbg-FaW.js => SettingsPage-VWHKo1Ho.js} (99%) rename src/gateway/static/dashboard/assets/{TablePagination-0H6sFfIt.js => TablePagination-D_2uYqKa.js} (98%) rename src/gateway/static/dashboard/assets/{ToolsGuardrailsPage-DkLhKtcA.js => ToolsGuardrailsPage-CBa0KCZv.js} (99%) create mode 100644 src/gateway/static/dashboard/assets/UsagePage-5U02HhO3.js delete mode 100644 src/gateway/static/dashboard/assets/UsagePage-CjaSd7XG.js rename src/gateway/static/dashboard/assets/{UsersPage-Cfif2r2r.js => UsersPage-AJZgT8Wn.js} (98%) delete mode 100644 src/gateway/static/dashboard/assets/charts-B_hm0rXH.js create mode 100644 src/gateway/static/dashboard/assets/charts-DNysd9jl.js rename src/gateway/static/dashboard/assets/{index-C-bDZxkO.js => index-DMrbj_xn.js} (96%) diff --git a/docs/public/openapi.json b/docs/public/openapi.json index e6f250fc3..f4465f2f3 100644 --- a/docs/public/openapi.json +++ b/docs/public/openapi.json @@ -10719,7 +10719,7 @@ }, "/v1/usage/series": { "get": { - "description": "Time series split by one dimension, for the dashboard's stacked charts.\n\nSame filters and window bounds as ``/summary``. The window's top groups by\nspend are returned as their own series; everything past the top eight folds\ninto a single ``other`` series per bucket, so the stack always reconciles\nwith the summary totals. Points are sparse (populated cells only).", + "description": "Time series split by one dimension, for the dashboard's stacked charts.\n\nSame filters and window bounds as ``/summary`` (kept in lockstep: the\ndashboard serializes one filter object for both, and a filter this endpoint\nsilently ignored would make the stacked chart disagree with the tiles beside\nit). The window's top groups by spend are returned as their own series;\neverything past the top eight folds into a single ``other`` series per\nbucket, so the stack always reconciles with the summary totals. Points are\nsparse (populated cells only); the bucket grid is bounded like ``/summary``'s\nseries, so an hourly bucket over a too-wide window is rejected rather than\nballooning the payload.", "operationId": "usage_series_v1_usage_series_get", "parameters": [ { @@ -10813,6 +10813,24 @@ "title": "Status" } }, + { + "description": "Filter to a single failure status code (e.g. 429 for provider rate limits, 402 for missing-pricing rejections). Only error rows carry one, so this filter also restricts to status='error' unless 'status' is given explicitly", + "in": "query", + "name": "status_code", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Filter to a single failure status code (e.g. 429 for provider rate limits, 402 for missing-pricing rejections). Only error rows carry one, so this filter also restricts to status='error' unless 'status' is given explicitly", + "title": "Status Code" + } + }, { "description": "Filter to a single model", "in": "query", @@ -10849,6 +10867,24 @@ "title": "Endpoint" } }, + { + "description": "Filter to a single provider (e.g. 'openai')", + "in": "query", + "name": "provider", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter to a single provider (e.g. 'openai')", + "title": "Provider" + } + }, { "description": "Filter to a single provenance source (e.g. 'gateway' or 'claude_code')", "in": "query", @@ -10867,6 +10903,24 @@ "title": "Source" } }, + { + "description": "Filter to a single session/project label (the source_label carried by imported usage)", + "in": "query", + "name": "source_label", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Filter to a single session/project label (the source_label carried by imported usage)", + "title": "Source Label" + } + }, { "description": "Filter to a single API key id", "in": "query", diff --git a/docs/public/otari.postman_collection.json b/docs/public/otari.postman_collection.json index cbe4287b5..fc1ecc4f4 100644 --- a/docs/public/otari.postman_collection.json +++ b/docs/public/otari.postman_collection.json @@ -2468,7 +2468,7 @@ { "name": "Usage Series", "request": { - "description": "Time series split by one dimension, for the dashboard's stacked charts.\n\nSame filters and window bounds as ``/summary``. The window's top groups by\nspend are returned as their own series; everything past the top eight folds\ninto a single ``other`` series per bucket, so the stack always reconciles\nwith the summary totals. Points are sparse (populated cells only).", + "description": "Time series split by one dimension, for the dashboard's stacked charts.\n\nSame filters and window bounds as ``/summary`` (kept in lockstep: the\ndashboard serializes one filter object for both, and a filter this endpoint\nsilently ignored would make the stacked chart disagree with the tiles beside\nit). The window's top groups by spend are returned as their own series;\neverything past the top eight folds into a single ``other`` series per\nbucket, so the stack always reconciles with the summary totals. Points are\nsparse (populated cells only); the bucket grid is bounded like ``/summary``'s\nseries, so an hourly bucket over a too-wide window is rejected rather than\nballooning the payload.", "header": [], "method": "GET", "url": { @@ -2511,6 +2511,12 @@ "key": "status", "value": "" }, + { + "description": "Filter to a single failure status code (e.g. 429 for provider rate limits, 402 for missing-pricing rejections). Only error rows carry one, so this filter also restricts to status='error' unless 'status' is given explicitly", + "disabled": true, + "key": "status_code", + "value": "" + }, { "description": "Filter to a single model", "disabled": true, @@ -2523,12 +2529,24 @@ "key": "endpoint", "value": "" }, + { + "description": "Filter to a single provider (e.g. 'openai')", + "disabled": true, + "key": "provider", + "value": "" + }, { "description": "Filter to a single provenance source (e.g. 'gateway' or 'claude_code')", "disabled": true, "key": "source", "value": "" }, + { + "description": "Filter to a single session/project label (the source_label carried by imported usage)", + "disabled": true, + "key": "source_label", + "value": "" + }, { "description": "Filter to a single API key id", "disabled": true, @@ -2554,7 +2572,7 @@ "value": "" } ], - "raw": "{{baseUrl}}/v1/usage/series?group_by=&start_date=&end_date=&user_id=&status=&model=&endpoint=&source=&api_key_id=&priced=&counts_toward_budget=&bucket=" + "raw": "{{baseUrl}}/v1/usage/series?group_by=&start_date=&end_date=&user_id=&status=&status_code=&model=&endpoint=&provider=&source=&source_label=&api_key_id=&priced=&counts_toward_budget=&bucket=" } } }, diff --git a/src/gateway/api/routes/usage.py b/src/gateway/api/routes/usage.py index 046d09a39..86c85acaf 100644 --- a/src/gateway/api/routes/usage.py +++ b/src/gateway/api/routes/usage.py @@ -10,7 +10,7 @@ from datetime import UTC, datetime, timedelta from typing import Annotated, Any, Literal -from fastapi import APIRouter, Depends, Query, Response +from fastapi import APIRouter, Depends, HTTPException, Query, Response from pydantic import BaseModel from sqlalchemy import ColumnElement, case, func, null, select from sqlalchemy.ext.asyncio import AsyncSession @@ -654,6 +654,13 @@ def _billed_expr(meter: str, fallback: Any) -> Any: of a missing key and a NULL column both yield NULL, so the fallback chain covers both, ending at 0. ``as_integer`` compiles to the dialect's JSON number cast on SQLite and PostgreSQL alike. + + Cost note: ``billing_meters`` is a plain ``json`` column, so on PostgreSQL + every extraction re-parses the row's text, and the summary runs several + aggregate passes per render. If profiling shows this biting on large + windows, the escapes are a ``jsonb`` migration or persisting the billed + totals as real columns at write time; the fallback semantics here would be + unchanged by either. """ return func.coalesce(UsageLog.billing_meters[meter].as_integer(), fallback, 0) @@ -1041,9 +1048,12 @@ async def usage_series( end_date: datetime | None = Query(default=None, description=_END_DESC), user_id: str | None = Query(default=None, description=_USER_DESC), status: str | None = Query(default=None, description=_STATUS_DESC), + status_code: int | None = Query(default=None, description=_STATUS_CODE_DESC), model: str | None = Query(default=None, description=_MODEL_DESC), endpoint: str | None = Query(default=None, description=_ENDPOINT_DESC), + provider: str | None = Query(default=None, description=_PROVIDER_DESC), source: str | None = Query(default=None, description=_SOURCE_DESC), + source_label: str | None = Query(default=None, description=_SOURCE_LABEL_DESC), api_key_id: str | None = Query(default=None, description=_API_KEY_DESC), priced: bool | None = Query(default=None, description=_PRICED_DESC), counts_toward_budget: bool | None = Query(default=None, description=_COUNTS_DESC), @@ -1051,10 +1061,15 @@ async def usage_series( ) -> UsageGroupedSeries: """Time series split by one dimension, for the dashboard's stacked charts. - Same filters and window bounds as ``/summary``. The window's top groups by - spend are returned as their own series; everything past the top eight folds - into a single ``other`` series per bucket, so the stack always reconciles - with the summary totals. Points are sparse (populated cells only). + Same filters and window bounds as ``/summary`` (kept in lockstep: the + dashboard serializes one filter object for both, and a filter this endpoint + silently ignored would make the stacked chart disagree with the tiles beside + it). The window's top groups by spend are returned as their own series; + everything past the top eight folds into a single ``other`` series per + bucket, so the stack always reconciles with the summary totals. Points are + sparse (populated cells only); the bucket grid is bounded like ``/summary``'s + series, so an hourly bucket over a too-wide window is rejected rather than + ballooning the payload. """ start, end, conditions, totals = await _summary_context( db, @@ -1062,13 +1077,25 @@ async def usage_series( end_date=end_date, user_id=user_id, status=status, + status_code=status_code, model=model, endpoint=endpoint, + provider=provider, source=source, + source_label=source_label, api_key_id=api_key_id, priced=priced, counts_toward_budget=counts_toward_budget, ) + # Finding-5 guard: /summary densifies then caps at _MAX_SERIES_POINTS; this + # endpoint is sparse, so cap the bucket *grid* instead (hourly over the + # 366-day max window would otherwise be ~8.8k buckets x 10 groups per call). + step = timedelta(hours=1) if bucket == "hour" else timedelta(days=1) + if (end - start) / step > _MAX_SERIES_POINTS: + raise HTTPException( + status_code=422, + detail=f"window spans more than {_MAX_SERIES_POINTS} {bucket} buckets; use bucket=day or narrow the range", + ) column = _GROUP_COLUMNS[group_by] groups = await _breakdown(db, column, conditions, totals, limit=_SERIES_TOP_N) diff --git a/src/gateway/static/dashboard/assets/ActivityPage-BENT_1o4.js b/src/gateway/static/dashboard/assets/ActivityPage-CcRVRd0J.js similarity index 98% rename from src/gateway/static/dashboard/assets/ActivityPage-BENT_1o4.js rename to src/gateway/static/dashboard/assets/ActivityPage-CcRVRd0J.js index 4af33ad68..f518dbf11 100644 --- a/src/gateway/static/dashboard/assets/ActivityPage-BENT_1o4.js +++ b/src/gateway/static/dashboard/assets/ActivityPage-CcRVRd0J.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as ct}from"./react-dgEcD0HR.js";import{f as dt,b as ut,a as mt,r as ht,u as pt,c as xt,d as gt,e as Oe,g as ve,h as G,i as ft,A as ce,j as vt,k as bt,P as _t,E as kt,C as Ke,l as $,R as yt,F as be,m as _e,n as $e,Y as St,N as jt}from"./index-C-bDZxkO.js";import{C as wt,T as Nt}from"./charts-B_hm0rXH.js";import{B as q,S as Ct}from"./heroui-DZj66Arc.js";import{u as Pt,r as It,B as Mt}from"./tableSelection-CojkFPwd.js";import{C as Et}from"./ConfirmDialog-BBkZMSqE.js";import{D as At}from"./DataTable-CrQq0sYf.js";import{F as Rt}from"./FilterChips-BLdhUEZK.js";import{T as Tt,S as Dt,P as Ft}from"./TablePagination-0H6sFfIt.js";import"./recharts-BwTTRGtj.js";function Le(t,n){const d=new Date(t);return Number.isNaN(d.getTime())?t:n==="hour"?d.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):d.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const Ot={key:"success",label:"Succeeded",color:"var(--otari-brand)"},Lt={key:"errors",label:"Failed",color:"var(--otari-danger)"},Ut={key:"requests",label:"Requests",color:"var(--otari-brand)"};function Bt({presets:t,extentKey:n,onPreset:d,onSelectRange:a,onSelectFull:i,series:b,bucket:o,windowStart:m,windowEnd:p,loading:_=!1,ariaLabel:S="Request volume over the selected window",action:j}){const x=b.map(r=>r.bucketStart),c=b.length,P=dt(m,p),w=b.some(r=>(r.errors??0)>0),H=w?[Ot,Lt]:[Ut],se=b.map(r=>{const h=Math.min(r.errors??0,r.requests);return w?{x:r.bucketStart,success:r.requests-h,errors:h}:{x:r.bucketStart,requests:r.requests}}),z=c>0?ut(x,m,p):{startIndex:0,endIndex:0},[E,f]=u.useState(null),V=u.useRef(E),W=r=>{V.current=r,f(r)},v=E??z,I=v.endIndex-v.startIndex+1,Y=v.startIndex===0&&v.endIndex>=c-1,T=c>0&&!Y,g=(r,h)=>{if(c===0)return;const N=Math.max(0,Math.min(r,h)),C=Math.min(c-1,Math.max(r,h));if(N===0&&C===c-1){i();return}const ee=ht(x,N,C,o);ee&&a(ee.startIso,ee.endIso)},k=t.findIndex(r=>r.key===n),O=k>=0?t[k].seconds:c*mt(o)/1e3,Z=k>=0?t[k+1]:t.find(r=>r.seconds===null||O!==null&&r.seconds>O),M=r=>{const h=Math.max(1,Math.min(c,Math.round(r))),N=(v.startIndex+v.endIndex+1)/2;let C=Math.round(N-h/2);C=Math.max(0,Math.min(c-h,C)),g(C,C+h-1)},L=()=>{if(Y){Z&&d(Z);return}M(I*2)},de=()=>M(I/2),U=u.useRef(null),A=u.useRef(null),X=r=>{const h=Math.max(0,Math.min(c-I,r));return{startIndex:h,endIndex:h+I-1}},ue=r=>{const h=r.key==="ArrowRight"||r.key==="ArrowUp"?1:r.key==="ArrowLeft"||r.key==="ArrowDown"?-1:r.key==="PageUp"?I:r.key==="PageDown"?-I:r.key==="Home"?-c:r.key==="End"?c:0;if(h===0)return;r.preventDefault();const N=X(v.startIndex+h);N.startIndex!==v.startIndex&&g(N.startIndex,N.endIndex)},ae=r=>{if(!A.current||!U.current)return;const h=U.current.getBoundingClientRect().width;if(h<=0)return;const N=Math.round((r.clientX-A.current.x)/h*c);W(X(A.current.startIndex+N))},J=r=>{r.currentTarget.hasPointerCapture(r.pointerId)&&r.currentTarget.releasePointerCapture(r.pointerId),A.current=null;const h=V.current;W(null),h&&h.startIndex!==z.startIndex&&g(h.startIndex,h.endIndex)},Q=c?v.startIndex/c*100:0,B=c?(v.endIndex+1)/c*100:100,D=Math.max(0,c-I);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.map(r=>e.jsx(q,{size:"sm",variant:n===r.key?"primary":"outline",onPress:()=>d(r),children:r.label},r.key)),e.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",P," · UTC"]}),j]})]}),e.jsxs("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[e.jsxs("span",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:["Requests / ",o==="hour"?"hour":"day"]}),e.jsx(wt,{series:H})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"hidden text-[11px] text-[var(--otari-muted)] sm:inline",children:"drag across the chart to zoom"}),e.jsx(q,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom in",isDisabled:c===0,onPress:de,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M12 5v14M5 12h14",strokeLinecap:"round"})})}),e.jsx(q,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom out",isDisabled:c===0||Y&&!Z,onPress:L,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})})}),T?e.jsx(q,{size:"sm",variant:"ghost",onPress:()=>g(0,c-1),children:"Reset"}):null]})]}),_&&c===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center",children:e.jsx(Ct,{size:"sm"})}):c===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center text-xs text-[var(--otari-muted)]",children:"No activity in this range."}):e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(Nt,{data:se,series:H,formatValue:r=>r.toLocaleString(),formatXTick:r=>Le(r,o),ariaLabel:S,height:90,onSelectRange:g,window:T||E?v:null}),T||E?e.jsx("div",{ref:U,className:"relative h-2.5 w-full rounded-full bg-[var(--otari-bg)]",children:e.jsx("div",{role:"slider","aria-label":"Pan the selected window","aria-valuemin":0,"aria-valuemax":D,"aria-valuenow":Math.min(v.startIndex,D),"aria-valuetext":`Window starting at ${Le(x[v.startIndex]??x[0],o)}`,tabIndex:0,className:"absolute inset-y-0 cursor-grab touch-none rounded-full bg-[var(--otari-brand)]/40 outline-none hover:bg-[var(--otari-brand)]/60 focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)] active:cursor-grabbing",style:{left:`${Q}%`,width:`${Math.max(2,B-Q)}%`},onKeyDown:ue,onPointerDown:r=>{r.preventDefault(),A.current={x:r.clientX,startIndex:v.startIndex},W({...v}),r.currentTarget.setPointerCapture(r.pointerId)},onPointerMove:ae,onPointerUp:J,onPointerCancel:J})}):null]})]})]})}function Kt(t){const[n,d]=ct(),a=u.useCallback(o=>n.get(o)??t[o],[n,t]),i=u.useCallback(o=>{const m=Number.parseInt(n.get(o)??"",10);if(!Number.isNaN(m))return m;const p=Number.parseInt(t[o],10);return Number.isNaN(p)?0:p},[n,t]),b=u.useCallback(o=>{d(m=>{const p=new URLSearchParams(m);for(const[_,S]of Object.entries(o)){const j=String(S);j===""||j===t[_]?p.delete(_):p.set(_,j)}return p},{replace:!0})},[d,t]);return{get:a,getNumber:i,patch:b}}const $t=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function le(t){return t===null?"—":$t.format(t)}function R(t){return t===null?"—":t.toLocaleString()}function qe(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function qt(t){const n=new Date(t);return Number.isNaN(n.getTime())?t:n.toLocaleString()}function zt(t){const n=new Date(t).getTime();if(Number.isNaN(n))return t;const d=Math.max(0,Math.round((Date.now()-n)/1e3));if(d<60)return`${d}s ago`;const a=Math.round(d/60);if(a<60)return`${a}m ago`;const i=Math.round(a/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}const Wt=t=>t.id,Yt=t=>t.status==="error"?"bg-red-50":void 0,Ue=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],Be=[{label:"All",value:""},{label:"Priced",value:"true"},{label:"Unpriced",value:"false"}],Zt=50,Gt=["model","source"],Ht=["source"],Vt={range:ce,start_date:"",end_date:"",status:"",model:"",user_id:"",api_key_id:"",priced:"",source:"",source_label:"",endpoint:"",provider:"",page:"0",size:String(Zt)};function ie(t,n,d){if(n||d)return{start:n||void 0,end:d||void 0};if(t===Ke)return{};const a=G($,t)??G($,ce),i=(a==null?void 0:a.seconds)??null;return{start:i==null?void 0:$e(i),end:void 0}}function ke(t){const n=ie(t,"","");if(n.start)return n;const d=G($,t);return(d==null?void 0:d.seconds)==null?{start:$e(St)}:n}function Xt({status:t}){const n=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${n}`,children:t})}const Jt={gateway:"Gateway",claude_code:"Claude Code",codex:"Codex"};function ye(t){return Jt[t]??t}function F(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function ze(t){const n=t.billing_meters??null,d=F(n?n.total_input_tokens:t.prompt_tokens),a=F(n?n.cache_read_tokens:t.cache_read_tokens),i=F(n?n.cache_write_tokens:t.cache_write_tokens),b=F(n?n.completion_tokens:t.completion_tokens),o=Math.max(0,d-a-i),m=o+a+i+b;return m>0?{fresh:o,cacheRead:a,cacheWrite:i,output:b,total:m}:null}const Qt=[{key:"fresh",label:"Fresh input",fill:"var(--otari-ink)"},{key:"cacheRead",label:"Cache read",fill:"var(--otari-brand)"},{key:"cacheWrite",label:"Cache write",fill:"var(--otari-brand-soft)"},{key:"output",label:"Output",fill:"var(--otari-brand-dark)"}];function es({entry:t}){const n=ze(t);if(n===null)return e.jsx("span",{className:"tabular-nums",children:R(t.total_tokens)});const d=Qt.map(o=>({...o,value:n[o.key]})),a=d.filter(o=>o.value>0).map(o=>`${o.label} ${o.value.toLocaleString()}`).join(", ");let i=0;const b=d.map(o=>{const m=o.value/n.total*100,p={...o,x:i,width:m};return i+=m,p});return e.jsxs("span",{className:"inline-flex flex-col items-end gap-1",title:a,children:[e.jsx("span",{className:"tabular-nums",children:n.total.toLocaleString()}),e.jsx("svg",{viewBox:"0 0 100 4",preserveAspectRatio:"none",role:"img","aria-label":`Token composition: ${a}`,className:"h-1.5 w-20 overflow-hidden rounded-full bg-[var(--otari-brand-tint)]",children:b.filter(o=>o.width>0).map(o=>e.jsx("rect",{x:o.x,y:0,width:o.width,height:4,fill:o.fill},o.key))})]})}function y({label:t,children:n}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:n})]})}function ts({entry:t}){var n,d;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"This request failed. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(y,{label:"Provider",children:t.provider??"—"}),e.jsx(y,{label:"Endpoint",children:t.endpoint}),e.jsx(y,{label:"Source",children:ye(t.source)}),t.source_label?e.jsx(y,{label:"Session",children:t.source_label}):null,e.jsx(y,{label:"User",children:t.user_id??"—"}),e.jsx(y,{label:"API key",children:t.api_key_id??"—"}),e.jsx(y,{label:"Prompt tokens",children:R(t.prompt_tokens)}),e.jsx(y,{label:"Completion tokens",children:R(t.completion_tokens)}),e.jsx(y,{label:"Total tokens",children:R(t.total_tokens)}),e.jsx(y,{label:"Billed tokens",children:e.jsx("span",{title:"Fresh input, cache reads and writes, and output: the tokens this request was priced on, and the total the activity row's bar splits.",children:R(((n=ze(t))==null?void 0:n.total)??null)})}),e.jsx(y,{label:"Cost",children:le(t.cost)}),e.jsx(y,{label:"Cache read tokens",children:R(t.cache_read_tokens)}),e.jsx(y,{label:"Cache write tokens",children:R(t.cache_write_tokens)}),e.jsx(y,{label:"1h cache writes",children:R(t.cache_write_1h_tokens??null)}),e.jsx(y,{label:"Total time",children:qe(t.latency_ms)}),e.jsx(y,{label:"Request ID",children:t.id})]}),(d=t.pricing_breakdown)!=null&&d.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(a=>e.jsxs(y,{label:a.meter.replaceAll("_"," "),children:[R(a.units)," at ",le(a.rate_per_million)," / 1M, ",le(a.cost)]},a.meter))})]}):null]})}function xs(){var Me,Ee,Ae,Re,Te,De;const t=pt(),n=xt(),d=u.useMemo(()=>{const s=new Map;for(const l of n.data??[])s.set(l.id,l.key_name??`${l.id.slice(0,8)}…`);return s},[n.data]),a=Kt(Vt),i=a.get("range"),b=a.get("start_date"),o=a.get("end_date"),m=a.get("status"),p=a.get("model"),_=a.get("user_id"),S=a.get("api_key_id"),j=a.get("priced"),x=a.get("source"),c=a.get("source_label"),P=a.get("endpoint"),w=a.get("provider"),H=Math.max(0,a.getNumber("page")),se=a.getNumber("size"),z=Ft.reduce((s,l)=>Math.abs(l-se)ie(i,b,o)),W=u.useRef(E);u.useEffect(()=>{W.current!==E&&(W.current=E,V(ie(i,b,o)))},[E,i,b,o]);const[v,I]=u.useState(()=>ke(i)),Y=u.useRef(i);u.useEffect(()=>{Y.current!==i&&(Y.current=i,I(ke(i)))},[i]);const T=j==="true"?!0:j==="false"?!1:void 0,g=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:P||void 0,provider:w||void 0,priced:T}),[f,m,p,_,S,x,c,P,w,T]),k=Pt(),O=JSON.stringify(g),Z=u.useRef(O);u.useEffect(()=>{Z.current!==O&&(Z.current=O,a.patch({page:0}),k.clear())},[O,a,k]);const M=gt(g,H,z),L=Oe(g),de=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:P||void 0,provider:w||void 0}),[f,m,_,S,x,c,P,w]),U=ve(de,"day",Gt),A=((Ee=(Me=U.data)==null?void 0:Me.by_model)==null?void 0:Ee.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],X=(n.data??[]).map(s=>({value:s.id,label:s.key_name??`${s.id.slice(0,8)}…`})),ue=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0}),[f,m,p,_,S]),ae=ve(ue,"day",Ht,!!x),J=(Ae=x?ae.data:U.data)==null?void 0:Ae.by_source,Q=u.useMemo(()=>{const s=(J??[]).filter(l=>!l.is_other&&l.key!==null).map(l=>l.key);return x&&!s.includes(x)?[x,...s]:s},[J,x]),B=G($,i)??G($,ce),D=!!(f.start&&v.start&&new Date(f.start).getTime()({start_date:D?f.start:v.start,end_date:D?f.end:void 0,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:P||void 0,provider:w||void 0,priced:T}),[D,f,v,m,p,_,S,x,c,P,w,T]),C=ve(N,h,jt),ee=(((Re=C.data)==null?void 0:Re.series)??[]).map(s=>({bucketStart:s.bucket_start,requests:s.requests,errors:s.errors??0})),K=M.data??[],We=L.isSuccess&&!L.isPlaceholderData?((Te=L.data)==null?void 0:Te.total)??0:null,me=G($,i),Ye=!!(b||o)||i!==ce&&(me==null?void 0:me.seconds)!=null,Ze=!!(m||p.trim()||_||S||j||x||c||P||w||Ye),re=(s,l)=>{var Fe;return((Fe=s.find(it=>it.value===l))==null?void 0:Fe.label)??l},Se=(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),Ge=()=>a.patch({status:"",priced:"",model:"",user_id:"",api_key_id:"",source:"",source_label:"",endpoint:"",provider:""}),He=[...m?[{key:"status",label:"Status",value:re(Ue,m),onClear:()=>a.patch({status:""})}]:[],...j?[{key:"priced",label:"Priced",value:re(Be,j),onClear:()=>a.patch({priced:""})}]:[],..._?[{key:"user",label:"User",value:re(Se,_),onClear:()=>a.patch({user_id:""})}]:[],...p.trim()?[{key:"model",label:"Model",value:p.trim(),onClear:()=>a.patch({model:""})}]:[],...S?[{key:"key",label:"API key",value:re(X,S),onClear:()=>a.patch({api_key_id:""})}]:[],...x?[{key:"source",label:"Source",value:ye(x),onClear:()=>a.patch({source:""})}]:[],...c?[{key:"session",label:"Session",value:c,onClear:()=>a.patch({source_label:""})}]:[],...P?[{key:"endpoint",label:"Endpoint",value:P,onClear:()=>a.patch({endpoint:""})}]:[],...w?[{key:"provider",label:"Provider",value:w,onClear:()=>a.patch({provider:""})}]:[]],he=u.useMemo(()=>K.filter(s=>!s.counts_toward_budget).map(s=>s.id),[K]),Ve=u.useMemo(()=>K.filter(s=>s.counts_toward_budget).map(s=>s.id),[K]),je=It(k.selectedKeys,he),te=je.length,we=k.allMatching||te>0,Xe=u.useMemo(()=>({...g,counts_toward_budget:!1}),[g]),Ne=Oe(Xe,we),ne=Ne.isSuccess?((De=Ne.data)==null?void 0:De.total)??null:null,Je=he.length>0&&te===he.length&&ne!=null&&ne>te,oe=k.allMatching?ne??te:te,pe=vt(),xe=bt(),[Qe,ge]=u.useState(!1),[et,fe]=u.useState(!1),[tt,Ce]=u.useState(null),st=u.useCallback(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Request detail"}),e.jsx(q,{size:"sm",variant:"ghost",onPress:()=>Ce(null),children:"Close"})]}),e.jsx(ts,{entry:s})]}),[]),Pe=()=>k.allMatching?{by_filter:!0,model:g.model,user_id:g.user_id,api_key_id:g.api_key_id,status:g.status,source:g.source,source_label:g.source_label,endpoint:g.endpoint,provider:g.provider,start_date:g.start_date,end_date:g.end_date,priced:g.priced}:{ids:je},at=()=>{pe.mutate(Pe(),{onSuccess:()=>{ge(!1),k.clear()}})},rt=s=>{xe.mutate({...Pe(),...s},{onSuccess:()=>{fe(!1),k.clear()}})},nt=()=>{M.refetch(),L.refetch(),C.refetch(),U.refetch(),x&&ae.refetch()},Ie=s=>{if(s.key===i&&!b&&!o){V(ie(s.key,"","")),I(ke(s.key));return}a.patch({range:s.key,start_date:"",end_date:""})},ot=(s,l)=>a.patch({start_date:s,end_date:l}),lt=u.useMemo(()=>{const s=l=>l===null?"—":d.get(l)??`${l.slice(0,8)}…`;return[{id:"time",header:"Time",cell:l=>e.jsx("span",{title:qt(l.timestamp),className:"text-[var(--otari-muted)]",children:zt(l.timestamp)})},{id:"user",header:"User",cell:l=>l.user_id??"—"},{id:"model",header:"Model",isRowHeader:!0,cell:l=>l.model},{id:"api_key",header:"API key",cell:l=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:s(l.api_key_id)})},{id:"tokens",header:"Tokens",align:"end",cell:l=>e.jsx(es,{entry:l})},{id:"cost",header:"Cost",align:"end",cell:l=>le(l.cost)},{id:"latency",header:"Total time",align:"end",cell:l=>qe(l.latency_ms)},{id:"status",header:"Status",cell:l=>e.jsx(Xt,{status:l.status})}]},[d]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(_t,{title:"Activity",description:"A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored."}),e.jsx(kt,{error:M.error??L.error??C.error}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(Bt,{presets:$,extentKey:r,onPreset:Ie,onSelectRange:ot,onSelectFull:()=>B?Ie(B):void 0,series:ee,bucket:h,windowStart:f.start,windowEnd:f.end,loading:C.isLoading,ariaLabel:"Activity request volume over the selected window",action:e.jsx(yt,{onRefresh:nt,isFetching:M.isFetching,updatedAt:M.dataUpdatedAt})}),e.jsxs(Rt,{chips:He,onClearAll:Ge,children:[e.jsx(be,{id:"filter-status",label:"Status",value:m,onChange:s=>a.patch({status:s}),children:Ue.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsx(be,{id:"filter-priced",label:"Priced?",value:j,onChange:s=>a.patch({priced:s}),children:Be.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),Q.length>1||x?e.jsxs(be,{id:"filter-source",label:"Source",value:x,onChange:s=>a.patch({source:s}),children:[e.jsx("option",{value:"",children:"All"}),Q.map(s=>e.jsx("option",{value:s,children:ye(s)},s))]}):null,e.jsx(_e,{label:"API key",value:S,onChange:s=>a.patch({api_key_id:s}),placeholder:"All keys",options:X}),e.jsx(_e,{label:"User",value:_,onChange:s=>a.patch({user_id:s}),placeholder:"All users",options:Se}),e.jsx(_e,{label:"Model",value:p,onChange:s=>a.patch({model:s}),allowsCustom:!0,placeholder:"Any model",options:(p&&!A.includes(p)?[p,...A]:A).map(s=>({value:s,label:s}))})]})]}),we?e.jsxs(Mt,{selectedCount:oe,allMatching:k.allMatching,matchingTotal:ne,canSelectAllMatching:Je,onSelectAllMatching:k.enableAllMatching,onClear:k.clear,children:[e.jsx(q,{size:"sm",variant:"primary",onPress:()=>fe(!0),children:"Set price"}),e.jsx(q,{size:"sm",variant:"danger",onPress:()=>ge(!0),children:"Delete"})]}):null,e.jsx(At,{ariaLabel:"Activity log",columns:lt,rows:K,getRowKey:Wt,isLoading:M.isLoading,emptyContent:Ze?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:k.selectedKeys,onSelectionChange:k.onSelectionChange,disabledKeys:Ve,onRowAction:s=>Ce(l=>l===s?null:s),rowClassName:Yt,detailKey:tt,renderDetail:st}),e.jsx(Tt,{page:H,pageSize:z,total:We,rowsOnPage:K.length,onPageChange:s=>a.patch({page:s}),onPageSizeChange:s=>a.patch({size:s,page:0}),isFetching:M.isFetching,hasNextFallback:K.length===z}),e.jsx(Et,{isOpen:Qe,onOpenChange:ge,heading:"Delete usage rows",body:`Delete ${oe.toLocaleString()} imported ${oe===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:pe.isPending,error:pe.error,onConfirm:at}),e.jsx(Dt,{isOpen:et,onOpenChange:fe,targetCount:oe,isPending:xe.isPending,error:xe.error,onSubmit:rt})]})}export{xs as ActivityPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as ct}from"./react-dgEcD0HR.js";import{f as dt,b as ut,a as mt,r as ht,u as pt,c as xt,d as gt,e as Oe,g as ve,h as G,i as ft,A as ce,j as vt,k as bt,P as _t,E as kt,C as Ke,l as $,R as yt,F as be,m as _e,n as $e,Y as St,N as jt}from"./index-DMrbj_xn.js";import{C as wt,T as Nt}from"./charts-DNysd9jl.js";import{B as q,S as Ct}from"./heroui-DZj66Arc.js";import{u as Pt,r as It,B as Mt}from"./tableSelection-CojkFPwd.js";import{C as Et}from"./ConfirmDialog-D3P-vj-t.js";import{D as At}from"./DataTable-CrQq0sYf.js";import{F as Rt}from"./FilterChips-BLdhUEZK.js";import{T as Tt,S as Dt,P as Ft}from"./TablePagination-D_2uYqKa.js";import"./recharts-BwTTRGtj.js";function Le(t,n){const d=new Date(t);return Number.isNaN(d.getTime())?t:n==="hour"?d.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):d.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const Ot={key:"success",label:"Succeeded",color:"var(--otari-brand)"},Lt={key:"errors",label:"Failed",color:"var(--otari-danger)"},Ut={key:"requests",label:"Requests",color:"var(--otari-brand)"};function Bt({presets:t,extentKey:n,onPreset:d,onSelectRange:a,onSelectFull:i,series:b,bucket:o,windowStart:m,windowEnd:p,loading:_=!1,ariaLabel:S="Request volume over the selected window",action:j}){const x=b.map(r=>r.bucketStart),c=b.length,P=dt(m,p),w=b.some(r=>(r.errors??0)>0),H=w?[Ot,Lt]:[Ut],se=b.map(r=>{const h=Math.min(r.errors??0,r.requests);return w?{x:r.bucketStart,success:r.requests-h,errors:h}:{x:r.bucketStart,requests:r.requests}}),z=c>0?ut(x,m,p):{startIndex:0,endIndex:0},[E,f]=u.useState(null),V=u.useRef(E),W=r=>{V.current=r,f(r)},v=E??z,I=v.endIndex-v.startIndex+1,Y=v.startIndex===0&&v.endIndex>=c-1,T=c>0&&!Y,g=(r,h)=>{if(c===0)return;const N=Math.max(0,Math.min(r,h)),C=Math.min(c-1,Math.max(r,h));if(N===0&&C===c-1){i();return}const ee=ht(x,N,C,o);ee&&a(ee.startIso,ee.endIso)},k=t.findIndex(r=>r.key===n),O=k>=0?t[k].seconds:c*mt(o)/1e3,Z=k>=0?t[k+1]:t.find(r=>r.seconds===null||O!==null&&r.seconds>O),M=r=>{const h=Math.max(1,Math.min(c,Math.round(r))),N=(v.startIndex+v.endIndex+1)/2;let C=Math.round(N-h/2);C=Math.max(0,Math.min(c-h,C)),g(C,C+h-1)},L=()=>{if(Y){Z&&d(Z);return}M(I*2)},de=()=>M(I/2),U=u.useRef(null),A=u.useRef(null),X=r=>{const h=Math.max(0,Math.min(c-I,r));return{startIndex:h,endIndex:h+I-1}},ue=r=>{const h=r.key==="ArrowRight"||r.key==="ArrowUp"?1:r.key==="ArrowLeft"||r.key==="ArrowDown"?-1:r.key==="PageUp"?I:r.key==="PageDown"?-I:r.key==="Home"?-c:r.key==="End"?c:0;if(h===0)return;r.preventDefault();const N=X(v.startIndex+h);N.startIndex!==v.startIndex&&g(N.startIndex,N.endIndex)},ae=r=>{if(!A.current||!U.current)return;const h=U.current.getBoundingClientRect().width;if(h<=0)return;const N=Math.round((r.clientX-A.current.x)/h*c);W(X(A.current.startIndex+N))},J=r=>{r.currentTarget.hasPointerCapture(r.pointerId)&&r.currentTarget.releasePointerCapture(r.pointerId),A.current=null;const h=V.current;W(null),h&&h.startIndex!==z.startIndex&&g(h.startIndex,h.endIndex)},Q=c?v.startIndex/c*100:0,B=c?(v.endIndex+1)/c*100:100,D=Math.max(0,c-I);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.map(r=>e.jsx(q,{size:"sm",variant:n===r.key?"primary":"outline",onPress:()=>d(r),children:r.label},r.key)),e.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",P," · UTC"]}),j]})]}),e.jsxs("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[e.jsxs("span",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:["Requests / ",o==="hour"?"hour":"day"]}),e.jsx(wt,{series:H})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"hidden text-[11px] text-[var(--otari-muted)] sm:inline",children:"drag across the chart to zoom"}),e.jsx(q,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom in",isDisabled:c===0,onPress:de,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M12 5v14M5 12h14",strokeLinecap:"round"})})}),e.jsx(q,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom out",isDisabled:c===0||Y&&!Z,onPress:L,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})})}),T?e.jsx(q,{size:"sm",variant:"ghost",onPress:()=>g(0,c-1),children:"Reset"}):null]})]}),_&&c===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center",children:e.jsx(Ct,{size:"sm"})}):c===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center text-xs text-[var(--otari-muted)]",children:"No activity in this range."}):e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(Nt,{data:se,series:H,formatValue:r=>r.toLocaleString(),formatXTick:r=>Le(r,o),ariaLabel:S,height:90,onSelectRange:g,window:T||E?v:null}),T||E?e.jsx("div",{ref:U,className:"relative h-2.5 w-full rounded-full bg-[var(--otari-bg)]",children:e.jsx("div",{role:"slider","aria-label":"Pan the selected window","aria-valuemin":0,"aria-valuemax":D,"aria-valuenow":Math.min(v.startIndex,D),"aria-valuetext":`Window starting at ${Le(x[v.startIndex]??x[0],o)}`,tabIndex:0,className:"absolute inset-y-0 cursor-grab touch-none rounded-full bg-[var(--otari-brand)]/40 outline-none hover:bg-[var(--otari-brand)]/60 focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)] active:cursor-grabbing",style:{left:`${Q}%`,width:`${Math.max(2,B-Q)}%`},onKeyDown:ue,onPointerDown:r=>{r.preventDefault(),A.current={x:r.clientX,startIndex:v.startIndex},W({...v}),r.currentTarget.setPointerCapture(r.pointerId)},onPointerMove:ae,onPointerUp:J,onPointerCancel:J})}):null]})]})]})}function Kt(t){const[n,d]=ct(),a=u.useCallback(o=>n.get(o)??t[o],[n,t]),i=u.useCallback(o=>{const m=Number.parseInt(n.get(o)??"",10);if(!Number.isNaN(m))return m;const p=Number.parseInt(t[o],10);return Number.isNaN(p)?0:p},[n,t]),b=u.useCallback(o=>{d(m=>{const p=new URLSearchParams(m);for(const[_,S]of Object.entries(o)){const j=String(S);j===""||j===t[_]?p.delete(_):p.set(_,j)}return p},{replace:!0})},[d,t]);return{get:a,getNumber:i,patch:b}}const $t=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function le(t){return t===null?"—":$t.format(t)}function R(t){return t===null?"—":t.toLocaleString()}function qe(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function qt(t){const n=new Date(t);return Number.isNaN(n.getTime())?t:n.toLocaleString()}function zt(t){const n=new Date(t).getTime();if(Number.isNaN(n))return t;const d=Math.max(0,Math.round((Date.now()-n)/1e3));if(d<60)return`${d}s ago`;const a=Math.round(d/60);if(a<60)return`${a}m ago`;const i=Math.round(a/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}const Wt=t=>t.id,Yt=t=>t.status==="error"?"bg-red-50":void 0,Ue=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],Be=[{label:"All",value:""},{label:"Priced",value:"true"},{label:"Unpriced",value:"false"}],Zt=50,Gt=["model","source"],Ht=["source"],Vt={range:ce,start_date:"",end_date:"",status:"",model:"",user_id:"",api_key_id:"",priced:"",source:"",source_label:"",endpoint:"",provider:"",page:"0",size:String(Zt)};function ie(t,n,d){if(n||d)return{start:n||void 0,end:d||void 0};if(t===Ke)return{};const a=G($,t)??G($,ce),i=(a==null?void 0:a.seconds)??null;return{start:i==null?void 0:$e(i),end:void 0}}function ke(t){const n=ie(t,"","");if(n.start)return n;const d=G($,t);return(d==null?void 0:d.seconds)==null?{start:$e(St)}:n}function Xt({status:t}){const n=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${n}`,children:t})}const Jt={gateway:"Gateway",claude_code:"Claude Code",codex:"Codex"};function ye(t){return Jt[t]??t}function F(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function ze(t){const n=t.billing_meters??null,d=F(n?n.total_input_tokens:t.prompt_tokens),a=F(n?n.cache_read_tokens:t.cache_read_tokens),i=F(n?n.cache_write_tokens:t.cache_write_tokens),b=F(n?n.completion_tokens:t.completion_tokens),o=Math.max(0,d-a-i),m=o+a+i+b;return m>0?{fresh:o,cacheRead:a,cacheWrite:i,output:b,total:m}:null}const Qt=[{key:"fresh",label:"Fresh input",fill:"var(--otari-ink)"},{key:"cacheRead",label:"Cache read",fill:"var(--otari-brand)"},{key:"cacheWrite",label:"Cache write",fill:"var(--otari-brand-soft)"},{key:"output",label:"Output",fill:"var(--otari-brand-dark)"}];function es({entry:t}){const n=ze(t);if(n===null)return e.jsx("span",{className:"tabular-nums",children:R(t.total_tokens)});const d=Qt.map(o=>({...o,value:n[o.key]})),a=d.filter(o=>o.value>0).map(o=>`${o.label} ${o.value.toLocaleString()}`).join(", ");let i=0;const b=d.map(o=>{const m=o.value/n.total*100,p={...o,x:i,width:m};return i+=m,p});return e.jsxs("span",{className:"inline-flex flex-col items-end gap-1",title:a,children:[e.jsx("span",{className:"tabular-nums",children:n.total.toLocaleString()}),e.jsx("svg",{viewBox:"0 0 100 4",preserveAspectRatio:"none",role:"img","aria-label":`Token composition: ${a}`,className:"h-1.5 w-20 overflow-hidden rounded-full bg-[var(--otari-brand-tint)]",children:b.filter(o=>o.width>0).map(o=>e.jsx("rect",{x:o.x,y:0,width:o.width,height:4,fill:o.fill},o.key))})]})}function y({label:t,children:n}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:n})]})}function ts({entry:t}){var n,d;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"This request failed. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(y,{label:"Provider",children:t.provider??"—"}),e.jsx(y,{label:"Endpoint",children:t.endpoint}),e.jsx(y,{label:"Source",children:ye(t.source)}),t.source_label?e.jsx(y,{label:"Session",children:t.source_label}):null,e.jsx(y,{label:"User",children:t.user_id??"—"}),e.jsx(y,{label:"API key",children:t.api_key_id??"—"}),e.jsx(y,{label:"Prompt tokens",children:R(t.prompt_tokens)}),e.jsx(y,{label:"Completion tokens",children:R(t.completion_tokens)}),e.jsx(y,{label:"Total tokens",children:R(t.total_tokens)}),e.jsx(y,{label:"Billed tokens",children:e.jsx("span",{title:"Fresh input, cache reads and writes, and output: the tokens this request was priced on, and the total the activity row's bar splits.",children:R(((n=ze(t))==null?void 0:n.total)??null)})}),e.jsx(y,{label:"Cost",children:le(t.cost)}),e.jsx(y,{label:"Cache read tokens",children:R(t.cache_read_tokens)}),e.jsx(y,{label:"Cache write tokens",children:R(t.cache_write_tokens)}),e.jsx(y,{label:"1h cache writes",children:R(t.cache_write_1h_tokens??null)}),e.jsx(y,{label:"Total time",children:qe(t.latency_ms)}),e.jsx(y,{label:"Request ID",children:t.id})]}),(d=t.pricing_breakdown)!=null&&d.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(a=>e.jsxs(y,{label:a.meter.replaceAll("_"," "),children:[R(a.units)," at ",le(a.rate_per_million)," / 1M, ",le(a.cost)]},a.meter))})]}):null]})}function xs(){var Me,Ee,Ae,Re,Te,De;const t=pt(),n=xt(),d=u.useMemo(()=>{const s=new Map;for(const l of n.data??[])s.set(l.id,l.key_name??`${l.id.slice(0,8)}…`);return s},[n.data]),a=Kt(Vt),i=a.get("range"),b=a.get("start_date"),o=a.get("end_date"),m=a.get("status"),p=a.get("model"),_=a.get("user_id"),S=a.get("api_key_id"),j=a.get("priced"),x=a.get("source"),c=a.get("source_label"),P=a.get("endpoint"),w=a.get("provider"),H=Math.max(0,a.getNumber("page")),se=a.getNumber("size"),z=Ft.reduce((s,l)=>Math.abs(l-se)ie(i,b,o)),W=u.useRef(E);u.useEffect(()=>{W.current!==E&&(W.current=E,V(ie(i,b,o)))},[E,i,b,o]);const[v,I]=u.useState(()=>ke(i)),Y=u.useRef(i);u.useEffect(()=>{Y.current!==i&&(Y.current=i,I(ke(i)))},[i]);const T=j==="true"?!0:j==="false"?!1:void 0,g=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:P||void 0,provider:w||void 0,priced:T}),[f,m,p,_,S,x,c,P,w,T]),k=Pt(),O=JSON.stringify(g),Z=u.useRef(O);u.useEffect(()=>{Z.current!==O&&(Z.current=O,a.patch({page:0}),k.clear())},[O,a,k]);const M=gt(g,H,z),L=Oe(g),de=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:P||void 0,provider:w||void 0}),[f,m,_,S,x,c,P,w]),U=ve(de,"day",Gt),A=((Ee=(Me=U.data)==null?void 0:Me.by_model)==null?void 0:Ee.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],X=(n.data??[]).map(s=>({value:s.id,label:s.key_name??`${s.id.slice(0,8)}…`})),ue=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0}),[f,m,p,_,S]),ae=ve(ue,"day",Ht,!!x),J=(Ae=x?ae.data:U.data)==null?void 0:Ae.by_source,Q=u.useMemo(()=>{const s=(J??[]).filter(l=>!l.is_other&&l.key!==null).map(l=>l.key);return x&&!s.includes(x)?[x,...s]:s},[J,x]),B=G($,i)??G($,ce),D=!!(f.start&&v.start&&new Date(f.start).getTime()({start_date:D?f.start:v.start,end_date:D?f.end:void 0,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:P||void 0,provider:w||void 0,priced:T}),[D,f,v,m,p,_,S,x,c,P,w,T]),C=ve(N,h,jt),ee=(((Re=C.data)==null?void 0:Re.series)??[]).map(s=>({bucketStart:s.bucket_start,requests:s.requests,errors:s.errors??0})),K=M.data??[],We=L.isSuccess&&!L.isPlaceholderData?((Te=L.data)==null?void 0:Te.total)??0:null,me=G($,i),Ye=!!(b||o)||i!==ce&&(me==null?void 0:me.seconds)!=null,Ze=!!(m||p.trim()||_||S||j||x||c||P||w||Ye),re=(s,l)=>{var Fe;return((Fe=s.find(it=>it.value===l))==null?void 0:Fe.label)??l},Se=(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),Ge=()=>a.patch({status:"",priced:"",model:"",user_id:"",api_key_id:"",source:"",source_label:"",endpoint:"",provider:""}),He=[...m?[{key:"status",label:"Status",value:re(Ue,m),onClear:()=>a.patch({status:""})}]:[],...j?[{key:"priced",label:"Priced",value:re(Be,j),onClear:()=>a.patch({priced:""})}]:[],..._?[{key:"user",label:"User",value:re(Se,_),onClear:()=>a.patch({user_id:""})}]:[],...p.trim()?[{key:"model",label:"Model",value:p.trim(),onClear:()=>a.patch({model:""})}]:[],...S?[{key:"key",label:"API key",value:re(X,S),onClear:()=>a.patch({api_key_id:""})}]:[],...x?[{key:"source",label:"Source",value:ye(x),onClear:()=>a.patch({source:""})}]:[],...c?[{key:"session",label:"Session",value:c,onClear:()=>a.patch({source_label:""})}]:[],...P?[{key:"endpoint",label:"Endpoint",value:P,onClear:()=>a.patch({endpoint:""})}]:[],...w?[{key:"provider",label:"Provider",value:w,onClear:()=>a.patch({provider:""})}]:[]],he=u.useMemo(()=>K.filter(s=>!s.counts_toward_budget).map(s=>s.id),[K]),Ve=u.useMemo(()=>K.filter(s=>s.counts_toward_budget).map(s=>s.id),[K]),je=It(k.selectedKeys,he),te=je.length,we=k.allMatching||te>0,Xe=u.useMemo(()=>({...g,counts_toward_budget:!1}),[g]),Ne=Oe(Xe,we),ne=Ne.isSuccess?((De=Ne.data)==null?void 0:De.total)??null:null,Je=he.length>0&&te===he.length&&ne!=null&&ne>te,oe=k.allMatching?ne??te:te,pe=vt(),xe=bt(),[Qe,ge]=u.useState(!1),[et,fe]=u.useState(!1),[tt,Ce]=u.useState(null),st=u.useCallback(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Request detail"}),e.jsx(q,{size:"sm",variant:"ghost",onPress:()=>Ce(null),children:"Close"})]}),e.jsx(ts,{entry:s})]}),[]),Pe=()=>k.allMatching?{by_filter:!0,model:g.model,user_id:g.user_id,api_key_id:g.api_key_id,status:g.status,source:g.source,source_label:g.source_label,endpoint:g.endpoint,provider:g.provider,start_date:g.start_date,end_date:g.end_date,priced:g.priced}:{ids:je},at=()=>{pe.mutate(Pe(),{onSuccess:()=>{ge(!1),k.clear()}})},rt=s=>{xe.mutate({...Pe(),...s},{onSuccess:()=>{fe(!1),k.clear()}})},nt=()=>{M.refetch(),L.refetch(),C.refetch(),U.refetch(),x&&ae.refetch()},Ie=s=>{if(s.key===i&&!b&&!o){V(ie(s.key,"","")),I(ke(s.key));return}a.patch({range:s.key,start_date:"",end_date:""})},ot=(s,l)=>a.patch({start_date:s,end_date:l}),lt=u.useMemo(()=>{const s=l=>l===null?"—":d.get(l)??`${l.slice(0,8)}…`;return[{id:"time",header:"Time",cell:l=>e.jsx("span",{title:qt(l.timestamp),className:"text-[var(--otari-muted)]",children:zt(l.timestamp)})},{id:"user",header:"User",cell:l=>l.user_id??"—"},{id:"model",header:"Model",isRowHeader:!0,cell:l=>l.model},{id:"api_key",header:"API key",cell:l=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:s(l.api_key_id)})},{id:"tokens",header:"Tokens",align:"end",cell:l=>e.jsx(es,{entry:l})},{id:"cost",header:"Cost",align:"end",cell:l=>le(l.cost)},{id:"latency",header:"Total time",align:"end",cell:l=>qe(l.latency_ms)},{id:"status",header:"Status",cell:l=>e.jsx(Xt,{status:l.status})}]},[d]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(_t,{title:"Activity",description:"A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored."}),e.jsx(kt,{error:M.error??L.error??C.error}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(Bt,{presets:$,extentKey:r,onPreset:Ie,onSelectRange:ot,onSelectFull:()=>B?Ie(B):void 0,series:ee,bucket:h,windowStart:f.start,windowEnd:f.end,loading:C.isLoading,ariaLabel:"Activity request volume over the selected window",action:e.jsx(yt,{onRefresh:nt,isFetching:M.isFetching,updatedAt:M.dataUpdatedAt})}),e.jsxs(Rt,{chips:He,onClearAll:Ge,children:[e.jsx(be,{id:"filter-status",label:"Status",value:m,onChange:s=>a.patch({status:s}),children:Ue.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsx(be,{id:"filter-priced",label:"Priced?",value:j,onChange:s=>a.patch({priced:s}),children:Be.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),Q.length>1||x?e.jsxs(be,{id:"filter-source",label:"Source",value:x,onChange:s=>a.patch({source:s}),children:[e.jsx("option",{value:"",children:"All"}),Q.map(s=>e.jsx("option",{value:s,children:ye(s)},s))]}):null,e.jsx(_e,{label:"API key",value:S,onChange:s=>a.patch({api_key_id:s}),placeholder:"All keys",options:X}),e.jsx(_e,{label:"User",value:_,onChange:s=>a.patch({user_id:s}),placeholder:"All users",options:Se}),e.jsx(_e,{label:"Model",value:p,onChange:s=>a.patch({model:s}),allowsCustom:!0,placeholder:"Any model",options:(p&&!A.includes(p)?[p,...A]:A).map(s=>({value:s,label:s}))})]})]}),we?e.jsxs(Mt,{selectedCount:oe,allMatching:k.allMatching,matchingTotal:ne,canSelectAllMatching:Je,onSelectAllMatching:k.enableAllMatching,onClear:k.clear,children:[e.jsx(q,{size:"sm",variant:"primary",onPress:()=>fe(!0),children:"Set price"}),e.jsx(q,{size:"sm",variant:"danger",onPress:()=>ge(!0),children:"Delete"})]}):null,e.jsx(At,{ariaLabel:"Activity log",columns:lt,rows:K,getRowKey:Wt,isLoading:M.isLoading,emptyContent:Ze?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:k.selectedKeys,onSelectionChange:k.onSelectionChange,disabledKeys:Ve,onRowAction:s=>Ce(l=>l===s?null:s),rowClassName:Yt,detailKey:tt,renderDetail:st}),e.jsx(Tt,{page:H,pageSize:z,total:We,rowsOnPage:K.length,onPageChange:s=>a.patch({page:s}),onPageSizeChange:s=>a.patch({size:s,page:0}),isFetching:M.isFetching,hasNextFallback:K.length===z}),e.jsx(Et,{isOpen:Qe,onOpenChange:ge,heading:"Delete usage rows",body:`Delete ${oe.toLocaleString()} imported ${oe===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:pe.isPending,error:pe.error,onConfirm:at}),e.jsx(Dt,{isOpen:et,onOpenChange:fe,targetCount:oe,isPending:xe.isPending,error:xe.error,onSubmit:rt})]})}export{xs as ActivityPage}; diff --git a/src/gateway/static/dashboard/assets/AliasesPage-CtStwRk-.js b/src/gateway/static/dashboard/assets/AliasesPage-CXPQdDm6.js similarity index 98% rename from src/gateway/static/dashboard/assets/AliasesPage-CtStwRk-.js rename to src/gateway/static/dashboard/assets/AliasesPage-CXPQdDm6.js index b14eba313..002a560b9 100644 --- a/src/gateway/static/dashboard/assets/AliasesPage-CtStwRk-.js +++ b/src/gateway/static/dashboard/assets/AliasesPage-CXPQdDm6.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as L}from"./react-dgEcD0HR.js";import{o as T,p as I,q as M,s as R,P as K,E as w,t as P,u as F}from"./index-C-bDZxkO.js";import{u as O,r as $,B as q}from"./tableSelection-CojkFPwd.js";import{C as U}from"./ConfirmDialog-BBkZMSqE.js";import{D as H}from"./DataTable-CrQq0sYf.js";import{F as V}from"./Field-DEJ6Wjg9.js";import{C as k,L as z,I as G,a as J,b as W,f as X,B as j,d as A}from"./heroui-DZj66Arc.js";import{U as Q}from"./UserComboBox-nt7pHfqn.js";const Y=50;function B({label:t,value:a,onChange:n,description:r,placeholder:c="provider:model",autoFocus:l,isRequired:d}){const o=T(),{visible:m,total:h,failed:x}=u.useMemo(()=>{var N;const i=a.trim().toLowerCase(),v=((N=o.data)==null?void 0:N.providers)??[],C=v.flatMap(f=>f.models),p=i?C.filter(f=>f.key.toLowerCase().includes(i)):C;return{visible:p.slice(0,Y),total:p.length,failed:v.filter(f=>!f.ok)}},[o.data,a]),g=o.isLoading?"Loading models from your providers…":x.length>0?`Could not list models for ${x.map(v=>v.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:h>m.length?`Showing ${m.length} of ${h} matches. Keep typing to narrow them.`:r;return e.jsxs(k.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:a,onInputChange:n,onSelectionChange:i=>{i!=null&&n(String(i))},isRequired:d,className:"flex max-w-md flex-col gap-1",children:[e.jsx(z,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(k.InputGroup,{children:[e.jsx(G,{placeholder:c,autoFocus:l}),e.jsx(k.Trigger,{})]}),e.jsx(k.Popover,{children:e.jsx(J,{items:m,className:"max-h-72 overflow-auto",children:i=>e.jsx(W,{id:i.key,textValue:i.key,children:i.key})})}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:g}):null]})}const S=t=>JSON.stringify([t.user_id,t.name]);function Z({userId:t,onChange:a}){const n=F(),r=t!==null,c=(l,d)=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>a(l?"":null),className:r===l?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:d});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Applies to"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"A global alias resolves for every caller. A user-scoped one resolves only for that user, and takes precedence over a global alias of the same name."})]}),e.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[c(!1,"Every caller"),c(!0,"One user")]}),r?e.jsx(Q,{label:"User",value:t??"",onChange:a,users:n.data??[],placeholder:"Pick a user…",description:"Only this user resolves the alias.",unknownHint:e.jsx("span",{className:"text-red-700",children:"No such user. Pick an existing one."})}):null]})}function ee({alias:t,onClose:a}){const n=P(),[r,c]=u.useState(t.target),l=r.trim()!==""&&r.trim()!==t.target,d=()=>{l&&n.mutate({name:t.name,target:r.trim(),user_id:t.user_id},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name}),t.user_id?e.jsxs(e.Fragment,{children:[" for user ",e.jsx("code",{children:t.user_id})]}):null]}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["The alias name and who it applies to (",t.user_id?e.jsx("code",{children:t.user_id}):"every caller",") are the key and cannot be changed here. Delete and recreate to change either."]})]}),e.jsx(B,{label:"Target",value:r,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!l||n.isPending,onPress:d,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function se({onClose:t,initialTarget:a=""}){const n=P(),[r,c]=u.useState(""),[l,d]=u.useState(a),[o,m]=u.useState(null),h=/[:/]/.test(r),x=o===null||o.trim()!=="",g=r.trim()!==""&&l.trim()!==""&&!h&&x,i=()=>{g&&n.mutate({name:r.trim(),target:l.trim(),user_id:o===null?null:o.trim()},{onSuccess:t})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(V,{label:"Alias name",value:r,onChange:c,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:h?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(B,{label:"Target",value:l,onChange:d,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsx(Z,{userId:o,onChange:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!g||n.isPending,onPress:i,children:n.isPending?"Creating…":"Create alias"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function me(){const t=I(),a=M(),[n]=L(),r=n.get("target")??"",[c,l]=u.useState(r!==""),[d,o]=u.useState(null),m=O(),[h,x]=u.useState(!1),[g,i]=u.useState(void 0),[v,C]=u.useState(!1),p=[...t.data??[]].sort((s,b)=>s.name.localeCompare(b.name)||(s.user_id??"").localeCompare(b.user_id??"")),N=p.filter(s=>s.source==="stored").map(S),f=p.filter(s=>s.source!=="stored").map(S),y=$(m.selectedKeys,N),D=new Map(p.map(s=>[S(s),s])),_=async()=>{C(!0),i(void 0);try{for(const s of y){const b=D.get(s);b!==void 0&&await a.mutateAsync({name:b.name,userId:b.user_id})}m.clear(),x(!1)}catch(s){i(s)}finally{C(!1)}},E=u.useMemo(()=>[{id:"alias",header:"Alias",isRowHeader:!0,cell:s=>e.jsx("span",{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name})},{id:"target",header:"Target",cell:s=>e.jsx("span",{className:"break-all text-[var(--otari-muted)]",children:s.target})},{id:"scope",header:"Applies to",cell:s=>s.user_id?e.jsx("code",{className:"break-all text-xs text-[var(--otari-ink)]",children:s.user_id}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Every caller"})},{id:"source",header:"Source",cell:s=>e.jsx(X,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})},{id:"actions",header:"Actions",align:"end",cell:s=>s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{l(!1),o(s)},children:"Edit"}),e.jsx(R,{confirmLabel:"Delete",isPending:a.isPending,onConfirm:()=>a.mutate({name:s.name,userId:s.user_id}),children:"Delete"})]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})}],[a.isPending,a.mutate]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(K,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:c||d?null:e.jsx(j,{variant:"primary",onPress:()=>{o(null),l(!0)},children:"New alias"})}),e.jsx(w,{error:t.error}),c?e.jsx(se,{initialTarget:r,onClose:()=>l(!1)}):null,d?e.jsx(ee,{alias:d,onClose:()=>o(null)}):null,a.error?e.jsx(w,{error:a.error}):null,y.length>0?e.jsx(q,{selectedCount:y.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:m.clear,children:e.jsx(j,{size:"sm",variant:"danger",onPress:()=>x(!0),children:"Delete"})}):null,e.jsx(H,{ariaLabel:"Aliases",columns:E,rows:p,getRowKey:S,isLoading:t.isLoading,emptyContent:"No aliases yet. Create one to give a model a friendly name.",selectionMode:"multiple",selectedKeys:m.selectedKeys,onSelectionChange:m.onSelectionChange,disabledKeys:f}),e.jsx(U,{isOpen:h,onOpenChange:x,heading:"Delete aliases",body:`Delete ${y.length} stored ${y.length===1?"alias":"aliases"}? Callers using ${y.length===1?"it":"them"} will get a model-not-found error.`,confirmLabel:"Delete",isPending:v,error:g,onConfirm:_})]})}export{me as AliasesPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as L}from"./react-dgEcD0HR.js";import{o as T,p as I,q as M,s as R,P as K,E as w,t as P,u as F}from"./index-DMrbj_xn.js";import{u as O,r as $,B as q}from"./tableSelection-CojkFPwd.js";import{C as U}from"./ConfirmDialog-D3P-vj-t.js";import{D as H}from"./DataTable-CrQq0sYf.js";import{F as V}from"./Field-DEJ6Wjg9.js";import{C as k,L as z,I as G,a as J,b as W,f as X,B as j,d as A}from"./heroui-DZj66Arc.js";import{U as Q}from"./UserComboBox-nt7pHfqn.js";const Y=50;function B({label:t,value:a,onChange:n,description:r,placeholder:c="provider:model",autoFocus:l,isRequired:d}){const o=T(),{visible:m,total:h,failed:x}=u.useMemo(()=>{var N;const i=a.trim().toLowerCase(),v=((N=o.data)==null?void 0:N.providers)??[],C=v.flatMap(f=>f.models),p=i?C.filter(f=>f.key.toLowerCase().includes(i)):C;return{visible:p.slice(0,Y),total:p.length,failed:v.filter(f=>!f.ok)}},[o.data,a]),g=o.isLoading?"Loading models from your providers…":x.length>0?`Could not list models for ${x.map(v=>v.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:h>m.length?`Showing ${m.length} of ${h} matches. Keep typing to narrow them.`:r;return e.jsxs(k.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:a,onInputChange:n,onSelectionChange:i=>{i!=null&&n(String(i))},isRequired:d,className:"flex max-w-md flex-col gap-1",children:[e.jsx(z,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(k.InputGroup,{children:[e.jsx(G,{placeholder:c,autoFocus:l}),e.jsx(k.Trigger,{})]}),e.jsx(k.Popover,{children:e.jsx(J,{items:m,className:"max-h-72 overflow-auto",children:i=>e.jsx(W,{id:i.key,textValue:i.key,children:i.key})})}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:g}):null]})}const S=t=>JSON.stringify([t.user_id,t.name]);function Z({userId:t,onChange:a}){const n=F(),r=t!==null,c=(l,d)=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>a(l?"":null),className:r===l?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:d});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Applies to"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"A global alias resolves for every caller. A user-scoped one resolves only for that user, and takes precedence over a global alias of the same name."})]}),e.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[c(!1,"Every caller"),c(!0,"One user")]}),r?e.jsx(Q,{label:"User",value:t??"",onChange:a,users:n.data??[],placeholder:"Pick a user…",description:"Only this user resolves the alias.",unknownHint:e.jsx("span",{className:"text-red-700",children:"No such user. Pick an existing one."})}):null]})}function ee({alias:t,onClose:a}){const n=P(),[r,c]=u.useState(t.target),l=r.trim()!==""&&r.trim()!==t.target,d=()=>{l&&n.mutate({name:t.name,target:r.trim(),user_id:t.user_id},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name}),t.user_id?e.jsxs(e.Fragment,{children:[" for user ",e.jsx("code",{children:t.user_id})]}):null]}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["The alias name and who it applies to (",t.user_id?e.jsx("code",{children:t.user_id}):"every caller",") are the key and cannot be changed here. Delete and recreate to change either."]})]}),e.jsx(B,{label:"Target",value:r,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!l||n.isPending,onPress:d,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function se({onClose:t,initialTarget:a=""}){const n=P(),[r,c]=u.useState(""),[l,d]=u.useState(a),[o,m]=u.useState(null),h=/[:/]/.test(r),x=o===null||o.trim()!=="",g=r.trim()!==""&&l.trim()!==""&&!h&&x,i=()=>{g&&n.mutate({name:r.trim(),target:l.trim(),user_id:o===null?null:o.trim()},{onSuccess:t})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(V,{label:"Alias name",value:r,onChange:c,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:h?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(B,{label:"Target",value:l,onChange:d,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsx(Z,{userId:o,onChange:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!g||n.isPending,onPress:i,children:n.isPending?"Creating…":"Create alias"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function me(){const t=I(),a=M(),[n]=L(),r=n.get("target")??"",[c,l]=u.useState(r!==""),[d,o]=u.useState(null),m=O(),[h,x]=u.useState(!1),[g,i]=u.useState(void 0),[v,C]=u.useState(!1),p=[...t.data??[]].sort((s,b)=>s.name.localeCompare(b.name)||(s.user_id??"").localeCompare(b.user_id??"")),N=p.filter(s=>s.source==="stored").map(S),f=p.filter(s=>s.source!=="stored").map(S),y=$(m.selectedKeys,N),D=new Map(p.map(s=>[S(s),s])),_=async()=>{C(!0),i(void 0);try{for(const s of y){const b=D.get(s);b!==void 0&&await a.mutateAsync({name:b.name,userId:b.user_id})}m.clear(),x(!1)}catch(s){i(s)}finally{C(!1)}},E=u.useMemo(()=>[{id:"alias",header:"Alias",isRowHeader:!0,cell:s=>e.jsx("span",{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name})},{id:"target",header:"Target",cell:s=>e.jsx("span",{className:"break-all text-[var(--otari-muted)]",children:s.target})},{id:"scope",header:"Applies to",cell:s=>s.user_id?e.jsx("code",{className:"break-all text-xs text-[var(--otari-ink)]",children:s.user_id}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Every caller"})},{id:"source",header:"Source",cell:s=>e.jsx(X,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})},{id:"actions",header:"Actions",align:"end",cell:s=>s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{l(!1),o(s)},children:"Edit"}),e.jsx(R,{confirmLabel:"Delete",isPending:a.isPending,onConfirm:()=>a.mutate({name:s.name,userId:s.user_id}),children:"Delete"})]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})}],[a.isPending,a.mutate]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(K,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:c||d?null:e.jsx(j,{variant:"primary",onPress:()=>{o(null),l(!0)},children:"New alias"})}),e.jsx(w,{error:t.error}),c?e.jsx(se,{initialTarget:r,onClose:()=>l(!1)}):null,d?e.jsx(ee,{alias:d,onClose:()=>o(null)}):null,a.error?e.jsx(w,{error:a.error}):null,y.length>0?e.jsx(q,{selectedCount:y.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:m.clear,children:e.jsx(j,{size:"sm",variant:"danger",onPress:()=>x(!0),children:"Delete"})}):null,e.jsx(H,{ariaLabel:"Aliases",columns:E,rows:p,getRowKey:S,isLoading:t.isLoading,emptyContent:"No aliases yet. Create one to give a model a friendly name.",selectionMode:"multiple",selectedKeys:m.selectedKeys,onSelectionChange:m.onSelectionChange,disabledKeys:f}),e.jsx(U,{isOpen:h,onOpenChange:x,heading:"Delete aliases",body:`Delete ${y.length} stored ${y.length===1?"alias":"aliases"}? Callers using ${y.length===1?"it":"them"} will get a model-not-found error.`,confirmLabel:"Delete",isPending:v,error:g,onConfirm:_})]})}export{me as AliasesPage}; diff --git a/src/gateway/static/dashboard/assets/BudgetsPage-0J25eK0m.js b/src/gateway/static/dashboard/assets/BudgetsPage-Cnrtd_az.js similarity index 99% rename from src/gateway/static/dashboard/assets/BudgetsPage-0J25eK0m.js rename to src/gateway/static/dashboard/assets/BudgetsPage-Cnrtd_az.js index f14df0b72..b84908584 100644 --- a/src/gateway/static/dashboard/assets/BudgetsPage-0J25eK0m.js +++ b/src/gateway/static/dashboard/assets/BudgetsPage-Cnrtd_az.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{v as ae,u as re,w as le,x as ie,y as oe,z as de,P as ue,E as T,I as ce,B as me,D as xe}from"./index-C-bDZxkO.js";import{u as ge,r as he,B as pe}from"./tableSelection-CojkFPwd.js";import{C as fe}from"./ConfirmDialog-BBkZMSqE.js";import{D as be}from"./DataTable-CrQq0sYf.js";import{F as $}from"./Field-DEJ6Wjg9.js";import{C as E,I as je,a as ve,b as ye,B as x,d as k,S as Ne}from"./heroui-DZj66Arc.js";const Se=50;function _e({value:t,onChange:r,users:a,label:o,description:l}){const[g,h]=i.useState(""),d=i.useMemo(()=>a.filter(s=>!s.user_id.startsWith("apikey-")).map(s=>({id:s.user_id,label:s.alias?`${s.user_id} (${s.alias})`:s.user_id})),[a]),p=i.useMemo(()=>{const s=g.trim().toLowerCase();return d.filter(u=>!t.includes(u.id)).filter(u=>!s||u.id.toLowerCase().includes(s)||u.label.toLowerCase().includes(s)).slice(0,Se)},[d,t,g]),c=s=>{t.includes(s)||r([...t,s]),h("")},m=s=>r(t.filter(u=>u!==s));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:o}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[s,e.jsx("button",{type:"button","aria-label":`Remove ${s}`,onClick:()=>m(s),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},s))}):null,d.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:h,selectedKey:null,onSelectionChange:s=>{s!=null&&c(String(s))},className:"flex flex-col gap-1",children:[e.jsxs(E.InputGroup,{children:[e.jsx(je,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(ve,{items:p,className:"max-h-72 overflow-auto",children:s=>e.jsx(ye,{id:s.id,textValue:s.label,children:s.label})})})]})]})}const Ce=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function D(t){return Ce.format(t)}const j=86400,W=3600,O=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function we(t){if(t===null)return"No reset";const r=O.find(a=>a.seconds===t);return r?r.label:t%j===0?`Every ${t/j} days`:t%W===0?`Every ${t/W} hours`:`Every ${t}s`}function q(t){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function De(t){const r=t.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function Y(t){return t!==null&&t%j===0?String(t/j):""}function Be({value:t,onChange:r,onInvalidChange:a}){const o=O.some(s=>s.seconds===t),[l,g]=i.useState(!o),[h,d]=i.useState(()=>Y(t)),p=h.trim(),c=Number(p),m=p!==""&&(!Number.isSafeInteger(c)||c<=0);return i.useEffect(()=>{a==null||a(m)},[m,a]),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.map(s=>e.jsx(x,{size:"sm",variant:!l&&t===s.seconds?"primary":"outline",onPress:()=>{g(!1),d(Y(s.seconds)),r(s.seconds)},children:s.label},s.label)),e.jsx(x,{size:"sm",variant:l?"primary":"outline",onPress:()=>g(!0),children:"Custom"})]}),l?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx($,{label:"Every N days",value:h,onChange:s=>{d(s);const u=Number(s.trim());r(s.trim()===""||!Number.isSafeInteger(u)||u<=0?null:u*j)},placeholder:"14",description:m?e.jsx("span",{className:"text-red-700",children:"Enter a whole number of days."}):"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function G({title:t,submitLabel:r,initial:a,error:o,isPending:l,onSubmit:g,onClose:h,assignUsers:d}){const[p,c]=i.useState(a.name??""),[m,s]=i.useState(a.max_budget===null?"":String(a.max_budget)),[u,b]=i.useState(a.budget_duration_sec),[S,v]=i.useState(!1),[B,P]=i.useState([]),f=De(m),A=!l&&f.valid&&!S,C=()=>{A&&g({name:p.trim()||null,max_budget:f.value,budget_duration_sec:u},B)};return e.jsx(k,{children:e.jsxs(k.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(T,{error:o}),e.jsx($,{label:"Name (optional)",value:p,onChange:c,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx($,{label:"Spending limit (USD)",value:m,onChange:s,placeholder:"100.00",description:f.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(Be,{value:u,onChange:b,onInvalidChange:v}),d?e.jsx(_e,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:B,onChange:P,users:d}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:!A,onPress:C,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:h,children:"Cancel"})]})]})})}function Pe({budget:t}){if(t.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=t.total_spend;if(t.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[D(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=t.max_budget*t.user_count,o=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:D(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",D(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(o,l?100:2)}%`}})})]})}function Ae({budgetId:t}){const r=xe(t);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(Ne,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:o.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:D(o.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:q(o.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:q(o.next_reset_at)})]},o.id))})]})})}function Ee({label:t,isPending:r,onConfirm:a}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:t}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}const ke=t=>t.budget_id;function Q(t){return t.split("-")[0]}function z(t){return t.name??Q(t.budget_id)}function Te(){const t=ae(),r=re(),a=le(),o=ie(),l=oe(),g=de(),[h,d]=i.useState(!1),[p,c]=i.useState(null),[m,s]=i.useState(null),[u,b]=i.useState(null),[S,v]=i.useState(null),[B,P]=i.useState(!1),f=ge(),[A,C]=i.useState(!1),[X,F]=i.useState(void 0),[J,H]=i.useState(!1),w=t.data??[],K=t.isLoading,y=w.find(n=>n.budget_id===p)??null,U=w.find(n=>n.budget_id===m)??null,L=!K&&w.length===0&&!h,Z=w.map(n=>n.budget_id),_=he(f.selectedKeys,Z),ee=async()=>{H(!0),F(void 0);try{for(const n of _)await l.mutateAsync(n);f.clear(),C(!1)}catch(n){F(n)}finally{H(!1)}},te=i.useMemo(()=>[{id:"budget",header:"Budget",isRowHeader:!0,cell:n=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:Q(n.budget_id)})]})},{id:"limit",header:"Limit (per user)",cell:n=>n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):D(n.max_budget)},{id:"reset",header:"Reset",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:we(n.budget_duration_sec)})},{id:"users",header:"Users",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:n.user_count})},{id:"usage",header:"Usage",cell:n=>e.jsx(Pe,{budget:n})},{id:"actions",header:"Actions",align:"end",cell:n=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(N=>N===n.budget_id?null:n.budget_id),children:m===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{d(!1),c(n.budget_id)},children:"Edit"}),e.jsx(Ee,{label:z(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})}],[m,l.isPending,l.mutate]),V=async(n,N)=>{P(!0),b(null);const I=await Promise.allSettled(N.map(M=>g.mutateAsync({id:M,body:{budget_id:n}})));P(!1);const R=I.flatMap((M,ne)=>M.status==="rejected"?[N[ne]]:[]);if(R.length>0){v({budgetId:n,userIds:R}),b(new Error(`Budget created, but could not assign it to: ${R.join(", ")}. Retry to try again.`));return}v(null),d(!1)},se=(n,N)=>{if(S){V(S.budgetId,S.userIds);return}b(null),a.mutate(n,{onSuccess:async I=>{if(N.length>0){await V(I.budget_id,N);return}d(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ue,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:h||L?null:e.jsx(x,{variant:"primary",onPress:()=>{c(null),b(null),v(null),d(!0)},children:"Create budget"})}),e.jsx(T,{error:t.error??a.error??o.error??l.error??g.error}),e.jsx(ce,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),L?e.jsx(me,{title:"No budgets yet",description:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit.",actionLabel:"Create your first budget",onAction:()=>{c(null),b(null),v(null),d(!0)}}):null,h?e.jsx(G,{title:"Create budget",submitLabel:S?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??u,isPending:a.isPending||B,assignUsers:r.data??[],onSubmit:se,onClose:()=>{b(null),v(null),d(!1)}}):null,y?e.jsx(G,{title:`Edit budget ${z(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:o.error,isPending:o.isPending,onSubmit:n=>o.mutate({id:y.budget_id,body:n},{onSuccess:()=>c(null)}),onClose:()=>c(null)},y.budget_id):null,_.length>0?e.jsx(pe,{selectedCount:_.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:f.clear,children:e.jsx(x,{size:"sm",variant:"danger",onPress:()=>C(!0),children:"Delete"})}):null,L?null:e.jsx(be,{ariaLabel:"Budgets",columns:te,rows:w,getRowKey:ke,isLoading:K,emptyContent:"No budgets yet. Create one to cap spending.",selectionMode:"multiple",selectedKeys:f.selectedKeys,onSelectionChange:f.onSelectionChange}),U?e.jsx(k,{children:e.jsxs(k.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsxs("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:["Reset history — ",z(U)]}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(null),children:"Close"})]}),e.jsx(Ae,{budgetId:U.budget_id})]})}):null,e.jsx(fe,{isOpen:A,onOpenChange:C,heading:"Delete budgets",body:`Delete ${_.length} ${_.length===1?"budget":"budgets"}? Users on ${_.length===1?"it":"them"} will no longer be capped.`,confirmLabel:"Delete",isPending:J,error:X,onConfirm:ee})]})}export{Te as BudgetsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{v as ae,u as re,w as le,x as ie,y as oe,z as de,P as ue,E as T,I as ce,B as me,D as xe}from"./index-DMrbj_xn.js";import{u as ge,r as he,B as pe}from"./tableSelection-CojkFPwd.js";import{C as fe}from"./ConfirmDialog-D3P-vj-t.js";import{D as be}from"./DataTable-CrQq0sYf.js";import{F as $}from"./Field-DEJ6Wjg9.js";import{C as E,I as je,a as ve,b as ye,B as x,d as k,S as Ne}from"./heroui-DZj66Arc.js";const Se=50;function _e({value:t,onChange:r,users:a,label:o,description:l}){const[g,h]=i.useState(""),d=i.useMemo(()=>a.filter(s=>!s.user_id.startsWith("apikey-")).map(s=>({id:s.user_id,label:s.alias?`${s.user_id} (${s.alias})`:s.user_id})),[a]),p=i.useMemo(()=>{const s=g.trim().toLowerCase();return d.filter(u=>!t.includes(u.id)).filter(u=>!s||u.id.toLowerCase().includes(s)||u.label.toLowerCase().includes(s)).slice(0,Se)},[d,t,g]),c=s=>{t.includes(s)||r([...t,s]),h("")},m=s=>r(t.filter(u=>u!==s));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:o}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[s,e.jsx("button",{type:"button","aria-label":`Remove ${s}`,onClick:()=>m(s),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},s))}):null,d.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:h,selectedKey:null,onSelectionChange:s=>{s!=null&&c(String(s))},className:"flex flex-col gap-1",children:[e.jsxs(E.InputGroup,{children:[e.jsx(je,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(ve,{items:p,className:"max-h-72 overflow-auto",children:s=>e.jsx(ye,{id:s.id,textValue:s.label,children:s.label})})})]})]})}const Ce=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function D(t){return Ce.format(t)}const j=86400,W=3600,O=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function we(t){if(t===null)return"No reset";const r=O.find(a=>a.seconds===t);return r?r.label:t%j===0?`Every ${t/j} days`:t%W===0?`Every ${t/W} hours`:`Every ${t}s`}function q(t){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function De(t){const r=t.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function Y(t){return t!==null&&t%j===0?String(t/j):""}function Be({value:t,onChange:r,onInvalidChange:a}){const o=O.some(s=>s.seconds===t),[l,g]=i.useState(!o),[h,d]=i.useState(()=>Y(t)),p=h.trim(),c=Number(p),m=p!==""&&(!Number.isSafeInteger(c)||c<=0);return i.useEffect(()=>{a==null||a(m)},[m,a]),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.map(s=>e.jsx(x,{size:"sm",variant:!l&&t===s.seconds?"primary":"outline",onPress:()=>{g(!1),d(Y(s.seconds)),r(s.seconds)},children:s.label},s.label)),e.jsx(x,{size:"sm",variant:l?"primary":"outline",onPress:()=>g(!0),children:"Custom"})]}),l?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx($,{label:"Every N days",value:h,onChange:s=>{d(s);const u=Number(s.trim());r(s.trim()===""||!Number.isSafeInteger(u)||u<=0?null:u*j)},placeholder:"14",description:m?e.jsx("span",{className:"text-red-700",children:"Enter a whole number of days."}):"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function G({title:t,submitLabel:r,initial:a,error:o,isPending:l,onSubmit:g,onClose:h,assignUsers:d}){const[p,c]=i.useState(a.name??""),[m,s]=i.useState(a.max_budget===null?"":String(a.max_budget)),[u,b]=i.useState(a.budget_duration_sec),[S,v]=i.useState(!1),[B,P]=i.useState([]),f=De(m),A=!l&&f.valid&&!S,C=()=>{A&&g({name:p.trim()||null,max_budget:f.value,budget_duration_sec:u},B)};return e.jsx(k,{children:e.jsxs(k.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(T,{error:o}),e.jsx($,{label:"Name (optional)",value:p,onChange:c,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx($,{label:"Spending limit (USD)",value:m,onChange:s,placeholder:"100.00",description:f.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(Be,{value:u,onChange:b,onInvalidChange:v}),d?e.jsx(_e,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:B,onChange:P,users:d}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:!A,onPress:C,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:h,children:"Cancel"})]})]})})}function Pe({budget:t}){if(t.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=t.total_spend;if(t.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[D(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=t.max_budget*t.user_count,o=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:D(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",D(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(o,l?100:2)}%`}})})]})}function Ae({budgetId:t}){const r=xe(t);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(Ne,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:o.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:D(o.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:q(o.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:q(o.next_reset_at)})]},o.id))})]})})}function Ee({label:t,isPending:r,onConfirm:a}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:t}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}const ke=t=>t.budget_id;function Q(t){return t.split("-")[0]}function z(t){return t.name??Q(t.budget_id)}function Te(){const t=ae(),r=re(),a=le(),o=ie(),l=oe(),g=de(),[h,d]=i.useState(!1),[p,c]=i.useState(null),[m,s]=i.useState(null),[u,b]=i.useState(null),[S,v]=i.useState(null),[B,P]=i.useState(!1),f=ge(),[A,C]=i.useState(!1),[X,F]=i.useState(void 0),[J,H]=i.useState(!1),w=t.data??[],K=t.isLoading,y=w.find(n=>n.budget_id===p)??null,U=w.find(n=>n.budget_id===m)??null,L=!K&&w.length===0&&!h,Z=w.map(n=>n.budget_id),_=he(f.selectedKeys,Z),ee=async()=>{H(!0),F(void 0);try{for(const n of _)await l.mutateAsync(n);f.clear(),C(!1)}catch(n){F(n)}finally{H(!1)}},te=i.useMemo(()=>[{id:"budget",header:"Budget",isRowHeader:!0,cell:n=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:Q(n.budget_id)})]})},{id:"limit",header:"Limit (per user)",cell:n=>n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):D(n.max_budget)},{id:"reset",header:"Reset",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:we(n.budget_duration_sec)})},{id:"users",header:"Users",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:n.user_count})},{id:"usage",header:"Usage",cell:n=>e.jsx(Pe,{budget:n})},{id:"actions",header:"Actions",align:"end",cell:n=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(N=>N===n.budget_id?null:n.budget_id),children:m===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{d(!1),c(n.budget_id)},children:"Edit"}),e.jsx(Ee,{label:z(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})}],[m,l.isPending,l.mutate]),V=async(n,N)=>{P(!0),b(null);const I=await Promise.allSettled(N.map(M=>g.mutateAsync({id:M,body:{budget_id:n}})));P(!1);const R=I.flatMap((M,ne)=>M.status==="rejected"?[N[ne]]:[]);if(R.length>0){v({budgetId:n,userIds:R}),b(new Error(`Budget created, but could not assign it to: ${R.join(", ")}. Retry to try again.`));return}v(null),d(!1)},se=(n,N)=>{if(S){V(S.budgetId,S.userIds);return}b(null),a.mutate(n,{onSuccess:async I=>{if(N.length>0){await V(I.budget_id,N);return}d(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ue,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:h||L?null:e.jsx(x,{variant:"primary",onPress:()=>{c(null),b(null),v(null),d(!0)},children:"Create budget"})}),e.jsx(T,{error:t.error??a.error??o.error??l.error??g.error}),e.jsx(ce,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),L?e.jsx(me,{title:"No budgets yet",description:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit.",actionLabel:"Create your first budget",onAction:()=>{c(null),b(null),v(null),d(!0)}}):null,h?e.jsx(G,{title:"Create budget",submitLabel:S?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??u,isPending:a.isPending||B,assignUsers:r.data??[],onSubmit:se,onClose:()=>{b(null),v(null),d(!1)}}):null,y?e.jsx(G,{title:`Edit budget ${z(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:o.error,isPending:o.isPending,onSubmit:n=>o.mutate({id:y.budget_id,body:n},{onSuccess:()=>c(null)}),onClose:()=>c(null)},y.budget_id):null,_.length>0?e.jsx(pe,{selectedCount:_.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:f.clear,children:e.jsx(x,{size:"sm",variant:"danger",onPress:()=>C(!0),children:"Delete"})}):null,L?null:e.jsx(be,{ariaLabel:"Budgets",columns:te,rows:w,getRowKey:ke,isLoading:K,emptyContent:"No budgets yet. Create one to cap spending.",selectionMode:"multiple",selectedKeys:f.selectedKeys,onSelectionChange:f.onSelectionChange}),U?e.jsx(k,{children:e.jsxs(k.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsxs("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:["Reset history — ",z(U)]}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(null),children:"Close"})]}),e.jsx(Ae,{budgetId:U.budget_id})]})}):null,e.jsx(fe,{isOpen:A,onOpenChange:C,heading:"Delete budgets",body:`Delete ${_.length} ${_.length===1?"budget":"budgets"}? Users on ${_.length===1?"it":"them"} will no longer be capped.`,confirmLabel:"Delete",isPending:J,error:X,onConfirm:ee})]})}export{Te as BudgetsPage}; diff --git a/src/gateway/static/dashboard/assets/ConfirmDialog-BBkZMSqE.js b/src/gateway/static/dashboard/assets/ConfirmDialog-D3P-vj-t.js similarity index 92% rename from src/gateway/static/dashboard/assets/ConfirmDialog-BBkZMSqE.js rename to src/gateway/static/dashboard/assets/ConfirmDialog-D3P-vj-t.js index 54792a617..09a1e6984 100644 --- a/src/gateway/static/dashboard/assets/ConfirmDialog-BBkZMSqE.js +++ b/src/gateway/static/dashboard/assets/ConfirmDialog-D3P-vj-t.js @@ -1 +1 @@ -import{j as r}from"./tanstack-query-1t81HyiD.js";import{E as j}from"./index-C-bDZxkO.js";import{A as e,B as l}from"./heroui-DZj66Arc.js";function p({isOpen:s,onOpenChange:a,heading:n,body:o,confirmLabel:t,confirmVariant:c="danger",isPending:i,error:d,onConfirm:x}){return r.jsx(e,{isOpen:s,onOpenChange:a,children:s?r.jsx(e.Backdrop,{children:r.jsx(e.Container,{placement:"center",size:"md",children:r.jsxs(e.Dialog,{children:[r.jsx(e.Header,{children:r.jsx(e.Heading,{children:n})}),r.jsxs(e.Body,{className:"flex flex-col gap-4",children:[r.jsx("div",{className:"text-sm text-[var(--otari-muted)]",children:o}),r.jsx(j,{error:d})]}),r.jsxs(e.Footer,{children:[r.jsx(l,{variant:"ghost",isDisabled:i,onPress:()=>a(!1),children:"Cancel"}),r.jsx(l,{variant:c,isPending:i,onPress:x,children:t})]})]})})}):null})}export{p as C}; +import{j as r}from"./tanstack-query-1t81HyiD.js";import{E as j}from"./index-DMrbj_xn.js";import{A as e,B as l}from"./heroui-DZj66Arc.js";function p({isOpen:s,onOpenChange:a,heading:n,body:o,confirmLabel:t,confirmVariant:c="danger",isPending:i,error:d,onConfirm:x}){return r.jsx(e,{isOpen:s,onOpenChange:a,children:s?r.jsx(e.Backdrop,{children:r.jsx(e.Container,{placement:"center",size:"md",children:r.jsxs(e.Dialog,{children:[r.jsx(e.Header,{children:r.jsx(e.Heading,{children:n})}),r.jsxs(e.Body,{className:"flex flex-col gap-4",children:[r.jsx("div",{className:"text-sm text-[var(--otari-muted)]",children:o}),r.jsx(j,{error:d})]}),r.jsxs(e.Footer,{children:[r.jsx(l,{variant:"ghost",isDisabled:i,onPress:()=>a(!1),children:"Cancel"}),r.jsx(l,{variant:c,isPending:i,onPress:x,children:t})]})]})})}):null})}export{p as C}; diff --git a/src/gateway/static/dashboard/assets/DocsPage-DoYdRqgR.js b/src/gateway/static/dashboard/assets/DocsPage-BgBskDDe.js similarity index 99% rename from src/gateway/static/dashboard/assets/DocsPage-DoYdRqgR.js rename to src/gateway/static/dashboard/assets/DocsPage-BgBskDDe.js index 8164a7c3f..80c7735f1 100644 --- a/src/gateway/static/dashboard/assets/DocsPage-DoYdRqgR.js +++ b/src/gateway/static/dashboard/assets/DocsPage-BgBskDDe.js @@ -1,4 +1,4 @@ -import{j as re}from"./tanstack-query-1t81HyiD.js";import{P as gi}from"./index-C-bDZxkO.js";import{d as ct}from"./heroui-DZj66Arc.js";import{g as nr}from"./react-dgEcD0HR.js";function yi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi={};function ht(e,t){return(bi.jsx?xi:ki).test(e)}const wi=/[ \t\n\f\r]/g;function Si(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(wi,"")===""}class Ke{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function tr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ke(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ci=0;const L=Te(),Y=Te(),Dn=Te(),E=Te(),$=Te(),ve=Te(),te=Te();function Te(){return 2**++Ci}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:ve,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ai.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Di);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Ti,zi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function zi(e){return"-"+e.toLowerCase()}function Di(e){return e.charAt(1).toUpperCase()}const Li=tr([rr,Ei,or,ar,sr],"html"),qn=tr([rr,vi,or,ar,sr],"svg");function _i(e){return e.join(" ").trim()}var De={},mn,dt;function Ri(){if(dt)return mn;dt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=` +import{j as re}from"./tanstack-query-1t81HyiD.js";import{P as gi}from"./index-DMrbj_xn.js";import{d as ct}from"./heroui-DZj66Arc.js";import{g as nr}from"./react-dgEcD0HR.js";function yi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi={};function ht(e,t){return(bi.jsx?xi:ki).test(e)}const wi=/[ \t\n\f\r]/g;function Si(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(wi,"")===""}class Ke{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function tr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ke(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ci=0;const L=Te(),Y=Te(),Dn=Te(),E=Te(),$=Te(),ve=Te(),te=Te();function Te(){return 2**++Ci}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:ve,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ai.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Di);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Ti,zi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function zi(e){return"-"+e.toLowerCase()}function Di(e){return e.charAt(1).toUpperCase()}const Li=tr([rr,Ei,or,ar,sr],"html"),qn=tr([rr,vi,or,ar,sr],"svg");function _i(e){return e.join(" ").trim()}var De={},mn,dt;function Ri(){if(dt)return mn;dt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=` `,u="/",h="*",c="",p="comment",f="declaration";function g(S,y){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];y=y||{};var v=1,C=1;function R(D){var T=D.match(t);T&&(v+=T.length);var U=D.lastIndexOf(s);C=~U?D.length-U:C+D.length}function F(){var D={line:v,column:C};return function(T){return T.position=new b(D),j(),T}}function b(D){this.start=D,this.end={line:v,column:C},this.source=y.source}b.prototype.content=S;function M(D){var T=new Error(y.source+":"+v+":"+C+": "+D);if(T.reason=D,T.filename=y.source,T.line=v,T.column=C,T.source=S,!y.silent)throw T}function H(D){var T=D.exec(S);if(T){var U=T[0];return R(U),S=S.slice(U.length),T}}function j(){H(n)}function k(D){var T;for(D=D||[];T=A();)T!==!1&&D.push(T);return D}function A(){var D=F();if(!(u!=S.charAt(0)||h!=S.charAt(1))){for(var T=2;c!=S.charAt(T)&&(h!=S.charAt(T)||u!=S.charAt(T+1));)++T;if(T+=2,c===S.charAt(T-1))return M("End of comment missing");var U=S.slice(2,T-2);return C+=2,R(U),S=S.slice(T),C+=2,D({type:p,comment:U})}}function P(){var D=F(),T=H(r);if(T){if(A(),!H(i))return M("property missing ':'");var U=H(o),K=D({type:f,property:w(T[0].replace(e,c)),value:U?w(U[0].replace(e,c)):c});return H(l),K}}function q(){var D=[];k(D);for(var T;T=P();)T!==!1&&(D.push(T),k(D));return D}return j(),q()}function w(S){return S?S.replace(a,c):c}return mn=g,mn}var gt;function Fi(){if(gt)return De;gt=1;var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(De,"__esModule",{value:!0}),De.default=n;const t=e(Ri());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),a=typeof i=="function";return l.forEach(s=>{if(s.type!=="declaration")return;const{property:u,value:h}=s;a?i(u,h,s):h&&(o=o||{},o[u]=h)}),o}return De}var Be={},yt;function Oi(){if(yt)return Be;yt=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(u){return!u||n.test(u)||e.test(u)},l=function(u,h){return h.toUpperCase()},a=function(u,h){return"".concat(h,"-")},s=function(u,h){return h===void 0&&(h={}),o(u)?u:(u=u.toLowerCase(),h.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(t,l))};return Be.camelCase=s,Be}var je,kt;function Mi(){if(kt)return je;kt=1;var e=je&&je.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Fi()),n=Oi();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(a,s){a&&s&&(l[(0,n.camelCase)(a,o)]=s)}),l}return r.default=r,je=r,je}var Ni=Mi();const Bi=nr(Ni),ur=cr("end"),Un=cr("start");function cr(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ji(e){const t=Un(e),n=ur(e);if(t&&n)return{start:t,end:n}}function Ue(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xt(e.position):"start"in e||"end"in e?xt(e):"line"in e||"column"in e?_n(e):""}function _n(e){return bt(e&&e.line)+":"+bt(e&&e.column)}function xt(e){return _n(e&&e.start)+"-"+_n(e&&e.end)}function bt(e){return e&&typeof e=="number"?e:1}class G extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?o.ruleId=r:(o.source=r.slice(0,s),o.ruleId=r.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){const s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ue(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}G.prototype.file="";G.prototype.name="";G.prototype.reason="";G.prototype.message="";G.prototype.stack="";G.prototype.column=void 0;G.prototype.line=void 0;G.prototype.ancestors=void 0;G.prototype.cause=void 0;G.prototype.fatal=void 0;G.prototype.place=void 0;G.prototype.ruleId=void 0;G.prototype.source=void 0;const Vn={}.hasOwnProperty,Hi=new Map,qi=/[A-Z]/g,Ui=new Set(["table","tbody","thead","tfoot","tr"]),Vi=new Set(["td","th"]),hr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $i(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Zi(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ji(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qn:Li,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=fr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function fr(e,t,n){if(t.type==="element")return Wi(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Yi(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Qi(e,t,n);if(t.type==="mdxjsEsm")return Ki(e,t);if(t.type==="root")return Xi(e,t,n);if(t.type==="text")return Gi(e,t)}function Wi(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=qn,e.schema=i),e.ancestors.push(t);const o=mr(e,t.tagName,!1),l=el(e,t);let a=Wn(e,t);return Ui.has(t.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!Si(s):!0})),pr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Yi(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}We(e,t.position)}function Ki(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);We(e,t.position)}function Qi(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=qn,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:mr(e,t.name,!0),l=nl(e,t),a=Wn(e,t);return pr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Xi(e,t,n){const r={};return $n(r,Wn(e,t)),e.create(t,e.Fragment,r,n)}function Gi(e,t){return t.value}function pr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $n(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ji(e,t,n){return r;function r(i,o,l,a){const u=Array.isArray(l.children)?n:t;return a?u(o,l,a):u(o,l)}}function Zi(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),s=Un(r);return t(i,o,l,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function el(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Vn.call(t.properties,i)){const o=tl(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&Vi.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function nl(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else We(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else We(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Wn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Hi;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(ie(e,e.length,0,t),e):t}const Ct={}.hasOwnProperty;function gr(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ce(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const J=be(/[A-Za-z]/),X=be(/[\dA-Za-z]/),hl=be(/[#-'*+\--9=?A-Z^-~]/);function rn(e){return e!==null&&(e<32||e===127)}const Rn=be(/\d/),fl=be(/[\dA-Fa-f]/),pl=be(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function W(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}const sn=be(new RegExp("\\p{P}|\\p{S}","u")),Ie=be(/\s/);function be(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fe(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function B(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(s){return O(s)?(e.enter(n),a(s)):t(s)}function a(s){return O(s)&&o++l))return;const M=t.events.length;let H=M,j,k;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(j){k=t.events[H][1].end;break}j=!0}for(y(r),b=M;bC;){const F=n[R];t.containerState=F[1],F[0].exit.call(t,e)}n.length=C}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function kl(e,t,n){return B(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _e(e){if(e===null||W(e)||Ie(e))return 1;if(sn(e))return 2}function un(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};vt(c,-s),vt(p,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:s>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=le(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=le(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=le(u,un(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=le(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,u=le(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,ie(e,r-1,n-r+3,u),n=r+u.length-h-2;break}}for(n=-1;++n0&&O(b)?B(e,v,"linePrefix",o+1)(b):v(b)}function v(b){return b===null||z(b)?e.check(It,w,R)(b):(e.enter("codeFlowValue"),C(b))}function C(b){return b===null||z(b)?(e.exit("codeFlowValue"),v(b)):(e.consume(b),C)}function R(b){return e.exit("codeFenced"),t(b)}function F(b,M,H){let j=0;return k;function k(T){return b.enter("lineEnding"),b.consume(T),b.exit("lineEnding"),A}function A(T){return b.enter("codeFencedFence"),O(T)?B(b,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):P(T)}function P(T){return T===a?(b.enter("codeFencedFenceSequence"),q(T)):H(T)}function q(T){return T===a?(j++,b.consume(T),q):j>=l?(b.exit("codeFencedFenceSequence"),O(T)?B(b,D,"whitespace")(T):D(T)):H(T)}function D(T){return T===null||z(T)?(b.exit("codeFencedFence"),M(T)):H(T)}}}function zl(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const gn={name:"codeIndented",tokenize:Ll},Dl={partial:!0,tokenize:_l};function Ll(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),B(e,o,"linePrefix",5)(u)}function o(u){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?s(u):z(u)?e.attempt(Dl,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||z(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),t(u)}}function _l(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):B(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):z(l)?i(l):n(l)}}const Rl={name:"codeText",previous:Ol,resolve:Fl,tokenize:Ml};function Fl(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&He(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),He(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),He(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Sr(e,t,n,r,i,o,l,a,s){const u=s||Number.POSITIVE_INFINITY;let h=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||rn(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||z(y)?n(y):(e.consume(y),y===92?g:f)}function g(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function w(y){return!h&&(y===null||y===41||W(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):h999||f===null||f===91||f===93&&!s||f===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===null||f===91||f===93||z(f)||a++>999?(e.exit("chunkString"),h(f)):(e.consume(f),s||(s=!O(f)),f===92?p:c)}function p(f){return f===91||f===92||f===93?(e.consume(f),a++,c):c(f)}}function Er(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,s):n(p)}function s(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),s(l)):p===null?n(p):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),B(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===l||p===null||z(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:h)}function c(p){return p===l||p===92?(e.consume(p),h):h(p)}}function Ve(e,t){let n;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):O(i)?B(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const $l={name:"definition",tokenize:Yl},Wl={partial:!0,tokenize:Kl};function Yl(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),l(f)}function l(f){return Cr.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=ce(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),s):n(f)}function s(f){return W(f)?Ve(e,u)(f):u(f)}function u(f){return Sr(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function h(f){return e.attempt(Wl,c,c)(f)}function c(f){return O(f)?B(e,p,"whitespace")(f):p(f)}function p(f){return f===null||z(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function Kl(e,t,n){return r;function r(a){return W(a)?Ve(e,i)(a):n(a)}function i(a){return Er(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return O(a)?B(e,l,"whitespace")(a):l(a)}function l(a){return a===null||z(a)?t(a):n(a)}}const Ql={name:"hardBreakEscape",tokenize:Xl};function Xl(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return z(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Gl={name:"headingAtx",resolve:Jl,tokenize:Zl};function Jl(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ie(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Zl(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),o(h)}function o(h){return e.enter("atxHeadingSequence"),l(h)}function l(h){return h===35&&r++<6?(e.consume(h),l):h===null||W(h)?(e.exit("atxHeadingSequence"),a(h)):n(h)}function a(h){return h===35?(e.enter("atxHeadingSequence"),s(h)):h===null||z(h)?(e.exit("atxHeading"),t(h)):O(h)?B(e,a,"whitespace")(h):(e.enter("atxHeadingText"),u(h))}function s(h){return h===35?(e.consume(h),s):(e.exit("atxHeadingSequence"),a(h))}function u(h){return h===null||h===35||W(h)?(e.exit("atxHeadingText"),a(h)):(e.consume(h),u)}}const eo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],At=["pre","script","style","textarea"],no={concrete:!0,name:"htmlFlow",resolveTo:io,tokenize:lo},to={partial:!0,tokenize:ao},ro={partial:!0,tokenize:oo};function io(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function lo(e,t,n){const r=this;let i,o,l,a,s;return u;function u(d){return h(d)}function h(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,w):d===63?(e.consume(d),i=3,r.interrupt?t:m):J(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function p(d){return d===45?(e.consume(d),i=2,f):d===91?(e.consume(d),i=5,a=0,g):J(d)?(e.consume(d),i=4,r.interrupt?t:m):n(d)}function f(d){return d===45?(e.consume(d),r.interrupt?t:m):n(d)}function g(d){const se="CDATA[";return d===se.charCodeAt(a++)?(e.consume(d),a===se.length?r.interrupt?t:P:g):n(d)}function w(d){return J(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function S(d){if(d===null||d===47||d===62||W(d)){const se=d===47,we=l.toLowerCase();return!se&&!o&&At.includes(we)?(i=1,r.interrupt?t(d):P(d)):eo.includes(l.toLowerCase())?(i=6,se?(e.consume(d),y):r.interrupt?t(d):P(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(d):o?v(d):C(d))}return d===45||X(d)?(e.consume(d),l+=String.fromCharCode(d),S):n(d)}function y(d){return d===62?(e.consume(d),r.interrupt?t:P):n(d)}function v(d){return O(d)?(e.consume(d),v):k(d)}function C(d){return d===47?(e.consume(d),k):d===58||d===95||J(d)?(e.consume(d),R):O(d)?(e.consume(d),C):k(d)}function R(d){return d===45||d===46||d===58||d===95||X(d)?(e.consume(d),R):F(d)}function F(d){return d===61?(e.consume(d),b):O(d)?(e.consume(d),F):C(d)}function b(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),s=d,M):O(d)?(e.consume(d),b):H(d)}function M(d){return d===s?(e.consume(d),s=null,j):d===null||z(d)?n(d):(e.consume(d),M)}function H(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||W(d)?F(d):(e.consume(d),H)}function j(d){return d===47||d===62||O(d)?C(d):n(d)}function k(d){return d===62?(e.consume(d),A):n(d)}function A(d){return d===null||z(d)?P(d):O(d)?(e.consume(d),A):n(d)}function P(d){return d===45&&i===2?(e.consume(d),U):d===60&&i===1?(e.consume(d),K):d===62&&i===4?(e.consume(d),ae):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),pe):z(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(to,me,q)(d)):d===null||z(d)?(e.exit("htmlFlowData"),q(d)):(e.consume(d),P)}function q(d){return e.check(ro,D,me)(d)}function D(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),T}function T(d){return d===null||z(d)?q(d):(e.enter("htmlFlowData"),P(d))}function U(d){return d===45?(e.consume(d),m):P(d)}function K(d){return d===47?(e.consume(d),l="",oe):P(d)}function oe(d){if(d===62){const se=l.toLowerCase();return At.includes(se)?(e.consume(d),ae):P(d)}return J(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),oe):P(d)}function pe(d){return d===93?(e.consume(d),m):P(d)}function m(d){return d===62?(e.consume(d),ae):d===45&&i===2?(e.consume(d),m):P(d)}function ae(d){return d===null||z(d)?(e.exit("htmlFlowData"),me(d)):(e.consume(d),ae)}function me(d){return e.exit("htmlFlow"),t(d)}}function oo(e,t,n){const r=this;return i;function i(l){return z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ao(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Qe,t,n)}}const so={name:"htmlText",tokenize:uo};function uo(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),s}function s(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),F):m===63?(e.consume(m),C):J(m)?(e.consume(m),H):n(m)}function u(m){return m===45?(e.consume(m),h):m===91?(e.consume(m),o=0,g):J(m)?(e.consume(m),v):n(m)}function h(m){return m===45?(e.consume(m),f):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):z(m)?(l=c,K(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),f):c(m)}function f(m){return m===62?U(m):m===45?p(m):c(m)}function g(m){const ae="CDATA[";return m===ae.charCodeAt(o++)?(e.consume(m),o===ae.length?w:g):n(m)}function w(m){return m===null?n(m):m===93?(e.consume(m),S):z(m)?(l=w,K(m)):(e.consume(m),w)}function S(m){return m===93?(e.consume(m),y):w(m)}function y(m){return m===62?U(m):m===93?(e.consume(m),y):w(m)}function v(m){return m===null||m===62?U(m):z(m)?(l=v,K(m)):(e.consume(m),v)}function C(m){return m===null?n(m):m===63?(e.consume(m),R):z(m)?(l=C,K(m)):(e.consume(m),C)}function R(m){return m===62?U(m):C(m)}function F(m){return J(m)?(e.consume(m),b):n(m)}function b(m){return m===45||X(m)?(e.consume(m),b):M(m)}function M(m){return z(m)?(l=M,K(m)):O(m)?(e.consume(m),M):U(m)}function H(m){return m===45||X(m)?(e.consume(m),H):m===47||m===62||W(m)?j(m):n(m)}function j(m){return m===47?(e.consume(m),U):m===58||m===95||J(m)?(e.consume(m),k):z(m)?(l=j,K(m)):O(m)?(e.consume(m),j):U(m)}function k(m){return m===45||m===46||m===58||m===95||X(m)?(e.consume(m),k):A(m)}function A(m){return m===61?(e.consume(m),P):z(m)?(l=A,K(m)):O(m)?(e.consume(m),A):j(m)}function P(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,q):z(m)?(l=P,K(m)):O(m)?(e.consume(m),P):(e.consume(m),D)}function q(m){return m===i?(e.consume(m),i=void 0,T):m===null?n(m):z(m)?(l=q,K(m)):(e.consume(m),q)}function D(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||W(m)?j(m):(e.consume(m),D)}function T(m){return m===47||m===62||W(m)?j(m):n(m)}function U(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function K(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),oe}function oe(m){return O(m)?B(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):pe(m)}function pe(m){return e.enter("htmlTextData"),l(m)}}const Qn={name:"labelEnd",resolveAll:po,resolveTo:mo,tokenize:go},co={tokenize:yo},ho={tokenize:ko},fo={tokenize:xo};function po(e){let t=-1;const n=[];for(;++t=3&&(u===null||z(u))?(e.exit("thematicBreak"),t(u)):n(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),O(u)?B(e,a,"whitespace")(u):a(u))}}const Z={continuation:{tokenize:Po},exit:Do,name:"list",tokenize:Ao},Io={partial:!0,tokenize:Lo},To={partial:!0,tokenize:zo};function Ao(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(f){const g=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Rn(f)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(tn,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(f)}return n(f)}function s(f){return Rn(f)&&++l<10?(e.consume(f),s):(!r.interrupt||l<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Qe,r.interrupt?n:h,e.attempt(Io,p,c))}function h(f){return r.containerState.initialBlankLine=!0,o++,p(f)}function c(f){return O(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Po(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Qe,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,B(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!O(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(To,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,B(e,e.attempt(Z,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function zo(e,t,n){const r=this;return B(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function Do(e){e.exit(this.containerState.type)}function Lo(e,t,n){const r=this;return B(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!O(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Pt={name:"setextUnderline",resolveTo:_o,tokenize:Ro};function _o(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Ro(e,t,n){const r=this;let i;return o;function o(u){let h=r.events.length,c;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){c=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),O(u)?B(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||z(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Fo={tokenize:Oo};function Oo(e){const t=this,n=e.attempt(Qe,r,e.attempt(this.parser.constructs.flowInitial,i,B(e,e.attempt(this.parser.constructs.flow,i,e.attempt(jl,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Mo={resolveAll:Ir()},No=vr("string"),Bo=vr("text");function vr(e){return{resolveAll:Ir(e==="text"?jo:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(h){return u(h)?o(h):a(h)}function a(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),s}function s(h){return u(h)?(n.exit("data"),o(h)):(n.consume(h),s)}function u(h){if(h===null)return!0;const c=i[h];let p=-1;if(c)for(;++p-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Zo(e,t){let n=-1;const r=[];let i;for(;++n0){const ue=_.tokenStack[_.tokenStack.length-1];(ue[1]||Dt).call(_,void 0,ue[0])}for(I.position={start:xe(x.length>0?x[0][1].start:{line:1,column:1,offset:0}),end:xe(x.length>0?x[x.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++V=x)return o.format(Math.round(n/x),l);return o.format(n,"second")}function de(t){if(!t.expires_at)return!1;const a=new Date(t.expires_at).getTime();return!Number.isNaN(a)&&aString(r).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}T${n(a.getHours())}:${n(a.getMinutes())}`}const me=t=>(t??"").startsWith("apikey-"),K=t=>t.key_name??t.id,xe=t=>t.id;function M({label:t,value:a,multiline:n=!1,fieldRef:r}){const d=i.useRef(null),o=r??d,[l,x]=i.useState(!1),[g,p]=i.useState(!1),c=async()=>{var m,y,h;(m=o.current)==null||m.focus(),(y=o.current)==null||y.select();try{if((h=navigator.clipboard)!=null&&h.writeText){await navigator.clipboard.writeText(a),x(!0),p(!1),window.setTimeout(()=>x(!1),2e3);return}}catch{}p(!0)},u="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(f,{size:"sm",variant:"outline",onPress:c,children:l?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:o,readOnly:!0,rows:a.split(` +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{c as Y,G as U,H as Q,J as X,P as Z,E as O,B as ee,K as te,u as V,I as se}from"./index-DMrbj_xn.js";import{u as ae,r as ne,B as re}from"./tableSelection-CojkFPwd.js";import{C as ie}from"./ConfirmDialog-D3P-vj-t.js";import{D as le}from"./DataTable-CrQq0sYf.js";import{F as A}from"./Field-DEJ6Wjg9.js";import{a as F,M as q}from"./ModelScopeControl-wPC6RjBJ.js";import{U as oe}from"./UserComboBox-nt7pHfqn.js";import{f as P,B as f,d as D}from"./heroui-DZj66Arc.js";function $(t){if(!t)return"—";const a=new Date(t);return Number.isNaN(a.getTime())?"—":a.toLocaleDateString()}function ce(t){if(!t)return null;const a=new Date(t).getTime();if(Number.isNaN(a))return null;const n=Math.round((a-Date.now())/1e3),r=Math.abs(n),d=[["day",86400],["hour",3600],["minute",60]],o=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[l,x]of d)if(r>=x)return o.format(Math.round(n/x),l);return o.format(n,"second")}function de(t){if(!t.expires_at)return!1;const a=new Date(t.expires_at).getTime();return!Number.isNaN(a)&&aString(r).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}T${n(a.getHours())}:${n(a.getMinutes())}`}const me=t=>(t??"").startsWith("apikey-"),K=t=>t.key_name??t.id,xe=t=>t.id;function M({label:t,value:a,multiline:n=!1,fieldRef:r}){const d=i.useRef(null),o=r??d,[l,x]=i.useState(!1),[g,p]=i.useState(!1),c=async()=>{var m,y,h;(m=o.current)==null||m.focus(),(y=o.current)==null||y.select();try{if((h=navigator.clipboard)!=null&&h.writeText){await navigator.clipboard.writeText(a),x(!0),p(!1),window.setTimeout(()=>x(!1),2e3);return}}catch{}p(!0)},u="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(f,{size:"sm",variant:"outline",onPress:c,children:l?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:o,readOnly:!0,rows:a.split(` `).length,value:a,onFocus:m=>m.currentTarget.select(),className:`${u} resize-none whitespace-pre`}):e.jsx("input",{ref:o,readOnly:!0,value:a,onFocus:m=>m.currentTarget.select(),className:u}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-green-700",children:l?"Copied to clipboard.":""}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function he({title:t,result:a,onClose:n}){const r=i.useRef(null),d=i.useRef(null),o=typeof window<"u"?window.location.origin:"",l=a.key;i.useEffect(()=>{var c,u;(c=d.current)==null||c.focus(),(u=d.current)==null||u.select()},[]);const x=c=>{var h;if(c.key!=="Tab")return;const u=(h=r.current)==null?void 0:h.querySelectorAll('button, input, textarea, a[href], [tabindex]:not([tabindex="-1"])');if(!u||u.length===0)return;const m=u[0],y=u[u.length-1];c.shiftKey&&document.activeElement===m?(c.preventDefault(),y.focus()):!c.shiftKey&&document.activeElement===y&&(c.preventDefault(),m.focus())},g=[`curl ${o}/v1/chat/completions \\`,` -H "Otari-Key: ${l}" \\`,' -H "Content-Type: application/json" \\',` -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'`].join(` `),p=["from openai import OpenAI","",`client = OpenAI(base_url="${o}/v1", api_key="${l}")`,"resp = client.chat.completions.create(",' model="your-model",',' messages=[{"role": "user", "content": "Hello"}],',")","print(resp.choices[0].message.content)"].join(` `);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:x,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(se,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",F(a.allowed_models).text,"."]}),e.jsx(M,{label:"Secret key",value:l,fieldRef:d}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(M,{label:"curl",value:g,multiline:!0}),e.jsx(M,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(f,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function H({trigger:t,message:a,confirmLabel:n,isPending:r,onConfirm:d}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:a}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(f,{size:"sm",variant:"danger",isDisabled:r,onPress:d,children:n}),e.jsx(f,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(f,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:t})}function G({userId:t,users:a}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const r=a.find(l=>l.user_id===n);if(!r)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:d}=F(r.allowed_models),o=r.allowed_models&&r.allowed_models.length>0?r.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:d.toLowerCase()}),o?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:o}),")"]}):null,". This key inherits that, or narrows within it."]})}function J({checked:t,onChange:a}){return e.jsxs("label",{className:"flex items-start gap-2 rounded-lg border border-[var(--otari-line)] p-3 text-sm",children:[e.jsx("input",{type:"checkbox",checked:t,onChange:n=>a(n.target.checked),className:"mt-0.5 h-4 w-4 accent-[var(--otari-brand)]","aria-label":"Exempt this key from budget"}),e.jsxs("span",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:"Exempt from budget"}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Requests on this key are logged with their cost but never counted toward the owner's budget or spend, and never blocked by it."})]})]})}function fe({onClose:t,onCreated:a}){const n=te(),r=V(),[d,o]=i.useState(""),[l,x]=i.useState(""),[g,p]=i.useState(!1),[c,u]=i.useState(""),[m,y]=i.useState(null),[h,N]=i.useState(!1),[v,I]=i.useState(!0),C=l!==""&&new Date(l).getTime(){if(n.isPending||!v||w)return;const b={key_name:d.trim()||null,user_id:c.trim(),expires_at:l?new Date(l).toISOString():null,allowed_models:m,exclude_from_budget:h};n.mutate(b,{onSuccess:j=>{a(j),t()}})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(A,{label:"Expires (optional)",value:l,onChange:x,type:"datetime-local",description:C?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(oe,{value:c,onChange:u,users:r.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(b=>!b),children:g?"Hide advanced":"Advanced"}),g?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(G,{userId:c,users:r.data??[]}),e.jsx(q,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(b,j)=>{y(b),I(j)}}),e.jsx(J,{checked:h,onChange:N})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!v||w,onPress:S,children:n.isPending?"Creating…":"Create key"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ge({apiKey:t,onClose:a}){const n=U(),r=V(),[d,o]=i.useState(t.key_name??""),[l,x]=i.useState(ue(t.expires_at)),[g,p]=i.useState(t.allowed_models),[c,u]=i.useState(t.exclude_from_budget),[m,y]=i.useState(!0),h=()=>{n.isPending||!m||n.mutate({id:t.id,body:{key_name:d.trim()||null,expires_at:l?new Date(l).toISOString():null,allowed_models:g,exclude_from_budget:c}},{onSuccess:a})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot"}),e.jsx(A,{label:"Expires",value:l,onChange:x,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(G,{userId:t.user_id,users:r.data??[]}):null,e.jsx(q,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(N,v)=>{p(N),y(v)}}),e.jsx(J,{checked:c,onChange:u}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!m,onPress:h,children:n.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function pe({apiKey:t}){return t.is_active?de(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function ye({allowed:t}){const{text:a,tone:n}=F(t),r=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",d=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${r}`,title:d,children:a})}function Ae(){const t=Y(),a=U(),n=Q(),r=X(),[d,o]=i.useState(!1),[l,x]=i.useState(null),[g,p]=i.useState(null),c=t.data??[],u=t.isLoading,m=c.find(s=>s.id===l)??null,y=!u&&c.length===0&&!d,h=ae(),[N,v]=i.useState(!1),[I,C]=i.useState(void 0),[w,S]=i.useState(!1),b=c.map(s=>s.id),j=ne(h.selectedKeys,b),E=c.filter(s=>j.includes(s.id)),z=i.useCallback((s,k)=>a.mutate({id:s.id,body:{is_active:k}}),[a.mutate]),L=i.useCallback(s=>n.mutate(s.id,{onSuccess:k=>p({title:`New secret for ${K(s)}`,result:k})}),[n.mutate]),R=async(s,k,T)=>{S(!0),C(void 0);try{for(const B of s)await k(B);h.clear(),T==null||T()}catch(B){C(B)}finally{S(!1)}},W=i.useMemo(()=>[{id:"name",header:"Name",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:s.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx(ye,{allowed:s.allowed_models}),s.exclude_from_budget?e.jsx("span",{className:"inline-flex items-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] px-2 py-0.5 text-xs font-medium text-[var(--otari-brand-dark)]",title:"Requests on this key are logged with cost but never counted toward budget",children:"Budget-exempt"}):null]})]})},{id:"status",header:"Status",cell:s=>e.jsx(pe,{apiKey:s})},{id:"owner",header:"Owner",cell:s=>me(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.user_id??"—"})},{id:"key",header:"Key",cell:s=>e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.key_prefix?`${s.key_prefix}…`:"—"})},{id:"created",header:"Created",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:$(s.created_at)})},{id:"last_used",header:"Last used",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:ce(s.last_used_at)??"never"})},{id:"expires",header:"Expires",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.expires_at?new Date(s.expires_at).toLocaleString():void 0,children:s.expires_at?$(s.expires_at):"never"})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:a.isPending,onPress:()=>z(s,!s.is_active),children:s.is_active?"Disable":"Enable"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{o(!1),x(s.id)},children:"Edit"}),e.jsx(H,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:K(s)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>L(s)}),s.is_active?null:e.jsx(H,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:r.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:K(s)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>r.mutate(s.id)})]})}],[a.isPending,n.isPending,r.isPending,r.mutate,z,L]),_=E.filter(s=>!s.is_active);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:d?null:e.jsx(f,{variant:"primary",onPress:()=>{x(null),o(!0)},children:"Create key"})}),e.jsx(O,{error:t.error??a.error??n.error??r.error}),y?e.jsx(ee,{title:"No API keys yet",description:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe.",actionLabel:"Create your first key",onAction:()=>{x(null),o(!0)}}):null,d?e.jsx(fe,{onClose:()=>o(!1),onCreated:s=>p({title:"API key created",result:s})}):null,m?e.jsx(ge,{apiKey:m,onClose:()=>x(null)},m.id):null,j.length>0?e.jsxs(re,{selectedCount:j.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:h.clear,children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{is_active:!1}})),children:"Disable"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{exclude_from_budget:!0}})),children:"Budget-exempt"}),e.jsx(f,{size:"sm",variant:"danger",isDisabled:_.length===0,onPress:()=>v(!0),children:"Delete"})]}):null,y?null:e.jsx(le,{ariaLabel:"API keys",columns:W,rows:c,getRowKey:xe,isLoading:u,emptyContent:"No API keys yet. Create one to authenticate a caller.",selectionMode:"multiple",selectedKeys:h.selectedKeys,onSelectionChange:h.onSelectionChange}),e.jsx(ie,{isOpen:N,onOpenChange:v,heading:"Delete API keys",body:`Permanently delete ${_.length} disabled ${_.length===1?"key":"keys"}? This removes them and unlinks their usage history. Cannot be undone. Active keys in the selection are skipped; disable them first.`,confirmLabel:"Delete permanently",isPending:w,error:I,onConfirm:()=>void R(_,s=>r.mutateAsync(s.id),()=>v(!1))}),g?e.jsx(he,{title:g.title,result:g.result,onClose:()=>{p(null),n.reset()}}):null]})}export{Ae as KeysPage}; diff --git a/src/gateway/static/dashboard/assets/ModelScopeControl-gV_ax1BN.js b/src/gateway/static/dashboard/assets/ModelScopeControl-wPC6RjBJ.js similarity index 98% rename from src/gateway/static/dashboard/assets/ModelScopeControl-gV_ax1BN.js rename to src/gateway/static/dashboard/assets/ModelScopeControl-wPC6RjBJ.js index 74861bca9..cf2f53b71 100644 --- a/src/gateway/static/dashboard/assets/ModelScopeControl-gV_ax1BN.js +++ b/src/gateway/static/dashboard/assets/ModelScopeControl-wPC6RjBJ.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{Z as A,o as $,p as P}from"./index-C-bDZxkO.js";import{C as d,I as R,a as T,b as V}from"./heroui-DZj66Arc.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function W({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function X(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{W as M,X as a}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{Z as A,o as $,p as P}from"./index-DMrbj_xn.js";import{C as d,I as R,a as T,b as V}from"./heroui-DZj66Arc.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function W({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function X(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{W as M,X as a}; diff --git a/src/gateway/static/dashboard/assets/ModelsPage-DyZuS75D.js b/src/gateway/static/dashboard/assets/ModelsPage-CH43id2j.js similarity index 99% rename from src/gateway/static/dashboard/assets/ModelsPage-DyZuS75D.js rename to src/gateway/static/dashboard/assets/ModelsPage-CH43id2j.js index b0ef231a1..605885242 100644 --- a/src/gateway/static/dashboard/assets/ModelsPage-DyZuS75D.js +++ b/src/gateway/static/dashboard/assets/ModelsPage-CH43id2j.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as gt,u as vt,r as c}from"./react-dgEcD0HR.js";import{L as _t,M as bt,o as jt,O as yt,Q as je,P as Pt,E as Nt,F as B,I as St,S as se,T as Re,s as we,U as be,V as Ct,W as kt,X as E}from"./index-C-bDZxkO.js";import{u as Mt,r as Wt,B as Tt}from"./tableSelection-CojkFPwd.js";import{D as It}from"./DataTable-CrQq0sYf.js";import{T as Lt,S as $t}from"./TablePagination-0H6sFfIt.js";import{B as $,d as ae,f as V}from"./heroui-DZj66Arc.js";function Oe(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function At(t,i=Date.now()){const r=new Map;for(const n of t){const l=r.get(n.model_key)??[];l.push(n),r.set(n.model_key,l)}const a=[];for(const n of r.values()){const l=[...n].sort((p,u)=>Date.parse(p.effective_at)-Date.parse(u.effective_at)),m=[...l].reverse().find(p=>Date.parse(p.effective_at)<=i);a.push(m??l[0])}return a.sort((n,l)=>n.model_key.localeCompare(l.model_key))}const Et="otari",De=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],Ot=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Fe={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Dt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],Ft=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Bt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],Kt=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Rt=1440*60*1e3,wt=t=>t.key;function Be(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function Ke(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const a=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,l)=>l.min_input_tokens-n.min_input_tokens)[0];return a?{inputPrice:a.input_price_per_million??r.inputPrice,outputPrice:a.output_price_per_million??r.outputPrice,cacheReadPrice:a.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:a.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:a.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ce(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function z(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function Y(t){return t.trim()===""?null:Number(t)}function ze(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Ve(t){const i=new Set;return t.every(r=>{const a=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(l=>l.trim()!=="");return!Number.isInteger(a)||a<=0||i.has(a)||!n?!1:(i.add(a),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(z))})}function Ye(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function b({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:a=>i(a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function qe({tiers:t,onChange:i}){const r=(n,l,m)=>{i(t.map(p=>p.id===n?{...p,[l]:m}:p))},a=()=>{const n=t.reduce((l,m)=>Math.max(l,m.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx($,{size:"sm",variant:"outline",onPress:a,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:l=>r(n.id,"minInputTokens",l.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(b,{value:n.input,onChange:l=>r(n.id,"input",l),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(b,{value:n.output,onChange:l=>r(n.id,"output",l),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(b,{value:n.cacheRead,onChange:l=>r(n.id,"cacheRead",l),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(b,{value:n.cacheWrite,onChange:l=>r(n.id,"cacheWrite",l),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(b,{value:n.cacheWrite1h,onChange:l=>r(n.id,"cacheWrite1h",l),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(l=>l.id!==n.id)),children:"Remove"})]},n.id))]})}function zt({source:t}){return t==="configured"?e.jsx(V,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(V,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function oe({label:t,tone:i="info",children:r}){const a=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":a,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:a,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Vt(){const t=kt();return t.data?t.data.default_pricing?e.jsx(oe,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(oe,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function le({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Yt({row:t}){const i=je(),r=Re(),[a,n]=c.useState(!1),[l,m]=c.useState(""),[p,u]=c.useState(""),[P,j]=c.useState(""),[k,I]=c.useState(""),[y,h]=c.useState(""),[N,O]=c.useState([]),S=()=>{m(t.inputPrice==null?"":String(t.inputPrice)),u(t.outputPrice==null?"":String(t.outputPrice)),j(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),I(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),h(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),O(ze(t.pricingTiers)),n(!0)},Q=ce(l)&&ce(p)&&z(P)&&z(k)&&z(y)&&Ve(N),W=()=>{Q&&i.mutate({model_key:t.key,input_price_per_million:Number(l),output_price_per_million:Number(p),cache_read_price_per_million:Y(P),cache_write_price_per_million:Y(k),cache_write_1h_price_per_million:Y(y),pricing_tiers:Ye(N)},{onSuccess:()=>n(!1)})};return a?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(b,{value:l,onChange:m,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(b,{value:p,onChange:u,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(b,{value:P,onChange:j,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(b,{value:k,onChange:I,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(b,{value:y,onChange:h,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(qe,{tiers:N,onChange:O}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:"sm",variant:"primary",isDisabled:i.isPending||!Q,onPress:W,children:"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:be(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${E(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${E(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${E(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${E(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${E(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx($,{size:"sm",variant:"outline",onPress:S,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(we,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error)}):null]})]})}function qt({row:t,metadata:i,metadataAvailable:r,onMakeAlias:a,onClose:n}){const l=(i==null?void 0:i.input_modalities)??[],m=(i==null?void 0:i.output_modalities)??[],p=Ot.filter(({key:u})=>i==null?void 0:i[u]);return e.jsx(ae,{children:e.jsxs(ae.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(V,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(le,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Yt,{row:t},t.key),e.jsx($,{size:"sm",variant:"outline",onPress:()=>a(t.key),children:"Make an alias"})]}),e.jsxs(le,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:se(t.contextWindow)}),e.jsx(T,{label:"Max output",value:se((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:Ct(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(le,{title:"Modalities",children:l.length===0&&m.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),l.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),m.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]})]})}),e.jsx(le,{title:"Capabilities",children:p.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(({key:u,label:P})=>e.jsx(V,{size:"sm",color:"default",children:P},u))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Ut=15;function Ht({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:a=>i(a.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}const Ue="otari.dashboard.modelsSort",_e={col:"model",dir:"asc"},Gt=["model","released","input","output"];function Jt(){if(typeof window>"u")return _e;try{const t=window.localStorage.getItem(Ue);if(!t)return _e;const i=JSON.parse(t);if(Gt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return _e}function Xt({row:t,onClose:i}){const r=je(),a=Re(),[n,l]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[m,p]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[u,P]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[j,k]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[I,y]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[h,N]=c.useState(ze(t.pricingTiers)),O=ce(n)&&ce(m)&&z(u)&&z(j)&&z(I)&&Ve(h),S=()=>{O&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(m),cache_read_price_per_million:Y(u),cache_write_price_per_million:Y(j),cache_write_1h_price_per_million:Y(I),pricing_tiers:Ye(h)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(b,{value:n,onChange:l,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(b,{value:m,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(b,{value:u,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(b,{value:j,onChange:k,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(b,{value:I,onChange:y,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx($,{size:"sm",variant:"primary",isDisabled:r.isPending||!O,onPress:S,children:r.isPending?"Saving…":"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(we,{confirmLabel:"Reset",isPending:a.isPending,onConfirm:()=>a.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||a.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error??a.error)}):null]}),e.jsx(qe,{tiers:h,onChange:N})]})}function Qt({primary:t,secondary:i,rowKey:r,primaryLabel:a,secondaryLabel:n,onEdit:l}){const m=(p,u)=>e.jsx("button",{type:"button","aria-label":`Edit ${u} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:P=>{P.stopPropagation(),l()},children:p==null?"—":E(p)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[m(t,a),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),m(i,n)]})}function Zt({rates:t,rowKey:i,onEdit:r}){const a=[t.cacheReadPrice==null?null:`R ${E(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${E(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${E(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:a.length>0?a.join(" · "):"Input-rate fallback"})}function ei({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,l)=>n.min_input_tokens-l.min_input_tokens).map(n=>se(n.min_input_tokens)),a=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:a})}function ti({rows:t,isLoading:i,empty:r,sortDescriptor:a,onSortChange:n,selectedKey:l,onSelect:m,onEditPricing:p,comparisonContextTokens:u,selectedKeys:P,onSelectionChange:j}){const k=c.useMemo(()=>{const y=u==null?"Base":`at ${se(u)}`;return[{id:"model",header:"Model",isRowHeader:!0,allowsSorting:!0,cell:h=>e.jsxs("span",{className:"font-medium break-all",children:[h.model,e.jsx("span",{className:"sr-only",children:h.key})]})},{id:"provider",header:"Provider",cell:h=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:h.provider})},{id:"input",header:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[`${y} in / out $ / 1M`,e.jsx(Vt,{})]}),align:"end",allowsSorting:!0,cell:h=>{const N=Ke(h,u);return e.jsx(Qt,{primary:N.inputPrice,secondary:N.outputPrice,rowKey:h.key,primaryLabel:"input",secondaryLabel:"output",onEdit:()=>p(h.key)})}},{id:"caching",header:`Caching ${u==null?"policy":y}`,align:"end",cell:h=>e.jsx(Zt,{rates:Ke(h,u),rowKey:h.key,onEdit:()=>p(h.key)})},{id:"policy",header:"Pricing policy",align:"end",cell:h=>e.jsx(ei,{row:h,onEdit:()=>p(h.key)})}]},[u,p]),I=c.useCallback(y=>y.key===l?"bg-[var(--otari-brand-tint)]":void 0,[l]);return e.jsx(It,{ariaLabel:"Models",columns:k,rows:t,getRowKey:wt,isLoading:i,emptyContent:r,selectionMode:"multiple",selectedKeys:P,onSelectionChange:j,sortDescriptor:a,onSortChange:n,onRowAction:m,rowClassName:I})}function ii({providers:t}){if(t.length===0)return null;const i=t.filter(l=>!l.discovery_unsupported),r=t.filter(l=>l.discovery_unsupported),a=l=>l.map(m=>m.provider).join(", "),n=l=>l.length===1;return e.jsxs(St,{tone:"warning",children:[i.length>0?e.jsxs("span",{className:"block",children:["Could not list ",a(i),". Check ",n(i)?"that provider's":"those providers'"," ","credentials in config.yml; ",n(i)?"its":"their"," models are missing from the list below."]}):null,r.length>0?e.jsxs("span",{className:"block",children:[a(r)," ",n(r)?"does":"do"," not offer model discovery, so"," ",n(r)?"its":"their"," models are missing from the list below."," ",n(r)?"The provider":"They"," may still serve requests; declare the model ids"," ",n(r)?"it serves":"they serve"," under the ",e.jsx("code",{children:"models:"})," key in config.yml to list them here."]}):null]})}function pi(){var Ie,Le,$e;const t=gt(),[i]=vt(),r=_t(),a=bt(),n=jt(),l=yt(),m=je(),[p,u]=c.useState(""),[P,j]=c.useState(0),[k,I]=c.useState(Ut),[y,h]=c.useState(null),[N,O]=c.useState(null),[S,Q]=c.useState(Jt),W=Mt(),[He,ue]=c.useState(!1),[Ge,ye]=c.useState(!1),[Je,Pe]=c.useState(void 0);c.useEffect(()=>{try{window.localStorage.setItem(Ue,JSON.stringify(S))}catch{}},[S]);const[D,Ne]=c.useState(i.get("provider")||"all"),[K,Xe]=c.useState("all"),[q,Qe]=c.useState("all"),[U,Ze]=c.useState("all"),[de,et]=c.useState("0"),[Z,tt]=c.useState(""),[ee,it]=c.useState("all"),[pe,rt]=c.useState(""),F=((Ie=l.data)==null?void 0:Ie.models)??{},nt=((Le=l.data)==null?void 0:Le.available)??!1,Se=c.useMemo(()=>{var s;return new Set((((s=n.data)==null?void 0:s.providers)??[]).flatMap(x=>x.models.map(o=>o.key)))},[n.data]),lt=s=>{u(s),j(0)},R=s=>x=>{s(x),j(0)},te=c.useMemo(()=>{var M,v,_,A,L,w,Ae;const s=new Map(At(a.data??[]).map(d=>[d.model_key,d])),x=[],o=new Set,g=(d,ve,Ee,f)=>{if(o.has(d))return;o.add(d);const C=s.get(d);x.push({key:d,model:Be(ve,Ee),provider:Ee,isDiscovered:Se.has(d),contextWindow:(f==null?void 0:f.contextWindow)??null,inputPrice:C?C.input_price_per_million:(f==null?void 0:f.inputPrice)??null,outputPrice:C?C.output_price_per_million:(f==null?void 0:f.outputPrice)??null,cacheReadPrice:C?C.cache_read_price_per_million:(f==null?void 0:f.cacheReadPrice)??null,cacheWritePrice:C?C.cache_write_price_per_million:(f==null?void 0:f.cacheWritePrice)??null,cacheWrite1hPrice:C?C.cache_write_1h_price_per_million??null:(f==null?void 0:f.cacheWrite1hPrice)??null,pricingTiers:C?C.pricing_tiers??[]:(f==null?void 0:f.pricingTiers)??[],source:C?"configured":(f==null?void 0:f.source)??"none"})};for(const d of((M=r.data)==null?void 0:M.data)??[]){if(d.owned_by===Et)continue;const ve=d.pricing_source==="default"?"default":d.pricing?"configured":"none";g(d.id,d.id,d.owned_by||Oe(d.id),{key:d.id,model:d.id,provider:d.owned_by,contextWindow:d.context_window,inputPrice:((v=d.pricing)==null?void 0:v.input_price_per_million)??null,outputPrice:((_=d.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:((A=d.pricing)==null?void 0:A.cache_read_price_per_million)??null,cacheWritePrice:((L=d.pricing)==null?void 0:L.cache_write_price_per_million)??null,cacheWrite1hPrice:((w=d.pricing)==null?void 0:w.cache_write_1h_price_per_million)??null,pricingTiers:((Ae=d.pricing)==null?void 0:Ae.pricing_tiers)??[],source:ve})}for(const d of s.keys())g(d,d,Oe(d));return x},[r.data,a.data,Se]),Ce=c.useMemo(()=>new Map(te.map(s=>[s.key,s])),[te]),ie=c.useMemo(()=>{var o,g,M;const s=te.map(v=>{var _,A;return{...v,contextWindow:v.contextWindow??((_=F[v.key])==null?void 0:_.context_window)??null,releaseDate:((A=F[v.key])==null?void 0:A.release_date)??null}}),x=new Set(s.map(v=>v.key));for(const v of((o=n.data)==null?void 0:o.providers)??[])for(const _ of v.models)x.has(_.key)||(x.add(_.key),s.push({key:_.key,model:Be(_.key,v.provider),provider:v.provider,isDiscovered:!0,contextWindow:((g=F[_.key])==null?void 0:g.context_window)??null,releaseDate:((M=F[_.key])==null?void 0:M.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return s},[te,n.data,F]),st=((($e=n.data)==null?void 0:$e.providers)??[]).filter(s=>!s.ok),re=c.useMemo(()=>{const s=Array.from(new Set(ie.map(x=>x.provider))).sort((x,o)=>x.localeCompare(o));return[{value:"all",label:"All providers"},...s.map(x=>({value:x,label:x}))]},[ie]);c.useEffect(()=>{D==="all"||re.length<=1||re.some(s=>s.value===D)||Ne("all")},[re,D]);const H=p.trim().toLowerCase(),he=Number(de)||0,me=Z===""?Number.POSITIVE_INFINITY:Number(Z),at=pe===""?null:Number(pe),xe=ee==="all"?null:Date.now()-Number(ee)*Rt,G=c.useMemo(()=>{const s=o=>{if(H&&!o.key.toLowerCase().includes(H)&&!o.provider.toLowerCase().includes(H)||D!=="all"&&o.provider!==D||K==="configured"&&o.source!=="configured"||K==="default"&&o.source!=="default"||K==="priced"&&o.inputPrice==null||K==="unpriced"&&o.inputPrice!=null||q==="discovered"&&!o.isDiscovered||q==="custom"&&o.isDiscovered)return!1;if(U!=="all"){const g=De.find(v=>v.value===U),M=F[o.key];if(!g||!M||!g.test(M))return!1}if(he>0&&(o.contextWindow==null||o.contextWindowme))return!1;if(xe!=null){const g=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(g)||g{const M=S.dir==="asc"?1:-1;if(S.col==="model")return o.model.localeCompare(g.model)*M;if(S.col==="released"){const L=o.releaseDate??null,w=g.releaseDate??null;return!L&&!w?o.model.localeCompare(g.model):L?w?(Lw?1:0)*M||o.model.localeCompare(g.model):-1:1}const v=L=>S.col==="input"?L.inputPrice:L.outputPrice,_=v(o),A=v(g);return _==null&&A==null?o.model.localeCompare(g.model):_==null?1:A==null?-1:(_-A)*M||o.model.localeCompare(g.model)};return ie.filter(s).sort(x)},[ie,H,D,K,q,U,he,me,xe,F,S]),J=G.length,ct=Math.max(1,Math.ceil(J/k)),ke=Math.min(P,ct-1),Me=ke*k,fe=G.slice(Me,Me+k),ot={column:S.col,direction:S.dir==="asc"?"ascending":"descending"},ut=s=>{Q({col:String(s.column),dir:s.direction==="ascending"?"asc":"desc"}),j(0)},dt=c.useCallback(s=>h(x=>x===s?null:s),[]),ge=fe.map(s=>s.key),X=Wt(W.selectedKeys,ge),pt=ge.length>0&&X.length===ge.length&&J>X.length,ht=W.allMatching?G.map(s=>s.key):X,We=W.allMatching?J:X.length,Te=y?G.find(s=>s.key===y)??Ce.get(y)??null:null,mt=async s=>{ye(!0),Pe(void 0);try{for(const x of ht)await m.mutateAsync({model_key:x,input_price_per_million:s.input_price_per_million,output_price_per_million:s.output_price_per_million,cache_read_price_per_million:s.cache_read_price_per_million??null,cache_write_price_per_million:s.cache_write_price_per_million??null,cache_write_1h_price_per_million:null,pricing_tiers:[]});W.clear(),ue(!1)}catch(x){Pe(x)}finally{ye(!1)}},xt=r.isLoading||a.isLoading||n.isLoading,ft=H!==""||D!=="all"||K!=="all"||q!=="all"||U!=="all"||de!=="0"||Z!==""||ee!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",ne=N?G.find(s=>s.key===N)??Ce.get(N)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Pt,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(Nt,{error:r.error??a.error??n.error??l.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${ne?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ht,{value:p,onChange:lt,placeholder:"Search models…"}),e.jsx(B,{ariaLabel:"Filter by provider",value:D,onChange:R(Ne),options:re}),e.jsx(B,{ariaLabel:"Filter by pricing",value:K,onChange:R(Xe),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(B,{ariaLabel:"Filter by source",value:q,onChange:R(Qe),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(B,{ariaLabel:"Filter by capability",value:U,onChange:R(Ze),options:[{value:"all",label:"Any capability"},...De.map(s=>({value:s.value,label:s.label}))]}),e.jsx(B,{ariaLabel:"Minimum context window",value:de,onChange:R(et),options:Dt}),e.jsx(B,{ariaLabel:"Maximum input price",value:Z,onChange:R(tt),options:Ft}),e.jsx(B,{ariaLabel:"Compare prices at context",value:pe,onChange:rt,options:Bt}),e.jsx(B,{ariaLabel:"Filter by release date",value:ee,onChange:R(it),options:Kt})]}),e.jsx(ii,{providers:st}),X.length>0?e.jsx(Tt,{selectedCount:We,allMatching:W.allMatching,matchingTotal:J,canSelectAllMatching:pt,onSelectAllMatching:W.enableAllMatching,onClear:W.clear,children:e.jsx($,{size:"sm",variant:"primary",onPress:()=>ue(!0),children:"Set pricing"})}):null,e.jsx(ti,{rows:fe,isLoading:xt,empty:ft,sortDescriptor:ot,onSortChange:ut,selectedKey:N,onSelect:O,onEditPricing:dt,comparisonContextTokens:at,selectedKeys:W.selectedKeys,onSelectionChange:W.onSelectionChange}),Te?e.jsx(ae,{children:e.jsxs(ae.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Edit pricing"}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>h(null),children:"Close"})]}),e.jsx(Xt,{row:Te,onClose:()=>h(null)})]})}):null,e.jsx(Lt,{page:ke,pageSize:k,total:J,rowsOnPage:fe.length,onPageChange:j,onPageSizeChange:s=>{I(s),j(0)},pageSizeOptions:[15,25,50]})]}),ne?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(qt,{row:ne,metadata:F[ne.key],metadataAvailable:nt,onMakeAlias:s=>t(`/aliases?target=${encodeURIComponent(s)}`),onClose:()=>O(null)})}):null]}),e.jsx($t,{isOpen:He,onOpenChange:ue,targetCount:We,isPending:Ge,error:Je,onSubmit:mt,title:"Set pricing",description:s=>`Apply these per-1M rates to ${s.toLocaleString()} selected ${s===1?"model":"models"}. This replaces each model's price; pricing tiers and the 1h cache rate are cleared. Edit a single model for tiers.`})]})}export{pi as ModelsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as gt,u as vt,r as c}from"./react-dgEcD0HR.js";import{L as _t,M as bt,o as jt,O as yt,Q as je,P as Pt,E as Nt,F as B,I as St,S as se,T as Re,s as we,U as be,V as Ct,W as kt,X as E}from"./index-DMrbj_xn.js";import{u as Mt,r as Wt,B as Tt}from"./tableSelection-CojkFPwd.js";import{D as It}from"./DataTable-CrQq0sYf.js";import{T as Lt,S as $t}from"./TablePagination-D_2uYqKa.js";import{B as $,d as ae,f as V}from"./heroui-DZj66Arc.js";function Oe(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function At(t,i=Date.now()){const r=new Map;for(const n of t){const l=r.get(n.model_key)??[];l.push(n),r.set(n.model_key,l)}const a=[];for(const n of r.values()){const l=[...n].sort((p,u)=>Date.parse(p.effective_at)-Date.parse(u.effective_at)),m=[...l].reverse().find(p=>Date.parse(p.effective_at)<=i);a.push(m??l[0])}return a.sort((n,l)=>n.model_key.localeCompare(l.model_key))}const Et="otari",De=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],Ot=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Fe={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Dt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],Ft=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Bt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],Kt=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Rt=1440*60*1e3,wt=t=>t.key;function Be(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function Ke(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const a=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,l)=>l.min_input_tokens-n.min_input_tokens)[0];return a?{inputPrice:a.input_price_per_million??r.inputPrice,outputPrice:a.output_price_per_million??r.outputPrice,cacheReadPrice:a.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:a.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:a.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ce(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function z(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function Y(t){return t.trim()===""?null:Number(t)}function ze(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Ve(t){const i=new Set;return t.every(r=>{const a=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(l=>l.trim()!=="");return!Number.isInteger(a)||a<=0||i.has(a)||!n?!1:(i.add(a),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(z))})}function Ye(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function b({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:a=>i(a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function qe({tiers:t,onChange:i}){const r=(n,l,m)=>{i(t.map(p=>p.id===n?{...p,[l]:m}:p))},a=()=>{const n=t.reduce((l,m)=>Math.max(l,m.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx($,{size:"sm",variant:"outline",onPress:a,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:l=>r(n.id,"minInputTokens",l.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(b,{value:n.input,onChange:l=>r(n.id,"input",l),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(b,{value:n.output,onChange:l=>r(n.id,"output",l),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(b,{value:n.cacheRead,onChange:l=>r(n.id,"cacheRead",l),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(b,{value:n.cacheWrite,onChange:l=>r(n.id,"cacheWrite",l),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(b,{value:n.cacheWrite1h,onChange:l=>r(n.id,"cacheWrite1h",l),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(l=>l.id!==n.id)),children:"Remove"})]},n.id))]})}function zt({source:t}){return t==="configured"?e.jsx(V,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(V,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function oe({label:t,tone:i="info",children:r}){const a=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":a,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:a,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Vt(){const t=kt();return t.data?t.data.default_pricing?e.jsx(oe,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(oe,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function le({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Yt({row:t}){const i=je(),r=Re(),[a,n]=c.useState(!1),[l,m]=c.useState(""),[p,u]=c.useState(""),[P,j]=c.useState(""),[k,I]=c.useState(""),[y,h]=c.useState(""),[N,O]=c.useState([]),S=()=>{m(t.inputPrice==null?"":String(t.inputPrice)),u(t.outputPrice==null?"":String(t.outputPrice)),j(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),I(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),h(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),O(ze(t.pricingTiers)),n(!0)},Q=ce(l)&&ce(p)&&z(P)&&z(k)&&z(y)&&Ve(N),W=()=>{Q&&i.mutate({model_key:t.key,input_price_per_million:Number(l),output_price_per_million:Number(p),cache_read_price_per_million:Y(P),cache_write_price_per_million:Y(k),cache_write_1h_price_per_million:Y(y),pricing_tiers:Ye(N)},{onSuccess:()=>n(!1)})};return a?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(b,{value:l,onChange:m,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(b,{value:p,onChange:u,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(b,{value:P,onChange:j,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(b,{value:k,onChange:I,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(b,{value:y,onChange:h,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(qe,{tiers:N,onChange:O}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:"sm",variant:"primary",isDisabled:i.isPending||!Q,onPress:W,children:"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:be(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${E(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${E(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${E(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${E(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${E(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx($,{size:"sm",variant:"outline",onPress:S,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(we,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error)}):null]})]})}function qt({row:t,metadata:i,metadataAvailable:r,onMakeAlias:a,onClose:n}){const l=(i==null?void 0:i.input_modalities)??[],m=(i==null?void 0:i.output_modalities)??[],p=Ot.filter(({key:u})=>i==null?void 0:i[u]);return e.jsx(ae,{children:e.jsxs(ae.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(V,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(le,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Yt,{row:t},t.key),e.jsx($,{size:"sm",variant:"outline",onPress:()=>a(t.key),children:"Make an alias"})]}),e.jsxs(le,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:se(t.contextWindow)}),e.jsx(T,{label:"Max output",value:se((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:Ct(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(le,{title:"Modalities",children:l.length===0&&m.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),l.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),m.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]})]})}),e.jsx(le,{title:"Capabilities",children:p.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(({key:u,label:P})=>e.jsx(V,{size:"sm",color:"default",children:P},u))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Ut=15;function Ht({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:a=>i(a.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}const Ue="otari.dashboard.modelsSort",_e={col:"model",dir:"asc"},Gt=["model","released","input","output"];function Jt(){if(typeof window>"u")return _e;try{const t=window.localStorage.getItem(Ue);if(!t)return _e;const i=JSON.parse(t);if(Gt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return _e}function Xt({row:t,onClose:i}){const r=je(),a=Re(),[n,l]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[m,p]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[u,P]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[j,k]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[I,y]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[h,N]=c.useState(ze(t.pricingTiers)),O=ce(n)&&ce(m)&&z(u)&&z(j)&&z(I)&&Ve(h),S=()=>{O&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(m),cache_read_price_per_million:Y(u),cache_write_price_per_million:Y(j),cache_write_1h_price_per_million:Y(I),pricing_tiers:Ye(h)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(b,{value:n,onChange:l,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(b,{value:m,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(b,{value:u,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(b,{value:j,onChange:k,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(b,{value:I,onChange:y,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx($,{size:"sm",variant:"primary",isDisabled:r.isPending||!O,onPress:S,children:r.isPending?"Saving…":"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(we,{confirmLabel:"Reset",isPending:a.isPending,onConfirm:()=>a.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||a.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error??a.error)}):null]}),e.jsx(qe,{tiers:h,onChange:N})]})}function Qt({primary:t,secondary:i,rowKey:r,primaryLabel:a,secondaryLabel:n,onEdit:l}){const m=(p,u)=>e.jsx("button",{type:"button","aria-label":`Edit ${u} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:P=>{P.stopPropagation(),l()},children:p==null?"—":E(p)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[m(t,a),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),m(i,n)]})}function Zt({rates:t,rowKey:i,onEdit:r}){const a=[t.cacheReadPrice==null?null:`R ${E(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${E(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${E(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:a.length>0?a.join(" · "):"Input-rate fallback"})}function ei({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,l)=>n.min_input_tokens-l.min_input_tokens).map(n=>se(n.min_input_tokens)),a=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:a})}function ti({rows:t,isLoading:i,empty:r,sortDescriptor:a,onSortChange:n,selectedKey:l,onSelect:m,onEditPricing:p,comparisonContextTokens:u,selectedKeys:P,onSelectionChange:j}){const k=c.useMemo(()=>{const y=u==null?"Base":`at ${se(u)}`;return[{id:"model",header:"Model",isRowHeader:!0,allowsSorting:!0,cell:h=>e.jsxs("span",{className:"font-medium break-all",children:[h.model,e.jsx("span",{className:"sr-only",children:h.key})]})},{id:"provider",header:"Provider",cell:h=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:h.provider})},{id:"input",header:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[`${y} in / out $ / 1M`,e.jsx(Vt,{})]}),align:"end",allowsSorting:!0,cell:h=>{const N=Ke(h,u);return e.jsx(Qt,{primary:N.inputPrice,secondary:N.outputPrice,rowKey:h.key,primaryLabel:"input",secondaryLabel:"output",onEdit:()=>p(h.key)})}},{id:"caching",header:`Caching ${u==null?"policy":y}`,align:"end",cell:h=>e.jsx(Zt,{rates:Ke(h,u),rowKey:h.key,onEdit:()=>p(h.key)})},{id:"policy",header:"Pricing policy",align:"end",cell:h=>e.jsx(ei,{row:h,onEdit:()=>p(h.key)})}]},[u,p]),I=c.useCallback(y=>y.key===l?"bg-[var(--otari-brand-tint)]":void 0,[l]);return e.jsx(It,{ariaLabel:"Models",columns:k,rows:t,getRowKey:wt,isLoading:i,emptyContent:r,selectionMode:"multiple",selectedKeys:P,onSelectionChange:j,sortDescriptor:a,onSortChange:n,onRowAction:m,rowClassName:I})}function ii({providers:t}){if(t.length===0)return null;const i=t.filter(l=>!l.discovery_unsupported),r=t.filter(l=>l.discovery_unsupported),a=l=>l.map(m=>m.provider).join(", "),n=l=>l.length===1;return e.jsxs(St,{tone:"warning",children:[i.length>0?e.jsxs("span",{className:"block",children:["Could not list ",a(i),". Check ",n(i)?"that provider's":"those providers'"," ","credentials in config.yml; ",n(i)?"its":"their"," models are missing from the list below."]}):null,r.length>0?e.jsxs("span",{className:"block",children:[a(r)," ",n(r)?"does":"do"," not offer model discovery, so"," ",n(r)?"its":"their"," models are missing from the list below."," ",n(r)?"The provider":"They"," may still serve requests; declare the model ids"," ",n(r)?"it serves":"they serve"," under the ",e.jsx("code",{children:"models:"})," key in config.yml to list them here."]}):null]})}function pi(){var Ie,Le,$e;const t=gt(),[i]=vt(),r=_t(),a=bt(),n=jt(),l=yt(),m=je(),[p,u]=c.useState(""),[P,j]=c.useState(0),[k,I]=c.useState(Ut),[y,h]=c.useState(null),[N,O]=c.useState(null),[S,Q]=c.useState(Jt),W=Mt(),[He,ue]=c.useState(!1),[Ge,ye]=c.useState(!1),[Je,Pe]=c.useState(void 0);c.useEffect(()=>{try{window.localStorage.setItem(Ue,JSON.stringify(S))}catch{}},[S]);const[D,Ne]=c.useState(i.get("provider")||"all"),[K,Xe]=c.useState("all"),[q,Qe]=c.useState("all"),[U,Ze]=c.useState("all"),[de,et]=c.useState("0"),[Z,tt]=c.useState(""),[ee,it]=c.useState("all"),[pe,rt]=c.useState(""),F=((Ie=l.data)==null?void 0:Ie.models)??{},nt=((Le=l.data)==null?void 0:Le.available)??!1,Se=c.useMemo(()=>{var s;return new Set((((s=n.data)==null?void 0:s.providers)??[]).flatMap(x=>x.models.map(o=>o.key)))},[n.data]),lt=s=>{u(s),j(0)},R=s=>x=>{s(x),j(0)},te=c.useMemo(()=>{var M,v,_,A,L,w,Ae;const s=new Map(At(a.data??[]).map(d=>[d.model_key,d])),x=[],o=new Set,g=(d,ve,Ee,f)=>{if(o.has(d))return;o.add(d);const C=s.get(d);x.push({key:d,model:Be(ve,Ee),provider:Ee,isDiscovered:Se.has(d),contextWindow:(f==null?void 0:f.contextWindow)??null,inputPrice:C?C.input_price_per_million:(f==null?void 0:f.inputPrice)??null,outputPrice:C?C.output_price_per_million:(f==null?void 0:f.outputPrice)??null,cacheReadPrice:C?C.cache_read_price_per_million:(f==null?void 0:f.cacheReadPrice)??null,cacheWritePrice:C?C.cache_write_price_per_million:(f==null?void 0:f.cacheWritePrice)??null,cacheWrite1hPrice:C?C.cache_write_1h_price_per_million??null:(f==null?void 0:f.cacheWrite1hPrice)??null,pricingTiers:C?C.pricing_tiers??[]:(f==null?void 0:f.pricingTiers)??[],source:C?"configured":(f==null?void 0:f.source)??"none"})};for(const d of((M=r.data)==null?void 0:M.data)??[]){if(d.owned_by===Et)continue;const ve=d.pricing_source==="default"?"default":d.pricing?"configured":"none";g(d.id,d.id,d.owned_by||Oe(d.id),{key:d.id,model:d.id,provider:d.owned_by,contextWindow:d.context_window,inputPrice:((v=d.pricing)==null?void 0:v.input_price_per_million)??null,outputPrice:((_=d.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:((A=d.pricing)==null?void 0:A.cache_read_price_per_million)??null,cacheWritePrice:((L=d.pricing)==null?void 0:L.cache_write_price_per_million)??null,cacheWrite1hPrice:((w=d.pricing)==null?void 0:w.cache_write_1h_price_per_million)??null,pricingTiers:((Ae=d.pricing)==null?void 0:Ae.pricing_tiers)??[],source:ve})}for(const d of s.keys())g(d,d,Oe(d));return x},[r.data,a.data,Se]),Ce=c.useMemo(()=>new Map(te.map(s=>[s.key,s])),[te]),ie=c.useMemo(()=>{var o,g,M;const s=te.map(v=>{var _,A;return{...v,contextWindow:v.contextWindow??((_=F[v.key])==null?void 0:_.context_window)??null,releaseDate:((A=F[v.key])==null?void 0:A.release_date)??null}}),x=new Set(s.map(v=>v.key));for(const v of((o=n.data)==null?void 0:o.providers)??[])for(const _ of v.models)x.has(_.key)||(x.add(_.key),s.push({key:_.key,model:Be(_.key,v.provider),provider:v.provider,isDiscovered:!0,contextWindow:((g=F[_.key])==null?void 0:g.context_window)??null,releaseDate:((M=F[_.key])==null?void 0:M.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return s},[te,n.data,F]),st=((($e=n.data)==null?void 0:$e.providers)??[]).filter(s=>!s.ok),re=c.useMemo(()=>{const s=Array.from(new Set(ie.map(x=>x.provider))).sort((x,o)=>x.localeCompare(o));return[{value:"all",label:"All providers"},...s.map(x=>({value:x,label:x}))]},[ie]);c.useEffect(()=>{D==="all"||re.length<=1||re.some(s=>s.value===D)||Ne("all")},[re,D]);const H=p.trim().toLowerCase(),he=Number(de)||0,me=Z===""?Number.POSITIVE_INFINITY:Number(Z),at=pe===""?null:Number(pe),xe=ee==="all"?null:Date.now()-Number(ee)*Rt,G=c.useMemo(()=>{const s=o=>{if(H&&!o.key.toLowerCase().includes(H)&&!o.provider.toLowerCase().includes(H)||D!=="all"&&o.provider!==D||K==="configured"&&o.source!=="configured"||K==="default"&&o.source!=="default"||K==="priced"&&o.inputPrice==null||K==="unpriced"&&o.inputPrice!=null||q==="discovered"&&!o.isDiscovered||q==="custom"&&o.isDiscovered)return!1;if(U!=="all"){const g=De.find(v=>v.value===U),M=F[o.key];if(!g||!M||!g.test(M))return!1}if(he>0&&(o.contextWindow==null||o.contextWindowme))return!1;if(xe!=null){const g=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(g)||g{const M=S.dir==="asc"?1:-1;if(S.col==="model")return o.model.localeCompare(g.model)*M;if(S.col==="released"){const L=o.releaseDate??null,w=g.releaseDate??null;return!L&&!w?o.model.localeCompare(g.model):L?w?(Lw?1:0)*M||o.model.localeCompare(g.model):-1:1}const v=L=>S.col==="input"?L.inputPrice:L.outputPrice,_=v(o),A=v(g);return _==null&&A==null?o.model.localeCompare(g.model):_==null?1:A==null?-1:(_-A)*M||o.model.localeCompare(g.model)};return ie.filter(s).sort(x)},[ie,H,D,K,q,U,he,me,xe,F,S]),J=G.length,ct=Math.max(1,Math.ceil(J/k)),ke=Math.min(P,ct-1),Me=ke*k,fe=G.slice(Me,Me+k),ot={column:S.col,direction:S.dir==="asc"?"ascending":"descending"},ut=s=>{Q({col:String(s.column),dir:s.direction==="ascending"?"asc":"desc"}),j(0)},dt=c.useCallback(s=>h(x=>x===s?null:s),[]),ge=fe.map(s=>s.key),X=Wt(W.selectedKeys,ge),pt=ge.length>0&&X.length===ge.length&&J>X.length,ht=W.allMatching?G.map(s=>s.key):X,We=W.allMatching?J:X.length,Te=y?G.find(s=>s.key===y)??Ce.get(y)??null:null,mt=async s=>{ye(!0),Pe(void 0);try{for(const x of ht)await m.mutateAsync({model_key:x,input_price_per_million:s.input_price_per_million,output_price_per_million:s.output_price_per_million,cache_read_price_per_million:s.cache_read_price_per_million??null,cache_write_price_per_million:s.cache_write_price_per_million??null,cache_write_1h_price_per_million:null,pricing_tiers:[]});W.clear(),ue(!1)}catch(x){Pe(x)}finally{ye(!1)}},xt=r.isLoading||a.isLoading||n.isLoading,ft=H!==""||D!=="all"||K!=="all"||q!=="all"||U!=="all"||de!=="0"||Z!==""||ee!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",ne=N?G.find(s=>s.key===N)??Ce.get(N)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Pt,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(Nt,{error:r.error??a.error??n.error??l.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${ne?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ht,{value:p,onChange:lt,placeholder:"Search models…"}),e.jsx(B,{ariaLabel:"Filter by provider",value:D,onChange:R(Ne),options:re}),e.jsx(B,{ariaLabel:"Filter by pricing",value:K,onChange:R(Xe),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(B,{ariaLabel:"Filter by source",value:q,onChange:R(Qe),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(B,{ariaLabel:"Filter by capability",value:U,onChange:R(Ze),options:[{value:"all",label:"Any capability"},...De.map(s=>({value:s.value,label:s.label}))]}),e.jsx(B,{ariaLabel:"Minimum context window",value:de,onChange:R(et),options:Dt}),e.jsx(B,{ariaLabel:"Maximum input price",value:Z,onChange:R(tt),options:Ft}),e.jsx(B,{ariaLabel:"Compare prices at context",value:pe,onChange:rt,options:Bt}),e.jsx(B,{ariaLabel:"Filter by release date",value:ee,onChange:R(it),options:Kt})]}),e.jsx(ii,{providers:st}),X.length>0?e.jsx(Tt,{selectedCount:We,allMatching:W.allMatching,matchingTotal:J,canSelectAllMatching:pt,onSelectAllMatching:W.enableAllMatching,onClear:W.clear,children:e.jsx($,{size:"sm",variant:"primary",onPress:()=>ue(!0),children:"Set pricing"})}):null,e.jsx(ti,{rows:fe,isLoading:xt,empty:ft,sortDescriptor:ot,onSortChange:ut,selectedKey:N,onSelect:O,onEditPricing:dt,comparisonContextTokens:at,selectedKeys:W.selectedKeys,onSelectionChange:W.onSelectionChange}),Te?e.jsx(ae,{children:e.jsxs(ae.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Edit pricing"}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>h(null),children:"Close"})]}),e.jsx(Xt,{row:Te,onClose:()=>h(null)})]})}):null,e.jsx(Lt,{page:ke,pageSize:k,total:J,rowsOnPage:fe.length,onPageChange:j,onPageSizeChange:s=>{I(s),j(0)},pageSizeOptions:[15,25,50]})]}),ne?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(qt,{row:ne,metadata:F[ne.key],metadataAvailable:nt,onMakeAlias:s=>t(`/aliases?target=${encodeURIComponent(s)}`),onClose:()=>O(null)})}):null]}),e.jsx($t,{isOpen:He,onOpenChange:ue,targetCount:We,isPending:Ge,error:Je,onSubmit:mt,title:"Set pricing",description:s=>`Apply these per-1M rates to ${s.toLocaleString()} selected ${s===1?"model":"models"}. This replaces each model's price; pricing tiers and the 1h cache rate are cleared. Edit a single model for tiers.`})]})}export{pi as ModelsPage}; diff --git a/src/gateway/static/dashboard/assets/OverviewPage-Tme0ej_W.js b/src/gateway/static/dashboard/assets/OverviewPage-BOO3r0BN.js similarity index 98% rename from src/gateway/static/dashboard/assets/OverviewPage-Tme0ej_W.js rename to src/gateway/static/dashboard/assets/OverviewPage-BOO3r0BN.js index 335843469..cfef09ada 100644 --- a/src/gateway/static/dashboard/assets/OverviewPage-Tme0ej_W.js +++ b/src/gateway/static/dashboard/assets/OverviewPage-BOO3r0BN.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as y,i as st,N as Y}from"./react-dgEcD0HR.js";import{Z as nt,_ as ot,g as j,$ as it,v as lt,c as dt,u as ct,d as ut,a0 as w,P as mt,R as vt,E as V,a1 as b,a2 as D,a3 as N,a4 as R,a5 as E,a6 as ht,N as _}from"./index-C-bDZxkO.js";import{S as U}from"./charts-B_hm0rXH.js";import{D as xt}from"./DataTable-CrQq0sYf.js";import{d as M,B as ft}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function K(e){return e==="neutral"?void 0:e}const pt=.02,gt=.1;function W(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,a=n>=gt?"alert":n>=pt?"warn":"ok";return{rate:n,status:a}}function bt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy+e.degraded===0?"alert":"warn"}const yt=.8;function St(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(o=>o.max_budget!==null&&o.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let a=0,l=0,r,m=-1;for(const o of n){const s=o.max_budget*o.user_count,i=s>0?o.total_spend/s:0;i>=1?a+=1:i>=yt&&(l+=1),i>m&&(m=i,r={name:o.name??o.budget_id,spent:o.total_spend,allocated:s,pct:i})}const d=a>0?"alert":l>0?"warn":"ok",h=a>0?`${a} over limit`:l>0?`${l} near limit`:"All within budget";return{status:d,label:h,overCount:a,nearCount:l,cappedCount:n.length,worst:r}}const G=864e5,I=30;function T(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function jt(){const[e,n]=y.useState(T);return y.useEffect(()=>{const a=()=>{if(document.visibilityState==="visible"){const l=T();n(r=>r===l?r:l)}};return document.addEventListener("visibilitychange",a),window.addEventListener("focus",a),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}},[]),y.useMemo(()=>{const a=Date.now(),l=new Date(a);return{today:new Date(l.getFullYear(),l.getMonth(),l.getDate()).toISOString(),periodStart:new Date(a-I*G).toISOString(),prevStart:new Date(a-2*I*G).toISOString()}},[e])}const wt={ok:"Healthy",warn:"Elevated",alert:"High"},Nt={ok:"On track",warn:"Near limit",alert:"Over budget"};function Bt(){const e=nt();return e.isLoading?t.jsx(ot,{}):t.jsx(Rt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function Rt({needsSetup:e=!1}){var $,L,A,F,P,q,B,H;const n=jt(),a=y.useMemo(()=>({start_date:n.today}),[n]),l=y.useMemo(()=>({start_date:n.periodStart}),[n]),r=y.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=j(a,"hour",_),d=j(l,"day",_),h=j(r,"day",_),o=it(),s=lt(),i=dt(),x=ct(),f=ut({},0,5),C=($=m.data)==null?void 0:$.totals,v=(L=d.data)==null?void 0:L.totals,p=(A=h.data)==null?void 0:A.totals,S=((F=d.data)==null?void 0:F.series)??[],k=S.length>1,c=W(v),O=W(p),Z=c.rate!==null&&O.rate!==null?w(c.rate,O.rate):null,u=St(s.data??[]),z=bt(o.data),J=(i.data??[]).filter(g=>g.is_active).length,Q=(x.data??[]).filter(g=>!g.blocked).length,X=(((P=f.data)==null?void 0:P.length)??0)>0,tt=e&&f.isSuccess&&!X,et=m.error??d.error??o.error??s.error??i.error??x.error,rt=()=>{m.refetch(),d.refetch(),h.refetch(),o.refetch(),s.refetch(),i.refetch(),x.refetch(),f.refetch()},at=m.isFetching||d.isFetching||h.isFetching||o.isFetching||s.isFetching||i.isFetching||x.isFetching||f.isFetching;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(mt,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway.",action:t.jsx(vt,{onRefresh:rt,isFetching:at,updatedAt:d.dataUpdatedAt})}),tt?t.jsx(_t,{}):null,t.jsx(V,{error:et}),t.jsx(Et,{providerHealth:z,healthy:((q=o.data)==null?void 0:q.healthy)??0,degraded:((B=o.data)==null?void 0:B.degraded)??0,total:((H=o.data)==null?void 0:H.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:o.isSuccess&&s.isSuccess&&d.isSuccess,failed:o.isError||s.isError||d.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(b,{label:"Spend today",value:C?D(C.cost):"—"}),t.jsx(b,{label:"Spend, last 30 days",value:v?D(v.cost):"—",hint:v?t.jsx(N,{fraction:w(v.cost,p==null?void 0:p.cost)}):null,chart:k?t.jsx(U,{values:S.map(g=>g.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Requests, last 30 days",value:v?R(v.request_count):"—",hint:v?t.jsx(N,{fraction:w(v.request_count,p==null?void 0:p.request_count)}):null,chart:k?t.jsx(U,{values:S.map(g=>g.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Error rate, last 30 days",value:c.rate===null?"—":E(c.rate),status:K(c.status),statusLabel:c.status==="neutral"?void 0:wt[c.status],hint:c.rate!==null?t.jsx(N,{fraction:Z}):null}),t.jsx(b,{label:"Budget health",value:s.data&&u.worst?E(u.worst.pct):"—",status:s.data?K(u.status):void 0,statusLabel:s.data&&u.status!=="neutral"?Nt[u.status]:void 0,hint:s.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(b,{label:"Active keys",value:i.data?R(J):"—",to:"/keys"}),t.jsx(b,{label:"Active users",value:x.data?R(Q):"—",to:"/users"})]}),t.jsx(kt,{entries:f.data??[],loading:f.isLoading,error:f.error})]})}function _t(){const e=st();return t.jsx(M,{children:t.jsxs(M.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(ft,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function Dt({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function Et({providerHealth:e,healthy:n,degraded:a,total:l,budget:r,errStatus:m,errRate:d,ready:h,failed:o}){if(o)return t.jsx(Dt,{text:"Some status data could not be loaded."});if(!h)return null;const s=[];if((e==="warn"||e==="alert")&&l>0){const i=l-n-a;i>0&&s.push({text:`${i} provider${i===1?"":"s"} unreachable`,to:"/providers"}),a>0&&s.push({text:`${a} provider${a===1?"":"s"} without model discovery`,to:"/providers"})}return r.overCount>0?s.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&s.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),m==="alert"&&d!==null&&s.push({text:`error rate ${E(d)}`,to:"/activity?status=error"}),s.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),s.map((i,x)=>t.jsxs("span",{className:"flex items-center gap-2",children:[x>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(Y,{to:i.to,className:"underline underline-offset-2 hover:text-amber-950",children:i.text})]},i.to+i.text))]})}function Ct(e){return e==="error"?"error":"ok"}function kt({entries:e,loading:n,error:a}){const l=[{id:"time",header:"Time",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(r.timestamp).toLocaleString(),children:ht(r.timestamp)})},{id:"model",header:"Model",isRowHeader:!0,cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:r.model})},{id:"cost",header:"Cost",align:"end",cell:r=>r.cost===null?"—":D(r.cost)},{id:"status",header:"Status",cell:r=>t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Ct(r.status)})}];return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(Y,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(V,{error:a}),t.jsx(xt,{ariaLabel:"Recent activity",columns:l,rows:e,getRowKey:r=>r.id,isLoading:n,emptyContent:"No requests yet. Once the gateway serves traffic, it appears here."})]})}export{Bt as OverviewIndex,Rt as OverviewPage,T as localDayKey}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as y,i as st,N as Y}from"./react-dgEcD0HR.js";import{Z as nt,_ as ot,g as j,$ as it,v as lt,c as dt,u as ct,d as ut,a0 as w,P as mt,R as vt,E as V,a1 as b,a2 as D,a3 as N,a4 as R,a5 as E,a6 as ht,N as _}from"./index-DMrbj_xn.js";import{S as U}from"./charts-DNysd9jl.js";import{D as xt}from"./DataTable-CrQq0sYf.js";import{d as M,B as ft}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function K(e){return e==="neutral"?void 0:e}const pt=.02,gt=.1;function W(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,a=n>=gt?"alert":n>=pt?"warn":"ok";return{rate:n,status:a}}function bt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy+e.degraded===0?"alert":"warn"}const yt=.8;function St(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(o=>o.max_budget!==null&&o.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let a=0,l=0,r,m=-1;for(const o of n){const s=o.max_budget*o.user_count,i=s>0?o.total_spend/s:0;i>=1?a+=1:i>=yt&&(l+=1),i>m&&(m=i,r={name:o.name??o.budget_id,spent:o.total_spend,allocated:s,pct:i})}const d=a>0?"alert":l>0?"warn":"ok",h=a>0?`${a} over limit`:l>0?`${l} near limit`:"All within budget";return{status:d,label:h,overCount:a,nearCount:l,cappedCount:n.length,worst:r}}const G=864e5,I=30;function T(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function jt(){const[e,n]=y.useState(T);return y.useEffect(()=>{const a=()=>{if(document.visibilityState==="visible"){const l=T();n(r=>r===l?r:l)}};return document.addEventListener("visibilitychange",a),window.addEventListener("focus",a),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}},[]),y.useMemo(()=>{const a=Date.now(),l=new Date(a);return{today:new Date(l.getFullYear(),l.getMonth(),l.getDate()).toISOString(),periodStart:new Date(a-I*G).toISOString(),prevStart:new Date(a-2*I*G).toISOString()}},[e])}const wt={ok:"Healthy",warn:"Elevated",alert:"High"},Nt={ok:"On track",warn:"Near limit",alert:"Over budget"};function Bt(){const e=nt();return e.isLoading?t.jsx(ot,{}):t.jsx(Rt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function Rt({needsSetup:e=!1}){var $,L,A,F,P,q,B,H;const n=jt(),a=y.useMemo(()=>({start_date:n.today}),[n]),l=y.useMemo(()=>({start_date:n.periodStart}),[n]),r=y.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=j(a,"hour",_),d=j(l,"day",_),h=j(r,"day",_),o=it(),s=lt(),i=dt(),x=ct(),f=ut({},0,5),C=($=m.data)==null?void 0:$.totals,v=(L=d.data)==null?void 0:L.totals,p=(A=h.data)==null?void 0:A.totals,S=((F=d.data)==null?void 0:F.series)??[],k=S.length>1,c=W(v),O=W(p),Z=c.rate!==null&&O.rate!==null?w(c.rate,O.rate):null,u=St(s.data??[]),z=bt(o.data),J=(i.data??[]).filter(g=>g.is_active).length,Q=(x.data??[]).filter(g=>!g.blocked).length,X=(((P=f.data)==null?void 0:P.length)??0)>0,tt=e&&f.isSuccess&&!X,et=m.error??d.error??o.error??s.error??i.error??x.error,rt=()=>{m.refetch(),d.refetch(),h.refetch(),o.refetch(),s.refetch(),i.refetch(),x.refetch(),f.refetch()},at=m.isFetching||d.isFetching||h.isFetching||o.isFetching||s.isFetching||i.isFetching||x.isFetching||f.isFetching;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(mt,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway.",action:t.jsx(vt,{onRefresh:rt,isFetching:at,updatedAt:d.dataUpdatedAt})}),tt?t.jsx(_t,{}):null,t.jsx(V,{error:et}),t.jsx(Et,{providerHealth:z,healthy:((q=o.data)==null?void 0:q.healthy)??0,degraded:((B=o.data)==null?void 0:B.degraded)??0,total:((H=o.data)==null?void 0:H.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:o.isSuccess&&s.isSuccess&&d.isSuccess,failed:o.isError||s.isError||d.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(b,{label:"Spend today",value:C?D(C.cost):"—"}),t.jsx(b,{label:"Spend, last 30 days",value:v?D(v.cost):"—",hint:v?t.jsx(N,{fraction:w(v.cost,p==null?void 0:p.cost)}):null,chart:k?t.jsx(U,{values:S.map(g=>g.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Requests, last 30 days",value:v?R(v.request_count):"—",hint:v?t.jsx(N,{fraction:w(v.request_count,p==null?void 0:p.request_count)}):null,chart:k?t.jsx(U,{values:S.map(g=>g.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Error rate, last 30 days",value:c.rate===null?"—":E(c.rate),status:K(c.status),statusLabel:c.status==="neutral"?void 0:wt[c.status],hint:c.rate!==null?t.jsx(N,{fraction:Z}):null}),t.jsx(b,{label:"Budget health",value:s.data&&u.worst?E(u.worst.pct):"—",status:s.data?K(u.status):void 0,statusLabel:s.data&&u.status!=="neutral"?Nt[u.status]:void 0,hint:s.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(b,{label:"Active keys",value:i.data?R(J):"—",to:"/keys"}),t.jsx(b,{label:"Active users",value:x.data?R(Q):"—",to:"/users"})]}),t.jsx(kt,{entries:f.data??[],loading:f.isLoading,error:f.error})]})}function _t(){const e=st();return t.jsx(M,{children:t.jsxs(M.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(ft,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function Dt({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function Et({providerHealth:e,healthy:n,degraded:a,total:l,budget:r,errStatus:m,errRate:d,ready:h,failed:o}){if(o)return t.jsx(Dt,{text:"Some status data could not be loaded."});if(!h)return null;const s=[];if((e==="warn"||e==="alert")&&l>0){const i=l-n-a;i>0&&s.push({text:`${i} provider${i===1?"":"s"} unreachable`,to:"/providers"}),a>0&&s.push({text:`${a} provider${a===1?"":"s"} without model discovery`,to:"/providers"})}return r.overCount>0?s.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&s.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),m==="alert"&&d!==null&&s.push({text:`error rate ${E(d)}`,to:"/activity?status=error"}),s.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),s.map((i,x)=>t.jsxs("span",{className:"flex items-center gap-2",children:[x>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(Y,{to:i.to,className:"underline underline-offset-2 hover:text-amber-950",children:i.text})]},i.to+i.text))]})}function Ct(e){return e==="error"?"error":"ok"}function kt({entries:e,loading:n,error:a}){const l=[{id:"time",header:"Time",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(r.timestamp).toLocaleString(),children:ht(r.timestamp)})},{id:"model",header:"Model",isRowHeader:!0,cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:r.model})},{id:"cost",header:"Cost",align:"end",cell:r=>r.cost===null?"—":D(r.cost)},{id:"status",header:"Status",cell:r=>t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Ct(r.status)})}];return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(Y,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(V,{error:a}),t.jsx(xt,{ariaLabel:"Recent activity",columns:l,rows:e,getRowKey:r=>r.id,isLoading:n,emptyContent:"No requests yet. Once the gateway serves traffic, it appears here."})]})}export{Bt as OverviewIndex,Rt as OverviewPage,T as localDayKey}; diff --git a/src/gateway/static/dashboard/assets/ProvidersPage-B46VzXV5.js b/src/gateway/static/dashboard/assets/ProvidersPage-enPv456e.js similarity index 99% rename from src/gateway/static/dashboard/assets/ProvidersPage-B46VzXV5.js rename to src/gateway/static/dashboard/assets/ProvidersPage-enPv456e.js index b69aded97..200308025 100644 --- a/src/gateway/static/dashboard/assets/ProvidersPage-B46VzXV5.js +++ b/src/gateway/static/dashboard/assets/ProvidersPage-enPv456e.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as m,L as Z}from"./react-dgEcD0HR.js";import{Z as J,a7 as Q,W as X,$ as ee,a8 as te,a9 as se,aa as ae,P as re,E as I,I as ne,ab as ie,ac as oe,a6 as q,s as de,ad as F,ae as le,U as H,af as ce,ag as ue}from"./index-C-bDZxkO.js";import{F as C}from"./Field-DEJ6Wjg9.js";import{D as me}from"./DataTable-CrQq0sYf.js";import{B as j,d as w,f as xe,T as pe,L as U,I as z,D as he,S as ve,C as T,a as ge,b as fe}from"./heroui-DZj66Arc.js";function E({value:t,onChange:s,label:a,placeholder:n,description:i}){return e.jsxs(pe,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(z,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),i?e.jsx(he,{className:"text-xs text-[var(--otari-muted)]",children:i}):null]})}function M({label:t,value:s,onChange:a,description:n,placeholder:i,extra:c=[],includeCatalog:d=!0}){var k;const b=ce(),x=m.useMemo(()=>d?[...c,...(b.data??[]).map(o=>({id:o.id,name:o.name}))]:c,[b.data,c,d]),[v,u]=m.useState(()=>{var o;return((o=x.find(y=>y.id===s))==null?void 0:o.name)??""}),f=((k=x.find(o=>o.id===s))==null?void 0:k.name)??"",g=v.trim()===f.trim()?"":v.trim().toLowerCase(),l=x.filter(o=>!g||o.name.toLowerCase().includes(g)||o.id.toLowerCase().includes(g)).slice(0,50);return e.jsxs(T.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:v,onInputChange:u,onSelectionChange:o=>{var y;o!=null?(a(String(o)),u(((y=x.find(N=>N.id===String(o)))==null?void 0:y.name)??"")):(a(""),u(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(T.InputGroup,{children:[e.jsx(z,{placeholder:i??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:o=>o.currentTarget.select()}),e.jsx(T.Trigger,{})]}),e.jsx(T.Popover,{children:e.jsx(ge,{items:l,className:"max-h-72 overflow-auto",children:o=>e.jsx(fe,{id:o.id,textValue:o.name,children:o.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function Y({getPayload:t}){const s=ue(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:H(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):s.data.discovery_unsupported?e.jsxs("span",{className:"block max-w-md break-words text-xs text-amber-800",children:["This provider does not list models, so the key could not be verified here. Save it and use the provider; declare its model ids under ",e.jsx("code",{children:"models:"})," to have them show up in the catalogue. If you did not expect this, check the provider's reply below.",s.data.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:s.data.error}):null]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function je({onClose:t}){var _;const s=F(),[a,n]=m.useState(""),[i,c]=m.useState(""),[d,b]=m.useState(!1),[x,v]=m.useState(""),[u,f]=m.useState(""),g=le(a),l=((_=g.data)==null?void 0:_.id)===a?g.data:void 0;m.useEffect(()=>{l&&v(l.default_api_base??"")},[l]);const k=(l==null?void 0:l.env_key_present)??!1,o=((l==null?void 0:l.requires_api_key)??!0)&&!k,y=u.trim()!==""&&u.trim()!==a,N=/[:/]/.test(u),P=a!==""&&!N&&(!o||i.trim()!=="")&&!s.isPending,A=()=>{P&&s.mutate({instance:y?u.trim():a,provider_type:y?a:null,api_base:x.trim()||null,api_key:i.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsx(M,{label:"Provider",value:a,onChange:S=>{n(S),f(""),v("")},description:"Its endpoint is built in."}),e.jsx(E,{value:i,onChange:c,label:l&&!o?"API key (optional)":"API key",description:l?o?`${l.name}'s endpoint is built in — just add your key.`:k?`${l.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${l.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>b(S=>!S),children:d?"Hide advanced":"Advanced (API base, rename)"}),d?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"API base",value:x,onChange:v,placeholder:(l==null?void 0:l.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(C,{label:"Name",value:u,onChange:f,placeholder:a||"instance name",description:N?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!P,onPress:A,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(Y,{getPayload:()=>a===""?null:{instance:y?u.trim():a,provider_type:y?a:null,api_base:x.trim()||null,api_key:i.trim()||null}})]})]})}function be({onClose:t}){const s=F(),[a,n]=m.useState(""),[i,c]=m.useState("openai-compatible"),[d,b]=m.useState(""),[x,v]=m.useState(""),u=/[:/]/.test(a),f=a.trim()!==""&&!u&&d.trim()!==""&&!s.isPending,g=()=>{f&&s.mutate({instance:a.trim(),provider_type:i||"openai-compatible",api_base:d.trim(),api_key:x.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:u?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(M,{label:"Compatible with",value:i,onChange:c,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(C,{label:"API base",value:d,onChange:b,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(E,{value:x,onChange:v,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!f,onPress:g,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(Y,{getPayload:()=>a.trim()===""||d.trim()===""?null:{instance:a.trim(),provider_type:i||"openai-compatible",api_base:d.trim(),api_key:x.trim()||null}})]})]})}function ye({onClose:t}){const[s,a]=m.useState("known");return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,i])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:i},n))})}),s==="known"?e.jsx(je,{onClose:t}):e.jsx(be,{onClose:t})]})})}function ke({provider:t,onClose:s,onSaved:a}){const n=ie(),[i,c]=m.useState(t.provider_type??""),[d,b]=m.useState(t.api_base??""),[x,v]=m.useState(!1),[u,f]=m.useState(""),g=()=>{if(n.isPending)return;const l={provider_type:i.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};x&&u.trim()&&(l.api_key=u.trim()),n.mutate({instance:t.instance,body:l},{onSuccess:()=>{a(t.instance),s()}})};return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(I,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"Provider type",value:i,onChange:c,placeholder:"openai"}),e.jsx(C,{label:"API base",value:d,onChange:b,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:x?e.jsxs(e.Fragment,{children:[e.jsx(E,{value:u,onChange:f,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{v(!1),f("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>v(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:n.isPending,onPress:g,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Pe(t,s){const a=new Map((s??[]).map(c=>[c.instance,c])),n=new Map((t??[]).map(c=>[c.instance,c]));return[...new Set([...a.keys(),...n.keys()])].sort().map(c=>{const d=a.get(c);return{instance:c,source:d?"stored":"config",stored:d,meta:n.get(c)}})}function Ne({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(ve,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):t.discovery_unsupported?e.jsxs("span",{className:"block max-w-xs break-words text-xs text-amber-800",children:["Could not list models, so the key could not be verified. It may still work for requests.",t.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:t.error}):null]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function _e({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=!t.ok&&t.discovery_unsupported,a=t.ok?"border-green-200 bg-green-50 text-green-700":s?"border-amber-200 bg-amber-50 text-amber-800":"border-red-200 bg-red-50 text-red-700",n=t.ok?"bg-green-500":s?"bg-amber-500":"bg-red-500",i=t.checked_at?`Last checked ${q(t.checked_at)}`:"Not checked yet",c=s?`${t.error??"This provider does not list models."} Requests to it may still work.`:t.error??"Unreachable",d=t.ok?i:`${c} · ${i}`;return e.jsxs("span",{title:d,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${n}`}),t.ok?"Reachable":s?"No model discovery":"Unreachable"]})}function Se({healthy:t,degraded:s,total:a,checkedAt:n}){const c=t===a?"bg-green-500":t+s===a?"bg-amber-500":"bg-red-500",d=oe();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${c}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s>0?e.jsxs("span",{className:"text-amber-800",children:[s," without model discovery"]}):null,n?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",q(n)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:d.isPending,onPress:()=>d.mutate(),children:d.isPending?"Re-checking…":"Re-check all"})]})}function R({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ce({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n,secretKeyConfigured:i}){return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(R,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(R,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(R,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",isDisabled:!i,onPress:t,children:"Add your first provider"})})]})})}function Ke(){var D,L,O,$;const t=J(),s=Q(),a=X(),n=ee(),i=te(),c=se(),d=ae(),[b,x]=m.useState(!1),[v,u]=m.useState(null),[f,g]=m.useState({}),l=Pe((D=t.data)==null?void 0:D.providers,s.data),k=new Map((((L=n.data)==null?void 0:L.providers)??[]).map(r=>[r.instance,r])),o=t.isLoading||s.isLoading,y=((O=s.data)==null?void 0:O.find(r=>r.instance===v))??null,N=(($=a.data)==null?void 0:$.require_pricing)===!0&&a.data.default_pricing===!1,P=a.data?a.data.secret_key_configured!==!1:!a.isError,A=!o&&l.length===0&&!b,_=m.useRef({}),S=r=>{const p=(_.current[r]??0)+1;return _.current[r]=p,p},K=r=>{S(r),g(p=>{if(!Object.hasOwn(p,r))return p;const h={...p};return delete h[r],h})},B=(r,p,h)=>{_.current[r]===p&&g(G=>({...G,[r]:h}))},V=async r=>{const p=S(r);g(h=>({...h,[r]:{status:"pending"}}));try{const h=await c.mutateAsync(r);B(r,p,{status:"done",...h})}catch(h){B(r,p,{status:"done",ok:!1,model_count:0,error:H(h),discovery_unsupported:!1})}},W=[{id:"provider",header:"Provider",isRowHeader:!0,cell:r=>e.jsx(Z,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"font-medium text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})},{id:"type",header:"Type",cell:r=>{var p,h;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:((p=r.meta)==null?void 0:p.provider_type)??((h=r.stored)==null?void 0:h.provider_type)??r.instance})}},{id:"source",header:"Source",cell:r=>e.jsx(xe,{size:"sm",color:r.source==="stored"?"accent":"default",children:r.source==="stored"?"stored":"config"})},{id:"api_key",header:"API key",cell:r=>{var p,h;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:(p=r.stored)!=null&&p.last4?`••••${r.stored.last4}`:"none set"}):(h=r.meta)!=null&&h.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"})}},{id:"status",header:"Status",cell:r=>e.jsx(_e,{health:k.get(r.instance)})},{id:"actions",header:"Actions",align:"end",cell:r=>{var p,h;return r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((p=f[r.instance])==null?void 0:p.status)==="pending"||((h=r.stored)==null?void 0:h.decryptable)===!1,onPress:()=>void V(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{x(!1),u(r.instance)},children:"Edit"}),e.jsx(de,{confirmLabel:"Delete",isPending:i.isPending,onConfirm:()=>i.mutate(r.instance,{onSuccess:()=>K(r.instance)}),children:"Delete"})]}),e.jsx(Ne,{state:f[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})}}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:b||A?null:e.jsx(j,{variant:"primary",isDisabled:!P,onPress:()=>{u(null),x(!0)},children:"Add provider"})}),e.jsx(I,{error:t.error??s.error??a.error??n.error??d.error??i.error}),P?null:e.jsxs(ne,{tone:"warning",children:[e.jsx("code",{children:"OTARI_SECRET_KEY"})," is not set, so provider keys can't be encrypted at rest and adding providers from the dashboard is disabled. Set it on the server and restart to add providers here. Providers defined in"," ",e.jsx("code",{children:"config.yml"})," keep working without it."]}),A?e.jsx(Ce,{onAddProvider:()=>{u(null),x(!0)},needsPricing:N,onEnablePricing:()=>d.mutate({default_pricing:!0}),enabling:d.isPending,secretKeyConfigured:P}):null,b&&P?e.jsx(ye,{onClose:()=>x(!1)}):null,y?e.jsx(ke,{provider:y,onClose:()=>u(null),onSaved:K}):null,!o&&l.length>0&&n.data&&n.data.total>0?e.jsx(Se,{healthy:n.data.healthy,degraded:n.data.degraded,total:n.data.total,checkedAt:n.data.checked_at}):null,A?null:e.jsx(me,{ariaLabel:"Providers",columns:W,rows:l,getRowKey:r=>r.instance,isLoading:o,emptyContent:"No providers yet. Add your first provider to start serving models."})]})}export{Ke as ProvidersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as m,L as Z}from"./react-dgEcD0HR.js";import{Z as J,a7 as Q,W as X,$ as ee,a8 as te,a9 as se,aa as ae,P as re,E as I,I as ne,ab as ie,ac as oe,a6 as q,s as de,ad as F,ae as le,U as H,af as ce,ag as ue}from"./index-DMrbj_xn.js";import{F as C}from"./Field-DEJ6Wjg9.js";import{D as me}from"./DataTable-CrQq0sYf.js";import{B as j,d as w,f as xe,T as pe,L as U,I as z,D as he,S as ve,C as T,a as ge,b as fe}from"./heroui-DZj66Arc.js";function E({value:t,onChange:s,label:a,placeholder:n,description:i}){return e.jsxs(pe,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(z,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),i?e.jsx(he,{className:"text-xs text-[var(--otari-muted)]",children:i}):null]})}function M({label:t,value:s,onChange:a,description:n,placeholder:i,extra:c=[],includeCatalog:d=!0}){var k;const b=ce(),x=m.useMemo(()=>d?[...c,...(b.data??[]).map(o=>({id:o.id,name:o.name}))]:c,[b.data,c,d]),[v,u]=m.useState(()=>{var o;return((o=x.find(y=>y.id===s))==null?void 0:o.name)??""}),f=((k=x.find(o=>o.id===s))==null?void 0:k.name)??"",g=v.trim()===f.trim()?"":v.trim().toLowerCase(),l=x.filter(o=>!g||o.name.toLowerCase().includes(g)||o.id.toLowerCase().includes(g)).slice(0,50);return e.jsxs(T.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:v,onInputChange:u,onSelectionChange:o=>{var y;o!=null?(a(String(o)),u(((y=x.find(N=>N.id===String(o)))==null?void 0:y.name)??"")):(a(""),u(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(T.InputGroup,{children:[e.jsx(z,{placeholder:i??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:o=>o.currentTarget.select()}),e.jsx(T.Trigger,{})]}),e.jsx(T.Popover,{children:e.jsx(ge,{items:l,className:"max-h-72 overflow-auto",children:o=>e.jsx(fe,{id:o.id,textValue:o.name,children:o.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function Y({getPayload:t}){const s=ue(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:H(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):s.data.discovery_unsupported?e.jsxs("span",{className:"block max-w-md break-words text-xs text-amber-800",children:["This provider does not list models, so the key could not be verified here. Save it and use the provider; declare its model ids under ",e.jsx("code",{children:"models:"})," to have them show up in the catalogue. If you did not expect this, check the provider's reply below.",s.data.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:s.data.error}):null]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function je({onClose:t}){var _;const s=F(),[a,n]=m.useState(""),[i,c]=m.useState(""),[d,b]=m.useState(!1),[x,v]=m.useState(""),[u,f]=m.useState(""),g=le(a),l=((_=g.data)==null?void 0:_.id)===a?g.data:void 0;m.useEffect(()=>{l&&v(l.default_api_base??"")},[l]);const k=(l==null?void 0:l.env_key_present)??!1,o=((l==null?void 0:l.requires_api_key)??!0)&&!k,y=u.trim()!==""&&u.trim()!==a,N=/[:/]/.test(u),P=a!==""&&!N&&(!o||i.trim()!=="")&&!s.isPending,A=()=>{P&&s.mutate({instance:y?u.trim():a,provider_type:y?a:null,api_base:x.trim()||null,api_key:i.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsx(M,{label:"Provider",value:a,onChange:S=>{n(S),f(""),v("")},description:"Its endpoint is built in."}),e.jsx(E,{value:i,onChange:c,label:l&&!o?"API key (optional)":"API key",description:l?o?`${l.name}'s endpoint is built in — just add your key.`:k?`${l.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${l.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>b(S=>!S),children:d?"Hide advanced":"Advanced (API base, rename)"}),d?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"API base",value:x,onChange:v,placeholder:(l==null?void 0:l.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(C,{label:"Name",value:u,onChange:f,placeholder:a||"instance name",description:N?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!P,onPress:A,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(Y,{getPayload:()=>a===""?null:{instance:y?u.trim():a,provider_type:y?a:null,api_base:x.trim()||null,api_key:i.trim()||null}})]})]})}function be({onClose:t}){const s=F(),[a,n]=m.useState(""),[i,c]=m.useState("openai-compatible"),[d,b]=m.useState(""),[x,v]=m.useState(""),u=/[:/]/.test(a),f=a.trim()!==""&&!u&&d.trim()!==""&&!s.isPending,g=()=>{f&&s.mutate({instance:a.trim(),provider_type:i||"openai-compatible",api_base:d.trim(),api_key:x.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:u?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(M,{label:"Compatible with",value:i,onChange:c,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(C,{label:"API base",value:d,onChange:b,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(E,{value:x,onChange:v,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!f,onPress:g,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(Y,{getPayload:()=>a.trim()===""||d.trim()===""?null:{instance:a.trim(),provider_type:i||"openai-compatible",api_base:d.trim(),api_key:x.trim()||null}})]})]})}function ye({onClose:t}){const[s,a]=m.useState("known");return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,i])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:i},n))})}),s==="known"?e.jsx(je,{onClose:t}):e.jsx(be,{onClose:t})]})})}function ke({provider:t,onClose:s,onSaved:a}){const n=ie(),[i,c]=m.useState(t.provider_type??""),[d,b]=m.useState(t.api_base??""),[x,v]=m.useState(!1),[u,f]=m.useState(""),g=()=>{if(n.isPending)return;const l={provider_type:i.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};x&&u.trim()&&(l.api_key=u.trim()),n.mutate({instance:t.instance,body:l},{onSuccess:()=>{a(t.instance),s()}})};return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(I,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"Provider type",value:i,onChange:c,placeholder:"openai"}),e.jsx(C,{label:"API base",value:d,onChange:b,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:x?e.jsxs(e.Fragment,{children:[e.jsx(E,{value:u,onChange:f,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{v(!1),f("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>v(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:n.isPending,onPress:g,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Pe(t,s){const a=new Map((s??[]).map(c=>[c.instance,c])),n=new Map((t??[]).map(c=>[c.instance,c]));return[...new Set([...a.keys(),...n.keys()])].sort().map(c=>{const d=a.get(c);return{instance:c,source:d?"stored":"config",stored:d,meta:n.get(c)}})}function Ne({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(ve,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):t.discovery_unsupported?e.jsxs("span",{className:"block max-w-xs break-words text-xs text-amber-800",children:["Could not list models, so the key could not be verified. It may still work for requests.",t.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:t.error}):null]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function _e({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=!t.ok&&t.discovery_unsupported,a=t.ok?"border-green-200 bg-green-50 text-green-700":s?"border-amber-200 bg-amber-50 text-amber-800":"border-red-200 bg-red-50 text-red-700",n=t.ok?"bg-green-500":s?"bg-amber-500":"bg-red-500",i=t.checked_at?`Last checked ${q(t.checked_at)}`:"Not checked yet",c=s?`${t.error??"This provider does not list models."} Requests to it may still work.`:t.error??"Unreachable",d=t.ok?i:`${c} · ${i}`;return e.jsxs("span",{title:d,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${n}`}),t.ok?"Reachable":s?"No model discovery":"Unreachable"]})}function Se({healthy:t,degraded:s,total:a,checkedAt:n}){const c=t===a?"bg-green-500":t+s===a?"bg-amber-500":"bg-red-500",d=oe();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${c}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s>0?e.jsxs("span",{className:"text-amber-800",children:[s," without model discovery"]}):null,n?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",q(n)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:d.isPending,onPress:()=>d.mutate(),children:d.isPending?"Re-checking…":"Re-check all"})]})}function R({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ce({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n,secretKeyConfigured:i}){return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(R,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(R,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(R,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",isDisabled:!i,onPress:t,children:"Add your first provider"})})]})})}function Ke(){var D,L,O,$;const t=J(),s=Q(),a=X(),n=ee(),i=te(),c=se(),d=ae(),[b,x]=m.useState(!1),[v,u]=m.useState(null),[f,g]=m.useState({}),l=Pe((D=t.data)==null?void 0:D.providers,s.data),k=new Map((((L=n.data)==null?void 0:L.providers)??[]).map(r=>[r.instance,r])),o=t.isLoading||s.isLoading,y=((O=s.data)==null?void 0:O.find(r=>r.instance===v))??null,N=(($=a.data)==null?void 0:$.require_pricing)===!0&&a.data.default_pricing===!1,P=a.data?a.data.secret_key_configured!==!1:!a.isError,A=!o&&l.length===0&&!b,_=m.useRef({}),S=r=>{const p=(_.current[r]??0)+1;return _.current[r]=p,p},K=r=>{S(r),g(p=>{if(!Object.hasOwn(p,r))return p;const h={...p};return delete h[r],h})},B=(r,p,h)=>{_.current[r]===p&&g(G=>({...G,[r]:h}))},V=async r=>{const p=S(r);g(h=>({...h,[r]:{status:"pending"}}));try{const h=await c.mutateAsync(r);B(r,p,{status:"done",...h})}catch(h){B(r,p,{status:"done",ok:!1,model_count:0,error:H(h),discovery_unsupported:!1})}},W=[{id:"provider",header:"Provider",isRowHeader:!0,cell:r=>e.jsx(Z,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"font-medium text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})},{id:"type",header:"Type",cell:r=>{var p,h;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:((p=r.meta)==null?void 0:p.provider_type)??((h=r.stored)==null?void 0:h.provider_type)??r.instance})}},{id:"source",header:"Source",cell:r=>e.jsx(xe,{size:"sm",color:r.source==="stored"?"accent":"default",children:r.source==="stored"?"stored":"config"})},{id:"api_key",header:"API key",cell:r=>{var p,h;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:(p=r.stored)!=null&&p.last4?`••••${r.stored.last4}`:"none set"}):(h=r.meta)!=null&&h.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"})}},{id:"status",header:"Status",cell:r=>e.jsx(_e,{health:k.get(r.instance)})},{id:"actions",header:"Actions",align:"end",cell:r=>{var p,h;return r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((p=f[r.instance])==null?void 0:p.status)==="pending"||((h=r.stored)==null?void 0:h.decryptable)===!1,onPress:()=>void V(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{x(!1),u(r.instance)},children:"Edit"}),e.jsx(de,{confirmLabel:"Delete",isPending:i.isPending,onConfirm:()=>i.mutate(r.instance,{onSuccess:()=>K(r.instance)}),children:"Delete"})]}),e.jsx(Ne,{state:f[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})}}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:b||A?null:e.jsx(j,{variant:"primary",isDisabled:!P,onPress:()=>{u(null),x(!0)},children:"Add provider"})}),e.jsx(I,{error:t.error??s.error??a.error??n.error??d.error??i.error}),P?null:e.jsxs(ne,{tone:"warning",children:[e.jsx("code",{children:"OTARI_SECRET_KEY"})," is not set, so provider keys can't be encrypted at rest and adding providers from the dashboard is disabled. Set it on the server and restart to add providers here. Providers defined in"," ",e.jsx("code",{children:"config.yml"})," keep working without it."]}),A?e.jsx(Ce,{onAddProvider:()=>{u(null),x(!0)},needsPricing:N,onEnablePricing:()=>d.mutate({default_pricing:!0}),enabling:d.isPending,secretKeyConfigured:P}):null,b&&P?e.jsx(ye,{onClose:()=>x(!1)}):null,y?e.jsx(ke,{provider:y,onClose:()=>u(null),onSaved:K}):null,!o&&l.length>0&&n.data&&n.data.total>0?e.jsx(Se,{healthy:n.data.healthy,degraded:n.data.degraded,total:n.data.total,checkedAt:n.data.checked_at}):null,A?null:e.jsx(me,{ariaLabel:"Providers",columns:W,rows:l,getRowKey:r=>r.instance,isLoading:o,emptyContent:"No providers yet. Add your first provider to start serving models."})]})}export{Ke as ProvidersPage}; diff --git a/src/gateway/static/dashboard/assets/SettingsPage-CMbg-FaW.js b/src/gateway/static/dashboard/assets/SettingsPage-VWHKo1Ho.js similarity index 99% rename from src/gateway/static/dashboard/assets/SettingsPage-CMbg-FaW.js rename to src/gateway/static/dashboard/assets/SettingsPage-VWHKo1Ho.js index b61875092..cd358bfc2 100644 --- a/src/gateway/static/dashboard/assets/SettingsPage-CMbg-FaW.js +++ b/src/gateway/static/dashboard/assets/SettingsPage-VWHKo1Ho.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{W as R,aa as C,P,E as y,_ as E,ah as T,ai as _,aj as D,F as A,ak as O,a7 as F,al as I,I as w}from"./index-C-bDZxkO.js";import{d as v,B as h,A as d,g as K,I as z}from"./heroui-DZj66Arc.js";function b(t,r){return{[t]:r}}function M(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function L(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||M(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(A,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function U({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function V({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(V,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function W({source:t}){const r=O(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:K({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(G,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function X(){var o;const t=F(),r=I(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(W,{source:t}),e.jsx(X,{})]})})]})}function Q({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=T(),r=_(),s=D(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(Q,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&L(l,n)),k=ee(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,t.isLoading?e.jsx(E,{}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(U,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,L as fieldMatches}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{W as R,aa as C,P,E as y,_ as E,ah as T,ai as _,aj as D,F as A,ak as O,a7 as F,al as I,I as w}from"./index-DMrbj_xn.js";import{d as v,B as h,A as d,g as K,I as z}from"./heroui-DZj66Arc.js";function b(t,r){return{[t]:r}}function M(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function L(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||M(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(A,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function U({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function V({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(V,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function W({source:t}){const r=O(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:K({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(G,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function X(){var o;const t=F(),r=I(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(W,{source:t}),e.jsx(X,{})]})})]})}function Q({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=T(),r=_(),s=D(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(Q,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&L(l,n)),k=ee(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,t.isLoading?e.jsx(E,{}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(U,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,L as fieldMatches}; diff --git a/src/gateway/static/dashboard/assets/TablePagination-0H6sFfIt.js b/src/gateway/static/dashboard/assets/TablePagination-D_2uYqKa.js similarity index 98% rename from src/gateway/static/dashboard/assets/TablePagination-0H6sFfIt.js rename to src/gateway/static/dashboard/assets/TablePagination-D_2uYqKa.js index c776d5ddf..46453d02d 100644 --- a/src/gateway/static/dashboard/assets/TablePagination-0H6sFfIt.js +++ b/src/gateway/static/dashboard/assets/TablePagination-D_2uYqKa.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{I as w,E as M,F as D}from"./index-C-bDZxkO.js";import{A as o,B as x,T as F,L as $,I as T,S as y}from"./heroui-DZj66Arc.js";function _({label:t,value:r,onChange:a,isRequired:c,autoFocus:i}){return e.jsxs(F,{value:r,onChange:a,isRequired:c,className:"flex flex-col gap-1",children:[e.jsx($,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsx(T,{inputMode:"decimal",placeholder:"0.00",autoFocus:i})]})}function R(t){const r=t.trim();if(r==="")return null;const a=Number(r);return Number.isFinite(a)&&a>=0?a:Number.NaN}const C=t=>`Recompute cost for ${t.toLocaleString()} imported ${t===1?"row":"rows"} from each row's own token counts at these per-1M rates. Enforced gateway rows are never affected.`;function W({isOpen:t,onOpenChange:r,targetCount:a,isPending:c,error:i,onSubmit:E,title:I="Set price",description:L=C}){const[j,p]=u.useState(""),[n,h]=u.useState(""),[b,N]=u.useState(""),[f,v]=u.useState("");u.useEffect(()=>{t&&(p(""),h(""),N(""),v(""))},[t]);const m=R(j),l=R(n),d=R(b),s=R(f),g=m===null||Number.isNaN(m)||l===null||Number.isNaN(l)||Number.isNaN(d??0)||Number.isNaN(s??0),S=()=>{g||m===null||l===null||E({input_price_per_million:m,output_price_per_million:l,...d!==null&&!Number.isNaN(d)?{cache_read_price_per_million:d}:{},...s!==null&&!Number.isNaN(s)?{cache_write_price_per_million:s}:{}})};return e.jsx(o,{isOpen:t,onOpenChange:r,children:t?e.jsx(o.Backdrop,{children:e.jsx(o.Container,{placement:"center",size:"lg",children:e.jsxs(o.Dialog,{children:[e.jsx(o.Header,{children:e.jsx(o.Heading,{children:I})}),e.jsxs(o.Body,{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:L(a)}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(_,{label:"Input $ / 1M",value:j,onChange:p,isRequired:!0,autoFocus:!0}),e.jsx(_,{label:"Output $ / 1M",value:n,onChange:h,isRequired:!0}),e.jsx(_,{label:"Cache read $ / 1M",value:b,onChange:N}),e.jsx(_,{label:"Cache write $ / 1M",value:f,onChange:v})]}),e.jsx(w,{tone:"info",children:"Leave a cache rate blank to bill those tokens at the input rate."}),e.jsx(M,{error:i})]}),e.jsxs(o.Footer,{children:[e.jsx(x,{variant:"ghost",isDisabled:c,onPress:()=>r(!1),children:"Cancel"}),e.jsx(x,{variant:"primary",isDisabled:g,isPending:c,onPress:S,children:"Set price"})]})]})})}):null})}const P=[25,50,100];function q({page:t,pageSize:r,total:a,rowsOnPage:c,onPageChange:i,onPageSizeChange:E,pageSizeOptions:I=P,isFetching:L=!1,hasNextFallback:j=!1}){const p=u.useId(),n=a!=null?Math.max(1,Math.ceil(a/r)):null,h=t===0,b=n!=null?t>=n-1:!j,N=c>0?t*r+1:0,f=t*r+c,v=a!=null?a===0?"0 of 0":`${N.toLocaleString()}–${f.toLocaleString()} of ${a.toLocaleString()}`:c>0?`${N.toLocaleString()}–${f.toLocaleString()}`:"0",[m,l]=u.useState(String(t+1));u.useEffect(()=>{l(String(t+1))},[t]);const d=()=>{const s=Number.parseInt(m,10);if(Number.isNaN(s)){l(String(t+1));return}const g=n??Number.MAX_SAFE_INTEGER,S=Math.min(Math.max(s,1),g);S-1!==t?i(S-1):l(String(t+1))};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:p,className:"text-sm text-[var(--otari-muted)]",children:"Rows"}),e.jsx(D,{id:p,ariaLabel:"Rows per page",value:String(r),onChange:s=>E(Number.parseInt(s,10)),options:I.map(s=>({value:String(s),label:String(s)}))}),L?e.jsx(y,{size:"sm"}):null]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[var(--otari-muted)] tabular-nums",children:v}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"outline","aria-label":"First page",isDisabled:h,onPress:()=>i(0),children:"«"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Previous page",isDisabled:h,onPress:()=>i(t-1),children:"‹"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{"aria-label":"Page number",inputMode:"numeric",value:m,onChange:s=>l(s.target.value.replace(/[^0-9]/g,"")),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()},onBlur:d,className:"w-12 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-2 py-1 text-center text-sm text-[var(--otari-ink)] tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"}),n!=null?e.jsxs("span",{className:"tabular-nums",children:["/ ",n.toLocaleString()]}):null]}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Next page",isDisabled:b,onPress:()=>i(t+1),children:"›"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Last page",isDisabled:n==null||b,onPress:()=>n!=null&&i(n-1),children:"»"})]})]})]})}export{P,W as S,q as T}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{I as w,E as M,F as D}from"./index-DMrbj_xn.js";import{A as o,B as x,T as F,L as $,I as T,S as y}from"./heroui-DZj66Arc.js";function _({label:t,value:r,onChange:a,isRequired:c,autoFocus:i}){return e.jsxs(F,{value:r,onChange:a,isRequired:c,className:"flex flex-col gap-1",children:[e.jsx($,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsx(T,{inputMode:"decimal",placeholder:"0.00",autoFocus:i})]})}function R(t){const r=t.trim();if(r==="")return null;const a=Number(r);return Number.isFinite(a)&&a>=0?a:Number.NaN}const C=t=>`Recompute cost for ${t.toLocaleString()} imported ${t===1?"row":"rows"} from each row's own token counts at these per-1M rates. Enforced gateway rows are never affected.`;function W({isOpen:t,onOpenChange:r,targetCount:a,isPending:c,error:i,onSubmit:E,title:I="Set price",description:L=C}){const[j,p]=u.useState(""),[n,h]=u.useState(""),[b,N]=u.useState(""),[f,v]=u.useState("");u.useEffect(()=>{t&&(p(""),h(""),N(""),v(""))},[t]);const m=R(j),l=R(n),d=R(b),s=R(f),g=m===null||Number.isNaN(m)||l===null||Number.isNaN(l)||Number.isNaN(d??0)||Number.isNaN(s??0),S=()=>{g||m===null||l===null||E({input_price_per_million:m,output_price_per_million:l,...d!==null&&!Number.isNaN(d)?{cache_read_price_per_million:d}:{},...s!==null&&!Number.isNaN(s)?{cache_write_price_per_million:s}:{}})};return e.jsx(o,{isOpen:t,onOpenChange:r,children:t?e.jsx(o.Backdrop,{children:e.jsx(o.Container,{placement:"center",size:"lg",children:e.jsxs(o.Dialog,{children:[e.jsx(o.Header,{children:e.jsx(o.Heading,{children:I})}),e.jsxs(o.Body,{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:L(a)}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(_,{label:"Input $ / 1M",value:j,onChange:p,isRequired:!0,autoFocus:!0}),e.jsx(_,{label:"Output $ / 1M",value:n,onChange:h,isRequired:!0}),e.jsx(_,{label:"Cache read $ / 1M",value:b,onChange:N}),e.jsx(_,{label:"Cache write $ / 1M",value:f,onChange:v})]}),e.jsx(w,{tone:"info",children:"Leave a cache rate blank to bill those tokens at the input rate."}),e.jsx(M,{error:i})]}),e.jsxs(o.Footer,{children:[e.jsx(x,{variant:"ghost",isDisabled:c,onPress:()=>r(!1),children:"Cancel"}),e.jsx(x,{variant:"primary",isDisabled:g,isPending:c,onPress:S,children:"Set price"})]})]})})}):null})}const P=[25,50,100];function q({page:t,pageSize:r,total:a,rowsOnPage:c,onPageChange:i,onPageSizeChange:E,pageSizeOptions:I=P,isFetching:L=!1,hasNextFallback:j=!1}){const p=u.useId(),n=a!=null?Math.max(1,Math.ceil(a/r)):null,h=t===0,b=n!=null?t>=n-1:!j,N=c>0?t*r+1:0,f=t*r+c,v=a!=null?a===0?"0 of 0":`${N.toLocaleString()}–${f.toLocaleString()} of ${a.toLocaleString()}`:c>0?`${N.toLocaleString()}–${f.toLocaleString()}`:"0",[m,l]=u.useState(String(t+1));u.useEffect(()=>{l(String(t+1))},[t]);const d=()=>{const s=Number.parseInt(m,10);if(Number.isNaN(s)){l(String(t+1));return}const g=n??Number.MAX_SAFE_INTEGER,S=Math.min(Math.max(s,1),g);S-1!==t?i(S-1):l(String(t+1))};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:p,className:"text-sm text-[var(--otari-muted)]",children:"Rows"}),e.jsx(D,{id:p,ariaLabel:"Rows per page",value:String(r),onChange:s=>E(Number.parseInt(s,10)),options:I.map(s=>({value:String(s),label:String(s)}))}),L?e.jsx(y,{size:"sm"}):null]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[var(--otari-muted)] tabular-nums",children:v}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"outline","aria-label":"First page",isDisabled:h,onPress:()=>i(0),children:"«"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Previous page",isDisabled:h,onPress:()=>i(t-1),children:"‹"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{"aria-label":"Page number",inputMode:"numeric",value:m,onChange:s=>l(s.target.value.replace(/[^0-9]/g,"")),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()},onBlur:d,className:"w-12 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-2 py-1 text-center text-sm text-[var(--otari-ink)] tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"}),n!=null?e.jsxs("span",{className:"tabular-nums",children:["/ ",n.toLocaleString()]}):null]}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Next page",isDisabled:b,onPress:()=>i(t+1),children:"›"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Last page",isDisabled:n==null||b,onPress:()=>n!=null&&i(n-1),children:"»"})]})]})]})}export{P,W as S,q as T}; diff --git a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-DkLhKtcA.js b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-CBa0KCZv.js similarity index 99% rename from src/gateway/static/dashboard/assets/ToolsGuardrailsPage-DkLhKtcA.js rename to src/gateway/static/dashboard/assets/ToolsGuardrailsPage-CBa0KCZv.js index fd5c96705..5cfd6daf4 100644 --- a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-DkLhKtcA.js +++ b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-CBa0KCZv.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x}from"./react-dgEcD0HR.js";import{am as L,an as C,P,E,_ as R,U as w,ao as D,F as U}from"./index-C-bDZxkO.js";import{d as N,B as g}from"./heroui-DZj66Arc.js";function M(s,t){return{[s]:t}}const B=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=x.useState(null),a=x.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function z({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",b="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r),[m,p]=x.useState(null),c=D();x.useEffect(()=>{i(r)},[r]);const o=l.trim()!==r,d=l.trim(),h=m!==null&&m===d;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:l,disabled:n,placeholder:"unset",onChange:v=>{i(v.target.value),c.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(d===""?null:d),children:"Save"}),e.jsx(g,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:d===""||c.isPending,onPress:()=>{p(d),c.mutate({service:s.service,url:d})},children:c.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:c.isPending||!h?null:c.error?e.jsx("span",{className:"text-red-700",children:w(c.error)}):c.data?e.jsx("span",{className:c.data.ok?"font-medium text-green-700":"text-red-700",children:c.data.reason}):null}),e.jsx(j,{message:a})]})]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:p=>i(p.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(l.trim()===""?null:l.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l.trim(),p=Number(m),o=(m===""||Number.isInteger(p)&&p>=1)&&m!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:d=>i(d.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(m===""?null:p),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(U,{ariaLabel:s.key,value:r,onChange:l=>t(l==="default"?null:l==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function O({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(F,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n})}function V(){const s=L(),t=C(),[a,n]=$(),[r,l]=x.useState({}),i=s.data,m=!i||t.isPending,p=new Map(((i==null?void 0:i.fields)??[]).map(o=>[o.key,o])),c=(o,d)=>{l(h=>{const{[o.key]:v,...u}=h;return u}),t.mutate(M(o.key,d),{onSuccess:()=>n(`${o.key} saved`),onError:h=>l(v=>({...v,[o.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(E,{error:s.error}),s.isLoading?e.jsx(R,{}):null,B.map(o=>{const d=o.order.map(u=>p.get(u)).filter(u=>u!==void 0),h=((i==null?void 0:i.fields)??[]).filter(u=>u.service===o.key&&!o.order.includes(u.key)),v=[...d,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:o.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:o.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(O,{field:u,onSave:T=>c(u,T),saveError:r[u.key],disabled:m},u.key))})})]},o.key)}),e.jsx(z,{message:a})]})}export{V as ToolsGuardrailsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x}from"./react-dgEcD0HR.js";import{am as L,an as C,P,E,_ as R,U as w,ao as D,F as U}from"./index-DMrbj_xn.js";import{d as N,B as g}from"./heroui-DZj66Arc.js";function M(s,t){return{[s]:t}}const B=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=x.useState(null),a=x.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function z({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",b="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r),[m,p]=x.useState(null),c=D();x.useEffect(()=>{i(r)},[r]);const o=l.trim()!==r,d=l.trim(),h=m!==null&&m===d;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:l,disabled:n,placeholder:"unset",onChange:v=>{i(v.target.value),c.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(d===""?null:d),children:"Save"}),e.jsx(g,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:d===""||c.isPending,onPress:()=>{p(d),c.mutate({service:s.service,url:d})},children:c.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:c.isPending||!h?null:c.error?e.jsx("span",{className:"text-red-700",children:w(c.error)}):c.data?e.jsx("span",{className:c.data.ok?"font-medium text-green-700":"text-red-700",children:c.data.reason}):null}),e.jsx(j,{message:a})]})]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:p=>i(p.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(l.trim()===""?null:l.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l.trim(),p=Number(m),o=(m===""||Number.isInteger(p)&&p>=1)&&m!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:d=>i(d.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(m===""?null:p),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(U,{ariaLabel:s.key,value:r,onChange:l=>t(l==="default"?null:l==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function O({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(F,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n})}function V(){const s=L(),t=C(),[a,n]=$(),[r,l]=x.useState({}),i=s.data,m=!i||t.isPending,p=new Map(((i==null?void 0:i.fields)??[]).map(o=>[o.key,o])),c=(o,d)=>{l(h=>{const{[o.key]:v,...u}=h;return u}),t.mutate(M(o.key,d),{onSuccess:()=>n(`${o.key} saved`),onError:h=>l(v=>({...v,[o.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(E,{error:s.error}),s.isLoading?e.jsx(R,{}):null,B.map(o=>{const d=o.order.map(u=>p.get(u)).filter(u=>u!==void 0),h=((i==null?void 0:i.fields)??[]).filter(u=>u.service===o.key&&!o.order.includes(u.key)),v=[...d,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:o.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:o.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(O,{field:u,onSave:T=>c(u,T),saveError:r[u.key],disabled:m},u.key))})})]},o.key)}),e.jsx(z,{message:a})]})}export{V as ToolsGuardrailsPage}; diff --git a/src/gateway/static/dashboard/assets/UsagePage-5U02HhO3.js b/src/gateway/static/dashboard/assets/UsagePage-5U02HhO3.js new file mode 100644 index 000000000..b018abc61 --- /dev/null +++ b/src/gateway/static/dashboard/assets/UsagePage-5U02HhO3.js @@ -0,0 +1 @@ +import{j as t}from"./tanstack-query-1t81HyiD.js";import{i as _t,r as d}from"./react-dgEcD0HR.js";import{u as yt,c as bt,n as ke,i as xt,g as _e,ap as ft,aq as gt,a0 as X,ar as He,P as jt,E as St,m as ye,f as wt,R as Nt,as as We,B as Ct,a1 as I,a3 as J,a2 as xe,a5 as Be,at as K,F as Et,h as Lt,N as Tt,r as Ft}from"./index-DMrbj_xn.js";import{S as ee,C as Rt,T as Ot}from"./charts-DNysd9jl.js";import{D as At}from"./DataTable-CrQq0sYf.js";import{F as Pt}from"./FilterChips-BLdhUEZK.js";import{B as R,S as Ue}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function te(c){return c.toLocaleString()}function qt(c){return c===null?"—":c<1e3?`${Math.round(c)} ms`:`${(c/1e3).toFixed(2)} s`}function Dt(c,x){const f=new Date(c);return Number.isNaN(f.getTime())?c:x==="hour"?f.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):f.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const Me=Lt(We,He),be=15,$e=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}],Bt=[{value:"",label:"None"},{value:"model",label:"Model"},{value:"user_id",label:"User"},{value:"api_key_id",label:"API key"},{value:"source",label:"Source"}],Ut=[{key:"fresh",label:"Fresh input",color:"var(--otari-ink)"},{key:"cache_read",label:"Cache read",color:"var(--otari-brand)"},{key:"cache_write",label:"Cache write",color:"var(--otari-brand-soft)"},{key:"output",label:"Output",color:"var(--otari-brand-dark)"}],Mt=[{key:"success",label:"Succeeded",color:"var(--otari-brand)"},{key:"errors",label:"Failed",color:"var(--otari-danger)"}],Ie=["var(--otari-cat-1)","var(--otari-cat-2)","var(--otari-cat-3)","var(--otari-cat-4)","var(--otari-cat-5)","var(--otari-cat-6)","var(--otari-cat-7)","var(--otari-cat-8)"],$t="var(--otari-cat-other)";function It(c){return c==="cost"?xe:c==="tokens"?K:te}const Ke="__other__",ze="__unknown__";function Ge({dimensionLabel:c,rows:x,totalCost:f,emptyLabel:b,unknownLabel:se="(unknown)",onDrill:L,loading:O}){const[h,P]=d.useState(!1),z=h?x:x.slice(0,be),G=x.length-z.length,re=r=>r.is_other?Ke:r.key??ze,H=[{id:"name",header:c,isRowHeader:!0,cell:r=>{const q=f>0?r.cost/f:0;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"truncate text-[var(--otari-ink)]",children:r.is_other?`Other (${r.requests.toLocaleString()} req)`:r.key===null?se:r.key}),t.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:t.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,q*100)}%`}})})]})}},{id:"requests",header:"Requests",align:"end",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:te(r.requests)})},{id:"tokens",header:"Tokens",align:"end",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:K(r.tokens)})},{id:"spend",header:"Spend",align:"end",cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:xe(r.cost)})}];return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(At,{ariaLabel:`Spend by ${c.toLowerCase()}`,columns:H,rows:z,getRowKey:re,isLoading:O,emptyContent:b,onRowAction:r=>{r!==Ke&&r!==ze&&L(r)}}),!O&&G>0?t.jsxs(R,{size:"sm",variant:"ghost",onPress:()=>P(!0),children:["Show all ",x.length]}):null,!O&&h&&x.length>be?t.jsxs(R,{size:"sm",variant:"ghost",onPress:()=>P(!1),children:["Show top ",be]}):null]})}const Kt=["model","user","source_label","endpoint","provider","source"],zt=["model"];function Jt(){var Oe,Ae,Pe,qe;const c=_t(),x=yt(),f=bt(),[b,se]=d.useState(Me),[L,O]=d.useState(()=>ke(Me.seconds??0)),[h,P]=d.useState(!1),[z,G]=d.useState(),[re,H]=d.useState(),[r,q]=d.useState(""),[k,ae]=d.useState(""),[p,oe]=d.useState(""),[u,Ye]=d.useState("cost"),[T,Ze]=d.useState(""),v=h?z:L,g=h?re:void 0,w=h?v?xt(v,g):"day":b.bucket,N=d.useMemo(()=>({start_date:v,end_date:g,model:r.trim()||void 0,user_id:k||void 0,api_key_id:p||void 0}),[v,g,r,k,p]),D=d.useMemo(()=>{if(h){if(!v||!g)return null;const e=new Date(g).getTime()-new Date(v).getTime();return e>0?{...N,start_date:new Date(new Date(v).getTime()-e).toISOString(),end_date:v}:null}return!L||b.seconds===null?null:{...N,start_date:new Date(new Date(L).getTime()-b.seconds*1e3).toISOString(),end_date:L}},[h,v,g,N,b.seconds,L]),j=_e(N,w,Kt),ne=_e(D??N,w,Tt,D!==null),C=ft(N,w,T||null),le=T!==""&&C.error instanceof gt&&C.error.status===404,F=le?"":T,s=j.data,a=s==null?void 0:s.totals,_=D!==null?(Oe=ne.data)==null?void 0:Oe.totals:void 0,fe=a?X(a.cost,_==null?void 0:_.cost):null,Qe=d.useMemo(()=>({...N,model:void 0}),[N]),ge=_e(Qe,w,zt),ie=((Pe=(Ae=ge.data)==null?void 0:Ae.by_model)==null?void 0:Pe.filter(e=>!e.is_other&&e.key!==null).map(e=>e.key))??[],je=(x.data??[]).map(e=>({value:e.user_id,label:e.alias?`${e.alias} (${e.user_id})`:e.user_id})),ce=(f.data??[]).map(e=>({value:e.id,label:e.key_name??`${e.id.slice(0,8)}…`})),Ve=e=>{var n;return((n=ce.find(l=>l.value===e))==null?void 0:n.label)??e},Xe=(r&&!ie.includes(r)?[r,...ie]:ie).map(e=>({value:e,label:e})),Je=h||b.key!==He,de=!!(r.trim()||k||p||Je),Se=(e,n)=>{var l;return((l=e.find(o=>o.value===n))==null?void 0:l.label)??n},et=()=>{q(""),ae(""),oe("")},tt=[...k?[{key:"user",label:"User",value:Se(je,k),onClear:()=>ae("")}]:[],...r.trim()?[{key:"model",label:"Model",value:r.trim(),onClear:()=>q("")}]:[],...p?[{key:"key",label:"API key",value:Se(ce,p),onClear:()=>oe("")}]:[]],st=!!(s&&a&&a.request_count===0&&!de),rt=(s==null?void 0:s.start_date)??v,at=(s==null?void 0:s.end_date)??g,we=e=>{P(!1),se(e),O(ke(e.seconds??0)),G(void 0),H(void 0)},ot=(e,n)=>{P(!0),G(e),H(n)},nt=()=>{h||O(ke(b.seconds??0)),j.refetch(),ge.refetch(),D!==null&&ne.refetch(),T&&C.refetch()},A=e=>{const n=new URLSearchParams;v&&n.set("start_date",v),g&&n.set("end_date",g);for(const[l,o]of Object.entries(e))o&&n.set(l,o);c(`/activity?${n.toString()}`)},lt=a&&a.request_count>0?a.error_count/a.request_count:0,Ne=((s==null?void 0:s.by_source)??[]).filter(e=>!e.is_other).length>1,it=Ne||T==="source",m=(s==null?void 0:s.series)??[],W=m.length>1,Ce=a==null?void 0:a.billed_input_tokens,Y=a===void 0?null:Ce!==void 0?Ce+(a.billed_output_tokens??a.completion_tokens):a.total_tokens,ct=_===void 0?null:_.billed_input_tokens!==void 0?_.billed_input_tokens+(_.billed_output_tokens??_.completion_tokens):_.total_tokens,Ee=e=>{let n=0,l=0,o=0;for(const y of e)n+=y.input_tokens??0,l+=y.cache_read_tokens??0,o+=y.cache_write_tokens??0;return{input:n,read:l,write:o}},B=Ee(m),Z=B.input>0?B.read/B.input:null,ue=Ee(D!==null?((qe=ne.data)==null?void 0:qe.series)??[]:[]),Le=ue.input>0?ue.read/ue.input:void 0,Te=e=>e.input_tokens!==void 0?e.input_tokens+(e.output_tokens??0):e.tokens,me=m.some(e=>(e.input_tokens??0)>0),Fe=m.some(e=>(e.errors??0)>0),E=d.useMemo(()=>{var l;const e=m.map(o=>o.bucket_start);if(F){const o=C.data;if(!o)return{series:[],data:[]};const y=o.groups.map((i,S)=>({key:`g${S}`,label:i.is_other?"Other":i.key===null?"(unknown)":F==="api_key_id"?Ve(i.key):i.key,color:i.is_other?$t:Ie[S%Ie.length]})),V=new Map(o.groups.map((i,S)=>[`${i.is_other}|${i.key}`,`g${S}`])),$=new Map(e.map(i=>[i,{x:i,...Object.fromEntries(y.map(S=>[S.key,0]))}]));for(const i of o.points){const S=V.get(`${i.is_other}|${i.key}`),De=$.get(i.bucket_start);!S||!De||(De[S]=u==="cost"?i.cost:u==="tokens"?i.tokens:i.requests)}return{series:y,data:[...$.values()]}}return u==="tokens"&&me?{series:Ut,data:m.map(o=>{const y=o.input_tokens??0,V=o.cache_read_tokens??0,$=o.cache_write_tokens??0;return{x:o.bucket_start,fresh:Math.max(0,y-V-$),cache_read:V,cache_write:$,output:o.output_tokens??0}})}:u==="requests"&&Fe?{series:Mt,data:m.map(o=>{const y=Math.min(o.errors??0,o.requests);return{x:o.bucket_start,success:o.requests-y,errors:y}})}:{series:[{key:u,label:((l=$e.find(o=>o.key===u))==null?void 0:l.label)??u,color:"var(--otari-brand)"}],data:m.map(o=>({x:o.bucket_start,[u]:u==="cost"?o.cost:u==="tokens"?Te(o):o.requests}))}},[m,F,C.data,u,me,Fe,f.data]),Re=It(u),dt=j.isLoading||!!F&&C.isLoading,ut=E.data.length?Math.max(...E.data.map(e=>E.series.reduce((n,l)=>n+(typeof e[l.key]=="number"?e[l.key]:0),0))):0,mt=m.map(e=>e.bucket_start),ht=(e,n)=>{const l=Ft(mt,e,n,w);l&&ot(l.startIso,l.endIso)},he=[{key:"model",label:"Model",rows:(s==null?void 0:s.by_model)??[],drill:e=>A({model:e,user_id:k||void 0,api_key_id:p||void 0})},{key:"user",label:"User",rows:(s==null?void 0:s.by_user)??[],drill:e=>A({user_id:e,model:r.trim()||void 0,api_key_id:p||void 0})}],pt=[{key:"source_label",label:"Session",rows:(s==null?void 0:s.by_source_label)??[],unknownLabel:"(no session)",drill:e=>A({source_label:e,model:r.trim()||void 0,user_id:k||void 0,api_key_id:p||void 0})},{key:"endpoint",label:"Endpoint",rows:(s==null?void 0:s.by_endpoint)??[],drill:e=>A({endpoint:e,model:r.trim()||void 0,user_id:k||void 0,api_key_id:p||void 0})},{key:"provider",label:"Provider",rows:(s==null?void 0:s.by_provider)??[],drill:e=>A({provider:e,model:r.trim()||void 0,user_id:k||void 0,api_key_id:p||void 0})},{key:"source",label:"Source",rows:(s==null?void 0:s.by_source)??[],drill:e=>A({source:e,model:r.trim()||void 0,user_id:k||void 0,api_key_id:p||void 0})}],[pe,vt]=d.useState("model"),[Q,kt]=d.useState("source_label"),U=he.find(e=>e.key===pe)??he[0],ve=pt.filter(e=>e.key!=="source"||Ne||Q==="source"),M=ve.find(e=>e.key===Q)??ve[0];return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(jt,{title:"Usage & analytics",description:"Spend, tokens, cache use, and request volume over time. Group the chart by model, user, key, or source, and click a breakdown row to drill into the request log."}),t.jsx(St,{error:j.error??(T!==""&&!le?C.error:null)}),t.jsxs(Pt,{chips:tt,onClearAll:et,start:We.map(e=>t.jsx(R,{size:"sm",variant:!h&&b.key===e.key?"primary":"outline",onPress:()=>we(e),children:e.label},e.key)),end:t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",wt(rt,at)," · UTC"]}),t.jsx(Nt,{onRefresh:nt,isFetching:j.isFetching,updatedAt:j.dataUpdatedAt})]}),children:[t.jsx(ye,{label:"User",value:k,onChange:ae,options:je,placeholder:"All users"}),t.jsx(ye,{label:"Model",value:r,onChange:q,options:Xe,placeholder:"All models"}),t.jsx(ye,{label:"API key",value:p,onChange:oe,options:ce,placeholder:"All keys"})]}),st?t.jsx(Ct,{title:"No usage yet",description:"Once the gateway serves requests, spend and volume appear here."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-5",children:[t.jsx(I,{label:"Tracked cost",value:a?xe(a.cost):"—",hint:a?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t.jsx(J,{fraction:fe}),a.unpriced_requests?`${fe!==null?" · ":""}${te(a.unpriced_requests)} unpriced`:null]}):null,chart:W?t.jsx(ee,{values:m.map(e=>e.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),t.jsx(I,{label:"Requests",value:a?te(a.request_count):"—",hint:a?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Be(lt)," errors",_?t.jsxs(t.Fragment,{children:[" · ",t.jsx(J,{fraction:X(a.request_count,_.request_count)})]}):null]}):null,chart:W?t.jsx(ee,{values:m.map(e=>e.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),t.jsx(I,{label:"Tokens (billed)",value:Y!==null?K(Y):"—",hint:Y!==null?t.jsx(J,{fraction:X(Y,ct??void 0)}):null,chart:W?t.jsx(ee,{values:m.map(Te),ariaLabel:"Billed token trend over the selected window"}):void 0}),t.jsx(I,{label:"Cache hit rate",value:Z!==null?Be(Z):"—",hint:a?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Z!==null&&Le!==void 0?t.jsxs(t.Fragment,{children:[t.jsx(J,{fraction:X(Z,Le)})," · "]}):null,K(B.read)," read · ",K(B.write)," written"]}):null,chart:W&&me?t.jsx(ee,{values:m.map(e=>(e.input_tokens??0)>0?(e.cache_read_tokens??0)/(e.input_tokens??1):0),ariaLabel:"Cache hit rate trend over the selected window"}):void 0}),t.jsx(I,{label:"Avg latency",value:a?qt(a.avg_latency_ms):"—"})]}),t.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("div",{className:"inline-flex gap-1.5",children:$e.map(e=>t.jsx(R,{size:"sm",variant:u===e.key?"primary":"outline","aria-pressed":u===e.key,onPress:()=>Ye(e.key),children:e.label},e.key))}),t.jsxs("div",{className:"flex items-center gap-2",children:[h?t.jsx(R,{size:"sm",variant:"ghost",onPress:()=>we(b),children:"Reset zoom"}):null,j.isFetching||F&&C.isFetching?t.jsx(Ue,{size:"sm"}):null,t.jsx(Et,{ariaLabel:"Group by",value:T,onChange:e=>Ze(e),options:Bt.filter(e=>e.value!=="source"||it).map(e=>({value:e.value,label:e.value?`By ${e.label.toLowerCase()}`:"No grouping"}))})]})]}),le?t.jsx("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:"The running gateway predates grouped series, so the chart shows ungrouped totals. Restart the gateway on this build to enable grouping."}):null,t.jsx(Rt,{series:E.series}),dt?t.jsx("div",{className:"flex h-64 items-center justify-center",children:t.jsx(Ue,{size:"sm"})}):E.data.length===0?t.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):t.jsxs("figure",{className:"flex flex-col gap-2",children:[t.jsx(Ot,{data:E.data,series:E.series,formatValue:Re,formatXTick:e=>Dt(e,w),ariaLabel:`${u} per ${w}${F?`, grouped by ${F}`:""}`,height:260,showYAxis:!0,showTotal:!0,onSelectRange:ht}),t.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[Re(ut)," peak · ",E.data.length," ",w==="hour"?"hours":"days"," (times in UTC) · drag across the chart to zoom"]})]})]}),t.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Spend by ",U.label.toLowerCase()]}),t.jsx("div",{className:"inline-flex gap-1.5",children:he.map(e=>t.jsx(R,{size:"sm",variant:pe===e.key?"primary":"outline","aria-pressed":pe===e.key,onPress:()=>vt(e.key),children:e.label},e.key))})]}),t.jsx(Ge,{dimensionLabel:U.label,rows:U.rows,totalCost:(a==null?void 0:a.cost)??0,emptyLabel:de?"No usage matches these filters.":"No usage recorded yet.",unknownLabel:U.unknownLabel,onDrill:U.drill,loading:j.isLoading})]}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Spend by ",M.label.toLowerCase()]}),t.jsx("div",{className:"inline-flex gap-1.5",children:ve.map(e=>t.jsx(R,{size:"sm",variant:Q===e.key?"primary":"outline","aria-pressed":Q===e.key,onPress:()=>kt(e.key),children:e.label},e.key))})]}),t.jsx(Ge,{dimensionLabel:M.label,rows:M.rows,totalCost:(a==null?void 0:a.cost)??0,emptyLabel:de?"No usage matches these filters.":"No usage recorded yet.",unknownLabel:M.unknownLabel,onDrill:M.drill,loading:j.isLoading})]})]})]})]})}export{Jt as UsagePage}; diff --git a/src/gateway/static/dashboard/assets/UsagePage-CjaSd7XG.js b/src/gateway/static/dashboard/assets/UsagePage-CjaSd7XG.js deleted file mode 100644 index 0337f4fa4..000000000 --- a/src/gateway/static/dashboard/assets/UsagePage-CjaSd7XG.js +++ /dev/null @@ -1 +0,0 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{i as ht,r as d}from"./react-dgEcD0HR.js";import{u as pt,c as vt,n as pe,i as kt,g as ve,ap as _t,aq as yt,a0 as X,ar as Ie,P as bt,E as xt,m as ke,f as gt,R as ft,as as Ke,B as jt,a1 as $,a3 as J,a2 as ye,a5 as Ae,at as I,F as St,h as wt,N as Nt,r as Ct}from"./index-C-bDZxkO.js";import{S as ee,C as Et,T as Lt}from"./charts-B_hm0rXH.js";import{D as Tt}from"./DataTable-CrQq0sYf.js";import{F as Ft}from"./FilterChips-BLdhUEZK.js";import{B as O,S as Pe}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function te(l){return l.toLocaleString()}function Rt(l){return l===null?"—":l<1e3?`${Math.round(l)} ms`:`${(l/1e3).toFixed(2)} s`}function Ot(l,x){const g=new Date(l);return Number.isNaN(g.getTime())?l:x==="hour"?g.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):g.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const qe=wt(Ke,Ie),_e=15,De=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}],At=[{value:"",label:"None"},{value:"model",label:"Model"},{value:"user_id",label:"User"},{value:"api_key_id",label:"API key"},{value:"source",label:"Source"}],Pt=[{key:"fresh",label:"Fresh input",color:"var(--otari-ink)"},{key:"cache_read",label:"Cache read",color:"var(--otari-brand)"},{key:"cache_write",label:"Cache write",color:"var(--otari-brand-soft)"},{key:"output",label:"Output",color:"var(--otari-brand-dark)"}],qt=[{key:"success",label:"Succeeded",color:"var(--otari-brand)"},{key:"errors",label:"Failed",color:"var(--otari-danger)"}],Be=["var(--otari-cat-1)","var(--otari-cat-2)","var(--otari-cat-3)","var(--otari-cat-4)","var(--otari-cat-5)","var(--otari-cat-6)","var(--otari-cat-7)","var(--otari-cat-8)"],Dt="var(--otari-cat-other)";function Bt(l){return l==="cost"?ye:l==="tokens"?I:te}const Ue="__other__",Me="__unknown__";function $e({dimensionLabel:l,rows:x,totalCost:g,emptyLabel:b,unknownLabel:se="(unknown)",labelFor:f,onDrill:K,loading:p}){const[D,z]=d.useState(!1),B=D?x:x.slice(0,_e),ae=x.length-B.length,G=o=>o.is_other?Ue:o.key??Me,u=[{id:"name",header:l,isRowHeader:!0,cell:o=>{const v=g>0?o.cost/g:0;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"truncate text-[var(--otari-ink)]",children:o.is_other?`Other (${o.requests.toLocaleString()} req)`:o.key===null?se:(f==null?void 0:f(o.key))??o.key}),t.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:t.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,v*100)}%`}})})]})}},{id:"requests",header:"Requests",align:"end",cell:o=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:te(o.requests)})},{id:"tokens",header:"Tokens",align:"end",cell:o=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:I(o.tokens)})},{id:"spend",header:"Spend",align:"end",cell:o=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:ye(o.cost)})}];return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(Tt,{ariaLabel:`Spend by ${l.toLowerCase()}`,columns:u,rows:B,getRowKey:G,isLoading:p,emptyContent:b,onRowAction:o=>{o!==Ue&&o!==Me&&K(o)}}),!p&&ae>0?t.jsxs(O,{size:"sm",variant:"ghost",onPress:()=>z(!0),children:["Show all ",x.length]}):null,!p&&D&&x.length>_e?t.jsxs(O,{size:"sm",variant:"ghost",onPress:()=>z(!1),children:["Show top ",_e]}):null]})}const Ut=["model","user","source_label","endpoint","provider","source"],Mt=["model"];function Zt(){var Te,Fe,Re;const l=ht(),x=pt(),g=vt(),[b,se]=d.useState(qe),[f,K]=d.useState(()=>pe(qe.seconds??0)),[p,D]=d.useState(!1),[z,B]=d.useState(),[ae,G]=d.useState(),[u,o]=d.useState(""),[v,re]=d.useState(""),[_,oe]=d.useState(""),[h,ze]=d.useState("cost"),[T,Ge]=d.useState(""),y=p?z:f,j=p?ae:void 0,N=p?y?kt(y,j):"day":b.bucket,C=d.useMemo(()=>({start_date:y,end_date:j,model:u.trim()||void 0,user_id:v||void 0,api_key_id:_||void 0}),[y,j,u,v,_]),H=d.useMemo(()=>{if(p){if(!y||!j)return null;const e=new Date(j).getTime()-new Date(y).getTime();return e>0?{...C,start_date:new Date(new Date(y).getTime()-e).toISOString(),end_date:y}:null}return!f||b.seconds===null?null:{...C,start_date:new Date(new Date(f).getTime()-b.seconds*1e3).toISOString(),end_date:f}},[p,y,j,C,b.seconds,f]),S=ve(C,N,Ut),be=ve(H??C,N,Nt,H!==null),E=_t(C,N,T||null),ne=T!==""&&E.error instanceof yt&&E.error.status===404,F=ne?"":T,a=S.data,s=a==null?void 0:a.totals,i=H!==null?(Te=be.data)==null?void 0:Te.totals:void 0,xe=s?X(s.cost,i==null?void 0:i.cost):null,He=d.useMemo(()=>({...C,model:void 0}),[C]),ge=ve(He,N,Mt),le=((Re=(Fe=ge.data)==null?void 0:Fe.by_model)==null?void 0:Re.filter(e=>!e.is_other&&e.key!==null).map(e=>e.key))??[],fe=(x.data??[]).map(e=>({value:e.user_id,label:e.alias?`${e.alias} (${e.user_id})`:e.user_id})),ie=(g.data??[]).map(e=>({value:e.id,label:e.key_name??`${e.id.slice(0,8)}…`})),We=e=>{var c;return((c=ie.find(m=>m.value===e))==null?void 0:c.label)??e},Ye=(u&&!le.includes(u)?[u,...le]:le).map(e=>({value:e,label:e})),Ze=p||b.key!==Ie,ce=!!(u.trim()||v||_||Ze),je=(e,c)=>{var m;return((m=e.find(r=>r.value===c))==null?void 0:m.label)??c},Qe=()=>{o(""),re(""),oe("")},Ve=[...v?[{key:"user",label:"User",value:je(fe,v),onClear:()=>re("")}]:[],...u.trim()?[{key:"model",label:"Model",value:u.trim(),onClear:()=>o("")}]:[],..._?[{key:"key",label:"API key",value:je(ie,_),onClear:()=>oe("")}]:[]],Xe=!!(a&&s&&s.request_count===0&&!ce),Je=(a==null?void 0:a.start_date)??y,et=(a==null?void 0:a.end_date)??j,Se=e=>{D(!1),se(e),K(pe(e.seconds??0)),B(void 0),G(void 0)},tt=(e,c)=>{D(!0),B(e),G(c)},st=()=>{p||K(pe(b.seconds??0)),S.refetch(),ge.refetch(),H!==null&&be.refetch(),T&&E.refetch()},A=e=>{const c=new URLSearchParams;y&&c.set("start_date",y),j&&c.set("end_date",j);for(const[m,r]of Object.entries(e))r&&c.set(m,r);l(`/activity?${c.toString()}`)},at=s&&s.request_count>0?s.error_count/s.request_count:0,we=((a==null?void 0:a.by_source)??[]).filter(e=>!e.is_other).length>1,rt=we||T==="source",k=(a==null?void 0:a.series)??[],W=k.length>1,U=s==null?void 0:s.billed_input_tokens,Y=s===void 0?null:U!==void 0?U+(s.billed_output_tokens??s.completion_tokens):s.total_tokens,ot=i===void 0?null:i.billed_input_tokens!==void 0?i.billed_input_tokens+(i.billed_output_tokens??i.completion_tokens):i.total_tokens,Z=U!==void 0&&U>0&&s?s.cache_read_tokens/U:null,Ne=(i==null?void 0:i.billed_input_tokens)!==void 0&&i.billed_input_tokens>0?i.cache_read_tokens/i.billed_input_tokens:void 0,Ce=e=>e.input_tokens!==void 0?e.input_tokens+(e.output_tokens??0):e.tokens,de=k.some(e=>(e.input_tokens??0)>0),Ee=k.some(e=>(e.errors??0)>0),L=d.useMemo(()=>{var m;const e=k.map(r=>r.bucket_start);if(F){const r=E.data;if(!r)return{series:[],data:[]};const R=r.groups.map((n,w)=>({key:`g${w}`,label:n.is_other?"Other":n.key===null?"(unknown)":F==="api_key_id"?We(n.key):n.key,color:n.is_other?Dt:Be[w%Be.length]})),V=new Map(r.groups.map((n,w)=>[`${n.is_other}|${n.key}`,`g${w}`])),M=new Map(e.map(n=>[n,{x:n,...Object.fromEntries(R.map(w=>[w.key,0]))}]));for(const n of r.points){const w=V.get(`${n.is_other}|${n.key}`),Oe=M.get(n.bucket_start);!w||!Oe||(Oe[w]=h==="cost"?n.cost:h==="tokens"?n.tokens:n.requests)}return{series:R,data:[...M.values()]}}return h==="tokens"&&de?{series:Pt,data:k.map(r=>{const R=r.input_tokens??0,V=r.cache_read_tokens??0,M=r.cache_write_tokens??0;return{x:r.bucket_start,fresh:Math.max(0,R-V-M),cache_read:V,cache_write:M,output:r.output_tokens??0}})}:h==="requests"&&Ee?{series:qt,data:k.map(r=>{const R=Math.min(r.errors??0,r.requests);return{x:r.bucket_start,success:r.requests-R,errors:R}})}:{series:[{key:h,label:((m=De.find(r=>r.key===h))==null?void 0:m.label)??h,color:"var(--otari-brand)"}],data:k.map(r=>({x:r.bucket_start,[h]:h==="cost"?r.cost:h==="tokens"?Ce(r):r.requests}))}},[k,F,E.data,h,de,Ee,g.data]),Le=Bt(h),nt=S.isLoading||!!F&&E.isLoading,lt=L.data.length?Math.max(...L.data.map(e=>L.series.reduce((c,m)=>c+(typeof e[m.key]=="number"?e[m.key]:0),0))):0,it=k.map(e=>e.bucket_start),ct=(e,c)=>{const m=Ct(it,e,c,N);m&&tt(m.startIso,m.endIso)},ue=[{key:"model",label:"Model",rows:(a==null?void 0:a.by_model)??[],drill:e=>A({model:e,user_id:v||void 0,api_key_id:_||void 0})},{key:"user",label:"User",rows:(a==null?void 0:a.by_user)??[],drill:e=>A({user_id:e,model:u.trim()||void 0,api_key_id:_||void 0})}],dt=[{key:"source_label",label:"Session",rows:(a==null?void 0:a.by_source_label)??[],unknownLabel:"(no session)",drill:e=>A({source_label:e,model:u.trim()||void 0,user_id:v||void 0,api_key_id:_||void 0})},{key:"endpoint",label:"Endpoint",rows:(a==null?void 0:a.by_endpoint)??[],drill:e=>A({endpoint:e,model:u.trim()||void 0,user_id:v||void 0,api_key_id:_||void 0})},{key:"provider",label:"Provider",rows:(a==null?void 0:a.by_provider)??[],drill:e=>A({provider:e,model:u.trim()||void 0,user_id:v||void 0,api_key_id:_||void 0})},{key:"source",label:"Source",rows:(a==null?void 0:a.by_source)??[],drill:e=>A({source:e,model:u.trim()||void 0,user_id:v||void 0,api_key_id:_||void 0})}],[me,ut]=d.useState("model"),[Q,mt]=d.useState("source_label"),P=ue.find(e=>e.key===me)??ue[0],he=dt.filter(e=>e.key!=="source"||we||Q==="source"),q=he.find(e=>e.key===Q)??he[0];return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(bt,{title:"Usage & analytics",description:"Spend, tokens, cache use, and request volume over time. Group the chart by model, user, key, or source, and click a breakdown row to drill into the request log."}),t.jsx(xt,{error:S.error??(T!==""&&!ne?E.error:null)}),t.jsxs(Ft,{chips:Ve,onClearAll:Qe,start:Ke.map(e=>t.jsx(O,{size:"sm",variant:!p&&b.key===e.key?"primary":"outline",onPress:()=>Se(e),children:e.label},e.key)),end:t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",gt(Je,et)," · UTC"]}),t.jsx(ft,{onRefresh:st,isFetching:S.isFetching,updatedAt:S.dataUpdatedAt})]}),children:[t.jsx(ke,{label:"User",value:v,onChange:re,options:fe,placeholder:"All users"}),t.jsx(ke,{label:"Model",value:u,onChange:o,options:Ye,placeholder:"All models"}),t.jsx(ke,{label:"API key",value:_,onChange:oe,options:ie,placeholder:"All keys"})]}),Xe?t.jsx(jt,{title:"No usage yet",description:"Once the gateway serves requests, spend and volume appear here."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-5",children:[t.jsx($,{label:"Tracked cost",value:s?ye(s.cost):"—",hint:s?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t.jsx(J,{fraction:xe}),s.unpriced_requests?`${xe!==null?" · ":""}${te(s.unpriced_requests)} unpriced`:null]}):null,chart:W?t.jsx(ee,{values:k.map(e=>e.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),t.jsx($,{label:"Requests",value:s?te(s.request_count):"—",hint:s?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Ae(at)," errors",i?t.jsxs(t.Fragment,{children:[" · ",t.jsx(J,{fraction:X(s.request_count,i.request_count)})]}):null]}):null,chart:W?t.jsx(ee,{values:k.map(e=>e.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),t.jsx($,{label:"Tokens (billed)",value:Y!==null?I(Y):"—",hint:Y!==null?t.jsx(J,{fraction:X(Y,ot??void 0)}):null,chart:W?t.jsx(ee,{values:k.map(Ce),ariaLabel:"Billed token trend over the selected window"}):void 0}),t.jsx($,{label:"Cache hit rate",value:Z!==null?Ae(Z):"—",hint:s?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Z!==null&&Ne!==void 0?t.jsxs(t.Fragment,{children:[t.jsx(J,{fraction:X(Z,Ne)})," · "]}):null,I(s.cache_read_tokens)," read · ",I(s.cache_write_tokens)," written"]}):null,chart:W&&de?t.jsx(ee,{values:k.map(e=>(e.input_tokens??0)>0?(e.cache_read_tokens??0)/(e.input_tokens??1):0),ariaLabel:"Cache hit rate trend over the selected window"}):void 0}),t.jsx($,{label:"Avg latency",value:s?Rt(s.avg_latency_ms):"—"})]}),t.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("div",{className:"inline-flex gap-1.5",children:De.map(e=>t.jsx(O,{size:"sm",variant:h===e.key?"primary":"outline","aria-pressed":h===e.key,onPress:()=>ze(e.key),children:e.label},e.key))}),t.jsxs("div",{className:"flex items-center gap-2",children:[p?t.jsx(O,{size:"sm",variant:"ghost",onPress:()=>Se(b),children:"Reset zoom"}):null,S.isFetching||F&&E.isFetching?t.jsx(Pe,{size:"sm"}):null,t.jsx(St,{ariaLabel:"Group by",value:T,onChange:e=>Ge(e),options:At.filter(e=>e.value!=="source"||rt).map(e=>({value:e.value,label:e.value?`By ${e.label.toLowerCase()}`:"No grouping"}))})]})]}),ne?t.jsx("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:"The running gateway predates grouped series, so the chart shows ungrouped totals. Restart the gateway on this build to enable grouping."}):null,t.jsx(Et,{series:L.series}),nt?t.jsx("div",{className:"flex h-64 items-center justify-center",children:t.jsx(Pe,{size:"sm"})}):L.data.length===0?t.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):t.jsxs("figure",{className:"flex flex-col gap-2",children:[t.jsx(Lt,{data:L.data,series:L.series,formatValue:Le,formatXTick:e=>Ot(e,N),ariaLabel:`${h} per ${N}${F?`, grouped by ${F}`:""}`,height:260,showYAxis:!0,showTotal:!0,onSelectRange:ct}),t.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[Le(lt)," peak · ",L.data.length," ",N==="hour"?"hours":"days"," (times in UTC) · drag across the chart to zoom"]})]})]}),t.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Spend by ",P.label.toLowerCase()]}),t.jsx("div",{className:"inline-flex gap-1.5",children:ue.map(e=>t.jsx(O,{size:"sm",variant:me===e.key?"primary":"outline","aria-pressed":me===e.key,onPress:()=>ut(e.key),children:e.label},e.key))})]}),t.jsx($e,{dimensionLabel:P.label,rows:P.rows,totalCost:(s==null?void 0:s.cost)??0,emptyLabel:ce?"No usage matches these filters.":"No usage recorded yet.",unknownLabel:P.unknownLabel,labelFor:P.labelFor,onDrill:P.drill,loading:S.isLoading})]}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Spend by ",q.label.toLowerCase()]}),t.jsx("div",{className:"inline-flex gap-1.5",children:he.map(e=>t.jsx(O,{size:"sm",variant:Q===e.key?"primary":"outline","aria-pressed":Q===e.key,onPress:()=>mt(e.key),children:e.label},e.key))})]}),t.jsx($e,{dimensionLabel:q.label,rows:q.rows,totalCost:(s==null?void 0:s.cost)??0,emptyLabel:ce?"No usage matches these filters.":"No usage recorded yet.",unknownLabel:q.unknownLabel,labelFor:q.labelFor,onDrill:q.drill,loading:S.isLoading})]})]})]})]})}export{Zt as UsagePage}; diff --git a/src/gateway/static/dashboard/assets/UsersPage-Cfif2r2r.js b/src/gateway/static/dashboard/assets/UsersPage-AJZgT8Wn.js similarity index 98% rename from src/gateway/static/dashboard/assets/UsersPage-Cfif2r2r.js rename to src/gateway/static/dashboard/assets/UsersPage-AJZgT8Wn.js index a8aa4cb6d..1625ad686 100644 --- a/src/gateway/static/dashboard/assets/UsersPage-Cfif2r2r.js +++ b/src/gateway/static/dashboard/assets/UsersPage-AJZgT8Wn.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r}from"./react-dgEcD0HR.js";import{u as Q,v as M,z as K,au as X,P as Y,E as A,B as Z,av as ee,F as se}from"./index-C-bDZxkO.js";import{u as te,r as ae,B as ne}from"./tableSelection-CojkFPwd.js";import{C as re}from"./ConfirmDialog-BBkZMSqE.js";import{D as le}from"./DataTable-CrQq0sYf.js";import{F as D}from"./Field-DEJ6Wjg9.js";import{a as ie,M as R}from"./ModelScopeControl-gV_ax1BN.js";import{f as I,B as d,d as S,A as f}from"./heroui-DZj66Arc.js";const de=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return de.format(t)}const oe=t=>t.user_id,B=t=>t.startsWith("apikey-");function H(t){return t.split("-")[0]}function z(t){return t.name??H(t.budget_id)}function $({value:t,onChange:l,budgets:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>l(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),n.map(a=>e.jsxs("option",{value:a.budget_id,children:[z(a),a.max_budget===null?" · no limit":` · ${U(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function ce({onClose:t}){const l=ee(),n=M(),[a,i]=r.useState(""),[o,u]=r.useState(""),[c,g]=r.useState(null),[p,m]=r.useState(null),[b,j]=r.useState(!0),x=()=>{if(l.isPending||!b||a.trim()==="")return;const h={user_id:a.trim(),alias:o.trim()||null,budget_id:c,allowed_models:p};l.mutate(h,{onSuccess:t})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:l.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(D,{label:"User ID",value:a,onChange:i,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(D,{label:"Alias (optional)",value:o,onChange:u,placeholder:"Alice"})]}),e.jsx($,{value:c,onChange:g,budgets:n.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{m(h),j(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:l.isPending||!b||a.trim()==="",onPress:x,children:l.isPending?"Creating…":"Create user"}),e.jsx(d,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ue({user:t,onClose:l}){const n=K(),a=M(),[i,o]=r.useState(t.alias??""),[u,c]=r.useState(t.budget_id),[g,p]=r.useState(t.allowed_models),[m,b]=r.useState(!0),j=()=>{if(n.isPending||!m)return;const x={alias:i.trim()||null,budget_id:u,allowed_models:g};n.mutate({id:t.user_id,body:x},{onSuccess:l})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:n.error}),e.jsx(D,{label:"Alias",value:i,onChange:o,placeholder:"Alice"}),e.jsx($,{value:u,onChange:c,budgets:a.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(x,h)=>{p(x),b(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:n.isPending||!m,onPress:j,children:n.isPending?"Saving…":"Save changes"}),e.jsx(d,{variant:"ghost",onPress:l,children:"Cancel"})]})]})})}function ge({trigger:t,message:l,confirmLabel:n,isPending:a,onConfirm:i}){const[o,u]=r.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:l}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(d,{size:"sm",variant:"danger",isDisabled:a,onPress:i,children:n}),e.jsx(d,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>u(!1),children:"Cancel"})]})]}):e.jsx(d,{size:"sm",variant:"danger-soft",onPress:()=>u(!0),children:t})}function me({user:t}){return t.blocked?e.jsx(I,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(I,{size:"sm",color:"accent",children:"Active"})}function xe({allowed:t}){const{text:l,tone:n}=ie(t),a=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",i=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:i,children:l})}function he({isOpen:t,onOpenChange:l,budgets:n,count:a,isPending:i,error:o,onAssign:u}){const[c,g]=r.useState("");return r.useEffect(()=>{t&&g("")},[t]),e.jsx(f,{isOpen:t,onOpenChange:l,children:t?e.jsx(f.Backdrop,{children:e.jsx(f.Container,{placement:"center",size:"md",children:e.jsxs(f.Dialog,{children:[e.jsx(f.Header,{children:e.jsx(f.Heading,{children:"Assign budget"})}),e.jsxs(f.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Assign a budget to ",a," selected ",a===1?"user":"users","."]}),e.jsx(se,{label:"Budget",value:c,onChange:g,options:[{value:"",label:"Select a budget…"},...n.map(p=>({value:p.budget_id,label:z(p)}))]}),e.jsx(A,{error:o})]}),e.jsxs(f.Footer,{children:[e.jsx(d,{variant:"ghost",isDisabled:i,onPress:()=>l(!1),children:"Cancel"}),e.jsx(d,{variant:"primary",isDisabled:!c,isPending:i,onPress:()=>u(c),children:"Assign"})]})]})})}):null})}function Ae(){const t=Q(),l=M(),n=K(),a=X(),[i,o]=r.useState(!1),[u,c]=r.useState(null),[g,p]=r.useState(!1),m=t.data??[],b=t.isLoading,j=m.filter(s=>B(s.user_id)).length,x=g?m:m.filter(s=>!B(s.user_id)),h=m.find(s=>s.user_id===u)??null,C=!b&&x.length===0&&!i,P=r.useMemo(()=>new Map((l.data??[]).map(s=>[s.budget_id,s])),[l.data]),y=te(),[q,_]=r.useState(!1),[W,N]=r.useState(!1),[E,F]=r.useState(void 0),[T,L]=r.useState(!1),G=x.map(s=>s.user_id),v=ae(y.selectedKeys,G),O=r.useCallback((s,k)=>n.mutate({id:s.user_id,body:{blocked:k}}),[n.mutate]),V=async(s,k)=>{L(!0),F(void 0);try{for(const w of v)await s(w);y.clear(),k()}catch(w){F(w)}finally{L(!1)}},J=r.useMemo(()=>[{id:"user",header:"User",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-medium text-[var(--otari-ink)]",children:s.user_id}),B(s.user_id)?e.jsx(I,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})},{id:"status",header:"Status",cell:s=>e.jsx(me,{user:s})},{id:"budget",header:"Budget",cell:s=>s.budget_id?e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.budget_id,children:P.get(s.budget_id)?z(P.get(s.budget_id)):H(s.budget_id)}):e.jsx("span",{className:"text-[var(--otari-muted)]",children:"—"})},{id:"spend",header:"Spend",cell:s=>e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[U(s.spend),s.reserved>0?e.jsxs("span",{children:[" (+",U(s.reserved)," held)"]}):null]})},{id:"access",header:"Model access",cell:s=>e.jsx(xe,{allowed:s.allowed_models})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(d,{size:"sm",variant:"outline",isDisabled:n.isPending,onPress:()=>O(s,!s.blocked),children:s.blocked?"Unblock":"Block"}),e.jsx(d,{size:"sm",variant:"ghost",onPress:()=>{o(!1),c(s.user_id)},children:"Edit"}),e.jsx(ge,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})}],[P,n.isPending,a.isPending,a.mutate,O]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:i?null:e.jsx(d,{variant:"primary",onPress:()=>{c(null),o(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??n.error??a.error}),C?e.jsx(Z,{title:"No users yet",description:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page.",actionLabel:"Create your first user",onAction:()=>{c(null),o(!0)}}):null,j>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>p(s.target.checked)}),"Show auto-created (virtual) users (",j,")"]}):null,i?e.jsx(ce,{onClose:()=>o(!1)}):null,h?e.jsx(ue,{user:h,onClose:()=>c(null)},h.user_id):null,v.length>0?e.jsxs(ne,{selectedCount:v.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:y.clear,children:[e.jsx(d,{size:"sm",variant:"primary",onPress:()=>N(!0),children:"Assign budget"}),e.jsx(d,{size:"sm",variant:"danger",onPress:()=>_(!0),children:"Delete"})]}):null,C?null:e.jsx(le,{ariaLabel:"Users",columns:J,rows:x,getRowKey:oe,isLoading:b,emptyContent:"No users yet. Create one, or create an API key to auto-create one.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange}),e.jsx(re,{isOpen:q,onOpenChange:_,heading:"Delete users",body:`Delete ${v.length} ${v.length===1?"user":"users"}? This deactivates their API keys and hides them; usage history is preserved.`,confirmLabel:"Delete",isPending:T,error:E,onConfirm:()=>V(s=>a.mutateAsync(s),()=>_(!1))}),e.jsx(he,{isOpen:W,onOpenChange:N,budgets:l.data??[],count:v.length,isPending:T,error:E,onAssign:s=>V(k=>n.mutateAsync({id:k,body:{budget_id:s}}),()=>N(!1))})]})}export{Ae as UsersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r}from"./react-dgEcD0HR.js";import{u as Q,v as M,z as K,au as X,P as Y,E as A,B as Z,av as ee,F as se}from"./index-DMrbj_xn.js";import{u as te,r as ae,B as ne}from"./tableSelection-CojkFPwd.js";import{C as re}from"./ConfirmDialog-D3P-vj-t.js";import{D as le}from"./DataTable-CrQq0sYf.js";import{F as D}from"./Field-DEJ6Wjg9.js";import{a as ie,M as R}from"./ModelScopeControl-wPC6RjBJ.js";import{f as I,B as d,d as S,A as f}from"./heroui-DZj66Arc.js";const de=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return de.format(t)}const oe=t=>t.user_id,B=t=>t.startsWith("apikey-");function H(t){return t.split("-")[0]}function z(t){return t.name??H(t.budget_id)}function $({value:t,onChange:l,budgets:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>l(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),n.map(a=>e.jsxs("option",{value:a.budget_id,children:[z(a),a.max_budget===null?" · no limit":` · ${U(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function ce({onClose:t}){const l=ee(),n=M(),[a,i]=r.useState(""),[o,u]=r.useState(""),[c,g]=r.useState(null),[p,m]=r.useState(null),[b,j]=r.useState(!0),x=()=>{if(l.isPending||!b||a.trim()==="")return;const h={user_id:a.trim(),alias:o.trim()||null,budget_id:c,allowed_models:p};l.mutate(h,{onSuccess:t})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:l.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(D,{label:"User ID",value:a,onChange:i,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(D,{label:"Alias (optional)",value:o,onChange:u,placeholder:"Alice"})]}),e.jsx($,{value:c,onChange:g,budgets:n.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{m(h),j(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:l.isPending||!b||a.trim()==="",onPress:x,children:l.isPending?"Creating…":"Create user"}),e.jsx(d,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ue({user:t,onClose:l}){const n=K(),a=M(),[i,o]=r.useState(t.alias??""),[u,c]=r.useState(t.budget_id),[g,p]=r.useState(t.allowed_models),[m,b]=r.useState(!0),j=()=>{if(n.isPending||!m)return;const x={alias:i.trim()||null,budget_id:u,allowed_models:g};n.mutate({id:t.user_id,body:x},{onSuccess:l})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:n.error}),e.jsx(D,{label:"Alias",value:i,onChange:o,placeholder:"Alice"}),e.jsx($,{value:u,onChange:c,budgets:a.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(x,h)=>{p(x),b(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:n.isPending||!m,onPress:j,children:n.isPending?"Saving…":"Save changes"}),e.jsx(d,{variant:"ghost",onPress:l,children:"Cancel"})]})]})})}function ge({trigger:t,message:l,confirmLabel:n,isPending:a,onConfirm:i}){const[o,u]=r.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:l}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(d,{size:"sm",variant:"danger",isDisabled:a,onPress:i,children:n}),e.jsx(d,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>u(!1),children:"Cancel"})]})]}):e.jsx(d,{size:"sm",variant:"danger-soft",onPress:()=>u(!0),children:t})}function me({user:t}){return t.blocked?e.jsx(I,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(I,{size:"sm",color:"accent",children:"Active"})}function xe({allowed:t}){const{text:l,tone:n}=ie(t),a=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",i=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:i,children:l})}function he({isOpen:t,onOpenChange:l,budgets:n,count:a,isPending:i,error:o,onAssign:u}){const[c,g]=r.useState("");return r.useEffect(()=>{t&&g("")},[t]),e.jsx(f,{isOpen:t,onOpenChange:l,children:t?e.jsx(f.Backdrop,{children:e.jsx(f.Container,{placement:"center",size:"md",children:e.jsxs(f.Dialog,{children:[e.jsx(f.Header,{children:e.jsx(f.Heading,{children:"Assign budget"})}),e.jsxs(f.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Assign a budget to ",a," selected ",a===1?"user":"users","."]}),e.jsx(se,{label:"Budget",value:c,onChange:g,options:[{value:"",label:"Select a budget…"},...n.map(p=>({value:p.budget_id,label:z(p)}))]}),e.jsx(A,{error:o})]}),e.jsxs(f.Footer,{children:[e.jsx(d,{variant:"ghost",isDisabled:i,onPress:()=>l(!1),children:"Cancel"}),e.jsx(d,{variant:"primary",isDisabled:!c,isPending:i,onPress:()=>u(c),children:"Assign"})]})]})})}):null})}function Ae(){const t=Q(),l=M(),n=K(),a=X(),[i,o]=r.useState(!1),[u,c]=r.useState(null),[g,p]=r.useState(!1),m=t.data??[],b=t.isLoading,j=m.filter(s=>B(s.user_id)).length,x=g?m:m.filter(s=>!B(s.user_id)),h=m.find(s=>s.user_id===u)??null,C=!b&&x.length===0&&!i,P=r.useMemo(()=>new Map((l.data??[]).map(s=>[s.budget_id,s])),[l.data]),y=te(),[q,_]=r.useState(!1),[W,N]=r.useState(!1),[E,F]=r.useState(void 0),[T,L]=r.useState(!1),G=x.map(s=>s.user_id),v=ae(y.selectedKeys,G),O=r.useCallback((s,k)=>n.mutate({id:s.user_id,body:{blocked:k}}),[n.mutate]),V=async(s,k)=>{L(!0),F(void 0);try{for(const w of v)await s(w);y.clear(),k()}catch(w){F(w)}finally{L(!1)}},J=r.useMemo(()=>[{id:"user",header:"User",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-medium text-[var(--otari-ink)]",children:s.user_id}),B(s.user_id)?e.jsx(I,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})},{id:"status",header:"Status",cell:s=>e.jsx(me,{user:s})},{id:"budget",header:"Budget",cell:s=>s.budget_id?e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.budget_id,children:P.get(s.budget_id)?z(P.get(s.budget_id)):H(s.budget_id)}):e.jsx("span",{className:"text-[var(--otari-muted)]",children:"—"})},{id:"spend",header:"Spend",cell:s=>e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[U(s.spend),s.reserved>0?e.jsxs("span",{children:[" (+",U(s.reserved)," held)"]}):null]})},{id:"access",header:"Model access",cell:s=>e.jsx(xe,{allowed:s.allowed_models})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(d,{size:"sm",variant:"outline",isDisabled:n.isPending,onPress:()=>O(s,!s.blocked),children:s.blocked?"Unblock":"Block"}),e.jsx(d,{size:"sm",variant:"ghost",onPress:()=>{o(!1),c(s.user_id)},children:"Edit"}),e.jsx(ge,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})}],[P,n.isPending,a.isPending,a.mutate,O]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:i?null:e.jsx(d,{variant:"primary",onPress:()=>{c(null),o(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??n.error??a.error}),C?e.jsx(Z,{title:"No users yet",description:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page.",actionLabel:"Create your first user",onAction:()=>{c(null),o(!0)}}):null,j>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>p(s.target.checked)}),"Show auto-created (virtual) users (",j,")"]}):null,i?e.jsx(ce,{onClose:()=>o(!1)}):null,h?e.jsx(ue,{user:h,onClose:()=>c(null)},h.user_id):null,v.length>0?e.jsxs(ne,{selectedCount:v.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:y.clear,children:[e.jsx(d,{size:"sm",variant:"primary",onPress:()=>N(!0),children:"Assign budget"}),e.jsx(d,{size:"sm",variant:"danger",onPress:()=>_(!0),children:"Delete"})]}):null,C?null:e.jsx(le,{ariaLabel:"Users",columns:J,rows:x,getRowKey:oe,isLoading:b,emptyContent:"No users yet. Create one, or create an API key to auto-create one.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange}),e.jsx(re,{isOpen:q,onOpenChange:_,heading:"Delete users",body:`Delete ${v.length} ${v.length===1?"user":"users"}? This deactivates their API keys and hides them; usage history is preserved.`,confirmLabel:"Delete",isPending:T,error:E,onConfirm:()=>V(s=>a.mutateAsync(s),()=>_(!1))}),e.jsx(he,{isOpen:W,onOpenChange:N,budgets:l.data??[],count:v.length,isPending:T,error:E,onAssign:s=>V(k=>n.mutateAsync({id:k,body:{budget_id:s}}),()=>N(!1))})]})}export{Ae as UsersPage}; diff --git a/src/gateway/static/dashboard/assets/charts-B_hm0rXH.js b/src/gateway/static/dashboard/assets/charts-B_hm0rXH.js deleted file mode 100644 index e24ec6c54..000000000 --- a/src/gateway/static/dashboard/assets/charts-B_hm0rXH.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as w}from"./react-dgEcD0HR.js";import{R as C,L,a as A,B as T,X as B,Y as D,T as O,b as S,c as j}from"./recharts-BwTTRGtj.js";const b="var(--otari-brand)";function E({active:n,label:a,payload:s,formatValue:o,formatLabel:c,showTotal:x=!1}){const i=(s??[]).filter(r=>typeof r.value=="number");if(!n||i.length===0)return null;const p=typeof a=="string"&&c?c(a):a,m=i.length>1?i.filter(r=>r.value>0):i,u=i.reduce((r,f)=>r+f.value,0);return e.jsxs("div",{className:"rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2.5 py-1.5 text-xs shadow-sm",children:[e.jsx("div",{className:"text-[var(--otari-muted)]",children:p}),e.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:m.map((r,f)=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[var(--otari-muted)]",children:[i.length>1?e.jsx("span",{"aria-hidden":!0,className:"h-2 w-2 rounded-sm",style:{backgroundColor:r.color}}):null,r.name]}),e.jsx("span",{className:"font-medium tabular-nums text-[var(--otari-ink)]",children:o(r.value)})]},f))}),x&&i.length>1?e.jsxs("div",{className:"mt-1 flex items-center justify-between gap-4 border-t border-[var(--otari-line)] pt-1",children:[e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Total"}),e.jsx("span",{className:"font-semibold tabular-nums text-[var(--otari-ink)]",children:o(u)})]}):null]})}function z({series:n}){return n.length<2?null:e.jsx("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:n.map(a=>e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx("span",{"aria-hidden":!0,className:"h-2 w-2 rounded-sm",style:{backgroundColor:a.color}}),a.label]},a.key))})}function M(n){const a=n==null?void 0:n.activeTooltipIndex,s=typeof a=="string"?Number(a):a;return typeof s=="number"&&Number.isFinite(s)?s:null}function W({data:n,series:a,formatValue:s,formatXTick:o,ariaLabel:c,height:x=200,showYAxis:i=!1,showTotal:p,onSelectRange:m,window:u}){const[r,f]=w.useState(null),h=w.useRef(r),v=t=>{h.current=t,f(t)},k=()=>{const t=h.current;v(null),!(!t||!m||t.start===t.end)&&m(Math.min(t.start,t.end),Math.max(t.start,t.end))},y=!!m&&n.length>1,g=n.length-1,N=t=>Math.min(Math.max(t,0),Math.max(g,0)),l=u&&n.length>0?{startIndex:N(u.startIndex),endIndex:N(u.endIndex)}:null,I=l!==null&&(l.startIndex>0||l.endIndex{if(!y)return;const d=M(t);d!==null&&v({start:d,end:d})},onMouseMove:t=>{const d=M(t);h.current&&d!==null&&v({...h.current,end:d})},onMouseUp:k,onMouseLeave:k,children:[e.jsx(B,{dataKey:"x",tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:40,tickFormatter:o,tick:{fontSize:10,fill:"var(--otari-muted)"}}),i?e.jsx(D,{width:52,tickLine:!1,axisLine:!1,tickFormatter:t=>s(t),tick:{fontSize:10,fill:"var(--otari-muted)"}}):null,e.jsx(O,{cursor:{fill:"var(--otari-line)",opacity:.35},content:e.jsx(E,{formatValue:s,formatLabel:o,showTotal:p})}),a.map(t=>e.jsx(S,{dataKey:t.key,name:t.label,stackId:"stack",fill:t.color,stroke:"var(--otari-surface)",strokeWidth:a.length>1?1:0,radius:a.length>1?0:[2,2,0,0],isAnimationActive:!1},t.key)),I&&l&&l.startIndex>0?e.jsx(j,{x1:n[0].x,x2:n[l.startIndex-1].x,fill:"var(--otari-bg)",fillOpacity:.75,stroke:"none"}):null,I&&l&&l.endIndex({index:x,value:c}));return e.jsx("div",{role:"img","aria-label":a,className:"w-full",children:e.jsx(C,{width:"100%",height:s,children:e.jsx(L,{data:o,margin:{top:2,right:2,left:2,bottom:2},children:e.jsx(A,{type:"monotone",dataKey:"value",stroke:b,strokeWidth:1.5,dot:!1,isAnimationActive:!1})})})})}export{z as C,Y as S,W as T}; diff --git a/src/gateway/static/dashboard/assets/charts-DNysd9jl.js b/src/gateway/static/dashboard/assets/charts-DNysd9jl.js new file mode 100644 index 000000000..883194024 --- /dev/null +++ b/src/gateway/static/dashboard/assets/charts-DNysd9jl.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as T}from"./react-dgEcD0HR.js";import{R as C,L,a as A,B,X as D,Y as S,T as E,b as O,c as N}from"./recharts-BwTTRGtj.js";const I="var(--otari-brand)";function F({active:n,label:a,payload:i,formatValue:d,formatLabel:x,showTotal:m=!1}){const l=(i??[]).filter(r=>typeof r.value=="number");if(!n||l.length===0)return null;const b=typeof a=="string"&&x?x(a):a,f=l.length>1?l.filter(r=>r.value>0):l,h=l.reduce((r,p)=>r+p.value,0);return e.jsxs("div",{className:"rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2.5 py-1.5 text-xs shadow-sm",children:[e.jsx("div",{className:"text-[var(--otari-muted)]",children:b}),e.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:f.map((r,p)=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[var(--otari-muted)]",children:[l.length>1?e.jsx("span",{"aria-hidden":!0,className:"h-2 w-2 rounded-sm",style:{backgroundColor:r.color}}):null,r.name]}),e.jsx("span",{className:"font-medium tabular-nums text-[var(--otari-ink)]",children:d(r.value)})]},p))}),m&&l.length>1?e.jsxs("div",{className:"mt-1 flex items-center justify-between gap-4 border-t border-[var(--otari-line)] pt-1",children:[e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Total"}),e.jsx("span",{className:"font-semibold tabular-nums text-[var(--otari-ink)]",children:d(h)})]}):null]})}function W({series:n}){return n.length<2?null:e.jsx("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:n.map(a=>e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx("span",{"aria-hidden":!0,className:"h-2 w-2 rounded-sm",style:{backgroundColor:a.color}}),a.label]},a.key))})}function j(n){const a=n==null?void 0:n.activeTooltipIndex,i=typeof a=="string"?Number(a):a;return typeof i=="number"&&Number.isFinite(i)?i:null}function Y({data:n,series:a,formatValue:i,formatXTick:d,ariaLabel:x,height:m=200,showYAxis:l=!1,showTotal:b,onSelectRange:f,window:h}){const[r,p]=T.useState(null),u=T.useRef(r),v=t=>{u.current=t,p(t)},k=n.length-1,c=t=>Math.min(Math.max(t,0),Math.max(k,0)),y=()=>{const t=u.current;if(v(null),!t||!f||t.start===t.end)return;const s=c(Math.min(t.start,t.end)),M=c(Math.max(t.start,t.end));s!==M&&f(s,M)},g=!!f&&n.length>1,o=h&&n.length>0?{startIndex:c(h.startIndex),endIndex:c(h.endIndex)}:null,w=o!==null&&(o.startIndex>0||o.endIndex{if(!g)return;const s=j(t);s!==null&&v({start:s,end:s})},onMouseMove:t=>{const s=j(t);u.current&&s!==null&&v({...u.current,end:s})},onMouseUp:y,onMouseLeave:y,onTouchStart:t=>{if(!g)return;const s=j(t);s!==null&&v({start:s,end:s})},onTouchMove:t=>{const s=j(t);u.current&&s!==null&&v({...u.current,end:s})},onTouchEnd:y,children:[e.jsx(D,{dataKey:"x",tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:40,tickFormatter:d,tick:{fontSize:10,fill:"var(--otari-muted)"}}),l?e.jsx(S,{width:52,tickLine:!1,axisLine:!1,tickFormatter:t=>i(t),tick:{fontSize:10,fill:"var(--otari-muted)"}}):null,e.jsx(E,{cursor:{fill:"var(--otari-line)",opacity:.35},content:e.jsx(F,{formatValue:i,formatLabel:d,showTotal:b})}),a.map(t=>e.jsx(O,{dataKey:t.key,name:t.label,stackId:"stack",fill:t.color,stroke:"var(--otari-surface)",strokeWidth:a.length>1?1:0,radius:a.length>1?0:[2,2,0,0],isAnimationActive:!1},t.key)),w&&o&&o.startIndex>0?e.jsx(N,{x1:n[0].x,x2:n[o.startIndex-1].x,fill:"var(--otari-bg)",fillOpacity:.75,stroke:"none"}):null,w&&o&&o.endIndex({index:m,value:x}));return e.jsx("div",{role:"img","aria-label":a,className:"w-full",children:e.jsx(C,{width:"100%",height:i,children:e.jsx(L,{data:d,margin:{top:2,right:2,left:2,bottom:2},children:e.jsx(A,{type:"monotone",dataKey:"value",stroke:I,strokeWidth:1.5,dot:!1,isAnimationActive:!1})})})})}export{W as C,G as S,Y as T}; diff --git a/src/gateway/static/dashboard/assets/index-C-bDZxkO.js b/src/gateway/static/dashboard/assets/index-DMrbj_xn.js similarity index 96% rename from src/gateway/static/dashboard/assets/index-C-bDZxkO.js rename to src/gateway/static/dashboard/assets/index-DMrbj_xn.js index a1b9d41ef..fc323c7dd 100644 --- a/src/gateway/static/dashboard/assets/index-C-bDZxkO.js +++ b/src/gateway/static/dashboard/assets/index-DMrbj_xn.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-BENT_1o4.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/charts-B_hm0rXH.js","assets/recharts-BwTTRGtj.js","assets/heroui-DZj66Arc.js","assets/tableSelection-CojkFPwd.js","assets/ConfirmDialog-BBkZMSqE.js","assets/DataTable-CrQq0sYf.js","assets/FilterChips-BLdhUEZK.js","assets/TablePagination-0H6sFfIt.js","assets/AliasesPage-CtStwRk-.js","assets/Field-DEJ6Wjg9.js","assets/UserComboBox-nt7pHfqn.js","assets/BudgetsPage-0J25eK0m.js","assets/DocsPage-DoYdRqgR.js","assets/KeysPage-JwzirK0P.js","assets/ModelScopeControl-gV_ax1BN.js","assets/ModelsPage-DyZuS75D.js","assets/OverviewPage-Tme0ej_W.js","assets/ProvidersPage-B46VzXV5.js","assets/SettingsPage-CMbg-FaW.js","assets/ToolsGuardrailsPage-DkLhKtcA.js","assets/UsagePage-CjaSd7XG.js","assets/UsersPage-Cfif2r2r.js"])))=>i.map(i=>d[i]); -var Ie=Object.defineProperty;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>qe(e,typeof t!="symbol"?t+"":t,r);import{u as g,j as n,a as p,b as x,k as z,Q as Re,c as Oe}from"./tanstack-query-1t81HyiD.js";import{d as Me,r as o,N as ee,L as Fe,O as Ue,H as Ke,e as Be,f as j,h as $e}from"./react-dgEcD0HR.js";import{B as C,C as K,L as xe,I as ye,a as ze,b as Qe,d as I,S as Ve,c as _,T as We,e as He}from"./heroui-DZj66Arc.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ge=Me();const Je="modulepreload",Ye=function(e){return"/"+e},ue={},P=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let u=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(r.map(y=>{if(y=Ye(y),y in ue)return;ue[y]=!0;const h=y.endsWith(".css"),b=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Je,h||(m.as="script"),m.crossOrigin="",m.href=y,f&&m.setAttribute("nonce",f),document.head.appendChild(m),h)return new Promise((N,M)=>{m.addEventListener("load",N),m.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};class L extends Error{constructor(r,s){super(s);ce(this,"status");this.name="ApiError",this.status=r}}let B=null;function de(e){B=e}async function te(e){try{const t=await e.json();if(typeof t.detail=="string")return t.detail;if(t.detail!=null)return JSON.stringify(t.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Xe(e){let t;try{t=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(t.status===401||t.status===403)return!1;if(!t.ok)throw new L(t.status,await te(t));return!0}async function Ze(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function l(e,t={}){const r=new Headers(t.headers);r.set("Accept","application/json"),t.body!=null&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let s;try{s=await fetch(e,{...t,headers:r})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(s.status===401||s.status===403)throw B==null||B(),new L(s.status,await te(s));if(!s.ok)throw new L(s.status,await te(s));if(s.status!==204)return await s.json()}const ne="otari.dashboard.hasSession",ve=o.createContext(null);function et(){try{return window.localStorage.getItem(ne)==="1"}catch{return!1}}function tt({children:e}){const t=g(),[r,s]=o.useState(et),a=o.useCallback(()=>{Ze(),s(!1),t.clear();try{window.localStorage.removeItem(ne)}catch{}},[t]),i=o.useCallback(()=>{t.clear(),s(!0);try{window.localStorage.setItem(ne,"1")}catch{}},[t]);o.useEffect(()=>(de(a),()=>de(null)),[a]);const u=o.useMemo(()=>({isAuthenticated:r,login:i,logout:a}),[r,i,a]);return n.jsx(ve.Provider,{value:u,children:e})}function re(){const e=o.useContext(ve);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function nt(e){return e instanceof L&&e.status===0}function rt(){const e=g(),[t,r]=o.useState(!1);return o.useEffect(()=>{const s=e.getQueryCache(),a=()=>s.getAll().some(i=>i.state.status==="error"&&nt(i.state.error));return r(a()),s.subscribe(()=>r(a()))},[e]),t}function st(){return rt()?n.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const Q=3600,T=86400,at=365*T,dn=[{key:"1h",label:"Last hour",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:T,bucket:"hour"},{key:"7d",label:"7d",seconds:7*T,bucket:"day"},{key:"30d",label:"30d",seconds:30*T,bucket:"day"},{key:"90d",label:"90d",seconds:90*T,bucket:"day"},{key:"12mo",label:"12mo",seconds:at,bucket:"day"}],mn="30d",fn=[{key:"1h",label:"1h",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:T,bucket:"hour"},{key:"7d",label:"7d",seconds:7*T,bucket:"day"},{key:"30d",label:"30d",seconds:30*T,bucket:"day"},{key:"all",label:"All",seconds:null,bucket:"day"}],hn="24h",xn="custom";function yn(e,t){return e.find(r=>r.key===t)}function it(e,t=Date.now()){return new Date(t-e*1e3).toISOString()}function ot(e){return(e==="hour"?Q:T)*1e3}function vn(e,t,r=Date.now()){const s=new Date(e).getTime();return(t?new Date(t).getTime():r)-s<=T*1e3?"hour":"day"}function gn(e,t,r,s){if(e.length===0)return null;const a=Math.max(0,Math.min(t,r)),i=Math.min(e.length-1,Math.max(t,r)),u=new Date(e[a]).getTime(),d=new Date(e[i]).getTime()+ot(s);return{startIso:new Date(u).toISOString(),endIso:new Date(d).toISOString()}}function pn(e,t,r){const s=e.length;if(s===0)return{startIndex:0,endIndex:0};const a=e.map(d=>new Date(d).getTime());let i=0;if(t){const d=new Date(t).getTime();for(let f=0;fl("/v1/models"),staleTime:6e4})}function dt(){return p({queryKey:[ct],queryFn:()=>l("/dashboard-build.json"),refetchInterval:ut,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function jn(){return p({queryKey:[ae],queryFn:()=>l("/v1/models/discoverable"),staleTime:5*6e4})}function Sn(){return p({queryKey:[ie],queryFn:()=>l("/v1/providers"),staleTime:5*6e4})}function kn(){return p({queryKey:["provider-catalog"],queryFn:()=>l("/v1/providers/catalog"),staleTime:1/0})}function En(e){return p({queryKey:["provider-catalog",e],queryFn:()=>l(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Pn(){return p({queryKey:[oe],queryFn:()=>l("/v1/providers/health"),staleTime:me,refetchInterval:me})}function Nn(){const e=g();return x({mutationFn:()=>l("/v1/providers/health?refresh=true"),onSuccess:t=>e.setQueryData([oe],t)})}function Cn(){return p({queryKey:[be],queryFn:()=>l("/v1/provider-credentials"),staleTime:6e4})}function W(e){e.invalidateQueries({queryKey:[be]}),e.invalidateQueries({queryKey:[ie]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]}),e.invalidateQueries({queryKey:[oe]})}function _n(){const e=g();return x({mutationFn:t=>l("/v1/provider-credentials",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>W(e)})}function Tn(){const e=g();return x({mutationFn:({instance:t,body:r})=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>W(e)})}function Ln(){const e=g();return x({mutationFn:t=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>W(e)})}function Dn(){const e=g();return x({mutationFn:()=>l("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>W(e)})}function An(){return x({mutationFn:e=>l(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function In(){return x({mutationFn:e=>l("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function qn(){return p({queryKey:[lt],queryFn:()=>l("/v1/models/metadata"),staleTime:10*6e4})}function Rn(){return p({queryKey:[se],queryFn:()=>l("/v1/aliases"),staleTime:6e4})}function On(){const e=g();return x({mutationFn:t=>l("/v1/aliases",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function Mn(){const e=g();return x({mutationFn:({name:t,userId:r})=>{const s=r==null?"":`?user_id=${encodeURIComponent(r)}`;return l(`/v1/aliases/${encodeURIComponent(t)}${s}`,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function mt(){return p({queryKey:[ge],queryFn:()=>l("/v1/settings"),staleTime:6e4})}function ft(){const e=g();return x({mutationFn:t=>l("/v1/settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([ge],t),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]})}})}function Fn(){return x({mutationFn:()=>l("/v1/settings/master-key/rotate",{method:"POST"})})}function Un(){return p({queryKey:[pe],queryFn:()=>l("/v1/tool-settings"),staleTime:6e4})}function Kn(){const e=g();return x({mutationFn:t=>l("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([pe],t)}})}function Bn(){return x({mutationFn:({service:e,url:t})=>l(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:t})})})}const G=1e3,ht=100;async function xt(){const e=[];for(let t=0;tl("/v1/pricing",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Qn(){const e=g();return x({mutationFn:t=>l(`/v1/pricing/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Vn(){return x({mutationFn:()=>l("/v1/pricing/refresh",{method:"POST"})})}function Wn(){const e=g();return x({mutationFn:()=>l("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ie]})}})}function Hn(){return x({mutationFn:()=>l("/v1/pricing/refresh/reject",{method:"POST"})})}const J=1e3,yt=100;async function vt(){const e=[];for(let t=0;tl("/v1/keys",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Yn(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Xn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Zn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}const Y=1e3,gt=100;async function pt(){const e=[];for(let t=0;tl(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function nr(){const e=g();return x({mutationFn:t=>l("/v1/budgets",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function rr(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function sr(){const e=g();return x({mutationFn:t=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}const X=1e3,bt=100;async function wt(){const e=[];for(let t=0;tl("/v1/users",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>le(e)})}function or(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>le(e)})}function lr(){const e=g();return x({mutationFn:t=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{le(e),e.invalidateQueries({queryKey:[R]})}})}function U(e){const t=new URLSearchParams;return e.start_date&&t.set("start_date",e.start_date),e.end_date&&t.set("end_date",e.end_date),e.status&&t.set("status",e.status),e.model&&t.set("model",e.model),e.endpoint&&t.set("endpoint",e.endpoint),e.provider&&t.set("provider",e.provider),e.user_id&&t.set("user_id",e.user_id),e.api_key_id&&t.set("api_key_id",e.api_key_id),e.source&&t.set("source",e.source),e.source_label&&t.set("source_label",e.source_label),e.priced!==void 0&&t.set("priced",String(e.priced)),e.counts_toward_budget!==void 0&&t.set("counts_toward_budget",String(e.counts_toward_budget)),t}function cr(e,t,r){return p({queryKey:[q,"list",e,t,r],queryFn:()=>{const s=U(e);return s.set("skip",String(t*r)),s.set("limit",String(r)),l(`/v1/usage?${s.toString()}`)},placeholderData:z,staleTime:1e4})}function ur(e,t=!0){return p({queryKey:[q,"count",e],queryFn:()=>l(`/v1/usage/count?${U(e).toString()}`),enabled:t,placeholderData:z,staleTime:1e4})}const jt=6e4;function St(e,t=!0){return p({queryKey:[q,"count","failures",e],queryFn:()=>{const r={status:"error",source:"gateway",start_date:it(e)};return l(`/v1/usage/count?${U(r).toString()}`)},enabled:t,refetchInterval:jt,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function dr(){const e=g();return x({mutationFn:t=>l("/v1/usage",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}function mr(){const e=g();return x({mutationFn:t=>l("/v1/usage/set-price",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}const fr=[];function hr(e,t,r,s=!0){return p({queryKey:[q,"summary",e,t,r??"all"],queryFn:()=>{const a=U(e);if(a.set("bucket",t),r)for(const i of r.length>0?r:["none"])a.append("dimensions",i);return l(`/v1/usage/summary?${a.toString()}`)},enabled:s,placeholderData:z,staleTime:3e4})}function xr(e,t,r,s=!0){return p({queryKey:[q,"series",e,t,r],queryFn:()=>{const a=U(e);return a.set("bucket",t),a.set("group_by",r),l(`/v1/usage/series?${a.toString()}`)},enabled:s&&r!==null,placeholderData:z,staleTime:3e4,retry:(a,i)=>!(i instanceof L&&i.status===404)&&a<3})}function yr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function vr(e){if(e==null)return"$0.00";const t=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}function gr(e){if(e==null)return"—";if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){const t=Math.round(e/1e3);return t>=1e3?"1M":`${t}K`}return String(e)}const kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pr(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})/.exec(e);if(!t)return e;const r=Number(t[2])-1;return r<0||r>11?t[1]:`${kt[r]} ${t[1]}`}const Et=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function br(e){return Et.format(e)}function wr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Pt(e){return`${(e*100).toFixed(1)}%`}function jr(e,t){return t===void 0||t===0?null:(e-t)/t}function Nt(e,t=Date.now()){if(!e)return"never";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const s=Math.round((t-r.getTime())/1e3),a=s<0,i=Math.abs(s),u=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let d=i,f="second";for(const[h,b]of u){if(f=h,d0?"▲":e<0?"▼":"•";return n.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t," ",Pt(Math.abs(e))," vs prev"]})}function Ct(e){return e instanceof L||e instanceof Error?e.message:"Something went wrong."}function _t({error:e}){return e?n.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:Ct(e)}):null}function Tt({tone:e="info",children:t}){const r=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return n.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${r}`,children:t})}function Er({title:e,description:t,action:r}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),r?n.jsx("div",{className:"flex flex-wrap gap-2",children:r}):null]})}function Lt(e){const[t,r]=o.useState(()=>Date.now());return o.useEffect(()=>{let s;const a=()=>{s===void 0&&(s=setInterval(()=>r(Date.now()),e))},i=()=>{s!==void 0&&(clearInterval(s),s=void 0)},u=()=>{r(Date.now()),document.visibilityState==="visible"?a():i()};return u(),document.addEventListener("visibilitychange",u),()=>{i(),document.removeEventListener("visibilitychange",u)}},[e]),t}function Pr({onRefresh:e,isFetching:t=!1,updatedAt:r,label:s="Refresh"}){const a=Lt(15e3),i=r?Nt(new Date(r).toISOString(),a):null;return n.jsxs("span",{className:"inline-flex items-center gap-2",children:[i?n.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Updated ",i]}):null,n.jsx(C,{variant:"outline",size:"sm",isIconOnly:!0,isDisabled:t,onPress:e,"aria-label":s,children:n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`h-4 w-4 ${t?"animate-spin":""}`,"aria-hidden":"true",children:[n.jsx("path",{d:"M20 11a8 8 0 1 0-.5 4",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M20 4v5h-5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function Nr({title:e,description:t,actionLabel:r,onAction:s,isActionDisabled:a,children:i}){return n.jsx(I,{children:n.jsxs(I.Content,{className:"flex flex-col gap-4 p-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),i,r&&s?n.jsx("div",{children:n.jsx(C,{variant:"primary",isDisabled:a,onPress:s,children:r})}):null]})})}function Cr({label:e="Loading…"}){return n.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 px-4 py-10 text-sm text-[var(--otari-muted)]",children:[n.jsx(Ve,{size:"sm"}),n.jsx("span",{children:e})]})}function _r({children:e,confirmLabel:t,onConfirm:r,isPending:s}){const[a,i]=o.useState(!1);return a?n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(C,{size:"sm",variant:"danger",isDisabled:s,onPress:r,children:t}),n.jsx(C,{size:"sm",variant:"ghost",isDisabled:s,onPress:()=>i(!1),children:"Cancel"})]}):n.jsx(C,{size:"sm",variant:"danger-soft",onPress:()=>i(!0),children:e})}const Dt="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Tr({id:e,label:t,ariaLabel:r,value:s,onChange:a,options:i,children:u,disabled:d}){const f=o.useId(),y=e??(t?f:void 0),h=n.jsx("select",{id:y,"aria-label":t?void 0:r,value:s,disabled:d,onChange:b=>a(b.target.value),className:Dt,children:i?i.map(b=>n.jsx("option",{value:b.value,children:b.label},b.value)):u});return t?n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),h]}):h}function Lr({label:e,value:t,onChange:r,options:s,placeholder:a,maxVisible:i=50,allowsCustom:u=!1}){const d=m=>{var N;return((N=s.find(M=>M.value===m))==null?void 0:N.label)??m},[f,y]=o.useState(()=>d(t));o.useEffect(()=>{y(d(t))},[t]);const h=f.trim().toLowerCase(),b=s.filter(m=>!h||m.value.toLowerCase().includes(h)||m.label.toLowerCase().includes(h)).slice(0,i);return n.jsxs(K.Root,{allowsEmptyCollection:!0,allowsCustomValue:u,menuTrigger:"focus",inputValue:f,onInputChange:m=>{y(m),u?r(m.trim()):m.trim()===""&&r("")},onSelectionChange:m=>{m!=null&&r(String(m))},className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),n.jsxs(K.InputGroup,{children:[n.jsx(ye,{placeholder:a,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),n.jsx(K.Trigger,{})]}),n.jsx(K.Popover,{children:n.jsx(ze,{items:b,className:"max-h-72 overflow-auto",children:m=>n.jsx(Qe,{id:m.value,textValue:m.label,children:m.label})})})]})}function At(){var f,y;const e=mt(),t=ft(),[r,s]=o.useState(!1),i=((f=e.data)==null?void 0:f.require_pricing)===!0&&e.data.default_pricing===!1&&!r,d=((y=St(Q,i).data)==null?void 0:y.total)??0;return i?n.jsx("div",{className:"shrink-0 px-6 pt-3",children:n.jsx(Tt,{tone:"warning",children:n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("span",{children:["Requests are rejected until pricing is set (",n.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away.",d>0?n.jsxs(n.Fragment,{children:[" ",n.jsxs("strong",{className:"font-semibold",children:[d.toLocaleString()," ",d===1?"request":"requests"," failed in the last hour."]})," ",n.jsx(Fe,{to:"/activity?status=error&range=1h&source=gateway",className:"underline underline-offset-2",children:"View failed requests"})]}):null]}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(C,{size:"sm",variant:"primary",isDisabled:t.isPending,onPress:()=>t.mutate({default_pricing:!0}),children:t.isPending?"Enabling…":"Enable default pricing"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Dismiss"})]})]})})}):null}function It(){const{data:e}=dt(),t=o.useRef(null);return e&&t.current===null&&(t.current=e.build),e!=null&&t.current!=null&&e.build!==t.current}function qt(){const e=It(),[t,r]=o.useState(!1);return!e||t?null:n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:n.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),n.jsx(C,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>r(!0),children:"Later"})]})})}const je=200,Se=480,Z=240,Rt=60,ke="otari.dashboard.sidebarWidth",Ee="otari.dashboard.sidebarCollapsed",he=16,Pe="(max-width: 767px)",$=e=>Math.min(Se,Math.max(je,e));function Ot(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(Pe).matches}const Mt='a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ft(e){return e?Array.from(e.querySelectorAll(Mt)).filter(t=>t.offsetParent!==null||t===document.activeElement):[]}function Ut(){if(typeof window>"u")return Z;try{const e=window.localStorage.getItem(ke),t=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(t)?Z:$(t)}catch{return Z}}function Kt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ee)==="1"}catch{return!1}}const Bt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],$t=[{to:"/",section:"home",label:"Overview",end:!0,icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),n.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),n.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),n.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),n.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function zt(){const{logout:e}=re(),t=o.useRef(null),r=o.useRef(null),s=o.useRef(null),[a,i]=o.useState(Ut),[u,d]=o.useState(Kt),[f,y]=o.useState(!1),[h,b]=o.useState(Ot),[m,N]=o.useState(!1);o.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const c=window.matchMedia(Pe),v=w=>{b(w.matches),w.matches||N(!1)};return typeof c.addEventListener=="function"?(c.addEventListener("change",v),()=>c.removeEventListener("change",v)):(c.addListener(v),()=>c.removeListener(v))},[]),o.useEffect(()=>{if(!m)return;const c=v=>{v.key==="Escape"&&N(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[m]),o.useEffect(()=>{var c,v,w;h&&(m?(c=t.current)==null||c.focus():(v=t.current)!=null&&v.contains(document.activeElement)&&((w=s.current)==null||w.focus()))},[h,m]);const M=o.useCallback(c=>{if(c.key!=="Tab")return;const v=Ft(t.current);if(v.length===0)return;const w=v[0],k=v[v.length-1],F=document.activeElement;c.shiftKey&&(F===w||F===t.current)?(c.preventDefault(),k.focus()):!c.shiftKey&&F===k&&(c.preventDefault(),w.focus())},[]);o.useEffect(()=>{const c=window.setTimeout(()=>{try{window.localStorage.setItem(ke,String(Math.round(a)))}catch{}},200);return()=>window.clearTimeout(c)},[a]),o.useEffect(()=>{try{window.localStorage.setItem(Ee,u?"1":"0")}catch{}},[u]);const Ce=o.useCallback(c=>{c.preventDefault(),c.currentTarget.setPointerCapture(c.pointerId),y(!0)},[]),_e=o.useCallback(c=>{var w;if(!c.currentTarget.hasPointerCapture(c.pointerId))return;const v=((w=t.current)==null?void 0:w.getBoundingClientRect().left)??0;i($(c.clientX-v))},[]),Te=o.useCallback(c=>{c.currentTarget.hasPointerCapture(c.pointerId)&&c.currentTarget.releasePointerCapture(c.pointerId),y(!1)},[]),Le=o.useCallback(c=>{var v;c.preventDefault(),(v=r.current)==null||v.focus()},[]),De=o.useCallback(c=>{c.key==="ArrowLeft"?(c.preventDefault(),i(v=>$(v-he))):c.key==="ArrowRight"&&(c.preventDefault(),i(v=>$(v+he)))},[]),Ae=u?Rt:a,S=h?!1:u,H=h&&m?!0:void 0;return n.jsxs("div",{className:_("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[n.jsx("button",{type:"button",inert:H,onClick:Le,className:"sr-only focus:not-sr-only focus:absolute focus:top-3 focus:left-3 focus:z-50 focus:rounded-lg focus:border focus:border-[var(--otari-brand)] focus:bg-[var(--otari-surface)] focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-[var(--otari-brand-dark)] focus:shadow-md focus:outline-none",children:"Skip to main content"}),n.jsxs("header",{inert:H,className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("button",{type:"button",ref:s,onClick:()=>N(c=>!c),"aria-label":m?"Close navigation":"Open navigation","aria-expanded":m,"aria-controls":"app-sidebar",className:"-ml-1 flex h-8 w-8 items-center justify-center rounded-lg text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)] md:hidden",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5",children:n.jsx("path",{d:"M4 6h16M4 12h16M4 18h16",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),n.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),n.jsx(C,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),n.jsx(qt,{}),n.jsx(st,{}),n.jsx(At,{}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[h&&m?n.jsx("div",{"aria-hidden":"true",onClick:()=>N(!1),className:"fixed inset-0 z-30 bg-black/40 md:hidden"}):null,n.jsxs("aside",{ref:t,id:"app-sidebar",role:h?"dialog":void 0,"aria-modal":h&&m?!0:void 0,"aria-label":h?"Navigation":void 0,tabIndex:h?-1:void 0,inert:h&&!m?!0:void 0,onKeyDown:h&&m?M:void 0,style:h?void 0:{width:Ae},className:_("flex flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)] focus:outline-none",h?_("fixed inset-y-0 left-0 z-40 w-[17rem] shadow-xl transition-transform duration-200",m?"translate-x-0":"-translate-x-full"):_("relative shrink-0",!f&&"transition-[width] duration-150")),children:[n.jsx("button",{type:"button",onClick:()=>d(c=>!c),"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-pressed":u,title:u?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 hidden h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)] md:flex",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:_("h-3.5 w-3.5 transition-transform",u&&"rotate-180"),children:n.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("nav",{className:_("flex flex-col py-4",S?"px-2":"px-3"),children:Bt.map((c,v)=>{const w=$t.filter(k=>k.section===c.key);return w.length===0?null:n.jsxs("div",{className:v>0?"mt-4":void 0,children:[!S&&c.label?n.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:c.label}):null,v>0&&(S||!c.label)?n.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,n.jsx("div",{className:"flex flex-col gap-1",children:w.map(k=>n.jsxs(ee,{to:k.to,end:k.end,onClick:()=>N(!1),"aria-label":S?k.label:void 0,title:S?k.label:void 0,className:({isActive:F})=>_("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"justify-center px-0":"gap-3 px-3",F?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,S?null:k.label]},k.to))})]},c.key)})}),n.jsxs("div",{className:"mt-auto flex flex-col gap-1 pb-3",children:[n.jsxs(ee,{to:"/docs",onClick:()=>N(!1),"aria-label":S?"User guide":void 0,title:S?"User guide":void 0,className:({isActive:c})=>_("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"mx-2 justify-center px-0":"mx-3 gap-3 px-3",c?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[n.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.5V18c4 0 6.5.5 8 2 1.5-1.5 4-2 8-2V4.5c-4 0-6.5.5-8 2z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 6.5V20",strokeLinecap:"round"})]}),S?null:"User guide"]}),n.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai: the hosted Otari gateway",className:_("flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",S?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),S?null:n.jsxs("span",{className:"flex-1",children:["otari.ai ",n.jsx("span",{"aria-hidden":!0,children:"↗"})]})]})]}),u||h?null:n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(a),"aria-valuemin":je,"aria-valuemax":Se,tabIndex:0,onPointerDown:Ce,onPointerMove:_e,onPointerUp:Te,onKeyDown:De,className:_("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),n.jsx("main",{ref:r,id:"main-content",tabIndex:-1,inert:H,className:"flex-1 overflow-y-auto focus:outline-none",children:n.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-4 py-5 md:px-6 md:py-6",children:n.jsx(Ue,{})})})]})]})}function Qt(){const{login:e}=re(),[t,r]=o.useState(""),[s,a]=o.useState(null),[i,u]=o.useState(!1),d=async()=>{const f=t.trim();if(!(!f||i)){u(!0),a(null);try{await Xe(f)?e():a(new Error("Invalid master key."))}catch(y){a(y)}finally{u(!1)}}};return n.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:n.jsx(I,{className:"w-full max-w-md",children:n.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),n.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),d()},children:[n.jsxs(We,{value:t,onChange:f=>{r(f),s&&a(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),n.jsx(ye,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),n.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[n.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),n.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",n.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",n.jsx("code",{children:"Your master key:"})," (for example, run"," ",n.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),n.jsx(_t,{error:s}),n.jsx(C,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!t.trim()||i,children:i?"Signing in…":"Sign in"})]}),n.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),n.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:n.jsx(He,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const Vt=o.lazy(async()=>({default:(await P(async()=>{const{ActivityPage:e}=await import("./ActivityPage-BENT_1o4.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))).ActivityPage})),Wt=o.lazy(async()=>({default:(await P(async()=>{const{AliasesPage:e}=await import("./AliasesPage-CtStwRk-.js");return{AliasesPage:e}},__vite__mapDeps([11,1,2,6,5,7,8,12,13]))).AliasesPage})),Ht=o.lazy(async()=>({default:(await P(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-0J25eK0m.js");return{BudgetsPage:e}},__vite__mapDeps([14,1,2,6,5,7,8,12]))).BudgetsPage})),Gt=o.lazy(async()=>({default:(await P(async()=>{const{DocsPage:e}=await import("./DocsPage-DoYdRqgR.js");return{DocsPage:e}},__vite__mapDeps([15,1,2,5]))).DocsPage})),Jt=o.lazy(async()=>({default:(await P(async()=>{const{KeysPage:e}=await import("./KeysPage-JwzirK0P.js");return{KeysPage:e}},__vite__mapDeps([16,1,2,6,5,7,8,12,17,13]))).KeysPage})),Yt=o.lazy(async()=>({default:(await P(async()=>{const{ModelsPage:e}=await import("./ModelsPage-DyZuS75D.js");return{ModelsPage:e}},__vite__mapDeps([18,1,2,6,5,8,10]))).ModelsPage})),Xt=o.lazy(async()=>({default:(await P(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-Tme0ej_W.js");return{OverviewIndex:e}},__vite__mapDeps([19,1,2,3,4,5,8]))).OverviewIndex})),Zt=o.lazy(async()=>({default:(await P(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-B46VzXV5.js");return{ProvidersPage:e}},__vite__mapDeps([20,1,2,12,5,8]))).ProvidersPage})),en=o.lazy(async()=>({default:(await P(async()=>{const{SettingsPage:e}=await import("./SettingsPage-CMbg-FaW.js");return{SettingsPage:e}},__vite__mapDeps([21,1,2,5]))).SettingsPage})),tn=o.lazy(async()=>({default:(await P(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-DkLhKtcA.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([22,1,2,5]))).ToolsGuardrailsPage})),nn=o.lazy(async()=>({default:(await P(async()=>{const{UsagePage:e}=await import("./UsagePage-CjaSd7XG.js");return{UsagePage:e}},__vite__mapDeps([23,1,2,3,4,5,8,9]))).UsagePage})),rn=o.lazy(async()=>({default:(await P(async()=>{const{UsersPage:e}=await import("./UsersPage-Cfif2r2r.js");return{UsersPage:e}},__vite__mapDeps([24,1,2,6,5,7,8,12,17]))).UsersPage}));function E(e){return n.jsx(o.Suspense,{fallback:n.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function sn(){const{isAuthenticated:e}=re();return e?n.jsx(Ke,{children:n.jsx(Be,{children:n.jsxs(j,{element:n.jsx(zt,{}),children:[n.jsx(j,{index:!0,element:E(n.jsx(Xt,{}))}),n.jsx(j,{path:"providers",element:E(n.jsx(Zt,{}))}),n.jsx(j,{path:"keys",element:E(n.jsx(Jt,{}))}),n.jsx(j,{path:"users",element:E(n.jsx(rn,{}))}),n.jsx(j,{path:"budgets",element:E(n.jsx(Ht,{}))}),n.jsx(j,{path:"activity",element:E(n.jsx(Vt,{}))}),n.jsx(j,{path:"usage",element:E(n.jsx(nn,{}))}),n.jsx(j,{path:"models",element:E(n.jsx(Yt,{}))}),n.jsx(j,{path:"aliases",element:E(n.jsx(Wt,{}))}),n.jsx(j,{path:"tools",element:E(n.jsx(tn,{}))}),n.jsx(j,{path:"settings",element:E(n.jsx(en,{}))}),n.jsx(j,{path:"docs",element:E(n.jsx(Gt,{}))}),n.jsx(j,{path:"*",element:n.jsx($e,{to:"/",replace:!0})})]})})}):n.jsx(Qt,{})}function an({children:e}){const[t]=o.useState(()=>new Re({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(r,s)=>s instanceof L&&(s.status===401||s.status===403)?!1:r<2}}}));return n.jsx(Oe,{client:t,children:n.jsx(tt,{children:e})})}const Ne=document.getElementById("root");if(!Ne)throw new Error("Root element #root not found");Ge.createRoot(Ne).render(n.jsx(o.StrictMode,{children:n.jsx(an,{children:n.jsx(sn,{})})}));export{Pn as $,hn as A,Nr as B,xn as C,tr as D,_t as E,Tr as F,Yn as G,Xn as H,Tt as I,Zn as J,Jn as K,wn as L,$n as M,fr as N,qn as O,Er as P,zn as Q,Pr as R,gr as S,Qn as T,Ct as U,pr as V,mt as W,vr as X,at as Y,Sn as Z,Cr as _,ot as a,jr as a0,Sr as a1,br as a2,kr as a3,yr as a4,Pt as a5,Nt as a6,Cn as a7,Ln as a8,An as a9,ft as aa,Tn as ab,Nn as ac,_n as ad,En as ae,kn as af,In as ag,Vn as ah,Wn as ai,Hn as aj,Fn as ak,Dn as al,Un as am,Kn as an,Bn as ao,xr as ap,L as aq,mn as ar,dn as as,wr as at,lr as au,ir as av,pn as b,Gn as c,cr as d,ur as e,bn as f,hr as g,yn as h,vn as i,dr as j,mr as k,fn as l,Lr as m,it as n,jn as o,Rn as p,Mn as q,gn as r,_r as s,On as t,ar as u,er as v,nr as w,rr as x,sr as y,or as z}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-CcRVRd0J.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/charts-DNysd9jl.js","assets/recharts-BwTTRGtj.js","assets/heroui-DZj66Arc.js","assets/tableSelection-CojkFPwd.js","assets/ConfirmDialog-D3P-vj-t.js","assets/DataTable-CrQq0sYf.js","assets/FilterChips-BLdhUEZK.js","assets/TablePagination-D_2uYqKa.js","assets/AliasesPage-CXPQdDm6.js","assets/Field-DEJ6Wjg9.js","assets/UserComboBox-nt7pHfqn.js","assets/BudgetsPage-Cnrtd_az.js","assets/DocsPage-BgBskDDe.js","assets/KeysPage-D9JSwodo.js","assets/ModelScopeControl-wPC6RjBJ.js","assets/ModelsPage-CH43id2j.js","assets/OverviewPage-BOO3r0BN.js","assets/ProvidersPage-enPv456e.js","assets/SettingsPage-VWHKo1Ho.js","assets/ToolsGuardrailsPage-CBa0KCZv.js","assets/UsagePage-5U02HhO3.js","assets/UsersPage-AJZgT8Wn.js"])))=>i.map(i=>d[i]); +var Ie=Object.defineProperty;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>qe(e,typeof t!="symbol"?t+"":t,r);import{u as g,j as n,a as p,b as x,k as z,Q as Re,c as Oe}from"./tanstack-query-1t81HyiD.js";import{d as Me,r as o,N as ee,L as Fe,O as Ue,H as Ke,e as Be,f as j,h as $e}from"./react-dgEcD0HR.js";import{B as C,C as K,L as xe,I as ye,a as ze,b as Qe,d as I,S as Ve,c as _,T as We,e as He}from"./heroui-DZj66Arc.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ge=Me();const Je="modulepreload",Ye=function(e){return"/"+e},ue={},P=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let u=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(r.map(y=>{if(y=Ye(y),y in ue)return;ue[y]=!0;const h=y.endsWith(".css"),b=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Je,h||(m.as="script"),m.crossOrigin="",m.href=y,f&&m.setAttribute("nonce",f),document.head.appendChild(m),h)return new Promise((N,M)=>{m.addEventListener("load",N),m.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};class L extends Error{constructor(r,s){super(s);ce(this,"status");this.name="ApiError",this.status=r}}let B=null;function de(e){B=e}async function te(e){try{const t=await e.json();if(typeof t.detail=="string")return t.detail;if(t.detail!=null)return JSON.stringify(t.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Xe(e){let t;try{t=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(t.status===401||t.status===403)return!1;if(!t.ok)throw new L(t.status,await te(t));return!0}async function Ze(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function l(e,t={}){const r=new Headers(t.headers);r.set("Accept","application/json"),t.body!=null&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let s;try{s=await fetch(e,{...t,headers:r})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(s.status===401||s.status===403)throw B==null||B(),new L(s.status,await te(s));if(!s.ok)throw new L(s.status,await te(s));if(s.status!==204)return await s.json()}const ne="otari.dashboard.hasSession",ve=o.createContext(null);function et(){try{return window.localStorage.getItem(ne)==="1"}catch{return!1}}function tt({children:e}){const t=g(),[r,s]=o.useState(et),a=o.useCallback(()=>{Ze(),s(!1),t.clear();try{window.localStorage.removeItem(ne)}catch{}},[t]),i=o.useCallback(()=>{t.clear(),s(!0);try{window.localStorage.setItem(ne,"1")}catch{}},[t]);o.useEffect(()=>(de(a),()=>de(null)),[a]);const u=o.useMemo(()=>({isAuthenticated:r,login:i,logout:a}),[r,i,a]);return n.jsx(ve.Provider,{value:u,children:e})}function re(){const e=o.useContext(ve);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function nt(e){return e instanceof L&&e.status===0}function rt(){const e=g(),[t,r]=o.useState(!1);return o.useEffect(()=>{const s=e.getQueryCache(),a=()=>s.getAll().some(i=>i.state.status==="error"&&nt(i.state.error));return r(a()),s.subscribe(()=>r(a()))},[e]),t}function st(){return rt()?n.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const Q=3600,T=86400,at=365*T,dn=[{key:"1h",label:"Last hour",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:T,bucket:"hour"},{key:"7d",label:"7d",seconds:7*T,bucket:"day"},{key:"30d",label:"30d",seconds:30*T,bucket:"day"},{key:"90d",label:"90d",seconds:90*T,bucket:"day"},{key:"12mo",label:"12mo",seconds:at,bucket:"day"}],mn="30d",fn=[{key:"1h",label:"1h",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:T,bucket:"hour"},{key:"7d",label:"7d",seconds:7*T,bucket:"day"},{key:"30d",label:"30d",seconds:30*T,bucket:"day"},{key:"all",label:"All",seconds:null,bucket:"day"}],hn="24h",xn="custom";function yn(e,t){return e.find(r=>r.key===t)}function it(e,t=Date.now()){return new Date(t-e*1e3).toISOString()}function ot(e){return(e==="hour"?Q:T)*1e3}function vn(e,t,r=Date.now()){const s=new Date(e).getTime();return(t?new Date(t).getTime():r)-s<=T*1e3?"hour":"day"}function gn(e,t,r,s){if(e.length===0)return null;const a=Math.max(0,Math.min(t,r)),i=Math.min(e.length-1,Math.max(t,r)),u=new Date(e[a]).getTime(),d=new Date(e[i]).getTime()+ot(s);return{startIso:new Date(u).toISOString(),endIso:new Date(d).toISOString()}}function pn(e,t,r){const s=e.length;if(s===0)return{startIndex:0,endIndex:0};const a=e.map(d=>new Date(d).getTime());let i=0;if(t){const d=new Date(t).getTime();for(let f=0;fl("/v1/models"),staleTime:6e4})}function dt(){return p({queryKey:[ct],queryFn:()=>l("/dashboard-build.json"),refetchInterval:ut,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function jn(){return p({queryKey:[ae],queryFn:()=>l("/v1/models/discoverable"),staleTime:5*6e4})}function Sn(){return p({queryKey:[ie],queryFn:()=>l("/v1/providers"),staleTime:5*6e4})}function kn(){return p({queryKey:["provider-catalog"],queryFn:()=>l("/v1/providers/catalog"),staleTime:1/0})}function En(e){return p({queryKey:["provider-catalog",e],queryFn:()=>l(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Pn(){return p({queryKey:[oe],queryFn:()=>l("/v1/providers/health"),staleTime:me,refetchInterval:me})}function Nn(){const e=g();return x({mutationFn:()=>l("/v1/providers/health?refresh=true"),onSuccess:t=>e.setQueryData([oe],t)})}function Cn(){return p({queryKey:[be],queryFn:()=>l("/v1/provider-credentials"),staleTime:6e4})}function W(e){e.invalidateQueries({queryKey:[be]}),e.invalidateQueries({queryKey:[ie]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]}),e.invalidateQueries({queryKey:[oe]})}function _n(){const e=g();return x({mutationFn:t=>l("/v1/provider-credentials",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>W(e)})}function Tn(){const e=g();return x({mutationFn:({instance:t,body:r})=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>W(e)})}function Ln(){const e=g();return x({mutationFn:t=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>W(e)})}function Dn(){const e=g();return x({mutationFn:()=>l("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>W(e)})}function An(){return x({mutationFn:e=>l(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function In(){return x({mutationFn:e=>l("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function qn(){return p({queryKey:[lt],queryFn:()=>l("/v1/models/metadata"),staleTime:10*6e4})}function Rn(){return p({queryKey:[se],queryFn:()=>l("/v1/aliases"),staleTime:6e4})}function On(){const e=g();return x({mutationFn:t=>l("/v1/aliases",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function Mn(){const e=g();return x({mutationFn:({name:t,userId:r})=>{const s=r==null?"":`?user_id=${encodeURIComponent(r)}`;return l(`/v1/aliases/${encodeURIComponent(t)}${s}`,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function mt(){return p({queryKey:[ge],queryFn:()=>l("/v1/settings"),staleTime:6e4})}function ft(){const e=g();return x({mutationFn:t=>l("/v1/settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([ge],t),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]})}})}function Fn(){return x({mutationFn:()=>l("/v1/settings/master-key/rotate",{method:"POST"})})}function Un(){return p({queryKey:[pe],queryFn:()=>l("/v1/tool-settings"),staleTime:6e4})}function Kn(){const e=g();return x({mutationFn:t=>l("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([pe],t)}})}function Bn(){return x({mutationFn:({service:e,url:t})=>l(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:t})})})}const G=1e3,ht=100;async function xt(){const e=[];for(let t=0;tl("/v1/pricing",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Qn(){const e=g();return x({mutationFn:t=>l(`/v1/pricing/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Vn(){return x({mutationFn:()=>l("/v1/pricing/refresh",{method:"POST"})})}function Wn(){const e=g();return x({mutationFn:()=>l("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ie]})}})}function Hn(){return x({mutationFn:()=>l("/v1/pricing/refresh/reject",{method:"POST"})})}const J=1e3,yt=100;async function vt(){const e=[];for(let t=0;tl("/v1/keys",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Yn(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Xn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Zn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}const Y=1e3,gt=100;async function pt(){const e=[];for(let t=0;tl(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function nr(){const e=g();return x({mutationFn:t=>l("/v1/budgets",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function rr(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function sr(){const e=g();return x({mutationFn:t=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}const X=1e3,bt=100;async function wt(){const e=[];for(let t=0;tl("/v1/users",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>le(e)})}function or(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>le(e)})}function lr(){const e=g();return x({mutationFn:t=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{le(e),e.invalidateQueries({queryKey:[R]})}})}function U(e){const t=new URLSearchParams;return e.start_date&&t.set("start_date",e.start_date),e.end_date&&t.set("end_date",e.end_date),e.status&&t.set("status",e.status),e.model&&t.set("model",e.model),e.endpoint&&t.set("endpoint",e.endpoint),e.provider&&t.set("provider",e.provider),e.user_id&&t.set("user_id",e.user_id),e.api_key_id&&t.set("api_key_id",e.api_key_id),e.source&&t.set("source",e.source),e.source_label&&t.set("source_label",e.source_label),e.priced!==void 0&&t.set("priced",String(e.priced)),e.counts_toward_budget!==void 0&&t.set("counts_toward_budget",String(e.counts_toward_budget)),t}function cr(e,t,r){return p({queryKey:[q,"list",e,t,r],queryFn:()=>{const s=U(e);return s.set("skip",String(t*r)),s.set("limit",String(r)),l(`/v1/usage?${s.toString()}`)},placeholderData:z,staleTime:1e4})}function ur(e,t=!0){return p({queryKey:[q,"count",e],queryFn:()=>l(`/v1/usage/count?${U(e).toString()}`),enabled:t,placeholderData:z,staleTime:1e4})}const jt=6e4;function St(e,t=!0){return p({queryKey:[q,"count","failures",e],queryFn:()=>{const r={status:"error",source:"gateway",start_date:it(e)};return l(`/v1/usage/count?${U(r).toString()}`)},enabled:t,refetchInterval:jt,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function dr(){const e=g();return x({mutationFn:t=>l("/v1/usage",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}function mr(){const e=g();return x({mutationFn:t=>l("/v1/usage/set-price",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}const fr=[];function hr(e,t,r,s=!0){return p({queryKey:[q,"summary",e,t,r??"all"],queryFn:()=>{const a=U(e);if(a.set("bucket",t),r)for(const i of r.length>0?r:["none"])a.append("dimensions",i);return l(`/v1/usage/summary?${a.toString()}`)},enabled:s,placeholderData:z,staleTime:3e4})}function xr(e,t,r,s=!0){return p({queryKey:[q,"series",e,t,r],queryFn:()=>{const a=U(e);return a.set("bucket",t),a.set("group_by",r),l(`/v1/usage/series?${a.toString()}`)},enabled:s&&r!==null,placeholderData:z,staleTime:3e4,retry:(a,i)=>!(i instanceof L&&i.status===404)&&a<3})}function yr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function vr(e){if(e==null)return"$0.00";const t=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}function gr(e){if(e==null)return"—";if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){const t=Math.round(e/1e3);return t>=1e3?"1M":`${t}K`}return String(e)}const kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pr(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})/.exec(e);if(!t)return e;const r=Number(t[2])-1;return r<0||r>11?t[1]:`${kt[r]} ${t[1]}`}const Et=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function br(e){return Et.format(e)}function wr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Pt(e){return`${(e*100).toFixed(1)}%`}function jr(e,t){return t===void 0||t===0?null:(e-t)/t}function Nt(e,t=Date.now()){if(!e)return"never";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const s=Math.round((t-r.getTime())/1e3),a=s<0,i=Math.abs(s),u=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let d=i,f="second";for(const[h,b]of u){if(f=h,d0?"▲":e<0?"▼":"•";return n.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t," ",Pt(Math.abs(e))," vs prev"]})}function Ct(e){return e instanceof L||e instanceof Error?e.message:"Something went wrong."}function _t({error:e}){return e?n.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:Ct(e)}):null}function Tt({tone:e="info",children:t}){const r=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return n.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${r}`,children:t})}function Er({title:e,description:t,action:r}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),r?n.jsx("div",{className:"flex flex-wrap gap-2",children:r}):null]})}function Lt(e){const[t,r]=o.useState(()=>Date.now());return o.useEffect(()=>{let s;const a=()=>{s===void 0&&(s=setInterval(()=>r(Date.now()),e))},i=()=>{s!==void 0&&(clearInterval(s),s=void 0)},u=()=>{r(Date.now()),document.visibilityState==="visible"?a():i()};return u(),document.addEventListener("visibilitychange",u),()=>{i(),document.removeEventListener("visibilitychange",u)}},[e]),t}function Pr({onRefresh:e,isFetching:t=!1,updatedAt:r,label:s="Refresh"}){const a=Lt(15e3),i=r?Nt(new Date(r).toISOString(),a):null;return n.jsxs("span",{className:"inline-flex items-center gap-2",children:[i?n.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Updated ",i]}):null,n.jsx(C,{variant:"outline",size:"sm",isIconOnly:!0,isDisabled:t,onPress:e,"aria-label":s,children:n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`h-4 w-4 ${t?"animate-spin":""}`,"aria-hidden":"true",children:[n.jsx("path",{d:"M20 11a8 8 0 1 0-.5 4",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M20 4v5h-5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function Nr({title:e,description:t,actionLabel:r,onAction:s,isActionDisabled:a,children:i}){return n.jsx(I,{children:n.jsxs(I.Content,{className:"flex flex-col gap-4 p-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),i,r&&s?n.jsx("div",{children:n.jsx(C,{variant:"primary",isDisabled:a,onPress:s,children:r})}):null]})})}function Cr({label:e="Loading…"}){return n.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 px-4 py-10 text-sm text-[var(--otari-muted)]",children:[n.jsx(Ve,{size:"sm"}),n.jsx("span",{children:e})]})}function _r({children:e,confirmLabel:t,onConfirm:r,isPending:s}){const[a,i]=o.useState(!1);return a?n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(C,{size:"sm",variant:"danger",isDisabled:s,onPress:r,children:t}),n.jsx(C,{size:"sm",variant:"ghost",isDisabled:s,onPress:()=>i(!1),children:"Cancel"})]}):n.jsx(C,{size:"sm",variant:"danger-soft",onPress:()=>i(!0),children:e})}const Dt="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Tr({id:e,label:t,ariaLabel:r,value:s,onChange:a,options:i,children:u,disabled:d}){const f=o.useId(),y=e??(t?f:void 0),h=n.jsx("select",{id:y,"aria-label":t?void 0:r,value:s,disabled:d,onChange:b=>a(b.target.value),className:Dt,children:i?i.map(b=>n.jsx("option",{value:b.value,children:b.label},b.value)):u});return t?n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),h]}):h}function Lr({label:e,value:t,onChange:r,options:s,placeholder:a,maxVisible:i=50,allowsCustom:u=!1}){const d=m=>{var N;return((N=s.find(M=>M.value===m))==null?void 0:N.label)??m},[f,y]=o.useState(()=>d(t));o.useEffect(()=>{y(d(t))},[t]);const h=f.trim().toLowerCase(),b=s.filter(m=>!h||m.value.toLowerCase().includes(h)||m.label.toLowerCase().includes(h)).slice(0,i);return n.jsxs(K.Root,{allowsEmptyCollection:!0,allowsCustomValue:u,menuTrigger:"focus",inputValue:f,onInputChange:m=>{y(m),u?r(m.trim()):m.trim()===""&&r("")},onSelectionChange:m=>{m!=null&&r(String(m))},className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),n.jsxs(K.InputGroup,{children:[n.jsx(ye,{placeholder:a,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),n.jsx(K.Trigger,{})]}),n.jsx(K.Popover,{children:n.jsx(ze,{items:b,className:"max-h-72 overflow-auto",children:m=>n.jsx(Qe,{id:m.value,textValue:m.label,children:m.label})})})]})}function At(){var f,y;const e=mt(),t=ft(),[r,s]=o.useState(!1),i=((f=e.data)==null?void 0:f.require_pricing)===!0&&e.data.default_pricing===!1&&!r,d=((y=St(Q,i).data)==null?void 0:y.total)??0;return i?n.jsx("div",{className:"shrink-0 px-6 pt-3",children:n.jsx(Tt,{tone:"warning",children:n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("span",{children:["Requests are rejected until pricing is set (",n.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away.",d>0?n.jsxs(n.Fragment,{children:[" ",n.jsxs("strong",{className:"font-semibold",children:[d.toLocaleString()," ",d===1?"request":"requests"," failed in the last hour."]})," ",n.jsx(Fe,{to:"/activity?status=error&range=1h&source=gateway",className:"underline underline-offset-2",children:"View failed requests"})]}):null]}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(C,{size:"sm",variant:"primary",isDisabled:t.isPending,onPress:()=>t.mutate({default_pricing:!0}),children:t.isPending?"Enabling…":"Enable default pricing"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Dismiss"})]})]})})}):null}function It(){const{data:e}=dt(),t=o.useRef(null);return e&&t.current===null&&(t.current=e.build),e!=null&&t.current!=null&&e.build!==t.current}function qt(){const e=It(),[t,r]=o.useState(!1);return!e||t?null:n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:n.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),n.jsx(C,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>r(!0),children:"Later"})]})})}const je=200,Se=480,Z=240,Rt=60,ke="otari.dashboard.sidebarWidth",Ee="otari.dashboard.sidebarCollapsed",he=16,Pe="(max-width: 767px)",$=e=>Math.min(Se,Math.max(je,e));function Ot(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(Pe).matches}const Mt='a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ft(e){return e?Array.from(e.querySelectorAll(Mt)).filter(t=>t.offsetParent!==null||t===document.activeElement):[]}function Ut(){if(typeof window>"u")return Z;try{const e=window.localStorage.getItem(ke),t=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(t)?Z:$(t)}catch{return Z}}function Kt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ee)==="1"}catch{return!1}}const Bt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],$t=[{to:"/",section:"home",label:"Overview",end:!0,icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),n.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),n.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),n.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),n.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function zt(){const{logout:e}=re(),t=o.useRef(null),r=o.useRef(null),s=o.useRef(null),[a,i]=o.useState(Ut),[u,d]=o.useState(Kt),[f,y]=o.useState(!1),[h,b]=o.useState(Ot),[m,N]=o.useState(!1);o.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const c=window.matchMedia(Pe),v=w=>{b(w.matches),w.matches||N(!1)};return typeof c.addEventListener=="function"?(c.addEventListener("change",v),()=>c.removeEventListener("change",v)):(c.addListener(v),()=>c.removeListener(v))},[]),o.useEffect(()=>{if(!m)return;const c=v=>{v.key==="Escape"&&N(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[m]),o.useEffect(()=>{var c,v,w;h&&(m?(c=t.current)==null||c.focus():(v=t.current)!=null&&v.contains(document.activeElement)&&((w=s.current)==null||w.focus()))},[h,m]);const M=o.useCallback(c=>{if(c.key!=="Tab")return;const v=Ft(t.current);if(v.length===0)return;const w=v[0],k=v[v.length-1],F=document.activeElement;c.shiftKey&&(F===w||F===t.current)?(c.preventDefault(),k.focus()):!c.shiftKey&&F===k&&(c.preventDefault(),w.focus())},[]);o.useEffect(()=>{const c=window.setTimeout(()=>{try{window.localStorage.setItem(ke,String(Math.round(a)))}catch{}},200);return()=>window.clearTimeout(c)},[a]),o.useEffect(()=>{try{window.localStorage.setItem(Ee,u?"1":"0")}catch{}},[u]);const Ce=o.useCallback(c=>{c.preventDefault(),c.currentTarget.setPointerCapture(c.pointerId),y(!0)},[]),_e=o.useCallback(c=>{var w;if(!c.currentTarget.hasPointerCapture(c.pointerId))return;const v=((w=t.current)==null?void 0:w.getBoundingClientRect().left)??0;i($(c.clientX-v))},[]),Te=o.useCallback(c=>{c.currentTarget.hasPointerCapture(c.pointerId)&&c.currentTarget.releasePointerCapture(c.pointerId),y(!1)},[]),Le=o.useCallback(c=>{var v;c.preventDefault(),(v=r.current)==null||v.focus()},[]),De=o.useCallback(c=>{c.key==="ArrowLeft"?(c.preventDefault(),i(v=>$(v-he))):c.key==="ArrowRight"&&(c.preventDefault(),i(v=>$(v+he)))},[]),Ae=u?Rt:a,S=h?!1:u,H=h&&m?!0:void 0;return n.jsxs("div",{className:_("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[n.jsx("button",{type:"button",inert:H,onClick:Le,className:"sr-only focus:not-sr-only focus:absolute focus:top-3 focus:left-3 focus:z-50 focus:rounded-lg focus:border focus:border-[var(--otari-brand)] focus:bg-[var(--otari-surface)] focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-[var(--otari-brand-dark)] focus:shadow-md focus:outline-none",children:"Skip to main content"}),n.jsxs("header",{inert:H,className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("button",{type:"button",ref:s,onClick:()=>N(c=>!c),"aria-label":m?"Close navigation":"Open navigation","aria-expanded":m,"aria-controls":"app-sidebar",className:"-ml-1 flex h-8 w-8 items-center justify-center rounded-lg text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)] md:hidden",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5",children:n.jsx("path",{d:"M4 6h16M4 12h16M4 18h16",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),n.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),n.jsx(C,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),n.jsx(qt,{}),n.jsx(st,{}),n.jsx(At,{}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[h&&m?n.jsx("div",{"aria-hidden":"true",onClick:()=>N(!1),className:"fixed inset-0 z-30 bg-black/40 md:hidden"}):null,n.jsxs("aside",{ref:t,id:"app-sidebar",role:h?"dialog":void 0,"aria-modal":h&&m?!0:void 0,"aria-label":h?"Navigation":void 0,tabIndex:h?-1:void 0,inert:h&&!m?!0:void 0,onKeyDown:h&&m?M:void 0,style:h?void 0:{width:Ae},className:_("flex flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)] focus:outline-none",h?_("fixed inset-y-0 left-0 z-40 w-[17rem] shadow-xl transition-transform duration-200",m?"translate-x-0":"-translate-x-full"):_("relative shrink-0",!f&&"transition-[width] duration-150")),children:[n.jsx("button",{type:"button",onClick:()=>d(c=>!c),"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-pressed":u,title:u?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 hidden h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)] md:flex",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:_("h-3.5 w-3.5 transition-transform",u&&"rotate-180"),children:n.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("nav",{className:_("flex flex-col py-4",S?"px-2":"px-3"),children:Bt.map((c,v)=>{const w=$t.filter(k=>k.section===c.key);return w.length===0?null:n.jsxs("div",{className:v>0?"mt-4":void 0,children:[!S&&c.label?n.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:c.label}):null,v>0&&(S||!c.label)?n.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,n.jsx("div",{className:"flex flex-col gap-1",children:w.map(k=>n.jsxs(ee,{to:k.to,end:k.end,onClick:()=>N(!1),"aria-label":S?k.label:void 0,title:S?k.label:void 0,className:({isActive:F})=>_("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"justify-center px-0":"gap-3 px-3",F?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,S?null:k.label]},k.to))})]},c.key)})}),n.jsxs("div",{className:"mt-auto flex flex-col gap-1 pb-3",children:[n.jsxs(ee,{to:"/docs",onClick:()=>N(!1),"aria-label":S?"User guide":void 0,title:S?"User guide":void 0,className:({isActive:c})=>_("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"mx-2 justify-center px-0":"mx-3 gap-3 px-3",c?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[n.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.5V18c4 0 6.5.5 8 2 1.5-1.5 4-2 8-2V4.5c-4 0-6.5.5-8 2z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 6.5V20",strokeLinecap:"round"})]}),S?null:"User guide"]}),n.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai: the hosted Otari gateway",className:_("flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",S?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),S?null:n.jsxs("span",{className:"flex-1",children:["otari.ai ",n.jsx("span",{"aria-hidden":!0,children:"↗"})]})]})]}),u||h?null:n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(a),"aria-valuemin":je,"aria-valuemax":Se,tabIndex:0,onPointerDown:Ce,onPointerMove:_e,onPointerUp:Te,onKeyDown:De,className:_("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),n.jsx("main",{ref:r,id:"main-content",tabIndex:-1,inert:H,className:"flex-1 overflow-y-auto focus:outline-none",children:n.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-4 py-5 md:px-6 md:py-6",children:n.jsx(Ue,{})})})]})]})}function Qt(){const{login:e}=re(),[t,r]=o.useState(""),[s,a]=o.useState(null),[i,u]=o.useState(!1),d=async()=>{const f=t.trim();if(!(!f||i)){u(!0),a(null);try{await Xe(f)?e():a(new Error("Invalid master key."))}catch(y){a(y)}finally{u(!1)}}};return n.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:n.jsx(I,{className:"w-full max-w-md",children:n.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),n.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),d()},children:[n.jsxs(We,{value:t,onChange:f=>{r(f),s&&a(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),n.jsx(ye,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),n.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[n.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),n.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",n.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",n.jsx("code",{children:"Your master key:"})," (for example, run"," ",n.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),n.jsx(_t,{error:s}),n.jsx(C,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!t.trim()||i,children:i?"Signing in…":"Sign in"})]}),n.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),n.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:n.jsx(He,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const Vt=o.lazy(async()=>({default:(await P(async()=>{const{ActivityPage:e}=await import("./ActivityPage-CcRVRd0J.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))).ActivityPage})),Wt=o.lazy(async()=>({default:(await P(async()=>{const{AliasesPage:e}=await import("./AliasesPage-CXPQdDm6.js");return{AliasesPage:e}},__vite__mapDeps([11,1,2,6,5,7,8,12,13]))).AliasesPage})),Ht=o.lazy(async()=>({default:(await P(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-Cnrtd_az.js");return{BudgetsPage:e}},__vite__mapDeps([14,1,2,6,5,7,8,12]))).BudgetsPage})),Gt=o.lazy(async()=>({default:(await P(async()=>{const{DocsPage:e}=await import("./DocsPage-BgBskDDe.js");return{DocsPage:e}},__vite__mapDeps([15,1,2,5]))).DocsPage})),Jt=o.lazy(async()=>({default:(await P(async()=>{const{KeysPage:e}=await import("./KeysPage-D9JSwodo.js");return{KeysPage:e}},__vite__mapDeps([16,1,2,6,5,7,8,12,17,13]))).KeysPage})),Yt=o.lazy(async()=>({default:(await P(async()=>{const{ModelsPage:e}=await import("./ModelsPage-CH43id2j.js");return{ModelsPage:e}},__vite__mapDeps([18,1,2,6,5,8,10]))).ModelsPage})),Xt=o.lazy(async()=>({default:(await P(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-BOO3r0BN.js");return{OverviewIndex:e}},__vite__mapDeps([19,1,2,3,4,5,8]))).OverviewIndex})),Zt=o.lazy(async()=>({default:(await P(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-enPv456e.js");return{ProvidersPage:e}},__vite__mapDeps([20,1,2,12,5,8]))).ProvidersPage})),en=o.lazy(async()=>({default:(await P(async()=>{const{SettingsPage:e}=await import("./SettingsPage-VWHKo1Ho.js");return{SettingsPage:e}},__vite__mapDeps([21,1,2,5]))).SettingsPage})),tn=o.lazy(async()=>({default:(await P(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-CBa0KCZv.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([22,1,2,5]))).ToolsGuardrailsPage})),nn=o.lazy(async()=>({default:(await P(async()=>{const{UsagePage:e}=await import("./UsagePage-5U02HhO3.js");return{UsagePage:e}},__vite__mapDeps([23,1,2,3,4,5,8,9]))).UsagePage})),rn=o.lazy(async()=>({default:(await P(async()=>{const{UsersPage:e}=await import("./UsersPage-AJZgT8Wn.js");return{UsersPage:e}},__vite__mapDeps([24,1,2,6,5,7,8,12,17]))).UsersPage}));function E(e){return n.jsx(o.Suspense,{fallback:n.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function sn(){const{isAuthenticated:e}=re();return e?n.jsx(Ke,{children:n.jsx(Be,{children:n.jsxs(j,{element:n.jsx(zt,{}),children:[n.jsx(j,{index:!0,element:E(n.jsx(Xt,{}))}),n.jsx(j,{path:"providers",element:E(n.jsx(Zt,{}))}),n.jsx(j,{path:"keys",element:E(n.jsx(Jt,{}))}),n.jsx(j,{path:"users",element:E(n.jsx(rn,{}))}),n.jsx(j,{path:"budgets",element:E(n.jsx(Ht,{}))}),n.jsx(j,{path:"activity",element:E(n.jsx(Vt,{}))}),n.jsx(j,{path:"usage",element:E(n.jsx(nn,{}))}),n.jsx(j,{path:"models",element:E(n.jsx(Yt,{}))}),n.jsx(j,{path:"aliases",element:E(n.jsx(Wt,{}))}),n.jsx(j,{path:"tools",element:E(n.jsx(tn,{}))}),n.jsx(j,{path:"settings",element:E(n.jsx(en,{}))}),n.jsx(j,{path:"docs",element:E(n.jsx(Gt,{}))}),n.jsx(j,{path:"*",element:n.jsx($e,{to:"/",replace:!0})})]})})}):n.jsx(Qt,{})}function an({children:e}){const[t]=o.useState(()=>new Re({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(r,s)=>s instanceof L&&(s.status===401||s.status===403)?!1:r<2}}}));return n.jsx(Oe,{client:t,children:n.jsx(tt,{children:e})})}const Ne=document.getElementById("root");if(!Ne)throw new Error("Root element #root not found");Ge.createRoot(Ne).render(n.jsx(o.StrictMode,{children:n.jsx(an,{children:n.jsx(sn,{})})}));export{Pn as $,hn as A,Nr as B,xn as C,tr as D,_t as E,Tr as F,Yn as G,Xn as H,Tt as I,Zn as J,Jn as K,wn as L,$n as M,fr as N,qn as O,Er as P,zn as Q,Pr as R,gr as S,Qn as T,Ct as U,pr as V,mt as W,vr as X,at as Y,Sn as Z,Cr as _,ot as a,jr as a0,Sr as a1,br as a2,kr as a3,yr as a4,Pt as a5,Nt as a6,Cn as a7,Ln as a8,An as a9,ft as aa,Tn as ab,Nn as ac,_n as ad,En as ae,kn as af,In as ag,Vn as ah,Wn as ai,Hn as aj,Fn as ak,Dn as al,Un as am,Kn as an,Bn as ao,xr as ap,L as aq,mn as ar,dn as as,wr as at,lr as au,ir as av,pn as b,Gn as c,cr as d,ur as e,bn as f,hr as g,yn as h,vn as i,dr as j,mr as k,fn as l,Lr as m,it as n,jn as o,Rn as p,Mn as q,gn as r,_r as s,On as t,ar as u,er as v,nr as w,rr as x,sr as y,or as z}; diff --git a/src/gateway/static/dashboard/index.html b/src/gateway/static/dashboard/index.html index 63dbe4bd9..ba040d749 100644 --- a/src/gateway/static/dashboard/index.html +++ b/src/gateway/static/dashboard/index.html @@ -19,7 +19,7 @@ insets to sit out of the way. --> Otari Dashboard - + diff --git a/tests/integration/test_usage_summary.py b/tests/integration/test_usage_summary.py index f914e6911..90dba720b 100644 --- a/tests/integration/test_usage_summary.py +++ b/tests/integration/test_usage_summary.py @@ -909,3 +909,59 @@ def test_grouped_series_null_top_group_and_fold_stay_separate( assert fold_point["requests"] == 2 assert fold_point["cost"] == pytest.approx(0.65 + 0.60) assert sum(p["requests"] for p in points) == 10 + + +def test_grouped_series_honors_provider_and_session_filters( + client: TestClient, master_key_header: dict[str, str], db_session: Session +) -> None: + """/series accepts the same filters as /summary (it claims parity). + + A filter it silently dropped would make the dashboard's stacked chart + aggregate over a wider set than the tiles beside it. + """ + ts = datetime(2025, 8, 1, 12, 0, tzinfo=UTC) + _make_log(db_session, user_id="par", timestamp=ts, model="m1", provider="openai", source_label="s1", cost=0.10) + _make_log(db_session, user_id="par", timestamp=ts, model="m1", provider="anthropic", source_label="s2", cost=0.20) + db_session.commit() + + window = {"start_date": "2025-08-01T00:00:00Z", "end_date": "2025-08-02T00:00:00Z", "user_id": "par"} + for params, expected_cost in ( + ({"provider": "openai"}, 0.10), + ({"source_label": "s2"}, 0.20), + ): + body = client.get( + SERIES_PATH, headers=master_key_header, params={"group_by": "model", **window, **params} + ).json() + assert sum(p["cost"] for p in body["points"]) == pytest.approx(expected_cost), params + + +def test_grouped_series_caps_hourly_buckets(client: TestClient, master_key_header: dict[str, str]) -> None: + """An hourly grid over a too-wide window is rejected, not ballooned. + + /summary densifies then caps at _MAX_SERIES_POINTS; the grouped series is + sparse per (bucket, group), so it bounds the bucket grid up front. + """ + resp = client.get( + SERIES_PATH, + headers=master_key_header, + params={ + "group_by": "model", + "bucket": "hour", + "start_date": "2025-01-01T00:00:00Z", + "end_date": "2025-06-01T00:00:00Z", + }, + ) + assert resp.status_code == 422 + assert "bucket=day" in resp.json()["detail"] + # The same window is fine at daily granularity. + ok = client.get( + SERIES_PATH, + headers=master_key_header, + params={ + "group_by": "model", + "bucket": "day", + "start_date": "2025-01-01T00:00:00Z", + "end_date": "2025-06-01T00:00:00Z", + }, + ) + assert ok.status_code == 200 diff --git a/web/src/components/charts.tsx b/web/src/components/charts.tsx index c40aa3518..8c2987c97 100644 --- a/web/src/components/charts.tsx +++ b/web/src/components/charts.tsx @@ -163,19 +163,26 @@ export function TrendChart({ setDrag(next); }; + // Series indices arrive from tooltip state and props computed against + // whatever length the data had at capture time; clamp every dereference so a + // shrunken series degrades the highlight instead of blanking the chart. + const last = data.length - 1; + const clampIndex = (index: number) => Math.min(Math.max(index, 0), Math.max(last, 0)); + const commit = () => { const range = dragRef.current; setDragBoth(null); if (!range || !onSelectRange || range.start === range.end) return; - onSelectRange(Math.min(range.start, range.end), Math.max(range.start, range.end)); + // Clamp like the window prop below: the indices were captured from a + // previous render's tooltip state, and a background refetch landing + // mid-drag can shrink the series under them. + const lo = clampIndex(Math.min(range.start, range.end)); + const hi = clampIndex(Math.max(range.start, range.end)); + if (lo === hi) return; + onSelectRange(lo, hi); }; const selectable = Boolean(onSelectRange) && data.length > 1; - // Clamp before dereferencing: a `window` computed against a longer series can - // still be in flight when `data` shrinks (a filter change landing first), and - // an out-of-range index would blank the chart instead of degrading it. - const last = data.length - 1; - const clampIndex = (index: number) => Math.min(Math.max(index, 0), Math.max(last, 0)); const dimmed = windowRange && data.length > 0 ? { startIndex: clampIndex(windowRange.startIndex), endIndex: clampIndex(windowRange.endIndex) } @@ -183,8 +190,12 @@ export function TrendChart({ const showDimming = dimmed !== null && (dimmed.startIndex > 0 || dimmed.endIndex < last); return ( + // A static chart is an image to AT; one that owns drag selection is not + // (role="img" would hide the interaction entirely), so it presents as a + // labelled group instead. Keyboard equivalents live with the callers + // (presets, zoom buttons, the Activity pan rail).
@@ -203,6 +214,16 @@ export function TrendChart({ }} onMouseUp={commit} onMouseLeave={commit} + onTouchStart={(state) => { + if (!selectable) return; + const index = toIndex(state); + if (index !== null) setDragBoth({ start: index, end: index }); + }} + onTouchMove={(state) => { + const index = toIndex(state); + if (dragRef.current && index !== null) setDragBoth({ ...dragRef.current, end: index }); + }} + onTouchEnd={commit} > ) : null} - {drag && drag.start !== drag.end ? ( + {drag && clampIndex(drag.start) !== clampIndex(drag.end) ? ( ({ start_date: win.start, diff --git a/web/src/pages/UsagePage.test.tsx b/web/src/pages/UsagePage.test.tsx index c6ce0fd5f..87eff52d2 100644 --- a/web/src/pages/UsagePage.test.tsx +++ b/web/src/pages/UsagePage.test.tsx @@ -181,12 +181,15 @@ describe("UsagePage", () => { const base = summary(); mockApi( summary({ - totals: { - ...base.totals, - cache_read_tokens: 5_100_000, - cache_write_tokens: 2_700_000, - billed_input_tokens: 10_200_000, - }, + // The tile reads the meter-normalized series composition (the same + // numbers as its sparkline), not the raw totals columns. + series: base.series.map((p, i) => ({ + ...p, + input_tokens: i === 0 ? 4_200_000 : 6_000_000, + cache_read_tokens: i === 0 ? 2_100_000 : 3_000_000, + cache_write_tokens: i === 0 ? 1_200_000 : 1_500_000, + output_tokens: 400_000, + })), }), ); renderPage(); @@ -520,9 +523,10 @@ describe("UsagePage", () => { const { container } = renderPage(); await screen.findByText("gpt-5.6"); - // The trend is now a recharts chart (labelled " per "), and a - // reusable sparkline rides the KPI tiles off the same bucketed series. - expect(screen.getByRole("img", { name: "cost per day" })).toBeInTheDocument(); + // The trend is now a recharts chart (labelled " per "; a + // group, not an image, since it owns drag selection), and a reusable + // sparkline rides the KPI tiles off the same bucketed series. + expect(screen.getByRole("group", { name: "cost per day" })).toBeInTheDocument(); expect(screen.getByRole("img", { name: /Spend trend/ })).toBeInTheDocument(); expect(container.querySelector(".recharts-surface")).not.toBeNull(); diff --git a/web/src/pages/UsagePage.tsx b/web/src/pages/UsagePage.tsx index 2f3eedc2a..c5639ff29 100644 --- a/web/src/pages/UsagePage.tsx +++ b/web/src/pages/UsagePage.tsx @@ -142,8 +142,6 @@ interface BreakdownProps { // has gone missing (a deleted user); a dimension where NULL is a normal state // (gateway rows carry no session label) passes its own wording. unknownLabel?: string; - // Maps a row key to a human label (e.g. API key id -> key name). - labelFor?: (key: string) => string; // Turns a row key into the Activity-page filter to drill into. onDrill: (key: string) => void; loading: boolean; @@ -162,7 +160,6 @@ function BreakdownTable({ totalCost, emptyLabel, unknownLabel = "(unknown)", - labelFor, onDrill, loading, }: BreakdownProps) { @@ -188,7 +185,7 @@ function BreakdownTable({ ? `Other (${row.requests.toLocaleString()} req)` : row.key === null ? unknownLabel - : (labelFor?.(row.key) ?? row.key)} + : row.key} string; drill: (key: string) => void; } @@ -475,11 +467,25 @@ export function UsagePage() { : prevTotals.billed_input_tokens !== undefined ? prevTotals.billed_input_tokens + (prevTotals.billed_output_tokens ?? prevTotals.completion_tokens) : prevTotals.total_tokens; - const cacheHitRate = billedInput !== undefined && billedInput > 0 && totals ? totals.cache_read_tokens / billedInput : null; - const prevCacheHitRate = - prevTotals?.billed_input_tokens !== undefined && prevTotals.billed_input_tokens > 0 - ? prevTotals.cache_read_tokens / prevTotals.billed_input_tokens - : undefined; + // Cache sums from the series composition rather than the raw totals columns: + // the raw sums follow each provider's reporting convention, while the series + // is meter-normalized, and the tile's own sparkline reads the series. One + // source keeps the headline, its trendline, and the hint in agreement. + const cacheSums = (points: UsageSeriesPoint[]) => { + let input = 0; + let read = 0; + let write = 0; + for (const p of points) { + input += p.input_tokens ?? 0; + read += p.cache_read_tokens ?? 0; + write += p.cache_write_tokens ?? 0; + } + return { input, read, write }; + }; + const cache = cacheSums(series); + const cacheHitRate = cache.input > 0 ? cache.read / cache.input : null; + const prevCache = cacheSums(previousFilters !== null ? (previous.data?.series ?? []) : []); + const prevCacheHitRate = prevCache.input > 0 ? prevCache.read / prevCache.input : undefined; const pointBilled = (p: UsageSeriesPoint) => p.input_tokens !== undefined ? p.input_tokens + (p.output_tokens ?? 0) : p.tokens; @@ -754,7 +760,7 @@ export function UsagePage() { {" · "} ) : null} - {formatTokens(totals.cache_read_tokens)} read · {formatTokens(totals.cache_write_tokens)} written + {formatTokens(cache.read)} read · {formatTokens(cache.write)} written ) : null } @@ -872,7 +878,6 @@ export function UsagePage() { totalCost={totals?.cost ?? 0} emptyLabel={anyFilter ? "No usage matches these filters." : "No usage recorded yet."} unknownLabel={activePrimary.unknownLabel} - labelFor={activePrimary.labelFor} onDrill={activePrimary.drill} loading={summary.isLoading} /> @@ -900,7 +905,6 @@ export function UsagePage() { totalCost={totals?.cost ?? 0} emptyLabel={anyFilter ? "No usage matches these filters." : "No usage recorded yet."} unknownLabel={activeSecondary.unknownLabel} - labelFor={activeSecondary.labelFor} onDrill={activeSecondary.drill} loading={summary.isLoading} /> From 895bbbf63599baf1f6af2fad7489ef631cb8d68a Mon Sep 17 00:00:00 2001 From: Nathan Brake Date: Tue, 4 Aug 2026 09:51:45 +0000 Subject: [PATCH 9/9] fix(dashboard): render series markers as SVG fills, not inline styles Copilot review nit: the tooltip and legend swatches used inline background-color styles, which the dashboard conventions rule out. An SVG rect's fill attribute carries the same var(--otari-*) tokens. Co-Authored-By: Claude Opus 5 (1M context) --- ...age-CcRVRd0J.js => ActivityPage-DBBA5cYp.js} | 2 +- ...Page-CXPQdDm6.js => AliasesPage-DB2HBhyO.js} | 2 +- ...Page-Cnrtd_az.js => BudgetsPage-ByNysHbI.js} | 2 +- ...og-D3P-vj-t.js => ConfirmDialog-WxOAhWT-.js} | 2 +- ...ocsPage-BgBskDDe.js => DocsPage-BB_QbZI8.js} | 2 +- ...eysPage-D9JSwodo.js => KeysPage-CI1KTehV.js} | 2 +- ...PC6RjBJ.js => ModelScopeControl-DeZ3FzjH.js} | 2 +- ...sPage-CH43id2j.js => ModelsPage-NAEvt-Hx.js} | 2 +- ...age-BOO3r0BN.js => OverviewPage-ycwh77Rn.js} | 2 +- ...ge-enPv456e.js => ProvidersPage-CYdIqkvJ.js} | 2 +- ...age-VWHKo1Ho.js => SettingsPage-pwhQKVhQ.js} | 2 +- ...-D_2uYqKa.js => TablePagination-Yoj0U_GE.js} | 2 +- ...0KCZv.js => ToolsGuardrailsPage-Digl65z3.js} | 2 +- ...gePage-5U02HhO3.js => UsagePage-1stKL9u3.js} | 2 +- ...rsPage-AJZgT8Wn.js => UsersPage-B5EUpDH1.js} | 2 +- .../static/dashboard/assets/charts-DNysd9jl.js | 1 - .../static/dashboard/assets/charts-d2MDwLL0.js | 1 + .../{index-DMrbj_xn.js => index-BTsnhpZj.js} | 4 ++-- .../{index-BJ3N7V3K.css => index-DZJUM2JE.css} | 2 +- src/gateway/static/dashboard/index.html | 4 ++-- web/src/components/charts.tsx | 17 +++++++++++++---- 21 files changed, 34 insertions(+), 25 deletions(-) rename src/gateway/static/dashboard/assets/{ActivityPage-CcRVRd0J.js => ActivityPage-DBBA5cYp.js} (98%) rename src/gateway/static/dashboard/assets/{AliasesPage-CXPQdDm6.js => AliasesPage-DB2HBhyO.js} (98%) rename src/gateway/static/dashboard/assets/{BudgetsPage-Cnrtd_az.js => BudgetsPage-ByNysHbI.js} (99%) rename src/gateway/static/dashboard/assets/{ConfirmDialog-D3P-vj-t.js => ConfirmDialog-WxOAhWT-.js} (92%) rename src/gateway/static/dashboard/assets/{DocsPage-BgBskDDe.js => DocsPage-BB_QbZI8.js} (99%) rename src/gateway/static/dashboard/assets/{KeysPage-D9JSwodo.js => KeysPage-CI1KTehV.js} (98%) rename src/gateway/static/dashboard/assets/{ModelScopeControl-wPC6RjBJ.js => ModelScopeControl-DeZ3FzjH.js} (98%) rename src/gateway/static/dashboard/assets/{ModelsPage-CH43id2j.js => ModelsPage-NAEvt-Hx.js} (99%) rename src/gateway/static/dashboard/assets/{OverviewPage-BOO3r0BN.js => OverviewPage-ycwh77Rn.js} (98%) rename src/gateway/static/dashboard/assets/{ProvidersPage-enPv456e.js => ProvidersPage-CYdIqkvJ.js} (99%) rename src/gateway/static/dashboard/assets/{SettingsPage-VWHKo1Ho.js => SettingsPage-pwhQKVhQ.js} (99%) rename src/gateway/static/dashboard/assets/{TablePagination-D_2uYqKa.js => TablePagination-Yoj0U_GE.js} (98%) rename src/gateway/static/dashboard/assets/{ToolsGuardrailsPage-CBa0KCZv.js => ToolsGuardrailsPage-Digl65z3.js} (99%) rename src/gateway/static/dashboard/assets/{UsagePage-5U02HhO3.js => UsagePage-1stKL9u3.js} (99%) rename src/gateway/static/dashboard/assets/{UsersPage-AJZgT8Wn.js => UsersPage-B5EUpDH1.js} (98%) delete mode 100644 src/gateway/static/dashboard/assets/charts-DNysd9jl.js create mode 100644 src/gateway/static/dashboard/assets/charts-d2MDwLL0.js rename src/gateway/static/dashboard/assets/{index-DMrbj_xn.js => index-BTsnhpZj.js} (96%) rename src/gateway/static/dashboard/assets/{index-BJ3N7V3K.css => index-DZJUM2JE.css} (94%) diff --git a/src/gateway/static/dashboard/assets/ActivityPage-CcRVRd0J.js b/src/gateway/static/dashboard/assets/ActivityPage-DBBA5cYp.js similarity index 98% rename from src/gateway/static/dashboard/assets/ActivityPage-CcRVRd0J.js rename to src/gateway/static/dashboard/assets/ActivityPage-DBBA5cYp.js index f518dbf11..4045db98c 100644 --- a/src/gateway/static/dashboard/assets/ActivityPage-CcRVRd0J.js +++ b/src/gateway/static/dashboard/assets/ActivityPage-DBBA5cYp.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as ct}from"./react-dgEcD0HR.js";import{f as dt,b as ut,a as mt,r as ht,u as pt,c as xt,d as gt,e as Oe,g as ve,h as G,i as ft,A as ce,j as vt,k as bt,P as _t,E as kt,C as Ke,l as $,R as yt,F as be,m as _e,n as $e,Y as St,N as jt}from"./index-DMrbj_xn.js";import{C as wt,T as Nt}from"./charts-DNysd9jl.js";import{B as q,S as Ct}from"./heroui-DZj66Arc.js";import{u as Pt,r as It,B as Mt}from"./tableSelection-CojkFPwd.js";import{C as Et}from"./ConfirmDialog-D3P-vj-t.js";import{D as At}from"./DataTable-CrQq0sYf.js";import{F as Rt}from"./FilterChips-BLdhUEZK.js";import{T as Tt,S as Dt,P as Ft}from"./TablePagination-D_2uYqKa.js";import"./recharts-BwTTRGtj.js";function Le(t,n){const d=new Date(t);return Number.isNaN(d.getTime())?t:n==="hour"?d.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):d.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const Ot={key:"success",label:"Succeeded",color:"var(--otari-brand)"},Lt={key:"errors",label:"Failed",color:"var(--otari-danger)"},Ut={key:"requests",label:"Requests",color:"var(--otari-brand)"};function Bt({presets:t,extentKey:n,onPreset:d,onSelectRange:a,onSelectFull:i,series:b,bucket:o,windowStart:m,windowEnd:p,loading:_=!1,ariaLabel:S="Request volume over the selected window",action:j}){const x=b.map(r=>r.bucketStart),c=b.length,P=dt(m,p),w=b.some(r=>(r.errors??0)>0),H=w?[Ot,Lt]:[Ut],se=b.map(r=>{const h=Math.min(r.errors??0,r.requests);return w?{x:r.bucketStart,success:r.requests-h,errors:h}:{x:r.bucketStart,requests:r.requests}}),z=c>0?ut(x,m,p):{startIndex:0,endIndex:0},[E,f]=u.useState(null),V=u.useRef(E),W=r=>{V.current=r,f(r)},v=E??z,I=v.endIndex-v.startIndex+1,Y=v.startIndex===0&&v.endIndex>=c-1,T=c>0&&!Y,g=(r,h)=>{if(c===0)return;const N=Math.max(0,Math.min(r,h)),C=Math.min(c-1,Math.max(r,h));if(N===0&&C===c-1){i();return}const ee=ht(x,N,C,o);ee&&a(ee.startIso,ee.endIso)},k=t.findIndex(r=>r.key===n),O=k>=0?t[k].seconds:c*mt(o)/1e3,Z=k>=0?t[k+1]:t.find(r=>r.seconds===null||O!==null&&r.seconds>O),M=r=>{const h=Math.max(1,Math.min(c,Math.round(r))),N=(v.startIndex+v.endIndex+1)/2;let C=Math.round(N-h/2);C=Math.max(0,Math.min(c-h,C)),g(C,C+h-1)},L=()=>{if(Y){Z&&d(Z);return}M(I*2)},de=()=>M(I/2),U=u.useRef(null),A=u.useRef(null),X=r=>{const h=Math.max(0,Math.min(c-I,r));return{startIndex:h,endIndex:h+I-1}},ue=r=>{const h=r.key==="ArrowRight"||r.key==="ArrowUp"?1:r.key==="ArrowLeft"||r.key==="ArrowDown"?-1:r.key==="PageUp"?I:r.key==="PageDown"?-I:r.key==="Home"?-c:r.key==="End"?c:0;if(h===0)return;r.preventDefault();const N=X(v.startIndex+h);N.startIndex!==v.startIndex&&g(N.startIndex,N.endIndex)},ae=r=>{if(!A.current||!U.current)return;const h=U.current.getBoundingClientRect().width;if(h<=0)return;const N=Math.round((r.clientX-A.current.x)/h*c);W(X(A.current.startIndex+N))},J=r=>{r.currentTarget.hasPointerCapture(r.pointerId)&&r.currentTarget.releasePointerCapture(r.pointerId),A.current=null;const h=V.current;W(null),h&&h.startIndex!==z.startIndex&&g(h.startIndex,h.endIndex)},Q=c?v.startIndex/c*100:0,B=c?(v.endIndex+1)/c*100:100,D=Math.max(0,c-I);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.map(r=>e.jsx(q,{size:"sm",variant:n===r.key?"primary":"outline",onPress:()=>d(r),children:r.label},r.key)),e.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",P," · UTC"]}),j]})]}),e.jsxs("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[e.jsxs("span",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:["Requests / ",o==="hour"?"hour":"day"]}),e.jsx(wt,{series:H})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"hidden text-[11px] text-[var(--otari-muted)] sm:inline",children:"drag across the chart to zoom"}),e.jsx(q,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom in",isDisabled:c===0,onPress:de,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M12 5v14M5 12h14",strokeLinecap:"round"})})}),e.jsx(q,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom out",isDisabled:c===0||Y&&!Z,onPress:L,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})})}),T?e.jsx(q,{size:"sm",variant:"ghost",onPress:()=>g(0,c-1),children:"Reset"}):null]})]}),_&&c===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center",children:e.jsx(Ct,{size:"sm"})}):c===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center text-xs text-[var(--otari-muted)]",children:"No activity in this range."}):e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(Nt,{data:se,series:H,formatValue:r=>r.toLocaleString(),formatXTick:r=>Le(r,o),ariaLabel:S,height:90,onSelectRange:g,window:T||E?v:null}),T||E?e.jsx("div",{ref:U,className:"relative h-2.5 w-full rounded-full bg-[var(--otari-bg)]",children:e.jsx("div",{role:"slider","aria-label":"Pan the selected window","aria-valuemin":0,"aria-valuemax":D,"aria-valuenow":Math.min(v.startIndex,D),"aria-valuetext":`Window starting at ${Le(x[v.startIndex]??x[0],o)}`,tabIndex:0,className:"absolute inset-y-0 cursor-grab touch-none rounded-full bg-[var(--otari-brand)]/40 outline-none hover:bg-[var(--otari-brand)]/60 focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)] active:cursor-grabbing",style:{left:`${Q}%`,width:`${Math.max(2,B-Q)}%`},onKeyDown:ue,onPointerDown:r=>{r.preventDefault(),A.current={x:r.clientX,startIndex:v.startIndex},W({...v}),r.currentTarget.setPointerCapture(r.pointerId)},onPointerMove:ae,onPointerUp:J,onPointerCancel:J})}):null]})]})]})}function Kt(t){const[n,d]=ct(),a=u.useCallback(o=>n.get(o)??t[o],[n,t]),i=u.useCallback(o=>{const m=Number.parseInt(n.get(o)??"",10);if(!Number.isNaN(m))return m;const p=Number.parseInt(t[o],10);return Number.isNaN(p)?0:p},[n,t]),b=u.useCallback(o=>{d(m=>{const p=new URLSearchParams(m);for(const[_,S]of Object.entries(o)){const j=String(S);j===""||j===t[_]?p.delete(_):p.set(_,j)}return p},{replace:!0})},[d,t]);return{get:a,getNumber:i,patch:b}}const $t=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function le(t){return t===null?"—":$t.format(t)}function R(t){return t===null?"—":t.toLocaleString()}function qe(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function qt(t){const n=new Date(t);return Number.isNaN(n.getTime())?t:n.toLocaleString()}function zt(t){const n=new Date(t).getTime();if(Number.isNaN(n))return t;const d=Math.max(0,Math.round((Date.now()-n)/1e3));if(d<60)return`${d}s ago`;const a=Math.round(d/60);if(a<60)return`${a}m ago`;const i=Math.round(a/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}const Wt=t=>t.id,Yt=t=>t.status==="error"?"bg-red-50":void 0,Ue=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],Be=[{label:"All",value:""},{label:"Priced",value:"true"},{label:"Unpriced",value:"false"}],Zt=50,Gt=["model","source"],Ht=["source"],Vt={range:ce,start_date:"",end_date:"",status:"",model:"",user_id:"",api_key_id:"",priced:"",source:"",source_label:"",endpoint:"",provider:"",page:"0",size:String(Zt)};function ie(t,n,d){if(n||d)return{start:n||void 0,end:d||void 0};if(t===Ke)return{};const a=G($,t)??G($,ce),i=(a==null?void 0:a.seconds)??null;return{start:i==null?void 0:$e(i),end:void 0}}function ke(t){const n=ie(t,"","");if(n.start)return n;const d=G($,t);return(d==null?void 0:d.seconds)==null?{start:$e(St)}:n}function Xt({status:t}){const n=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${n}`,children:t})}const Jt={gateway:"Gateway",claude_code:"Claude Code",codex:"Codex"};function ye(t){return Jt[t]??t}function F(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function ze(t){const n=t.billing_meters??null,d=F(n?n.total_input_tokens:t.prompt_tokens),a=F(n?n.cache_read_tokens:t.cache_read_tokens),i=F(n?n.cache_write_tokens:t.cache_write_tokens),b=F(n?n.completion_tokens:t.completion_tokens),o=Math.max(0,d-a-i),m=o+a+i+b;return m>0?{fresh:o,cacheRead:a,cacheWrite:i,output:b,total:m}:null}const Qt=[{key:"fresh",label:"Fresh input",fill:"var(--otari-ink)"},{key:"cacheRead",label:"Cache read",fill:"var(--otari-brand)"},{key:"cacheWrite",label:"Cache write",fill:"var(--otari-brand-soft)"},{key:"output",label:"Output",fill:"var(--otari-brand-dark)"}];function es({entry:t}){const n=ze(t);if(n===null)return e.jsx("span",{className:"tabular-nums",children:R(t.total_tokens)});const d=Qt.map(o=>({...o,value:n[o.key]})),a=d.filter(o=>o.value>0).map(o=>`${o.label} ${o.value.toLocaleString()}`).join(", ");let i=0;const b=d.map(o=>{const m=o.value/n.total*100,p={...o,x:i,width:m};return i+=m,p});return e.jsxs("span",{className:"inline-flex flex-col items-end gap-1",title:a,children:[e.jsx("span",{className:"tabular-nums",children:n.total.toLocaleString()}),e.jsx("svg",{viewBox:"0 0 100 4",preserveAspectRatio:"none",role:"img","aria-label":`Token composition: ${a}`,className:"h-1.5 w-20 overflow-hidden rounded-full bg-[var(--otari-brand-tint)]",children:b.filter(o=>o.width>0).map(o=>e.jsx("rect",{x:o.x,y:0,width:o.width,height:4,fill:o.fill},o.key))})]})}function y({label:t,children:n}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:n})]})}function ts({entry:t}){var n,d;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"This request failed. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(y,{label:"Provider",children:t.provider??"—"}),e.jsx(y,{label:"Endpoint",children:t.endpoint}),e.jsx(y,{label:"Source",children:ye(t.source)}),t.source_label?e.jsx(y,{label:"Session",children:t.source_label}):null,e.jsx(y,{label:"User",children:t.user_id??"—"}),e.jsx(y,{label:"API key",children:t.api_key_id??"—"}),e.jsx(y,{label:"Prompt tokens",children:R(t.prompt_tokens)}),e.jsx(y,{label:"Completion tokens",children:R(t.completion_tokens)}),e.jsx(y,{label:"Total tokens",children:R(t.total_tokens)}),e.jsx(y,{label:"Billed tokens",children:e.jsx("span",{title:"Fresh input, cache reads and writes, and output: the tokens this request was priced on, and the total the activity row's bar splits.",children:R(((n=ze(t))==null?void 0:n.total)??null)})}),e.jsx(y,{label:"Cost",children:le(t.cost)}),e.jsx(y,{label:"Cache read tokens",children:R(t.cache_read_tokens)}),e.jsx(y,{label:"Cache write tokens",children:R(t.cache_write_tokens)}),e.jsx(y,{label:"1h cache writes",children:R(t.cache_write_1h_tokens??null)}),e.jsx(y,{label:"Total time",children:qe(t.latency_ms)}),e.jsx(y,{label:"Request ID",children:t.id})]}),(d=t.pricing_breakdown)!=null&&d.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(a=>e.jsxs(y,{label:a.meter.replaceAll("_"," "),children:[R(a.units)," at ",le(a.rate_per_million)," / 1M, ",le(a.cost)]},a.meter))})]}):null]})}function xs(){var Me,Ee,Ae,Re,Te,De;const t=pt(),n=xt(),d=u.useMemo(()=>{const s=new Map;for(const l of n.data??[])s.set(l.id,l.key_name??`${l.id.slice(0,8)}…`);return s},[n.data]),a=Kt(Vt),i=a.get("range"),b=a.get("start_date"),o=a.get("end_date"),m=a.get("status"),p=a.get("model"),_=a.get("user_id"),S=a.get("api_key_id"),j=a.get("priced"),x=a.get("source"),c=a.get("source_label"),P=a.get("endpoint"),w=a.get("provider"),H=Math.max(0,a.getNumber("page")),se=a.getNumber("size"),z=Ft.reduce((s,l)=>Math.abs(l-se)ie(i,b,o)),W=u.useRef(E);u.useEffect(()=>{W.current!==E&&(W.current=E,V(ie(i,b,o)))},[E,i,b,o]);const[v,I]=u.useState(()=>ke(i)),Y=u.useRef(i);u.useEffect(()=>{Y.current!==i&&(Y.current=i,I(ke(i)))},[i]);const T=j==="true"?!0:j==="false"?!1:void 0,g=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:P||void 0,provider:w||void 0,priced:T}),[f,m,p,_,S,x,c,P,w,T]),k=Pt(),O=JSON.stringify(g),Z=u.useRef(O);u.useEffect(()=>{Z.current!==O&&(Z.current=O,a.patch({page:0}),k.clear())},[O,a,k]);const M=gt(g,H,z),L=Oe(g),de=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:P||void 0,provider:w||void 0}),[f,m,_,S,x,c,P,w]),U=ve(de,"day",Gt),A=((Ee=(Me=U.data)==null?void 0:Me.by_model)==null?void 0:Ee.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],X=(n.data??[]).map(s=>({value:s.id,label:s.key_name??`${s.id.slice(0,8)}…`})),ue=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0}),[f,m,p,_,S]),ae=ve(ue,"day",Ht,!!x),J=(Ae=x?ae.data:U.data)==null?void 0:Ae.by_source,Q=u.useMemo(()=>{const s=(J??[]).filter(l=>!l.is_other&&l.key!==null).map(l=>l.key);return x&&!s.includes(x)?[x,...s]:s},[J,x]),B=G($,i)??G($,ce),D=!!(f.start&&v.start&&new Date(f.start).getTime()({start_date:D?f.start:v.start,end_date:D?f.end:void 0,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:P||void 0,provider:w||void 0,priced:T}),[D,f,v,m,p,_,S,x,c,P,w,T]),C=ve(N,h,jt),ee=(((Re=C.data)==null?void 0:Re.series)??[]).map(s=>({bucketStart:s.bucket_start,requests:s.requests,errors:s.errors??0})),K=M.data??[],We=L.isSuccess&&!L.isPlaceholderData?((Te=L.data)==null?void 0:Te.total)??0:null,me=G($,i),Ye=!!(b||o)||i!==ce&&(me==null?void 0:me.seconds)!=null,Ze=!!(m||p.trim()||_||S||j||x||c||P||w||Ye),re=(s,l)=>{var Fe;return((Fe=s.find(it=>it.value===l))==null?void 0:Fe.label)??l},Se=(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),Ge=()=>a.patch({status:"",priced:"",model:"",user_id:"",api_key_id:"",source:"",source_label:"",endpoint:"",provider:""}),He=[...m?[{key:"status",label:"Status",value:re(Ue,m),onClear:()=>a.patch({status:""})}]:[],...j?[{key:"priced",label:"Priced",value:re(Be,j),onClear:()=>a.patch({priced:""})}]:[],..._?[{key:"user",label:"User",value:re(Se,_),onClear:()=>a.patch({user_id:""})}]:[],...p.trim()?[{key:"model",label:"Model",value:p.trim(),onClear:()=>a.patch({model:""})}]:[],...S?[{key:"key",label:"API key",value:re(X,S),onClear:()=>a.patch({api_key_id:""})}]:[],...x?[{key:"source",label:"Source",value:ye(x),onClear:()=>a.patch({source:""})}]:[],...c?[{key:"session",label:"Session",value:c,onClear:()=>a.patch({source_label:""})}]:[],...P?[{key:"endpoint",label:"Endpoint",value:P,onClear:()=>a.patch({endpoint:""})}]:[],...w?[{key:"provider",label:"Provider",value:w,onClear:()=>a.patch({provider:""})}]:[]],he=u.useMemo(()=>K.filter(s=>!s.counts_toward_budget).map(s=>s.id),[K]),Ve=u.useMemo(()=>K.filter(s=>s.counts_toward_budget).map(s=>s.id),[K]),je=It(k.selectedKeys,he),te=je.length,we=k.allMatching||te>0,Xe=u.useMemo(()=>({...g,counts_toward_budget:!1}),[g]),Ne=Oe(Xe,we),ne=Ne.isSuccess?((De=Ne.data)==null?void 0:De.total)??null:null,Je=he.length>0&&te===he.length&&ne!=null&&ne>te,oe=k.allMatching?ne??te:te,pe=vt(),xe=bt(),[Qe,ge]=u.useState(!1),[et,fe]=u.useState(!1),[tt,Ce]=u.useState(null),st=u.useCallback(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Request detail"}),e.jsx(q,{size:"sm",variant:"ghost",onPress:()=>Ce(null),children:"Close"})]}),e.jsx(ts,{entry:s})]}),[]),Pe=()=>k.allMatching?{by_filter:!0,model:g.model,user_id:g.user_id,api_key_id:g.api_key_id,status:g.status,source:g.source,source_label:g.source_label,endpoint:g.endpoint,provider:g.provider,start_date:g.start_date,end_date:g.end_date,priced:g.priced}:{ids:je},at=()=>{pe.mutate(Pe(),{onSuccess:()=>{ge(!1),k.clear()}})},rt=s=>{xe.mutate({...Pe(),...s},{onSuccess:()=>{fe(!1),k.clear()}})},nt=()=>{M.refetch(),L.refetch(),C.refetch(),U.refetch(),x&&ae.refetch()},Ie=s=>{if(s.key===i&&!b&&!o){V(ie(s.key,"","")),I(ke(s.key));return}a.patch({range:s.key,start_date:"",end_date:""})},ot=(s,l)=>a.patch({start_date:s,end_date:l}),lt=u.useMemo(()=>{const s=l=>l===null?"—":d.get(l)??`${l.slice(0,8)}…`;return[{id:"time",header:"Time",cell:l=>e.jsx("span",{title:qt(l.timestamp),className:"text-[var(--otari-muted)]",children:zt(l.timestamp)})},{id:"user",header:"User",cell:l=>l.user_id??"—"},{id:"model",header:"Model",isRowHeader:!0,cell:l=>l.model},{id:"api_key",header:"API key",cell:l=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:s(l.api_key_id)})},{id:"tokens",header:"Tokens",align:"end",cell:l=>e.jsx(es,{entry:l})},{id:"cost",header:"Cost",align:"end",cell:l=>le(l.cost)},{id:"latency",header:"Total time",align:"end",cell:l=>qe(l.latency_ms)},{id:"status",header:"Status",cell:l=>e.jsx(Xt,{status:l.status})}]},[d]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(_t,{title:"Activity",description:"A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored."}),e.jsx(kt,{error:M.error??L.error??C.error}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(Bt,{presets:$,extentKey:r,onPreset:Ie,onSelectRange:ot,onSelectFull:()=>B?Ie(B):void 0,series:ee,bucket:h,windowStart:f.start,windowEnd:f.end,loading:C.isLoading,ariaLabel:"Activity request volume over the selected window",action:e.jsx(yt,{onRefresh:nt,isFetching:M.isFetching,updatedAt:M.dataUpdatedAt})}),e.jsxs(Rt,{chips:He,onClearAll:Ge,children:[e.jsx(be,{id:"filter-status",label:"Status",value:m,onChange:s=>a.patch({status:s}),children:Ue.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsx(be,{id:"filter-priced",label:"Priced?",value:j,onChange:s=>a.patch({priced:s}),children:Be.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),Q.length>1||x?e.jsxs(be,{id:"filter-source",label:"Source",value:x,onChange:s=>a.patch({source:s}),children:[e.jsx("option",{value:"",children:"All"}),Q.map(s=>e.jsx("option",{value:s,children:ye(s)},s))]}):null,e.jsx(_e,{label:"API key",value:S,onChange:s=>a.patch({api_key_id:s}),placeholder:"All keys",options:X}),e.jsx(_e,{label:"User",value:_,onChange:s=>a.patch({user_id:s}),placeholder:"All users",options:Se}),e.jsx(_e,{label:"Model",value:p,onChange:s=>a.patch({model:s}),allowsCustom:!0,placeholder:"Any model",options:(p&&!A.includes(p)?[p,...A]:A).map(s=>({value:s,label:s}))})]})]}),we?e.jsxs(Mt,{selectedCount:oe,allMatching:k.allMatching,matchingTotal:ne,canSelectAllMatching:Je,onSelectAllMatching:k.enableAllMatching,onClear:k.clear,children:[e.jsx(q,{size:"sm",variant:"primary",onPress:()=>fe(!0),children:"Set price"}),e.jsx(q,{size:"sm",variant:"danger",onPress:()=>ge(!0),children:"Delete"})]}):null,e.jsx(At,{ariaLabel:"Activity log",columns:lt,rows:K,getRowKey:Wt,isLoading:M.isLoading,emptyContent:Ze?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:k.selectedKeys,onSelectionChange:k.onSelectionChange,disabledKeys:Ve,onRowAction:s=>Ce(l=>l===s?null:s),rowClassName:Yt,detailKey:tt,renderDetail:st}),e.jsx(Tt,{page:H,pageSize:z,total:We,rowsOnPage:K.length,onPageChange:s=>a.patch({page:s}),onPageSizeChange:s=>a.patch({size:s,page:0}),isFetching:M.isFetching,hasNextFallback:K.length===z}),e.jsx(Et,{isOpen:Qe,onOpenChange:ge,heading:"Delete usage rows",body:`Delete ${oe.toLocaleString()} imported ${oe===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:pe.isPending,error:pe.error,onConfirm:at}),e.jsx(Dt,{isOpen:et,onOpenChange:fe,targetCount:oe,isPending:xe.isPending,error:xe.error,onSubmit:rt})]})}export{xs as ActivityPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as ct}from"./react-dgEcD0HR.js";import{f as dt,b as ut,a as mt,r as ht,u as pt,c as xt,d as gt,e as Oe,g as ve,h as G,i as ft,A as ce,j as vt,k as bt,P as _t,E as kt,C as Ke,l as $,R as yt,F as be,m as _e,n as $e,Y as St,N as jt}from"./index-BTsnhpZj.js";import{C as wt,T as Nt}from"./charts-d2MDwLL0.js";import{B as q,S as Ct}from"./heroui-DZj66Arc.js";import{u as Pt,r as It,B as Mt}from"./tableSelection-CojkFPwd.js";import{C as Et}from"./ConfirmDialog-WxOAhWT-.js";import{D as At}from"./DataTable-CrQq0sYf.js";import{F as Rt}from"./FilterChips-BLdhUEZK.js";import{T as Tt,S as Dt,P as Ft}from"./TablePagination-Yoj0U_GE.js";import"./recharts-BwTTRGtj.js";function Le(t,n){const d=new Date(t);return Number.isNaN(d.getTime())?t:n==="hour"?d.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):d.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const Ot={key:"success",label:"Succeeded",color:"var(--otari-brand)"},Lt={key:"errors",label:"Failed",color:"var(--otari-danger)"},Ut={key:"requests",label:"Requests",color:"var(--otari-brand)"};function Bt({presets:t,extentKey:n,onPreset:d,onSelectRange:a,onSelectFull:i,series:b,bucket:o,windowStart:m,windowEnd:p,loading:_=!1,ariaLabel:S="Request volume over the selected window",action:j}){const x=b.map(r=>r.bucketStart),c=b.length,P=dt(m,p),w=b.some(r=>(r.errors??0)>0),H=w?[Ot,Lt]:[Ut],se=b.map(r=>{const h=Math.min(r.errors??0,r.requests);return w?{x:r.bucketStart,success:r.requests-h,errors:h}:{x:r.bucketStart,requests:r.requests}}),z=c>0?ut(x,m,p):{startIndex:0,endIndex:0},[E,f]=u.useState(null),V=u.useRef(E),W=r=>{V.current=r,f(r)},v=E??z,I=v.endIndex-v.startIndex+1,Y=v.startIndex===0&&v.endIndex>=c-1,T=c>0&&!Y,g=(r,h)=>{if(c===0)return;const N=Math.max(0,Math.min(r,h)),C=Math.min(c-1,Math.max(r,h));if(N===0&&C===c-1){i();return}const ee=ht(x,N,C,o);ee&&a(ee.startIso,ee.endIso)},k=t.findIndex(r=>r.key===n),O=k>=0?t[k].seconds:c*mt(o)/1e3,Z=k>=0?t[k+1]:t.find(r=>r.seconds===null||O!==null&&r.seconds>O),M=r=>{const h=Math.max(1,Math.min(c,Math.round(r))),N=(v.startIndex+v.endIndex+1)/2;let C=Math.round(N-h/2);C=Math.max(0,Math.min(c-h,C)),g(C,C+h-1)},L=()=>{if(Y){Z&&d(Z);return}M(I*2)},de=()=>M(I/2),U=u.useRef(null),A=u.useRef(null),X=r=>{const h=Math.max(0,Math.min(c-I,r));return{startIndex:h,endIndex:h+I-1}},ue=r=>{const h=r.key==="ArrowRight"||r.key==="ArrowUp"?1:r.key==="ArrowLeft"||r.key==="ArrowDown"?-1:r.key==="PageUp"?I:r.key==="PageDown"?-I:r.key==="Home"?-c:r.key==="End"?c:0;if(h===0)return;r.preventDefault();const N=X(v.startIndex+h);N.startIndex!==v.startIndex&&g(N.startIndex,N.endIndex)},ae=r=>{if(!A.current||!U.current)return;const h=U.current.getBoundingClientRect().width;if(h<=0)return;const N=Math.round((r.clientX-A.current.x)/h*c);W(X(A.current.startIndex+N))},J=r=>{r.currentTarget.hasPointerCapture(r.pointerId)&&r.currentTarget.releasePointerCapture(r.pointerId),A.current=null;const h=V.current;W(null),h&&h.startIndex!==z.startIndex&&g(h.startIndex,h.endIndex)},Q=c?v.startIndex/c*100:0,B=c?(v.endIndex+1)/c*100:100,D=Math.max(0,c-I);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.map(r=>e.jsx(q,{size:"sm",variant:n===r.key?"primary":"outline",onPress:()=>d(r),children:r.label},r.key)),e.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",P," · UTC"]}),j]})]}),e.jsxs("div",{className:"rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 px-1 pb-1",children:[e.jsxs("span",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:["Requests / ",o==="hour"?"hour":"day"]}),e.jsx(wt,{series:H})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"hidden text-[11px] text-[var(--otari-muted)] sm:inline",children:"drag across the chart to zoom"}),e.jsx(q,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom in",isDisabled:c===0,onPress:de,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M12 5v14M5 12h14",strokeLinecap:"round"})})}),e.jsx(q,{size:"sm",variant:"ghost",isIconOnly:!0,"aria-label":"Zoom out",isDisabled:c===0||Y&&!Z,onPress:L,children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4","aria-hidden":"true",children:e.jsx("path",{d:"M5 12h14",strokeLinecap:"round"})})}),T?e.jsx(q,{size:"sm",variant:"ghost",onPress:()=>g(0,c-1),children:"Reset"}):null]})]}),_&&c===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center",children:e.jsx(Ct,{size:"sm"})}):c===0?e.jsx("div",{className:"flex h-[90px] items-center justify-center text-xs text-[var(--otari-muted)]",children:"No activity in this range."}):e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(Nt,{data:se,series:H,formatValue:r=>r.toLocaleString(),formatXTick:r=>Le(r,o),ariaLabel:S,height:90,onSelectRange:g,window:T||E?v:null}),T||E?e.jsx("div",{ref:U,className:"relative h-2.5 w-full rounded-full bg-[var(--otari-bg)]",children:e.jsx("div",{role:"slider","aria-label":"Pan the selected window","aria-valuemin":0,"aria-valuemax":D,"aria-valuenow":Math.min(v.startIndex,D),"aria-valuetext":`Window starting at ${Le(x[v.startIndex]??x[0],o)}`,tabIndex:0,className:"absolute inset-y-0 cursor-grab touch-none rounded-full bg-[var(--otari-brand)]/40 outline-none hover:bg-[var(--otari-brand)]/60 focus-visible:ring-2 focus-visible:ring-[var(--otari-brand)] active:cursor-grabbing",style:{left:`${Q}%`,width:`${Math.max(2,B-Q)}%`},onKeyDown:ue,onPointerDown:r=>{r.preventDefault(),A.current={x:r.clientX,startIndex:v.startIndex},W({...v}),r.currentTarget.setPointerCapture(r.pointerId)},onPointerMove:ae,onPointerUp:J,onPointerCancel:J})}):null]})]})]})}function Kt(t){const[n,d]=ct(),a=u.useCallback(o=>n.get(o)??t[o],[n,t]),i=u.useCallback(o=>{const m=Number.parseInt(n.get(o)??"",10);if(!Number.isNaN(m))return m;const p=Number.parseInt(t[o],10);return Number.isNaN(p)?0:p},[n,t]),b=u.useCallback(o=>{d(m=>{const p=new URLSearchParams(m);for(const[_,S]of Object.entries(o)){const j=String(S);j===""||j===t[_]?p.delete(_):p.set(_,j)}return p},{replace:!0})},[d,t]);return{get:a,getNumber:i,patch:b}}const $t=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function le(t){return t===null?"—":$t.format(t)}function R(t){return t===null?"—":t.toLocaleString()}function qe(t){return t===null?"—":t<1e3?`${t} ms`:`${(t/1e3).toFixed(t<1e4?2:1)} s`}function qt(t){const n=new Date(t);return Number.isNaN(n.getTime())?t:n.toLocaleString()}function zt(t){const n=new Date(t).getTime();if(Number.isNaN(n))return t;const d=Math.max(0,Math.round((Date.now()-n)/1e3));if(d<60)return`${d}s ago`;const a=Math.round(d/60);if(a<60)return`${a}m ago`;const i=Math.round(a/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}const Wt=t=>t.id,Yt=t=>t.status==="error"?"bg-red-50":void 0,Ue=[{label:"All",value:""},{label:"Success",value:"success"},{label:"Error",value:"error"}],Be=[{label:"All",value:""},{label:"Priced",value:"true"},{label:"Unpriced",value:"false"}],Zt=50,Gt=["model","source"],Ht=["source"],Vt={range:ce,start_date:"",end_date:"",status:"",model:"",user_id:"",api_key_id:"",priced:"",source:"",source_label:"",endpoint:"",provider:"",page:"0",size:String(Zt)};function ie(t,n,d){if(n||d)return{start:n||void 0,end:d||void 0};if(t===Ke)return{};const a=G($,t)??G($,ce),i=(a==null?void 0:a.seconds)??null;return{start:i==null?void 0:$e(i),end:void 0}}function ke(t){const n=ie(t,"","");if(n.start)return n;const d=G($,t);return(d==null?void 0:d.seconds)==null?{start:$e(St)}:n}function Xt({status:t}){const n=t==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${n}`,children:t})}const Jt={gateway:"Gateway",claude_code:"Claude Code",codex:"Codex"};function ye(t){return Jt[t]??t}function F(t){return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function ze(t){const n=t.billing_meters??null,d=F(n?n.total_input_tokens:t.prompt_tokens),a=F(n?n.cache_read_tokens:t.cache_read_tokens),i=F(n?n.cache_write_tokens:t.cache_write_tokens),b=F(n?n.completion_tokens:t.completion_tokens),o=Math.max(0,d-a-i),m=o+a+i+b;return m>0?{fresh:o,cacheRead:a,cacheWrite:i,output:b,total:m}:null}const Qt=[{key:"fresh",label:"Fresh input",fill:"var(--otari-ink)"},{key:"cacheRead",label:"Cache read",fill:"var(--otari-brand)"},{key:"cacheWrite",label:"Cache write",fill:"var(--otari-brand-soft)"},{key:"output",label:"Output",fill:"var(--otari-brand-dark)"}];function es({entry:t}){const n=ze(t);if(n===null)return e.jsx("span",{className:"tabular-nums",children:R(t.total_tokens)});const d=Qt.map(o=>({...o,value:n[o.key]})),a=d.filter(o=>o.value>0).map(o=>`${o.label} ${o.value.toLocaleString()}`).join(", ");let i=0;const b=d.map(o=>{const m=o.value/n.total*100,p={...o,x:i,width:m};return i+=m,p});return e.jsxs("span",{className:"inline-flex flex-col items-end gap-1",title:a,children:[e.jsx("span",{className:"tabular-nums",children:n.total.toLocaleString()}),e.jsx("svg",{viewBox:"0 0 100 4",preserveAspectRatio:"none",role:"img","aria-label":`Token composition: ${a}`,className:"h-1.5 w-20 overflow-hidden rounded-full bg-[var(--otari-brand-tint)]",children:b.filter(o=>o.width>0).map(o=>e.jsx("rect",{x:o.x,y:0,width:o.width,height:4,fill:o.fill},o.key))})]})}function y({label:t,children:n}){return e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-sm text-[var(--otari-ink)] break-all",children:n})]})}function ts({entry:t}){var n,d;return e.jsxs("div",{className:"flex flex-col gap-4 px-4 py-4",children:[t.error_message?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Error"}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-lg border border-red-200 bg-red-50 p-3 text-xs whitespace-pre-wrap break-all text-red-700",children:"This request failed. Inspect gateway logs for details."})]}):null,e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(y,{label:"Provider",children:t.provider??"—"}),e.jsx(y,{label:"Endpoint",children:t.endpoint}),e.jsx(y,{label:"Source",children:ye(t.source)}),t.source_label?e.jsx(y,{label:"Session",children:t.source_label}):null,e.jsx(y,{label:"User",children:t.user_id??"—"}),e.jsx(y,{label:"API key",children:t.api_key_id??"—"}),e.jsx(y,{label:"Prompt tokens",children:R(t.prompt_tokens)}),e.jsx(y,{label:"Completion tokens",children:R(t.completion_tokens)}),e.jsx(y,{label:"Total tokens",children:R(t.total_tokens)}),e.jsx(y,{label:"Billed tokens",children:e.jsx("span",{title:"Fresh input, cache reads and writes, and output: the tokens this request was priced on, and the total the activity row's bar splits.",children:R(((n=ze(t))==null?void 0:n.total)??null)})}),e.jsx(y,{label:"Cost",children:le(t.cost)}),e.jsx(y,{label:"Cache read tokens",children:R(t.cache_read_tokens)}),e.jsx(y,{label:"Cache write tokens",children:R(t.cache_write_tokens)}),e.jsx(y,{label:"1h cache writes",children:R(t.cache_write_1h_tokens??null)}),e.jsx(y,{label:"Total time",children:qe(t.latency_ms)}),e.jsx(y,{label:"Request ID",children:t.id})]}),(d=t.pricing_breakdown)!=null&&d.length?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[var(--otari-muted)]",children:"Billed meters"}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:t.pricing_breakdown.map(a=>e.jsxs(y,{label:a.meter.replaceAll("_"," "),children:[R(a.units)," at ",le(a.rate_per_million)," / 1M, ",le(a.cost)]},a.meter))})]}):null]})}function xs(){var Me,Ee,Ae,Re,Te,De;const t=pt(),n=xt(),d=u.useMemo(()=>{const s=new Map;for(const l of n.data??[])s.set(l.id,l.key_name??`${l.id.slice(0,8)}…`);return s},[n.data]),a=Kt(Vt),i=a.get("range"),b=a.get("start_date"),o=a.get("end_date"),m=a.get("status"),p=a.get("model"),_=a.get("user_id"),S=a.get("api_key_id"),j=a.get("priced"),x=a.get("source"),c=a.get("source_label"),P=a.get("endpoint"),w=a.get("provider"),H=Math.max(0,a.getNumber("page")),se=a.getNumber("size"),z=Ft.reduce((s,l)=>Math.abs(l-se)ie(i,b,o)),W=u.useRef(E);u.useEffect(()=>{W.current!==E&&(W.current=E,V(ie(i,b,o)))},[E,i,b,o]);const[v,I]=u.useState(()=>ke(i)),Y=u.useRef(i);u.useEffect(()=>{Y.current!==i&&(Y.current=i,I(ke(i)))},[i]);const T=j==="true"?!0:j==="false"?!1:void 0,g=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:P||void 0,provider:w||void 0,priced:T}),[f,m,p,_,S,x,c,P,w,T]),k=Pt(),O=JSON.stringify(g),Z=u.useRef(O);u.useEffect(()=>{Z.current!==O&&(Z.current=O,a.patch({page:0}),k.clear())},[O,a,k]);const M=gt(g,H,z),L=Oe(g),de=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:P||void 0,provider:w||void 0}),[f,m,_,S,x,c,P,w]),U=ve(de,"day",Gt),A=((Ee=(Me=U.data)==null?void 0:Me.by_model)==null?void 0:Ee.filter(s=>!s.is_other&&s.key!==null).map(s=>s.key))??[],X=(n.data??[]).map(s=>({value:s.id,label:s.key_name??`${s.id.slice(0,8)}…`})),ue=u.useMemo(()=>({start_date:f.start,end_date:f.end,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0}),[f,m,p,_,S]),ae=ve(ue,"day",Ht,!!x),J=(Ae=x?ae.data:U.data)==null?void 0:Ae.by_source,Q=u.useMemo(()=>{const s=(J??[]).filter(l=>!l.is_other&&l.key!==null).map(l=>l.key);return x&&!s.includes(x)?[x,...s]:s},[J,x]),B=G($,i)??G($,ce),D=!!(f.start&&v.start&&new Date(f.start).getTime()({start_date:D?f.start:v.start,end_date:D?f.end:void 0,status:m||void 0,model:p.trim()||void 0,user_id:_||void 0,api_key_id:S||void 0,source:x||void 0,source_label:c||void 0,endpoint:P||void 0,provider:w||void 0,priced:T}),[D,f,v,m,p,_,S,x,c,P,w,T]),C=ve(N,h,jt),ee=(((Re=C.data)==null?void 0:Re.series)??[]).map(s=>({bucketStart:s.bucket_start,requests:s.requests,errors:s.errors??0})),K=M.data??[],We=L.isSuccess&&!L.isPlaceholderData?((Te=L.data)==null?void 0:Te.total)??0:null,me=G($,i),Ye=!!(b||o)||i!==ce&&(me==null?void 0:me.seconds)!=null,Ze=!!(m||p.trim()||_||S||j||x||c||P||w||Ye),re=(s,l)=>{var Fe;return((Fe=s.find(it=>it.value===l))==null?void 0:Fe.label)??l},Se=(t.data??[]).map(s=>({value:s.user_id,label:s.alias?`${s.alias} (${s.user_id})`:s.user_id})),Ge=()=>a.patch({status:"",priced:"",model:"",user_id:"",api_key_id:"",source:"",source_label:"",endpoint:"",provider:""}),He=[...m?[{key:"status",label:"Status",value:re(Ue,m),onClear:()=>a.patch({status:""})}]:[],...j?[{key:"priced",label:"Priced",value:re(Be,j),onClear:()=>a.patch({priced:""})}]:[],..._?[{key:"user",label:"User",value:re(Se,_),onClear:()=>a.patch({user_id:""})}]:[],...p.trim()?[{key:"model",label:"Model",value:p.trim(),onClear:()=>a.patch({model:""})}]:[],...S?[{key:"key",label:"API key",value:re(X,S),onClear:()=>a.patch({api_key_id:""})}]:[],...x?[{key:"source",label:"Source",value:ye(x),onClear:()=>a.patch({source:""})}]:[],...c?[{key:"session",label:"Session",value:c,onClear:()=>a.patch({source_label:""})}]:[],...P?[{key:"endpoint",label:"Endpoint",value:P,onClear:()=>a.patch({endpoint:""})}]:[],...w?[{key:"provider",label:"Provider",value:w,onClear:()=>a.patch({provider:""})}]:[]],he=u.useMemo(()=>K.filter(s=>!s.counts_toward_budget).map(s=>s.id),[K]),Ve=u.useMemo(()=>K.filter(s=>s.counts_toward_budget).map(s=>s.id),[K]),je=It(k.selectedKeys,he),te=je.length,we=k.allMatching||te>0,Xe=u.useMemo(()=>({...g,counts_toward_budget:!1}),[g]),Ne=Oe(Xe,we),ne=Ne.isSuccess?((De=Ne.data)==null?void 0:De.total)??null:null,Je=he.length>0&&te===he.length&&ne!=null&&ne>te,oe=k.allMatching?ne??te:te,pe=vt(),xe=bt(),[Qe,ge]=u.useState(!1),[et,fe]=u.useState(!1),[tt,Ce]=u.useState(null),st=u.useCallback(s=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Request detail"}),e.jsx(q,{size:"sm",variant:"ghost",onPress:()=>Ce(null),children:"Close"})]}),e.jsx(ts,{entry:s})]}),[]),Pe=()=>k.allMatching?{by_filter:!0,model:g.model,user_id:g.user_id,api_key_id:g.api_key_id,status:g.status,source:g.source,source_label:g.source_label,endpoint:g.endpoint,provider:g.provider,start_date:g.start_date,end_date:g.end_date,priced:g.priced}:{ids:je},at=()=>{pe.mutate(Pe(),{onSuccess:()=>{ge(!1),k.clear()}})},rt=s=>{xe.mutate({...Pe(),...s},{onSuccess:()=>{fe(!1),k.clear()}})},nt=()=>{M.refetch(),L.refetch(),C.refetch(),U.refetch(),x&&ae.refetch()},Ie=s=>{if(s.key===i&&!b&&!o){V(ie(s.key,"","")),I(ke(s.key));return}a.patch({range:s.key,start_date:"",end_date:""})},ot=(s,l)=>a.patch({start_date:s,end_date:l}),lt=u.useMemo(()=>{const s=l=>l===null?"—":d.get(l)??`${l.slice(0,8)}…`;return[{id:"time",header:"Time",cell:l=>e.jsx("span",{title:qt(l.timestamp),className:"text-[var(--otari-muted)]",children:zt(l.timestamp)})},{id:"user",header:"User",cell:l=>l.user_id??"—"},{id:"model",header:"Model",isRowHeader:!0,cell:l=>l.model},{id:"api_key",header:"API key",cell:l=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:s(l.api_key_id)})},{id:"tokens",header:"Tokens",align:"end",cell:l=>e.jsx(es,{entry:l})},{id:"cost",header:"Cost",align:"end",cell:l=>le(l.cost)},{id:"latency",header:"Total time",align:"end",cell:l=>qe(l.latency_ms)},{id:"status",header:"Status",cell:l=>e.jsx(Xt,{status:l.status})}]},[d]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(_t,{title:"Activity",description:"A per-request log of what the gateway served: tokens, cost, latency, and failures. No request or response content is stored."}),e.jsx(kt,{error:M.error??L.error??C.error}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(Bt,{presets:$,extentKey:r,onPreset:Ie,onSelectRange:ot,onSelectFull:()=>B?Ie(B):void 0,series:ee,bucket:h,windowStart:f.start,windowEnd:f.end,loading:C.isLoading,ariaLabel:"Activity request volume over the selected window",action:e.jsx(yt,{onRefresh:nt,isFetching:M.isFetching,updatedAt:M.dataUpdatedAt})}),e.jsxs(Rt,{chips:He,onClearAll:Ge,children:[e.jsx(be,{id:"filter-status",label:"Status",value:m,onChange:s=>a.patch({status:s}),children:Ue.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),e.jsx(be,{id:"filter-priced",label:"Priced?",value:j,onChange:s=>a.patch({priced:s}),children:Be.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))}),Q.length>1||x?e.jsxs(be,{id:"filter-source",label:"Source",value:x,onChange:s=>a.patch({source:s}),children:[e.jsx("option",{value:"",children:"All"}),Q.map(s=>e.jsx("option",{value:s,children:ye(s)},s))]}):null,e.jsx(_e,{label:"API key",value:S,onChange:s=>a.patch({api_key_id:s}),placeholder:"All keys",options:X}),e.jsx(_e,{label:"User",value:_,onChange:s=>a.patch({user_id:s}),placeholder:"All users",options:Se}),e.jsx(_e,{label:"Model",value:p,onChange:s=>a.patch({model:s}),allowsCustom:!0,placeholder:"Any model",options:(p&&!A.includes(p)?[p,...A]:A).map(s=>({value:s,label:s}))})]})]}),we?e.jsxs(Mt,{selectedCount:oe,allMatching:k.allMatching,matchingTotal:ne,canSelectAllMatching:Je,onSelectAllMatching:k.enableAllMatching,onClear:k.clear,children:[e.jsx(q,{size:"sm",variant:"primary",onPress:()=>fe(!0),children:"Set price"}),e.jsx(q,{size:"sm",variant:"danger",onPress:()=>ge(!0),children:"Delete"})]}):null,e.jsx(At,{ariaLabel:"Activity log",columns:lt,rows:K,getRowKey:Wt,isLoading:M.isLoading,emptyContent:Ze?"No requests match these filters.":"No requests recorded yet.",selectionMode:"multiple",selectedKeys:k.selectedKeys,onSelectionChange:k.onSelectionChange,disabledKeys:Ve,onRowAction:s=>Ce(l=>l===s?null:s),rowClassName:Yt,detailKey:tt,renderDetail:st}),e.jsx(Tt,{page:H,pageSize:z,total:We,rowsOnPage:K.length,onPageChange:s=>a.patch({page:s}),onPageSizeChange:s=>a.patch({size:s,page:0}),isFetching:M.isFetching,hasNextFallback:K.length===z}),e.jsx(Et,{isOpen:Qe,onOpenChange:ge,heading:"Delete usage rows",body:`Delete ${oe.toLocaleString()} imported ${oe===1?"row":"rows"}? Only imported rows are removed, and this cannot be undone.`,confirmLabel:"Delete",isPending:pe.isPending,error:pe.error,onConfirm:at}),e.jsx(Dt,{isOpen:et,onOpenChange:fe,targetCount:oe,isPending:xe.isPending,error:xe.error,onSubmit:rt})]})}export{xs as ActivityPage}; diff --git a/src/gateway/static/dashboard/assets/AliasesPage-CXPQdDm6.js b/src/gateway/static/dashboard/assets/AliasesPage-DB2HBhyO.js similarity index 98% rename from src/gateway/static/dashboard/assets/AliasesPage-CXPQdDm6.js rename to src/gateway/static/dashboard/assets/AliasesPage-DB2HBhyO.js index 002a560b9..54b162e34 100644 --- a/src/gateway/static/dashboard/assets/AliasesPage-CXPQdDm6.js +++ b/src/gateway/static/dashboard/assets/AliasesPage-DB2HBhyO.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as L}from"./react-dgEcD0HR.js";import{o as T,p as I,q as M,s as R,P as K,E as w,t as P,u as F}from"./index-DMrbj_xn.js";import{u as O,r as $,B as q}from"./tableSelection-CojkFPwd.js";import{C as U}from"./ConfirmDialog-D3P-vj-t.js";import{D as H}from"./DataTable-CrQq0sYf.js";import{F as V}from"./Field-DEJ6Wjg9.js";import{C as k,L as z,I as G,a as J,b as W,f as X,B as j,d as A}from"./heroui-DZj66Arc.js";import{U as Q}from"./UserComboBox-nt7pHfqn.js";const Y=50;function B({label:t,value:a,onChange:n,description:r,placeholder:c="provider:model",autoFocus:l,isRequired:d}){const o=T(),{visible:m,total:h,failed:x}=u.useMemo(()=>{var N;const i=a.trim().toLowerCase(),v=((N=o.data)==null?void 0:N.providers)??[],C=v.flatMap(f=>f.models),p=i?C.filter(f=>f.key.toLowerCase().includes(i)):C;return{visible:p.slice(0,Y),total:p.length,failed:v.filter(f=>!f.ok)}},[o.data,a]),g=o.isLoading?"Loading models from your providers…":x.length>0?`Could not list models for ${x.map(v=>v.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:h>m.length?`Showing ${m.length} of ${h} matches. Keep typing to narrow them.`:r;return e.jsxs(k.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:a,onInputChange:n,onSelectionChange:i=>{i!=null&&n(String(i))},isRequired:d,className:"flex max-w-md flex-col gap-1",children:[e.jsx(z,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(k.InputGroup,{children:[e.jsx(G,{placeholder:c,autoFocus:l}),e.jsx(k.Trigger,{})]}),e.jsx(k.Popover,{children:e.jsx(J,{items:m,className:"max-h-72 overflow-auto",children:i=>e.jsx(W,{id:i.key,textValue:i.key,children:i.key})})}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:g}):null]})}const S=t=>JSON.stringify([t.user_id,t.name]);function Z({userId:t,onChange:a}){const n=F(),r=t!==null,c=(l,d)=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>a(l?"":null),className:r===l?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:d});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Applies to"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"A global alias resolves for every caller. A user-scoped one resolves only for that user, and takes precedence over a global alias of the same name."})]}),e.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[c(!1,"Every caller"),c(!0,"One user")]}),r?e.jsx(Q,{label:"User",value:t??"",onChange:a,users:n.data??[],placeholder:"Pick a user…",description:"Only this user resolves the alias.",unknownHint:e.jsx("span",{className:"text-red-700",children:"No such user. Pick an existing one."})}):null]})}function ee({alias:t,onClose:a}){const n=P(),[r,c]=u.useState(t.target),l=r.trim()!==""&&r.trim()!==t.target,d=()=>{l&&n.mutate({name:t.name,target:r.trim(),user_id:t.user_id},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name}),t.user_id?e.jsxs(e.Fragment,{children:[" for user ",e.jsx("code",{children:t.user_id})]}):null]}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["The alias name and who it applies to (",t.user_id?e.jsx("code",{children:t.user_id}):"every caller",") are the key and cannot be changed here. Delete and recreate to change either."]})]}),e.jsx(B,{label:"Target",value:r,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!l||n.isPending,onPress:d,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function se({onClose:t,initialTarget:a=""}){const n=P(),[r,c]=u.useState(""),[l,d]=u.useState(a),[o,m]=u.useState(null),h=/[:/]/.test(r),x=o===null||o.trim()!=="",g=r.trim()!==""&&l.trim()!==""&&!h&&x,i=()=>{g&&n.mutate({name:r.trim(),target:l.trim(),user_id:o===null?null:o.trim()},{onSuccess:t})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(V,{label:"Alias name",value:r,onChange:c,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:h?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(B,{label:"Target",value:l,onChange:d,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsx(Z,{userId:o,onChange:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!g||n.isPending,onPress:i,children:n.isPending?"Creating…":"Create alias"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function me(){const t=I(),a=M(),[n]=L(),r=n.get("target")??"",[c,l]=u.useState(r!==""),[d,o]=u.useState(null),m=O(),[h,x]=u.useState(!1),[g,i]=u.useState(void 0),[v,C]=u.useState(!1),p=[...t.data??[]].sort((s,b)=>s.name.localeCompare(b.name)||(s.user_id??"").localeCompare(b.user_id??"")),N=p.filter(s=>s.source==="stored").map(S),f=p.filter(s=>s.source!=="stored").map(S),y=$(m.selectedKeys,N),D=new Map(p.map(s=>[S(s),s])),_=async()=>{C(!0),i(void 0);try{for(const s of y){const b=D.get(s);b!==void 0&&await a.mutateAsync({name:b.name,userId:b.user_id})}m.clear(),x(!1)}catch(s){i(s)}finally{C(!1)}},E=u.useMemo(()=>[{id:"alias",header:"Alias",isRowHeader:!0,cell:s=>e.jsx("span",{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name})},{id:"target",header:"Target",cell:s=>e.jsx("span",{className:"break-all text-[var(--otari-muted)]",children:s.target})},{id:"scope",header:"Applies to",cell:s=>s.user_id?e.jsx("code",{className:"break-all text-xs text-[var(--otari-ink)]",children:s.user_id}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Every caller"})},{id:"source",header:"Source",cell:s=>e.jsx(X,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})},{id:"actions",header:"Actions",align:"end",cell:s=>s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{l(!1),o(s)},children:"Edit"}),e.jsx(R,{confirmLabel:"Delete",isPending:a.isPending,onConfirm:()=>a.mutate({name:s.name,userId:s.user_id}),children:"Delete"})]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})}],[a.isPending,a.mutate]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(K,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:c||d?null:e.jsx(j,{variant:"primary",onPress:()=>{o(null),l(!0)},children:"New alias"})}),e.jsx(w,{error:t.error}),c?e.jsx(se,{initialTarget:r,onClose:()=>l(!1)}):null,d?e.jsx(ee,{alias:d,onClose:()=>o(null)}):null,a.error?e.jsx(w,{error:a.error}):null,y.length>0?e.jsx(q,{selectedCount:y.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:m.clear,children:e.jsx(j,{size:"sm",variant:"danger",onPress:()=>x(!0),children:"Delete"})}):null,e.jsx(H,{ariaLabel:"Aliases",columns:E,rows:p,getRowKey:S,isLoading:t.isLoading,emptyContent:"No aliases yet. Create one to give a model a friendly name.",selectionMode:"multiple",selectedKeys:m.selectedKeys,onSelectionChange:m.onSelectionChange,disabledKeys:f}),e.jsx(U,{isOpen:h,onOpenChange:x,heading:"Delete aliases",body:`Delete ${y.length} stored ${y.length===1?"alias":"aliases"}? Callers using ${y.length===1?"it":"them"} will get a model-not-found error.`,confirmLabel:"Delete",isPending:v,error:g,onConfirm:_})]})}export{me as AliasesPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u,u as L}from"./react-dgEcD0HR.js";import{o as T,p as I,q as M,s as R,P as K,E as w,t as P,u as F}from"./index-BTsnhpZj.js";import{u as O,r as $,B as q}from"./tableSelection-CojkFPwd.js";import{C as U}from"./ConfirmDialog-WxOAhWT-.js";import{D as H}from"./DataTable-CrQq0sYf.js";import{F as V}from"./Field-DEJ6Wjg9.js";import{C as k,L as z,I as G,a as J,b as W,f as X,B as j,d as A}from"./heroui-DZj66Arc.js";import{U as Q}from"./UserComboBox-nt7pHfqn.js";const Y=50;function B({label:t,value:a,onChange:n,description:r,placeholder:c="provider:model",autoFocus:l,isRequired:d}){const o=T(),{visible:m,total:h,failed:x}=u.useMemo(()=>{var N;const i=a.trim().toLowerCase(),v=((N=o.data)==null?void 0:N.providers)??[],C=v.flatMap(f=>f.models),p=i?C.filter(f=>f.key.toLowerCase().includes(i)):C;return{visible:p.slice(0,Y),total:p.length,failed:v.filter(f=>!f.ok)}},[o.data,a]),g=o.isLoading?"Loading models from your providers…":x.length>0?`Could not list models for ${x.map(v=>v.provider).join(", ")}. Check that provider's credentials, or type the model key directly.`:h>m.length?`Showing ${m.length} of ${h} matches. Keep typing to narrow them.`:r;return e.jsxs(k.Root,{allowsCustomValue:!0,allowsEmptyCollection:!0,menuTrigger:"input",inputValue:a,onInputChange:n,onSelectionChange:i=>{i!=null&&n(String(i))},isRequired:d,className:"flex max-w-md flex-col gap-1",children:[e.jsx(z,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(k.InputGroup,{children:[e.jsx(G,{placeholder:c,autoFocus:l}),e.jsx(k.Trigger,{})]}),e.jsx(k.Popover,{children:e.jsx(J,{items:m,className:"max-h-72 overflow-auto",children:i=>e.jsx(W,{id:i.key,textValue:i.key,children:i.key})})}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:g}):null]})}const S=t=>JSON.stringify([t.user_id,t.name]);function Z({userId:t,onChange:a}){const n=F(),r=t!==null,c=(l,d)=>e.jsx("button",{type:"button","aria-pressed":r===l,onClick:()=>a(l?"":null),className:r===l?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:d});return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Applies to"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"A global alias resolves for every caller. A user-scoped one resolves only for that user, and takes precedence over a global alias of the same name."})]}),e.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[c(!1,"Every caller"),c(!0,"One user")]}),r?e.jsx(Q,{label:"User",value:t??"",onChange:a,users:n.data??[],placeholder:"Pick a user…",description:"Only this user resolves the alias.",unknownHint:e.jsx("span",{className:"text-red-700",children:"No such user. Pick an existing one."})}):null]})}function ee({alias:t,onClose:a}){const n=P(),[r,c]=u.useState(t.target),l=r.trim()!==""&&r.trim()!==t.target,d=()=>{l&&n.mutate({name:t.name,target:r.trim(),user_id:t.user_id},{onSuccess:a})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit alias ",e.jsx("code",{children:t.name}),t.user_id?e.jsxs(e.Fragment,{children:[" for user ",e.jsx("code",{children:t.user_id})]}):null]}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Alias name"}),e.jsx("code",{className:"text-sm text-[var(--otari-muted)]",children:t.name}),e.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["The alias name and who it applies to (",t.user_id?e.jsx("code",{children:t.user_id}):"every caller",") are the key and cannot be changed here. Delete and recreate to change either."]})]}),e.jsx(B,{label:"Target",value:r,onChange:c,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!l||n.isPending,onPress:d,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function se({onClose:t,initialTarget:a=""}){const n=P(),[r,c]=u.useState(""),[l,d]=u.useState(a),[o,m]=u.useState(null),h=/[:/]/.test(r),x=o===null||o.trim()!=="",g=r.trim()!==""&&l.trim()!==""&&!h&&x,i=()=>{g&&n.mutate({name:r.trim(),target:l.trim(),user_id:o===null?null:o.trim()},{onSuccess:t})};return e.jsx(A,{children:e.jsxs(A.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"New alias"}),e.jsx(w,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(V,{label:"Alias name",value:r,onChange:c,placeholder:"fast-model",isRequired:!0,autoFocus:!0,description:h?e.jsx("span",{className:"text-red-700",children:"An alias name cannot contain “:” or “/”."}):"What callers send as `model`."}),e.jsx(B,{label:"Target",value:l,onChange:d,isRequired:!0,description:"The real model this resolves to. Callers never see it."})]}),e.jsx(Z,{userId:o,onChange:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!g||n.isPending,onPress:i,children:n.isPending?"Creating…":"Create alias"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function me(){const t=I(),a=M(),[n]=L(),r=n.get("target")??"",[c,l]=u.useState(r!==""),[d,o]=u.useState(null),m=O(),[h,x]=u.useState(!1),[g,i]=u.useState(void 0),[v,C]=u.useState(!1),p=[...t.data??[]].sort((s,b)=>s.name.localeCompare(b.name)||(s.user_id??"").localeCompare(b.user_id??"")),N=p.filter(s=>s.source==="stored").map(S),f=p.filter(s=>s.source!=="stored").map(S),y=$(m.selectedKeys,N),D=new Map(p.map(s=>[S(s),s])),_=async()=>{C(!0),i(void 0);try{for(const s of y){const b=D.get(s);b!==void 0&&await a.mutateAsync({name:b.name,userId:b.user_id})}m.clear(),x(!1)}catch(s){i(s)}finally{C(!1)}},E=u.useMemo(()=>[{id:"alias",header:"Alias",isRowHeader:!0,cell:s=>e.jsx("span",{className:"font-medium break-all text-[var(--otari-ink)]",children:s.name})},{id:"target",header:"Target",cell:s=>e.jsx("span",{className:"break-all text-[var(--otari-muted)]",children:s.target})},{id:"scope",header:"Applies to",cell:s=>s.user_id?e.jsx("code",{className:"break-all text-xs text-[var(--otari-ink)]",children:s.user_id}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Every caller"})},{id:"source",header:"Source",cell:s=>e.jsx(X,{size:"sm",color:s.source==="stored"?"accent":"default",children:s.source})},{id:"actions",header:"Actions",align:"end",cell:s=>s.source==="stored"?e.jsxs("span",{className:"inline-flex items-center gap-2 whitespace-nowrap",children:[e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{l(!1),o(s)},children:"Edit"}),e.jsx(R,{confirmLabel:"Delete",isPending:a.isPending,onConfirm:()=>a.mutate({name:s.name,userId:s.user_id}),children:"Delete"})]}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"set in config.yml"})}],[a.isPending,a.mutate]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(K,{title:"Aliases",description:"Friendly names that map to a real provider:model. Callers send the alias as the model; pricing, budgets, and usage key on the target.",action:c||d?null:e.jsx(j,{variant:"primary",onPress:()=>{o(null),l(!0)},children:"New alias"})}),e.jsx(w,{error:t.error}),c?e.jsx(se,{initialTarget:r,onClose:()=>l(!1)}):null,d?e.jsx(ee,{alias:d,onClose:()=>o(null)}):null,a.error?e.jsx(w,{error:a.error}):null,y.length>0?e.jsx(q,{selectedCount:y.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:m.clear,children:e.jsx(j,{size:"sm",variant:"danger",onPress:()=>x(!0),children:"Delete"})}):null,e.jsx(H,{ariaLabel:"Aliases",columns:E,rows:p,getRowKey:S,isLoading:t.isLoading,emptyContent:"No aliases yet. Create one to give a model a friendly name.",selectionMode:"multiple",selectedKeys:m.selectedKeys,onSelectionChange:m.onSelectionChange,disabledKeys:f}),e.jsx(U,{isOpen:h,onOpenChange:x,heading:"Delete aliases",body:`Delete ${y.length} stored ${y.length===1?"alias":"aliases"}? Callers using ${y.length===1?"it":"them"} will get a model-not-found error.`,confirmLabel:"Delete",isPending:v,error:g,onConfirm:_})]})}export{me as AliasesPage}; diff --git a/src/gateway/static/dashboard/assets/BudgetsPage-Cnrtd_az.js b/src/gateway/static/dashboard/assets/BudgetsPage-ByNysHbI.js similarity index 99% rename from src/gateway/static/dashboard/assets/BudgetsPage-Cnrtd_az.js rename to src/gateway/static/dashboard/assets/BudgetsPage-ByNysHbI.js index b84908584..915917adc 100644 --- a/src/gateway/static/dashboard/assets/BudgetsPage-Cnrtd_az.js +++ b/src/gateway/static/dashboard/assets/BudgetsPage-ByNysHbI.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{v as ae,u as re,w as le,x as ie,y as oe,z as de,P as ue,E as T,I as ce,B as me,D as xe}from"./index-DMrbj_xn.js";import{u as ge,r as he,B as pe}from"./tableSelection-CojkFPwd.js";import{C as fe}from"./ConfirmDialog-D3P-vj-t.js";import{D as be}from"./DataTable-CrQq0sYf.js";import{F as $}from"./Field-DEJ6Wjg9.js";import{C as E,I as je,a as ve,b as ye,B as x,d as k,S as Ne}from"./heroui-DZj66Arc.js";const Se=50;function _e({value:t,onChange:r,users:a,label:o,description:l}){const[g,h]=i.useState(""),d=i.useMemo(()=>a.filter(s=>!s.user_id.startsWith("apikey-")).map(s=>({id:s.user_id,label:s.alias?`${s.user_id} (${s.alias})`:s.user_id})),[a]),p=i.useMemo(()=>{const s=g.trim().toLowerCase();return d.filter(u=>!t.includes(u.id)).filter(u=>!s||u.id.toLowerCase().includes(s)||u.label.toLowerCase().includes(s)).slice(0,Se)},[d,t,g]),c=s=>{t.includes(s)||r([...t,s]),h("")},m=s=>r(t.filter(u=>u!==s));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:o}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[s,e.jsx("button",{type:"button","aria-label":`Remove ${s}`,onClick:()=>m(s),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},s))}):null,d.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:h,selectedKey:null,onSelectionChange:s=>{s!=null&&c(String(s))},className:"flex flex-col gap-1",children:[e.jsxs(E.InputGroup,{children:[e.jsx(je,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(ve,{items:p,className:"max-h-72 overflow-auto",children:s=>e.jsx(ye,{id:s.id,textValue:s.label,children:s.label})})})]})]})}const Ce=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function D(t){return Ce.format(t)}const j=86400,W=3600,O=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function we(t){if(t===null)return"No reset";const r=O.find(a=>a.seconds===t);return r?r.label:t%j===0?`Every ${t/j} days`:t%W===0?`Every ${t/W} hours`:`Every ${t}s`}function q(t){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function De(t){const r=t.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function Y(t){return t!==null&&t%j===0?String(t/j):""}function Be({value:t,onChange:r,onInvalidChange:a}){const o=O.some(s=>s.seconds===t),[l,g]=i.useState(!o),[h,d]=i.useState(()=>Y(t)),p=h.trim(),c=Number(p),m=p!==""&&(!Number.isSafeInteger(c)||c<=0);return i.useEffect(()=>{a==null||a(m)},[m,a]),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.map(s=>e.jsx(x,{size:"sm",variant:!l&&t===s.seconds?"primary":"outline",onPress:()=>{g(!1),d(Y(s.seconds)),r(s.seconds)},children:s.label},s.label)),e.jsx(x,{size:"sm",variant:l?"primary":"outline",onPress:()=>g(!0),children:"Custom"})]}),l?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx($,{label:"Every N days",value:h,onChange:s=>{d(s);const u=Number(s.trim());r(s.trim()===""||!Number.isSafeInteger(u)||u<=0?null:u*j)},placeholder:"14",description:m?e.jsx("span",{className:"text-red-700",children:"Enter a whole number of days."}):"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function G({title:t,submitLabel:r,initial:a,error:o,isPending:l,onSubmit:g,onClose:h,assignUsers:d}){const[p,c]=i.useState(a.name??""),[m,s]=i.useState(a.max_budget===null?"":String(a.max_budget)),[u,b]=i.useState(a.budget_duration_sec),[S,v]=i.useState(!1),[B,P]=i.useState([]),f=De(m),A=!l&&f.valid&&!S,C=()=>{A&&g({name:p.trim()||null,max_budget:f.value,budget_duration_sec:u},B)};return e.jsx(k,{children:e.jsxs(k.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(T,{error:o}),e.jsx($,{label:"Name (optional)",value:p,onChange:c,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx($,{label:"Spending limit (USD)",value:m,onChange:s,placeholder:"100.00",description:f.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(Be,{value:u,onChange:b,onInvalidChange:v}),d?e.jsx(_e,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:B,onChange:P,users:d}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:!A,onPress:C,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:h,children:"Cancel"})]})]})})}function Pe({budget:t}){if(t.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=t.total_spend;if(t.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[D(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=t.max_budget*t.user_count,o=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:D(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",D(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(o,l?100:2)}%`}})})]})}function Ae({budgetId:t}){const r=xe(t);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(Ne,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:o.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:D(o.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:q(o.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:q(o.next_reset_at)})]},o.id))})]})})}function Ee({label:t,isPending:r,onConfirm:a}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:t}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}const ke=t=>t.budget_id;function Q(t){return t.split("-")[0]}function z(t){return t.name??Q(t.budget_id)}function Te(){const t=ae(),r=re(),a=le(),o=ie(),l=oe(),g=de(),[h,d]=i.useState(!1),[p,c]=i.useState(null),[m,s]=i.useState(null),[u,b]=i.useState(null),[S,v]=i.useState(null),[B,P]=i.useState(!1),f=ge(),[A,C]=i.useState(!1),[X,F]=i.useState(void 0),[J,H]=i.useState(!1),w=t.data??[],K=t.isLoading,y=w.find(n=>n.budget_id===p)??null,U=w.find(n=>n.budget_id===m)??null,L=!K&&w.length===0&&!h,Z=w.map(n=>n.budget_id),_=he(f.selectedKeys,Z),ee=async()=>{H(!0),F(void 0);try{for(const n of _)await l.mutateAsync(n);f.clear(),C(!1)}catch(n){F(n)}finally{H(!1)}},te=i.useMemo(()=>[{id:"budget",header:"Budget",isRowHeader:!0,cell:n=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:Q(n.budget_id)})]})},{id:"limit",header:"Limit (per user)",cell:n=>n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):D(n.max_budget)},{id:"reset",header:"Reset",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:we(n.budget_duration_sec)})},{id:"users",header:"Users",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:n.user_count})},{id:"usage",header:"Usage",cell:n=>e.jsx(Pe,{budget:n})},{id:"actions",header:"Actions",align:"end",cell:n=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(N=>N===n.budget_id?null:n.budget_id),children:m===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{d(!1),c(n.budget_id)},children:"Edit"}),e.jsx(Ee,{label:z(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})}],[m,l.isPending,l.mutate]),V=async(n,N)=>{P(!0),b(null);const I=await Promise.allSettled(N.map(M=>g.mutateAsync({id:M,body:{budget_id:n}})));P(!1);const R=I.flatMap((M,ne)=>M.status==="rejected"?[N[ne]]:[]);if(R.length>0){v({budgetId:n,userIds:R}),b(new Error(`Budget created, but could not assign it to: ${R.join(", ")}. Retry to try again.`));return}v(null),d(!1)},se=(n,N)=>{if(S){V(S.budgetId,S.userIds);return}b(null),a.mutate(n,{onSuccess:async I=>{if(N.length>0){await V(I.budget_id,N);return}d(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ue,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:h||L?null:e.jsx(x,{variant:"primary",onPress:()=>{c(null),b(null),v(null),d(!0)},children:"Create budget"})}),e.jsx(T,{error:t.error??a.error??o.error??l.error??g.error}),e.jsx(ce,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),L?e.jsx(me,{title:"No budgets yet",description:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit.",actionLabel:"Create your first budget",onAction:()=>{c(null),b(null),v(null),d(!0)}}):null,h?e.jsx(G,{title:"Create budget",submitLabel:S?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??u,isPending:a.isPending||B,assignUsers:r.data??[],onSubmit:se,onClose:()=>{b(null),v(null),d(!1)}}):null,y?e.jsx(G,{title:`Edit budget ${z(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:o.error,isPending:o.isPending,onSubmit:n=>o.mutate({id:y.budget_id,body:n},{onSuccess:()=>c(null)}),onClose:()=>c(null)},y.budget_id):null,_.length>0?e.jsx(pe,{selectedCount:_.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:f.clear,children:e.jsx(x,{size:"sm",variant:"danger",onPress:()=>C(!0),children:"Delete"})}):null,L?null:e.jsx(be,{ariaLabel:"Budgets",columns:te,rows:w,getRowKey:ke,isLoading:K,emptyContent:"No budgets yet. Create one to cap spending.",selectionMode:"multiple",selectedKeys:f.selectedKeys,onSelectionChange:f.onSelectionChange}),U?e.jsx(k,{children:e.jsxs(k.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsxs("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:["Reset history — ",z(U)]}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(null),children:"Close"})]}),e.jsx(Ae,{budgetId:U.budget_id})]})}):null,e.jsx(fe,{isOpen:A,onOpenChange:C,heading:"Delete budgets",body:`Delete ${_.length} ${_.length===1?"budget":"budgets"}? Users on ${_.length===1?"it":"them"} will no longer be capped.`,confirmLabel:"Delete",isPending:J,error:X,onConfirm:ee})]})}export{Te as BudgetsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{v as ae,u as re,w as le,x as ie,y as oe,z as de,P as ue,E as T,I as ce,B as me,D as xe}from"./index-BTsnhpZj.js";import{u as ge,r as he,B as pe}from"./tableSelection-CojkFPwd.js";import{C as fe}from"./ConfirmDialog-WxOAhWT-.js";import{D as be}from"./DataTable-CrQq0sYf.js";import{F as $}from"./Field-DEJ6Wjg9.js";import{C as E,I as je,a as ve,b as ye,B as x,d as k,S as Ne}from"./heroui-DZj66Arc.js";const Se=50;function _e({value:t,onChange:r,users:a,label:o,description:l}){const[g,h]=i.useState(""),d=i.useMemo(()=>a.filter(s=>!s.user_id.startsWith("apikey-")).map(s=>({id:s.user_id,label:s.alias?`${s.user_id} (${s.alias})`:s.user_id})),[a]),p=i.useMemo(()=>{const s=g.trim().toLowerCase();return d.filter(u=>!t.includes(u.id)).filter(u=>!s||u.id.toLowerCase().includes(s)||u.label.toLowerCase().includes(s)).slice(0,Se)},[d,t,g]),c=s=>{t.includes(s)||r([...t,s]),h("")},m=s=>r(t.filter(u=>u!==s));return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:o}),l?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:l}):null]}),t.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[s,e.jsx("button",{type:"button","aria-label":`Remove ${s}`,onClick:()=>m(s),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},s))}):null,d.length===0?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users yet. Create users first, then assign them here or from the Users page."}):e.jsxs(E.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:g,onInputChange:h,selectedKey:null,onSelectionChange:s=>{s!=null&&c(String(s))},className:"flex flex-col gap-1",children:[e.jsxs(E.InputGroup,{children:[e.jsx(je,{"aria-label":"Add a user",placeholder:"Search users…",autoComplete:"off"}),e.jsx(E.Trigger,{})]}),e.jsx(E.Popover,{children:e.jsx(ve,{items:p,className:"max-h-72 overflow-auto",children:s=>e.jsx(ye,{id:s.id,textValue:s.label,children:s.label})})})]})]})}const Ce=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function D(t){return Ce.format(t)}const j=86400,W=3600,O=[{label:"No reset",seconds:null},{label:"Daily",seconds:j},{label:"Weekly",seconds:7*j},{label:"Monthly",seconds:30*j}];function we(t){if(t===null)return"No reset";const r=O.find(a=>a.seconds===t);return r?r.label:t%j===0?`Every ${t/j} days`:t%W===0?`Every ${t/W} hours`:`Every ${t}s`}function q(t){if(!t)return"—";const r=new Date(t);return Number.isNaN(r.getTime())?"—":r.toLocaleString()}function De(t){const r=t.trim();if(r==="")return{value:null,valid:!0};const a=Number(r);return!Number.isFinite(a)||a<0?{value:null,valid:!1}:{value:a,valid:!0}}function Y(t){return t!==null&&t%j===0?String(t/j):""}function Be({value:t,onChange:r,onInvalidChange:a}){const o=O.some(s=>s.seconds===t),[l,g]=i.useState(!o),[h,d]=i.useState(()=>Y(t)),p=h.trim(),c=Number(p),m=p!==""&&(!Number.isSafeInteger(c)||c<=0);return i.useEffect(()=>{a==null||a(m)},[m,a]),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Reset period"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[O.map(s=>e.jsx(x,{size:"sm",variant:!l&&t===s.seconds?"primary":"outline",onPress:()=>{g(!1),d(Y(s.seconds)),r(s.seconds)},children:s.label},s.label)),e.jsx(x,{size:"sm",variant:l?"primary":"outline",onPress:()=>g(!0),children:"Custom"})]}),l?e.jsx("div",{className:"flex items-end gap-2",children:e.jsx($,{label:"Every N days",value:h,onChange:s=>{d(s);const u=Number(s.trim());r(s.trim()===""||!Number.isSafeInteger(u)||u<=0?null:u*j)},placeholder:"14",description:m?e.jsx("span",{className:"text-red-700",children:"Enter a whole number of days."}):"Whole days between resets."})}):null,e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Spend returns to zero each period. A user’s clock starts when the budget is assigned to them."})]})}function G({title:t,submitLabel:r,initial:a,error:o,isPending:l,onSubmit:g,onClose:h,assignUsers:d}){const[p,c]=i.useState(a.name??""),[m,s]=i.useState(a.max_budget===null?"":String(a.max_budget)),[u,b]=i.useState(a.budget_duration_sec),[S,v]=i.useState(!1),[B,P]=i.useState([]),f=De(m),A=!l&&f.valid&&!S,C=()=>{A&&g({name:p.trim()||null,max_budget:f.value,budget_duration_sec:u},B)};return e.jsx(k,{children:e.jsxs(k.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(T,{error:o}),e.jsx($,{label:"Name (optional)",value:p,onChange:c,autoFocus:!0,placeholder:"team-free-tier",description:"A label to recognize this budget later."}),e.jsx($,{label:"Spending limit (USD)",value:m,onChange:s,placeholder:"100.00",description:f.valid?"The most a single user on this budget may spend per period. Leave blank for no limit.":e.jsx("span",{className:"text-red-700",children:"Enter a non-negative number, or leave blank for no limit."})}),e.jsx(Be,{value:u,onChange:b,onInvalidChange:v}),d?e.jsx(_e,{label:"Assign to users (optional)",description:"Attach this budget to existing users now. You can also manage assignments later on the Users page.",value:B,onChange:P,users:d}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(x,{variant:"primary",isDisabled:!A,onPress:C,children:l?"Saving…":r}),e.jsx(x,{variant:"ghost",isDisabled:l,onPress:h,children:"Cancel"})]})]})})}function Pe({budget:t}){if(t.user_count===0)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No users assigned"});const r=t.total_spend;if(t.max_budget===null)return e.jsxs("span",{className:"text-xs text-[var(--otari-ink)]",children:[D(r)," spent",e.jsx("span",{className:"text-[var(--otari-muted)]",children:" · no limit"})]});const a=t.max_budget*t.user_count,o=a>0?Math.min(100,r/a*100):0,l=r>a;return e.jsxs("div",{className:"flex min-w-[140px] flex-col gap-1",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 text-xs",children:[e.jsx("span",{className:"text-[var(--otari-ink)]",children:D(r)}),e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["of ",D(a)]})]}),e.jsx("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Aggregate spend against total allocation",children:e.jsx("div",{className:`h-full rounded-full ${l?"bg-red-500":"bg-[var(--otari-brand)]"}`,style:{width:`${Math.max(o,l?100:2)}%`}})})]})}function Ae({budgetId:t}){const r=xe(t);if(r.isLoading)return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-4 text-sm text-[var(--otari-muted)]",children:[e.jsx(Ne,{size:"sm"})," Loading reset history…"]});if(r.error)return e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{error:r.error})});const a=r.data??[];return a.length===0?e.jsx("div",{className:"px-4 py-4 text-sm text-[var(--otari-muted)]",children:"No resets recorded yet for this budget."}):e.jsx("div",{className:"overflow-x-auto px-4 py-3",children:e.jsxs("table",{className:"w-full border-collapse text-xs",children:[e.jsx("thead",{className:"text-left text-[var(--otari-muted)]",children:e.jsxs("tr",{children:[e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"User"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Spend cleared"}),e.jsx("th",{className:"py-1.5 pr-4 font-medium",children:"Reset at"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Next reset"})]})}),e.jsx("tbody",{children:a.map(o=>e.jsxs("tr",{className:"border-t border-[var(--otari-line)]",children:[e.jsx("td",{className:"py-1.5 pr-4",children:e.jsx("code",{children:o.user_id??"—"})}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-ink)]",children:D(o.previous_spend)}),e.jsx("td",{className:"py-1.5 pr-4 text-[var(--otari-muted)]",children:q(o.reset_at)}),e.jsx("td",{className:"py-1.5 text-[var(--otari-muted)]",children:q(o.next_reset_at)})]},o.id))})]})})}function Ee({label:t,isPending:r,onConfirm:a}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsxs("span",{className:"max-w-xs text-xs text-amber-800",children:["Delete ",e.jsx("strong",{children:t}),"? Users keep their spend but lose this limit. Cannot be undone."]}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(x,{size:"sm",variant:"danger",isDisabled:r,onPress:a,children:"Delete permanently"}),e.jsx(x,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(x,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:"Delete"})}const ke=t=>t.budget_id;function Q(t){return t.split("-")[0]}function z(t){return t.name??Q(t.budget_id)}function Te(){const t=ae(),r=re(),a=le(),o=ie(),l=oe(),g=de(),[h,d]=i.useState(!1),[p,c]=i.useState(null),[m,s]=i.useState(null),[u,b]=i.useState(null),[S,v]=i.useState(null),[B,P]=i.useState(!1),f=ge(),[A,C]=i.useState(!1),[X,F]=i.useState(void 0),[J,H]=i.useState(!1),w=t.data??[],K=t.isLoading,y=w.find(n=>n.budget_id===p)??null,U=w.find(n=>n.budget_id===m)??null,L=!K&&w.length===0&&!h,Z=w.map(n=>n.budget_id),_=he(f.selectedKeys,Z),ee=async()=>{H(!0),F(void 0);try{for(const n of _)await l.mutateAsync(n);f.clear(),C(!1)}catch(n){F(n)}finally{H(!1)}},te=i.useMemo(()=>[{id:"budget",header:"Budget",isRowHeader:!0,cell:n=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:n.name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsx("code",{className:"text-[11px] text-[var(--otari-muted)]",title:n.budget_id,children:Q(n.budget_id)})]})},{id:"limit",header:"Limit (per user)",cell:n=>n.max_budget===null?e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Unlimited"}):D(n.max_budget)},{id:"reset",header:"Reset",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:we(n.budget_duration_sec)})},{id:"users",header:"Users",cell:n=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:n.user_count})},{id:"usage",header:"Usage",cell:n=>e.jsx(Pe,{budget:n})},{id:"actions",header:"Actions",align:"end",cell:n=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(N=>N===n.budget_id?null:n.budget_id),children:m===n.budget_id?"Hide history":"History"}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>{d(!1),c(n.budget_id)},children:"Edit"}),e.jsx(Ee,{label:z(n),isPending:l.isPending,onConfirm:()=>l.mutate(n.budget_id)})]})}],[m,l.isPending,l.mutate]),V=async(n,N)=>{P(!0),b(null);const I=await Promise.allSettled(N.map(M=>g.mutateAsync({id:M,body:{budget_id:n}})));P(!1);const R=I.flatMap((M,ne)=>M.status==="rejected"?[N[ne]]:[]);if(R.length>0){v({budgetId:n,userIds:R}),b(new Error(`Budget created, but could not assign it to: ${R.join(", ")}. Retry to try again.`));return}v(null),d(!1)},se=(n,N)=>{if(S){V(S.budgetId,S.userIds);return}b(null),a.mutate(n,{onSuccess:async I=>{if(N.length>0){await V(I.budget_id,N);return}d(!1)}})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(ue,{title:"Budgets",description:"Define spending limits and reset schedules. Assign a budget to users to enforce it.",action:h||L?null:e.jsx(x,{variant:"primary",onPress:()=>{c(null),b(null),v(null),d(!0)},children:"Create budget"})}),e.jsx(T,{error:t.error??a.error??o.error??l.error??g.error}),e.jsx(ce,{children:"Assign a budget to users when you create it, or later from the Users page. Each row’s usage aggregates the spend of the users currently on that budget."}),L?e.jsx(me,{title:"No budgets yet",description:"A budget caps how much a user may spend and, optionally, resets that spend on a schedule. Create one, then assign it to users to enforce a limit.",actionLabel:"Create your first budget",onAction:()=>{c(null),b(null),v(null),d(!0)}}):null,h?e.jsx(G,{title:"Create budget",submitLabel:S?"Retry assignments":"Create budget",initial:{name:null,max_budget:null,budget_duration_sec:null},error:a.error??u,isPending:a.isPending||B,assignUsers:r.data??[],onSubmit:se,onClose:()=>{b(null),v(null),d(!1)}}):null,y?e.jsx(G,{title:`Edit budget ${z(y)}`,submitLabel:"Save changes",initial:{name:y.name,max_budget:y.max_budget,budget_duration_sec:y.budget_duration_sec},error:o.error,isPending:o.isPending,onSubmit:n=>o.mutate({id:y.budget_id,body:n},{onSuccess:()=>c(null)}),onClose:()=>c(null)},y.budget_id):null,_.length>0?e.jsx(pe,{selectedCount:_.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:f.clear,children:e.jsx(x,{size:"sm",variant:"danger",onPress:()=>C(!0),children:"Delete"})}):null,L?null:e.jsx(be,{ariaLabel:"Budgets",columns:te,rows:w,getRowKey:ke,isLoading:K,emptyContent:"No budgets yet. Create one to cap spending.",selectionMode:"multiple",selectedKeys:f.selectedKeys,onSelectionChange:f.onSelectionChange}),U?e.jsx(k,{children:e.jsxs(k.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsxs("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:["Reset history — ",z(U)]}),e.jsx(x,{size:"sm",variant:"ghost",onPress:()=>s(null),children:"Close"})]}),e.jsx(Ae,{budgetId:U.budget_id})]})}):null,e.jsx(fe,{isOpen:A,onOpenChange:C,heading:"Delete budgets",body:`Delete ${_.length} ${_.length===1?"budget":"budgets"}? Users on ${_.length===1?"it":"them"} will no longer be capped.`,confirmLabel:"Delete",isPending:J,error:X,onConfirm:ee})]})}export{Te as BudgetsPage}; diff --git a/src/gateway/static/dashboard/assets/ConfirmDialog-D3P-vj-t.js b/src/gateway/static/dashboard/assets/ConfirmDialog-WxOAhWT-.js similarity index 92% rename from src/gateway/static/dashboard/assets/ConfirmDialog-D3P-vj-t.js rename to src/gateway/static/dashboard/assets/ConfirmDialog-WxOAhWT-.js index 09a1e6984..ea522dbe8 100644 --- a/src/gateway/static/dashboard/assets/ConfirmDialog-D3P-vj-t.js +++ b/src/gateway/static/dashboard/assets/ConfirmDialog-WxOAhWT-.js @@ -1 +1 @@ -import{j as r}from"./tanstack-query-1t81HyiD.js";import{E as j}from"./index-DMrbj_xn.js";import{A as e,B as l}from"./heroui-DZj66Arc.js";function p({isOpen:s,onOpenChange:a,heading:n,body:o,confirmLabel:t,confirmVariant:c="danger",isPending:i,error:d,onConfirm:x}){return r.jsx(e,{isOpen:s,onOpenChange:a,children:s?r.jsx(e.Backdrop,{children:r.jsx(e.Container,{placement:"center",size:"md",children:r.jsxs(e.Dialog,{children:[r.jsx(e.Header,{children:r.jsx(e.Heading,{children:n})}),r.jsxs(e.Body,{className:"flex flex-col gap-4",children:[r.jsx("div",{className:"text-sm text-[var(--otari-muted)]",children:o}),r.jsx(j,{error:d})]}),r.jsxs(e.Footer,{children:[r.jsx(l,{variant:"ghost",isDisabled:i,onPress:()=>a(!1),children:"Cancel"}),r.jsx(l,{variant:c,isPending:i,onPress:x,children:t})]})]})})}):null})}export{p as C}; +import{j as r}from"./tanstack-query-1t81HyiD.js";import{E as j}from"./index-BTsnhpZj.js";import{A as e,B as l}from"./heroui-DZj66Arc.js";function p({isOpen:s,onOpenChange:a,heading:n,body:o,confirmLabel:t,confirmVariant:c="danger",isPending:i,error:d,onConfirm:x}){return r.jsx(e,{isOpen:s,onOpenChange:a,children:s?r.jsx(e.Backdrop,{children:r.jsx(e.Container,{placement:"center",size:"md",children:r.jsxs(e.Dialog,{children:[r.jsx(e.Header,{children:r.jsx(e.Heading,{children:n})}),r.jsxs(e.Body,{className:"flex flex-col gap-4",children:[r.jsx("div",{className:"text-sm text-[var(--otari-muted)]",children:o}),r.jsx(j,{error:d})]}),r.jsxs(e.Footer,{children:[r.jsx(l,{variant:"ghost",isDisabled:i,onPress:()=>a(!1),children:"Cancel"}),r.jsx(l,{variant:c,isPending:i,onPress:x,children:t})]})]})})}):null})}export{p as C}; diff --git a/src/gateway/static/dashboard/assets/DocsPage-BgBskDDe.js b/src/gateway/static/dashboard/assets/DocsPage-BB_QbZI8.js similarity index 99% rename from src/gateway/static/dashboard/assets/DocsPage-BgBskDDe.js rename to src/gateway/static/dashboard/assets/DocsPage-BB_QbZI8.js index 80c7735f1..8e2a98672 100644 --- a/src/gateway/static/dashboard/assets/DocsPage-BgBskDDe.js +++ b/src/gateway/static/dashboard/assets/DocsPage-BB_QbZI8.js @@ -1,4 +1,4 @@ -import{j as re}from"./tanstack-query-1t81HyiD.js";import{P as gi}from"./index-DMrbj_xn.js";import{d as ct}from"./heroui-DZj66Arc.js";import{g as nr}from"./react-dgEcD0HR.js";function yi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi={};function ht(e,t){return(bi.jsx?xi:ki).test(e)}const wi=/[ \t\n\f\r]/g;function Si(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(wi,"")===""}class Ke{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function tr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ke(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ci=0;const L=Te(),Y=Te(),Dn=Te(),E=Te(),$=Te(),ve=Te(),te=Te();function Te(){return 2**++Ci}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:ve,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ai.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Di);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Ti,zi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function zi(e){return"-"+e.toLowerCase()}function Di(e){return e.charAt(1).toUpperCase()}const Li=tr([rr,Ei,or,ar,sr],"html"),qn=tr([rr,vi,or,ar,sr],"svg");function _i(e){return e.join(" ").trim()}var De={},mn,dt;function Ri(){if(dt)return mn;dt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=` +import{j as re}from"./tanstack-query-1t81HyiD.js";import{P as gi}from"./index-BTsnhpZj.js";import{d as ct}from"./heroui-DZj66Arc.js";import{g as nr}from"./react-dgEcD0HR.js";function yi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const ki=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,bi={};function ht(e,t){return(bi.jsx?xi:ki).test(e)}const wi=/[ \t\n\f\r]/g;function Si(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(wi,"")===""}class Ke{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ke.prototype.normal={};Ke.prototype.property={};Ke.prototype.space=void 0;function tr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ke(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let Ci=0;const L=Te(),Y=Te(),Dn=Te(),E=Te(),$=Te(),ve=Te(),te=Te();function Te(){return 2**++Ci}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:ve,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),pt(this,"space",i),typeof r=="number")for(;++o4&&n.slice(0,4)==="data"&&Ai.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(mt,Di);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!mt.test(o)){let l=o.replace(Ti,zi);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function zi(e){return"-"+e.toLowerCase()}function Di(e){return e.charAt(1).toUpperCase()}const Li=tr([rr,Ei,or,ar,sr],"html"),qn=tr([rr,vi,or,ar,sr],"svg");function _i(e){return e.join(" ").trim()}var De={},mn,dt;function Ri(){if(dt)return mn;dt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=` `,u="/",h="*",c="",p="comment",f="declaration";function g(S,y){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];y=y||{};var v=1,C=1;function R(D){var T=D.match(t);T&&(v+=T.length);var U=D.lastIndexOf(s);C=~U?D.length-U:C+D.length}function F(){var D={line:v,column:C};return function(T){return T.position=new b(D),j(),T}}function b(D){this.start=D,this.end={line:v,column:C},this.source=y.source}b.prototype.content=S;function M(D){var T=new Error(y.source+":"+v+":"+C+": "+D);if(T.reason=D,T.filename=y.source,T.line=v,T.column=C,T.source=S,!y.silent)throw T}function H(D){var T=D.exec(S);if(T){var U=T[0];return R(U),S=S.slice(U.length),T}}function j(){H(n)}function k(D){var T;for(D=D||[];T=A();)T!==!1&&D.push(T);return D}function A(){var D=F();if(!(u!=S.charAt(0)||h!=S.charAt(1))){for(var T=2;c!=S.charAt(T)&&(h!=S.charAt(T)||u!=S.charAt(T+1));)++T;if(T+=2,c===S.charAt(T-1))return M("End of comment missing");var U=S.slice(2,T-2);return C+=2,R(U),S=S.slice(T),C+=2,D({type:p,comment:U})}}function P(){var D=F(),T=H(r);if(T){if(A(),!H(i))return M("property missing ':'");var U=H(o),K=D({type:f,property:w(T[0].replace(e,c)),value:U?w(U[0].replace(e,c)):c});return H(l),K}}function q(){var D=[];k(D);for(var T;T=P();)T!==!1&&(D.push(T),k(D));return D}return j(),q()}function w(S){return S?S.replace(a,c):c}return mn=g,mn}var gt;function Fi(){if(gt)return De;gt=1;var e=De&&De.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(De,"__esModule",{value:!0}),De.default=n;const t=e(Ri());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),a=typeof i=="function";return l.forEach(s=>{if(s.type!=="declaration")return;const{property:u,value:h}=s;a?i(u,h,s):h&&(o=o||{},o[u]=h)}),o}return De}var Be={},yt;function Oi(){if(yt)return Be;yt=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(u){return!u||n.test(u)||e.test(u)},l=function(u,h){return h.toUpperCase()},a=function(u,h){return"".concat(h,"-")},s=function(u,h){return h===void 0&&(h={}),o(u)?u:(u=u.toLowerCase(),h.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(t,l))};return Be.camelCase=s,Be}var je,kt;function Mi(){if(kt)return je;kt=1;var e=je&&je.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Fi()),n=Oi();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(a,s){a&&s&&(l[(0,n.camelCase)(a,o)]=s)}),l}return r.default=r,je=r,je}var Ni=Mi();const Bi=nr(Ni),ur=cr("end"),Un=cr("start");function cr(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function ji(e){const t=Un(e),n=ur(e);if(t&&n)return{start:t,end:n}}function Ue(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?xt(e.position):"start"in e||"end"in e?xt(e):"line"in e||"column"in e?_n(e):""}function _n(e){return bt(e&&e.line)+":"+bt(e&&e.column)}function xt(e){return _n(e&&e.start)+"-"+_n(e&&e.end)}function bt(e){return e&&typeof e=="number"?e:1}class G extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?o.ruleId=r:(o.source=r.slice(0,s),o.ruleId=r.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){const s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ue(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}G.prototype.file="";G.prototype.name="";G.prototype.reason="";G.prototype.message="";G.prototype.stack="";G.prototype.column=void 0;G.prototype.line=void 0;G.prototype.ancestors=void 0;G.prototype.cause=void 0;G.prototype.fatal=void 0;G.prototype.place=void 0;G.prototype.ruleId=void 0;G.prototype.source=void 0;const Vn={}.hasOwnProperty,Hi=new Map,qi=/[A-Z]/g,Ui=new Set(["table","tbody","thead","tfoot","tr"]),Vi=new Set(["td","th"]),hr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $i(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Zi(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ji(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qn:Li,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=fr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function fr(e,t,n){if(t.type==="element")return Wi(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Yi(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Qi(e,t,n);if(t.type==="mdxjsEsm")return Ki(e,t);if(t.type==="root")return Xi(e,t,n);if(t.type==="text")return Gi(e,t)}function Wi(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=qn,e.schema=i),e.ancestors.push(t);const o=mr(e,t.tagName,!1),l=el(e,t);let a=Wn(e,t);return Ui.has(t.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!Si(s):!0})),pr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Yi(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}We(e,t.position)}function Ki(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);We(e,t.position)}function Qi(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=qn,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:mr(e,t.name,!0),l=nl(e,t),a=Wn(e,t);return pr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Xi(e,t,n){const r={};return $n(r,Wn(e,t)),e.create(t,e.Fragment,r,n)}function Gi(e,t){return t.value}function pr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $n(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ji(e,t,n){return r;function r(i,o,l,a){const u=Array.isArray(l.children)?n:t;return a?u(o,l,a):u(o,l)}}function Zi(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),s=Un(r);return t(i,o,l,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function el(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Vn.call(t.properties,i)){const o=tl(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&Vi.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function nl(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else We(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else We(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Wn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Hi;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o0?(ie(e,e.length,0,t),e):t}const Ct={}.hasOwnProperty;function gr(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ce(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const J=be(/[A-Za-z]/),X=be(/[\dA-Za-z]/),hl=be(/[#-'*+\--9=?A-Z^-~]/);function rn(e){return e!==null&&(e<32||e===127)}const Rn=be(/\d/),fl=be(/[\dA-Fa-f]/),pl=be(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function W(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}const sn=be(new RegExp("\\p{P}|\\p{S}","u")),Ie=be(/\s/);function be(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Fe(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function B(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(s){return O(s)?(e.enter(n),a(s)):t(s)}function a(s){return O(s)&&o++l))return;const M=t.events.length;let H=M,j,k;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(j){k=t.events[H][1].end;break}j=!0}for(y(r),b=M;bC;){const F=n[R];t.containerState=F[1],F[0].exit.call(t,e)}n.length=C}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function kl(e,t,n){return B(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _e(e){if(e===null||W(e)||Ie(e))return 1;if(sn(e))return 2}function un(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};vt(c,-s),vt(p,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:s>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=le(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=le(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=le(u,un(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=le(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,u=le(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,ie(e,r-1,n-r+3,u),n=r+u.length-h-2;break}}for(n=-1;++n0&&O(b)?B(e,v,"linePrefix",o+1)(b):v(b)}function v(b){return b===null||z(b)?e.check(It,w,R)(b):(e.enter("codeFlowValue"),C(b))}function C(b){return b===null||z(b)?(e.exit("codeFlowValue"),v(b)):(e.consume(b),C)}function R(b){return e.exit("codeFenced"),t(b)}function F(b,M,H){let j=0;return k;function k(T){return b.enter("lineEnding"),b.consume(T),b.exit("lineEnding"),A}function A(T){return b.enter("codeFencedFence"),O(T)?B(b,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):P(T)}function P(T){return T===a?(b.enter("codeFencedFenceSequence"),q(T)):H(T)}function q(T){return T===a?(j++,b.consume(T),q):j>=l?(b.exit("codeFencedFenceSequence"),O(T)?B(b,D,"whitespace")(T):D(T)):H(T)}function D(T){return T===null||z(T)?(b.exit("codeFencedFence"),M(T)):H(T)}}}function zl(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const gn={name:"codeIndented",tokenize:Ll},Dl={partial:!0,tokenize:_l};function Ll(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),B(e,o,"linePrefix",5)(u)}function o(u){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?s(u):z(u)?e.attempt(Dl,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||z(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),t(u)}}function _l(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):B(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):z(l)?i(l):n(l)}}const Rl={name:"codeText",previous:Ol,resolve:Fl,tokenize:Ml};function Fl(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&He(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),He(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),He(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Sr(e,t,n,r,i,o,l,a,s){const u=s||Number.POSITIVE_INFINITY;let h=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||rn(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||z(y)?n(y):(e.consume(y),y===92?g:f)}function g(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function w(y){return!h&&(y===null||y===41||W(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):h999||f===null||f===91||f===93&&!s||f===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):z(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),c(f))}function c(f){return f===null||f===91||f===93||z(f)||a++>999?(e.exit("chunkString"),h(f)):(e.consume(f),s||(s=!O(f)),f===92?p:c)}function p(f){return f===91||f===92||f===93?(e.consume(f),a++,c):c(f)}}function Er(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,s):n(p)}function s(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),s(l)):p===null?n(p):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),B(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===l||p===null||z(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:h)}function c(p){return p===l||p===92?(e.consume(p),h):h(p)}}function Ve(e,t){let n;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):O(i)?B(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const $l={name:"definition",tokenize:Yl},Wl={partial:!0,tokenize:Kl};function Yl(e,t,n){const r=this;let i;return o;function o(f){return e.enter("definition"),l(f)}function l(f){return Cr.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=ce(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),s):n(f)}function s(f){return W(f)?Ve(e,u)(f):u(f)}function u(f){return Sr(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function h(f){return e.attempt(Wl,c,c)(f)}function c(f){return O(f)?B(e,p,"whitespace")(f):p(f)}function p(f){return f===null||z(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function Kl(e,t,n){return r;function r(a){return W(a)?Ve(e,i)(a):n(a)}function i(a){return Er(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return O(a)?B(e,l,"whitespace")(a):l(a)}function l(a){return a===null||z(a)?t(a):n(a)}}const Ql={name:"hardBreakEscape",tokenize:Xl};function Xl(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return z(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Gl={name:"headingAtx",resolve:Jl,tokenize:Zl};function Jl(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ie(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Zl(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),o(h)}function o(h){return e.enter("atxHeadingSequence"),l(h)}function l(h){return h===35&&r++<6?(e.consume(h),l):h===null||W(h)?(e.exit("atxHeadingSequence"),a(h)):n(h)}function a(h){return h===35?(e.enter("atxHeadingSequence"),s(h)):h===null||z(h)?(e.exit("atxHeading"),t(h)):O(h)?B(e,a,"whitespace")(h):(e.enter("atxHeadingText"),u(h))}function s(h){return h===35?(e.consume(h),s):(e.exit("atxHeadingSequence"),a(h))}function u(h){return h===null||h===35||W(h)?(e.exit("atxHeadingText"),a(h)):(e.consume(h),u)}}const eo=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],At=["pre","script","style","textarea"],no={concrete:!0,name:"htmlFlow",resolveTo:io,tokenize:lo},to={partial:!0,tokenize:ao},ro={partial:!0,tokenize:oo};function io(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function lo(e,t,n){const r=this;let i,o,l,a,s;return u;function u(d){return h(d)}function h(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,w):d===63?(e.consume(d),i=3,r.interrupt?t:m):J(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function p(d){return d===45?(e.consume(d),i=2,f):d===91?(e.consume(d),i=5,a=0,g):J(d)?(e.consume(d),i=4,r.interrupt?t:m):n(d)}function f(d){return d===45?(e.consume(d),r.interrupt?t:m):n(d)}function g(d){const se="CDATA[";return d===se.charCodeAt(a++)?(e.consume(d),a===se.length?r.interrupt?t:P:g):n(d)}function w(d){return J(d)?(e.consume(d),l=String.fromCharCode(d),S):n(d)}function S(d){if(d===null||d===47||d===62||W(d)){const se=d===47,we=l.toLowerCase();return!se&&!o&&At.includes(we)?(i=1,r.interrupt?t(d):P(d)):eo.includes(l.toLowerCase())?(i=6,se?(e.consume(d),y):r.interrupt?t(d):P(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(d):o?v(d):C(d))}return d===45||X(d)?(e.consume(d),l+=String.fromCharCode(d),S):n(d)}function y(d){return d===62?(e.consume(d),r.interrupt?t:P):n(d)}function v(d){return O(d)?(e.consume(d),v):k(d)}function C(d){return d===47?(e.consume(d),k):d===58||d===95||J(d)?(e.consume(d),R):O(d)?(e.consume(d),C):k(d)}function R(d){return d===45||d===46||d===58||d===95||X(d)?(e.consume(d),R):F(d)}function F(d){return d===61?(e.consume(d),b):O(d)?(e.consume(d),F):C(d)}function b(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),s=d,M):O(d)?(e.consume(d),b):H(d)}function M(d){return d===s?(e.consume(d),s=null,j):d===null||z(d)?n(d):(e.consume(d),M)}function H(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||W(d)?F(d):(e.consume(d),H)}function j(d){return d===47||d===62||O(d)?C(d):n(d)}function k(d){return d===62?(e.consume(d),A):n(d)}function A(d){return d===null||z(d)?P(d):O(d)?(e.consume(d),A):n(d)}function P(d){return d===45&&i===2?(e.consume(d),U):d===60&&i===1?(e.consume(d),K):d===62&&i===4?(e.consume(d),ae):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),pe):z(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(to,me,q)(d)):d===null||z(d)?(e.exit("htmlFlowData"),q(d)):(e.consume(d),P)}function q(d){return e.check(ro,D,me)(d)}function D(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),T}function T(d){return d===null||z(d)?q(d):(e.enter("htmlFlowData"),P(d))}function U(d){return d===45?(e.consume(d),m):P(d)}function K(d){return d===47?(e.consume(d),l="",oe):P(d)}function oe(d){if(d===62){const se=l.toLowerCase();return At.includes(se)?(e.consume(d),ae):P(d)}return J(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),oe):P(d)}function pe(d){return d===93?(e.consume(d),m):P(d)}function m(d){return d===62?(e.consume(d),ae):d===45&&i===2?(e.consume(d),m):P(d)}function ae(d){return d===null||z(d)?(e.exit("htmlFlowData"),me(d)):(e.consume(d),ae)}function me(d){return e.exit("htmlFlow"),t(d)}}function oo(e,t,n){const r=this;return i;function i(l){return z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ao(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Qe,t,n)}}const so={name:"htmlText",tokenize:uo};function uo(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),s}function s(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),F):m===63?(e.consume(m),C):J(m)?(e.consume(m),H):n(m)}function u(m){return m===45?(e.consume(m),h):m===91?(e.consume(m),o=0,g):J(m)?(e.consume(m),v):n(m)}function h(m){return m===45?(e.consume(m),f):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):z(m)?(l=c,K(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),f):c(m)}function f(m){return m===62?U(m):m===45?p(m):c(m)}function g(m){const ae="CDATA[";return m===ae.charCodeAt(o++)?(e.consume(m),o===ae.length?w:g):n(m)}function w(m){return m===null?n(m):m===93?(e.consume(m),S):z(m)?(l=w,K(m)):(e.consume(m),w)}function S(m){return m===93?(e.consume(m),y):w(m)}function y(m){return m===62?U(m):m===93?(e.consume(m),y):w(m)}function v(m){return m===null||m===62?U(m):z(m)?(l=v,K(m)):(e.consume(m),v)}function C(m){return m===null?n(m):m===63?(e.consume(m),R):z(m)?(l=C,K(m)):(e.consume(m),C)}function R(m){return m===62?U(m):C(m)}function F(m){return J(m)?(e.consume(m),b):n(m)}function b(m){return m===45||X(m)?(e.consume(m),b):M(m)}function M(m){return z(m)?(l=M,K(m)):O(m)?(e.consume(m),M):U(m)}function H(m){return m===45||X(m)?(e.consume(m),H):m===47||m===62||W(m)?j(m):n(m)}function j(m){return m===47?(e.consume(m),U):m===58||m===95||J(m)?(e.consume(m),k):z(m)?(l=j,K(m)):O(m)?(e.consume(m),j):U(m)}function k(m){return m===45||m===46||m===58||m===95||X(m)?(e.consume(m),k):A(m)}function A(m){return m===61?(e.consume(m),P):z(m)?(l=A,K(m)):O(m)?(e.consume(m),A):j(m)}function P(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,q):z(m)?(l=P,K(m)):O(m)?(e.consume(m),P):(e.consume(m),D)}function q(m){return m===i?(e.consume(m),i=void 0,T):m===null?n(m):z(m)?(l=q,K(m)):(e.consume(m),q)}function D(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||W(m)?j(m):(e.consume(m),D)}function T(m){return m===47||m===62||W(m)?j(m):n(m)}function U(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function K(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),oe}function oe(m){return O(m)?B(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):pe(m)}function pe(m){return e.enter("htmlTextData"),l(m)}}const Qn={name:"labelEnd",resolveAll:po,resolveTo:mo,tokenize:go},co={tokenize:yo},ho={tokenize:ko},fo={tokenize:xo};function po(e){let t=-1;const n=[];for(;++t=3&&(u===null||z(u))?(e.exit("thematicBreak"),t(u)):n(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),O(u)?B(e,a,"whitespace")(u):a(u))}}const Z={continuation:{tokenize:Po},exit:Do,name:"list",tokenize:Ao},Io={partial:!0,tokenize:Lo},To={partial:!0,tokenize:zo};function Ao(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(f){const g=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Rn(f)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(tn,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(f)}return n(f)}function s(f){return Rn(f)&&++l<10?(e.consume(f),s):(!r.interrupt||l<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Qe,r.interrupt?n:h,e.attempt(Io,p,c))}function h(f){return r.containerState.initialBlankLine=!0,o++,p(f)}function c(f){return O(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),p):n(f)}function p(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Po(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Qe,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,B(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!O(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(To,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,B(e,e.attempt(Z,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function zo(e,t,n){const r=this;return B(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function Do(e){e.exit(this.containerState.type)}function Lo(e,t,n){const r=this;return B(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!O(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Pt={name:"setextUnderline",resolveTo:_o,tokenize:Ro};function _o(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Ro(e,t,n){const r=this;let i;return o;function o(u){let h=r.events.length,c;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){c=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),O(u)?B(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||z(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Fo={tokenize:Oo};function Oo(e){const t=this,n=e.attempt(Qe,r,e.attempt(this.parser.constructs.flowInitial,i,B(e,e.attempt(this.parser.constructs.flow,i,e.attempt(jl,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Mo={resolveAll:Ir()},No=vr("string"),Bo=vr("text");function vr(e){return{resolveAll:Ir(e==="text"?jo:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(h){return u(h)?o(h):a(h)}function a(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),s}function s(h){return u(h)?(n.exit("data"),o(h)):(n.consume(h),s)}function u(h){if(h===null)return!0;const c=i[h];let p=-1;if(c)for(;++p-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Zo(e,t){let n=-1;const r=[];let i;for(;++n0){const ue=_.tokenStack[_.tokenStack.length-1];(ue[1]||Dt).call(_,void 0,ue[0])}for(I.position={start:xe(x.length>0?x[0][1].start:{line:1,column:1,offset:0}),end:xe(x.length>0?x[x.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++V=x)return o.format(Math.round(n/x),l);return o.format(n,"second")}function de(t){if(!t.expires_at)return!1;const a=new Date(t.expires_at).getTime();return!Number.isNaN(a)&&aString(r).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}T${n(a.getHours())}:${n(a.getMinutes())}`}const me=t=>(t??"").startsWith("apikey-"),K=t=>t.key_name??t.id,xe=t=>t.id;function M({label:t,value:a,multiline:n=!1,fieldRef:r}){const d=i.useRef(null),o=r??d,[l,x]=i.useState(!1),[g,p]=i.useState(!1),c=async()=>{var m,y,h;(m=o.current)==null||m.focus(),(y=o.current)==null||y.select();try{if((h=navigator.clipboard)!=null&&h.writeText){await navigator.clipboard.writeText(a),x(!0),p(!1),window.setTimeout(()=>x(!1),2e3);return}}catch{}p(!0)},u="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(f,{size:"sm",variant:"outline",onPress:c,children:l?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:o,readOnly:!0,rows:a.split(` +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as i}from"./react-dgEcD0HR.js";import{c as Y,G as U,H as Q,J as X,P as Z,E as O,B as ee,K as te,u as V,I as se}from"./index-BTsnhpZj.js";import{u as ae,r as ne,B as re}from"./tableSelection-CojkFPwd.js";import{C as ie}from"./ConfirmDialog-WxOAhWT-.js";import{D as le}from"./DataTable-CrQq0sYf.js";import{F as A}from"./Field-DEJ6Wjg9.js";import{a as F,M as q}from"./ModelScopeControl-DeZ3FzjH.js";import{U as oe}from"./UserComboBox-nt7pHfqn.js";import{f as P,B as f,d as D}from"./heroui-DZj66Arc.js";function $(t){if(!t)return"—";const a=new Date(t);return Number.isNaN(a.getTime())?"—":a.toLocaleDateString()}function ce(t){if(!t)return null;const a=new Date(t).getTime();if(Number.isNaN(a))return null;const n=Math.round((a-Date.now())/1e3),r=Math.abs(n),d=[["day",86400],["hour",3600],["minute",60]],o=new Intl.RelativeTimeFormat(void 0,{numeric:"auto"});for(const[l,x]of d)if(r>=x)return o.format(Math.round(n/x),l);return o.format(n,"second")}function de(t){if(!t.expires_at)return!1;const a=new Date(t.expires_at).getTime();return!Number.isNaN(a)&&aString(r).padStart(2,"0");return`${a.getFullYear()}-${n(a.getMonth()+1)}-${n(a.getDate())}T${n(a.getHours())}:${n(a.getMinutes())}`}const me=t=>(t??"").startsWith("apikey-"),K=t=>t.key_name??t.id,xe=t=>t.id;function M({label:t,value:a,multiline:n=!1,fieldRef:r}){const d=i.useRef(null),o=r??d,[l,x]=i.useState(!1),[g,p]=i.useState(!1),c=async()=>{var m,y,h;(m=o.current)==null||m.focus(),(y=o.current)==null||y.select();try{if((h=navigator.clipboard)!=null&&h.writeText){await navigator.clipboard.writeText(a),x(!0),p(!1),window.setTimeout(()=>x(!1),2e3);return}}catch{}p(!0)},u="w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 font-mono text-xs text-[var(--otari-ink)]";return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),e.jsx(f,{size:"sm",variant:"outline",onPress:c,children:l?"Copied":"Copy"})]}),n?e.jsx("textarea",{ref:o,readOnly:!0,rows:a.split(` `).length,value:a,onFocus:m=>m.currentTarget.select(),className:`${u} resize-none whitespace-pre`}):e.jsx("input",{ref:o,readOnly:!0,value:a,onFocus:m=>m.currentTarget.select(),className:u}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-green-700",children:l?"Copied to clipboard.":""}),g?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function he({title:t,result:a,onClose:n}){const r=i.useRef(null),d=i.useRef(null),o=typeof window<"u"?window.location.origin:"",l=a.key;i.useEffect(()=>{var c,u;(c=d.current)==null||c.focus(),(u=d.current)==null||u.select()},[]);const x=c=>{var h;if(c.key!=="Tab")return;const u=(h=r.current)==null?void 0:h.querySelectorAll('button, input, textarea, a[href], [tabindex]:not([tabindex="-1"])');if(!u||u.length===0)return;const m=u[0],y=u[u.length-1];c.shiftKey&&document.activeElement===m?(c.preventDefault(),y.focus()):!c.shiftKey&&document.activeElement===y&&(c.preventDefault(),m.focus())},g=[`curl ${o}/v1/chat/completions \\`,` -H "Otari-Key: ${l}" \\`,' -H "Content-Type: application/json" \\',` -d '{"model": "your-model", "messages": [{"role": "user", "content": "Hello"}]}'`].join(` `),p=["from openai import OpenAI","",`client = OpenAI(base_url="${o}/v1", api_key="${l}")`,"resp = client.chat.completions.create(",' model="your-model",',' messages=[{"role": "user", "content": "Hello"}],',")","print(resp.choices[0].message.content)"].join(` `);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"presentation",children:e.jsxs("div",{ref:r,role:"dialog","aria-modal":"true","aria-labelledby":"reveal-title",onKeyDown:x,className:"flex max-h-[90vh] w-full max-w-2xl flex-col gap-4 overflow-y-auto rounded-xl bg-[var(--otari-surface)] p-6 shadow-xl",children:[e.jsx("h2",{id:"reveal-title",className:"text-lg font-semibold text-[var(--otari-ink)]",children:t}),e.jsx(se,{tone:"warning",children:"Copy this key now. For security it is shown only once and cannot be retrieved later. If you lose it, use Regenerate to issue a new secret."}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Model access: ",F(a.allowed_models).text,"."]}),e.jsx(M,{label:"Secret key",value:l,fieldRef:d}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Make your first call"}),e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Replace ",e.jsx("code",{children:"your-model"})," with a model from the Models page."]})]}),e.jsx(M,{label:"curl",value:g,multiline:!0}),e.jsx(M,{label:"Python (OpenAI SDK)",value:p,multiline:!0})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(f,{variant:"primary",onPress:n,children:"I’ve saved this key"})})]})})}function H({trigger:t,message:a,confirmLabel:n,isPending:r,onConfirm:d}){const[o,l]=i.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:a}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(f,{size:"sm",variant:"danger",isDisabled:r,onPress:d,children:n}),e.jsx(f,{size:"sm",variant:"ghost",isDisabled:r,onPress:()=>l(!1),children:"Cancel"})]})]}):e.jsx(f,{size:"sm",variant:"danger-soft",onPress:()=>l(!0),children:t})}function G({userId:t,users:a}){const n=t.trim();if(n==="")return e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Choose an owner above to see the models this key can inherit."});const r=a.find(l=>l.user_id===n);if(!r)return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["New user ",e.jsx("code",{children:n})," starts unrestricted, so this key may allow any model."]});const{text:d}=F(r.allowed_models),o=r.allowed_models&&r.allowed_models.length>0?r.allowed_models.join(", "):null;return e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Owner ",e.jsx("code",{children:n})," allows ",e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:d.toLowerCase()}),o?e.jsxs(e.Fragment,{children:[" (",e.jsx("span",{className:"font-mono",children:o}),")"]}):null,". This key inherits that, or narrows within it."]})}function J({checked:t,onChange:a}){return e.jsxs("label",{className:"flex items-start gap-2 rounded-lg border border-[var(--otari-line)] p-3 text-sm",children:[e.jsx("input",{type:"checkbox",checked:t,onChange:n=>a(n.target.checked),className:"mt-0.5 h-4 w-4 accent-[var(--otari-brand)]","aria-label":"Exempt this key from budget"}),e.jsxs("span",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:"Exempt from budget"}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Requests on this key are logged with their cost but never counted toward the owner's budget or spend, and never blocked by it."})]})]})}function fe({onClose:t,onCreated:a}){const n=te(),r=V(),[d,o]=i.useState(""),[l,x]=i.useState(""),[g,p]=i.useState(!1),[c,u]=i.useState(""),[m,y]=i.useState(null),[h,N]=i.useState(!1),[v,I]=i.useState(!0),C=l!==""&&new Date(l).getTime(){if(n.isPending||!v||w)return;const b={key_name:d.trim()||null,user_id:c.trim(),expires_at:l?new Date(l).toISOString():null,allowed_models:m,exclude_from_budget:h};n.mutate(b,{onSuccess:j=>{a(j),t()}})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create API key"}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot",autoFocus:!0,description:"A label to recognize this key later."}),e.jsx(A,{label:"Expires (optional)",value:l,onChange:x,type:"datetime-local",description:C?e.jsx("span",{className:"text-red-700",children:"That time is in the past; the key would be rejected immediately."}):"Leave blank for a key that never expires."})]}),e.jsx(oe,{value:c,onChange:u,users:r.data??[]}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>p(b=>!b),children:g?"Hide advanced":"Advanced"}),g?e.jsxs("div",{className:"flex flex-col gap-4 rounded-lg border border-[var(--otari-line)] p-4",children:[e.jsx(G,{userId:c,users:r.data??[]}),e.jsx(q,{title:"Restrict this key's models",description:"By default this key inherits its owner's access. Optionally narrow it to a subset; a key can never exceed its owner's allowed models.",anyLabel:"Inherit owner access",initial:null,onChange:(b,j)=>{y(b),I(j)}}),e.jsx(J,{checked:h,onChange:N})]}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!v||w,onPress:S,children:n.isPending?"Creating…":"Create key"}),e.jsx(f,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ge({apiKey:t,onClose:a}){const n=U(),r=V(),[d,o]=i.useState(t.key_name??""),[l,x]=i.useState(ue(t.expires_at)),[g,p]=i.useState(t.allowed_models),[c,u]=i.useState(t.exclude_from_budget),[m,y]=i.useState(!0),h=()=>{n.isPending||!m||n.mutate({id:t.id,body:{key_name:d.trim()||null,expires_at:l?new Date(l).toISOString():null,allowed_models:g,exclude_from_budget:c}},{onSuccess:a})};return e.jsx(D,{children:e.jsxs(D.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.key_name??t.id})]}),e.jsx(O,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(A,{label:"Name",value:d,onChange:o,placeholder:"ci-bot"}),e.jsx(A,{label:"Expires",value:l,onChange:x,type:"datetime-local",description:"Blank clears the expiry."})]}),t.user_id?e.jsx(G,{userId:t.user_id,users:r.data??[]}):null,e.jsx(q,{title:"Restrict this key's models",description:"This key inherits its owner's access by default. Narrow it to a subset here; it can never exceed the owner's allowed models.",anyLabel:"Inherit owner access",initial:t.allowed_models,onChange:(N,v)=>{p(N),y(v)}}),e.jsx(J,{checked:c,onChange:u}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{variant:"primary",isDisabled:n.isPending||!m,onPress:h,children:n.isPending?"Saving…":"Save changes"}),e.jsx(f,{variant:"ghost",onPress:a,children:"Cancel"})]})]})})}function pe({apiKey:t}){return t.is_active?de(t)?e.jsx(P,{size:"sm",color:"warning",children:"Expired"}):e.jsx(P,{size:"sm",color:"accent",children:"Active"}):e.jsx(P,{size:"sm",color:"default",children:"Disabled"})}function ye({allowed:t}){const{text:a,tone:n}=F(t),r=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",d=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${r}`,title:d,children:a})}function Ae(){const t=Y(),a=U(),n=Q(),r=X(),[d,o]=i.useState(!1),[l,x]=i.useState(null),[g,p]=i.useState(null),c=t.data??[],u=t.isLoading,m=c.find(s=>s.id===l)??null,y=!u&&c.length===0&&!d,h=ae(),[N,v]=i.useState(!1),[I,C]=i.useState(void 0),[w,S]=i.useState(!1),b=c.map(s=>s.id),j=ne(h.selectedKeys,b),E=c.filter(s=>j.includes(s.id)),z=i.useCallback((s,k)=>a.mutate({id:s.id,body:{is_active:k}}),[a.mutate]),L=i.useCallback(s=>n.mutate(s.id,{onSuccess:k=>p({title:`New secret for ${K(s)}`,result:k})}),[n.mutate]),R=async(s,k,T)=>{S(!0),C(void 0);try{for(const B of s)await k(B);h.clear(),T==null||T()}catch(B){C(B)}finally{S(!1)}},W=i.useMemo(()=>[{id:"name",header:"Name",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"font-medium text-[var(--otari-ink)]",children:s.key_name??e.jsx("span",{className:"text-[var(--otari-muted)]",children:"(unnamed)"})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx(ye,{allowed:s.allowed_models}),s.exclude_from_budget?e.jsx("span",{className:"inline-flex items-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-brand-tint)] px-2 py-0.5 text-xs font-medium text-[var(--otari-brand-dark)]",title:"Requests on this key are logged with cost but never counted toward budget",children:"Budget-exempt"}):null]})]})},{id:"status",header:"Status",cell:s=>e.jsx(pe,{apiKey:s})},{id:"owner",header:"Owner",cell:s=>me(s.user_id)?e.jsx(P,{size:"sm",color:"default",children:"virtual"}):e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.user_id??"—"})},{id:"key",header:"Key",cell:s=>e.jsx("code",{className:"text-xs text-[var(--otari-muted)]",children:s.key_prefix?`${s.key_prefix}…`:"—"})},{id:"created",header:"Created",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:$(s.created_at)})},{id:"last_used",header:"Last used",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:ce(s.last_used_at)??"never"})},{id:"expires",header:"Expires",cell:s=>e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.expires_at?new Date(s.expires_at).toLocaleString():void 0,children:s.expires_at?$(s.expires_at):"never"})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:a.isPending,onPress:()=>z(s,!s.is_active),children:s.is_active?"Disable":"Enable"}),e.jsx(f,{size:"sm",variant:"ghost",onPress:()=>{o(!1),x(s.id)},children:"Edit"}),e.jsx(H,{trigger:"Regenerate",confirmLabel:"Regenerate",isPending:n.isPending,message:e.jsxs(e.Fragment,{children:["Regenerate the secret for ",e.jsx("strong",{children:K(s)}),"? The current secret stops working immediately, with no grace period."]}),onConfirm:()=>L(s)}),s.is_active?null:e.jsx(H,{trigger:"Delete",confirmLabel:"Delete permanently",isPending:r.isPending,message:e.jsxs(e.Fragment,{children:["Permanently delete ",e.jsx("strong",{children:K(s)}),"? This removes the key and unlinks its usage history. Cannot be undone."]}),onConfirm:()=>r.mutate(s.id)})]})}],[a.isPending,n.isPending,r.isPending,r.mutate,z,L]),_=E.filter(s=>!s.is_active);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Z,{title:"API keys",description:"Issue and revoke the keys that authenticate callers to this gateway. Secrets are shown once at creation.",action:d?null:e.jsx(f,{variant:"primary",onPress:()=>{x(null),o(!0)},children:"Create key"})}),e.jsx(O,{error:t.error??a.error??n.error??r.error}),y?e.jsx(ee,{title:"No API keys yet",description:"An API key authenticates callers to this gateway. Create one to make your first request; the secret is shown once, so keep it somewhere safe.",actionLabel:"Create your first key",onAction:()=>{x(null),o(!0)}}):null,d?e.jsx(fe,{onClose:()=>o(!1),onCreated:s=>p({title:"API key created",result:s})}):null,m?e.jsx(ge,{apiKey:m,onClose:()=>x(null)},m.id):null,j.length>0?e.jsxs(re,{selectedCount:j.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:h.clear,children:[e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{is_active:!1}})),children:"Disable"}),e.jsx(f,{size:"sm",variant:"outline",isDisabled:w,onPress:()=>void R(E,s=>a.mutateAsync({id:s.id,body:{exclude_from_budget:!0}})),children:"Budget-exempt"}),e.jsx(f,{size:"sm",variant:"danger",isDisabled:_.length===0,onPress:()=>v(!0),children:"Delete"})]}):null,y?null:e.jsx(le,{ariaLabel:"API keys",columns:W,rows:c,getRowKey:xe,isLoading:u,emptyContent:"No API keys yet. Create one to authenticate a caller.",selectionMode:"multiple",selectedKeys:h.selectedKeys,onSelectionChange:h.onSelectionChange}),e.jsx(ie,{isOpen:N,onOpenChange:v,heading:"Delete API keys",body:`Permanently delete ${_.length} disabled ${_.length===1?"key":"keys"}? This removes them and unlinks their usage history. Cannot be undone. Active keys in the selection are skipped; disable them first.`,confirmLabel:"Delete permanently",isPending:w,error:I,onConfirm:()=>void R(_,s=>r.mutateAsync(s.id),()=>v(!1))}),g?e.jsx(he,{title:g.title,result:g.result,onClose:()=>{p(null),n.reset()}}):null]})}export{Ae as KeysPage}; diff --git a/src/gateway/static/dashboard/assets/ModelScopeControl-wPC6RjBJ.js b/src/gateway/static/dashboard/assets/ModelScopeControl-DeZ3FzjH.js similarity index 98% rename from src/gateway/static/dashboard/assets/ModelScopeControl-wPC6RjBJ.js rename to src/gateway/static/dashboard/assets/ModelScopeControl-DeZ3FzjH.js index cf2f53b71..fdf0bc31d 100644 --- a/src/gateway/static/dashboard/assets/ModelScopeControl-wPC6RjBJ.js +++ b/src/gateway/static/dashboard/assets/ModelScopeControl-DeZ3FzjH.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{Z as A,o as $,p as P}from"./index-DMrbj_xn.js";import{C as d,I as R,a as T,b as V}from"./heroui-DZj66Arc.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function W({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function X(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{W as M,X as a}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as n}from"./react-dgEcD0HR.js";import{Z as A,o as $,p as P}from"./index-BTsnhpZj.js";import{C as d,I as R,a as T,b as V}from"./heroui-DZj66Arc.js";function q(r){return r===null?"any":r.length===0?"block":"only"}const O=50;function W({initial:r,onChange:m,title:N="Model access",description:w,anyLabel:C="Any model"}){const x=A(),u=$(),v=P(),[i,S]=n.useState(q(r)),[a,g]=n.useState(r??[]),[p,y]=n.useState(""),f=n.useMemo(()=>{var j,k;const e=new Set,s=[],l=(o,c)=>{o&&!e.has(o)&&(e.add(o),s.push({id:o,label:c}))};for(const o of((j=x.data)==null?void 0:j.providers)??[])l(`${o.instance}:*`,`${o.instance}:* · all ${o.instance} models`);for(const o of((k=u.data)==null?void 0:k.providers)??[])for(const c of o.models)l(c.key,c.key);for(const o of v.data??[])l(o.target,`${o.name} · alias`);return s},[x.data,u.data,v.data]),L=n.useMemo(()=>{const e=p.trim().toLowerCase();return f.filter(s=>!a.includes(s.id)).filter(s=>!e||s.id.toLowerCase().includes(e)||s.label.toLowerCase().includes(e)).slice(0,O)},[f,a,p]),h=(e,s)=>{e==="any"?m(null,!0):e==="block"?m([],!0):m(s,s.length>0)},B=e=>{S(e),h(e,a)},M=e=>{const s=a.includes(e)?a:[...a,e];g(s),y(""),h("only",s)},E=e=>{const s=a.filter(l=>l!==e);g(s),h("only",s)},b=(e,s)=>t.jsx("button",{type:"button","aria-pressed":i===e,onClick:()=>B(e),className:i===e?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:s}),I=!u.isLoading&&!x.isLoading&&f.length===0;return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:N}),t.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:w??"Which models this key may list and call. The master key is never restricted, so blocking a key cannot lock you out of the dashboard."})]}),t.jsxs("div",{className:"flex w-fit items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[b("any",C),b("only","Only selected"),b("block","Block all")]}),i==="block"?t.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["Blocked from ",t.jsx("strong",{children:"every"})," model until you change this access."]}):null,i==="only"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.length===0?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Pick at least one model below, or choose “Block all”."}):a.map(e=>t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[var(--otari-brand-tint)] px-2.5 py-1 font-mono text-xs text-[var(--otari-brand-dark)]",children:[e,t.jsx("button",{type:"button","aria-label":`Remove ${e}`,onClick:()=>E(e),className:"text-[var(--otari-brand-dark)] hover:text-red-700",children:"×"})]},e))}),I?t.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"No providers or models discovered yet. Configure a provider first, then scope this key."}):t.jsxs(d.Root,{allowsEmptyCollection:!0,menuTrigger:"input",inputValue:p,onInputChange:y,selectedKey:null,onSelectionChange:e=>{e!=null&&M(String(e))},className:"flex max-w-md flex-col gap-1",children:[t.jsxs(d.InputGroup,{children:[t.jsx(R,{"aria-label":"Add a model",placeholder:"Search providers, models, aliases…",autoComplete:"off"}),t.jsx(d.Trigger,{})]}),t.jsx(d.Popover,{children:t.jsx(T,{items:L,className:"max-h-72 overflow-auto",children:e=>t.jsx(V,{id:e.id,textValue:e.label,children:e.label})})})]})]}):null]})}function X(r){return r===null?{text:"All models",tone:"muted"}:r.length===0?{text:"No models",tone:"danger"}:{text:"Selected models",tone:"normal"}}export{W as M,X as a}; diff --git a/src/gateway/static/dashboard/assets/ModelsPage-CH43id2j.js b/src/gateway/static/dashboard/assets/ModelsPage-NAEvt-Hx.js similarity index 99% rename from src/gateway/static/dashboard/assets/ModelsPage-CH43id2j.js rename to src/gateway/static/dashboard/assets/ModelsPage-NAEvt-Hx.js index 605885242..544a8c3a2 100644 --- a/src/gateway/static/dashboard/assets/ModelsPage-CH43id2j.js +++ b/src/gateway/static/dashboard/assets/ModelsPage-NAEvt-Hx.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as gt,u as vt,r as c}from"./react-dgEcD0HR.js";import{L as _t,M as bt,o as jt,O as yt,Q as je,P as Pt,E as Nt,F as B,I as St,S as se,T as Re,s as we,U as be,V as Ct,W as kt,X as E}from"./index-DMrbj_xn.js";import{u as Mt,r as Wt,B as Tt}from"./tableSelection-CojkFPwd.js";import{D as It}from"./DataTable-CrQq0sYf.js";import{T as Lt,S as $t}from"./TablePagination-D_2uYqKa.js";import{B as $,d as ae,f as V}from"./heroui-DZj66Arc.js";function Oe(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function At(t,i=Date.now()){const r=new Map;for(const n of t){const l=r.get(n.model_key)??[];l.push(n),r.set(n.model_key,l)}const a=[];for(const n of r.values()){const l=[...n].sort((p,u)=>Date.parse(p.effective_at)-Date.parse(u.effective_at)),m=[...l].reverse().find(p=>Date.parse(p.effective_at)<=i);a.push(m??l[0])}return a.sort((n,l)=>n.model_key.localeCompare(l.model_key))}const Et="otari",De=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],Ot=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Fe={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Dt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],Ft=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Bt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],Kt=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Rt=1440*60*1e3,wt=t=>t.key;function Be(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function Ke(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const a=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,l)=>l.min_input_tokens-n.min_input_tokens)[0];return a?{inputPrice:a.input_price_per_million??r.inputPrice,outputPrice:a.output_price_per_million??r.outputPrice,cacheReadPrice:a.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:a.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:a.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ce(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function z(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function Y(t){return t.trim()===""?null:Number(t)}function ze(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Ve(t){const i=new Set;return t.every(r=>{const a=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(l=>l.trim()!=="");return!Number.isInteger(a)||a<=0||i.has(a)||!n?!1:(i.add(a),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(z))})}function Ye(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function b({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:a=>i(a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function qe({tiers:t,onChange:i}){const r=(n,l,m)=>{i(t.map(p=>p.id===n?{...p,[l]:m}:p))},a=()=>{const n=t.reduce((l,m)=>Math.max(l,m.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx($,{size:"sm",variant:"outline",onPress:a,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:l=>r(n.id,"minInputTokens",l.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(b,{value:n.input,onChange:l=>r(n.id,"input",l),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(b,{value:n.output,onChange:l=>r(n.id,"output",l),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(b,{value:n.cacheRead,onChange:l=>r(n.id,"cacheRead",l),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(b,{value:n.cacheWrite,onChange:l=>r(n.id,"cacheWrite",l),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(b,{value:n.cacheWrite1h,onChange:l=>r(n.id,"cacheWrite1h",l),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(l=>l.id!==n.id)),children:"Remove"})]},n.id))]})}function zt({source:t}){return t==="configured"?e.jsx(V,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(V,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function oe({label:t,tone:i="info",children:r}){const a=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":a,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:a,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Vt(){const t=kt();return t.data?t.data.default_pricing?e.jsx(oe,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(oe,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function le({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Yt({row:t}){const i=je(),r=Re(),[a,n]=c.useState(!1),[l,m]=c.useState(""),[p,u]=c.useState(""),[P,j]=c.useState(""),[k,I]=c.useState(""),[y,h]=c.useState(""),[N,O]=c.useState([]),S=()=>{m(t.inputPrice==null?"":String(t.inputPrice)),u(t.outputPrice==null?"":String(t.outputPrice)),j(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),I(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),h(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),O(ze(t.pricingTiers)),n(!0)},Q=ce(l)&&ce(p)&&z(P)&&z(k)&&z(y)&&Ve(N),W=()=>{Q&&i.mutate({model_key:t.key,input_price_per_million:Number(l),output_price_per_million:Number(p),cache_read_price_per_million:Y(P),cache_write_price_per_million:Y(k),cache_write_1h_price_per_million:Y(y),pricing_tiers:Ye(N)},{onSuccess:()=>n(!1)})};return a?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(b,{value:l,onChange:m,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(b,{value:p,onChange:u,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(b,{value:P,onChange:j,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(b,{value:k,onChange:I,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(b,{value:y,onChange:h,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(qe,{tiers:N,onChange:O}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:"sm",variant:"primary",isDisabled:i.isPending||!Q,onPress:W,children:"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:be(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${E(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${E(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${E(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${E(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${E(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx($,{size:"sm",variant:"outline",onPress:S,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(we,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error)}):null]})]})}function qt({row:t,metadata:i,metadataAvailable:r,onMakeAlias:a,onClose:n}){const l=(i==null?void 0:i.input_modalities)??[],m=(i==null?void 0:i.output_modalities)??[],p=Ot.filter(({key:u})=>i==null?void 0:i[u]);return e.jsx(ae,{children:e.jsxs(ae.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(V,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(le,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Yt,{row:t},t.key),e.jsx($,{size:"sm",variant:"outline",onPress:()=>a(t.key),children:"Make an alias"})]}),e.jsxs(le,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:se(t.contextWindow)}),e.jsx(T,{label:"Max output",value:se((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:Ct(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(le,{title:"Modalities",children:l.length===0&&m.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),l.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),m.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]})]})}),e.jsx(le,{title:"Capabilities",children:p.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(({key:u,label:P})=>e.jsx(V,{size:"sm",color:"default",children:P},u))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Ut=15;function Ht({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:a=>i(a.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}const Ue="otari.dashboard.modelsSort",_e={col:"model",dir:"asc"},Gt=["model","released","input","output"];function Jt(){if(typeof window>"u")return _e;try{const t=window.localStorage.getItem(Ue);if(!t)return _e;const i=JSON.parse(t);if(Gt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return _e}function Xt({row:t,onClose:i}){const r=je(),a=Re(),[n,l]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[m,p]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[u,P]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[j,k]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[I,y]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[h,N]=c.useState(ze(t.pricingTiers)),O=ce(n)&&ce(m)&&z(u)&&z(j)&&z(I)&&Ve(h),S=()=>{O&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(m),cache_read_price_per_million:Y(u),cache_write_price_per_million:Y(j),cache_write_1h_price_per_million:Y(I),pricing_tiers:Ye(h)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(b,{value:n,onChange:l,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(b,{value:m,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(b,{value:u,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(b,{value:j,onChange:k,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(b,{value:I,onChange:y,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx($,{size:"sm",variant:"primary",isDisabled:r.isPending||!O,onPress:S,children:r.isPending?"Saving…":"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(we,{confirmLabel:"Reset",isPending:a.isPending,onConfirm:()=>a.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||a.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error??a.error)}):null]}),e.jsx(qe,{tiers:h,onChange:N})]})}function Qt({primary:t,secondary:i,rowKey:r,primaryLabel:a,secondaryLabel:n,onEdit:l}){const m=(p,u)=>e.jsx("button",{type:"button","aria-label":`Edit ${u} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:P=>{P.stopPropagation(),l()},children:p==null?"—":E(p)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[m(t,a),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),m(i,n)]})}function Zt({rates:t,rowKey:i,onEdit:r}){const a=[t.cacheReadPrice==null?null:`R ${E(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${E(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${E(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:a.length>0?a.join(" · "):"Input-rate fallback"})}function ei({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,l)=>n.min_input_tokens-l.min_input_tokens).map(n=>se(n.min_input_tokens)),a=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:a})}function ti({rows:t,isLoading:i,empty:r,sortDescriptor:a,onSortChange:n,selectedKey:l,onSelect:m,onEditPricing:p,comparisonContextTokens:u,selectedKeys:P,onSelectionChange:j}){const k=c.useMemo(()=>{const y=u==null?"Base":`at ${se(u)}`;return[{id:"model",header:"Model",isRowHeader:!0,allowsSorting:!0,cell:h=>e.jsxs("span",{className:"font-medium break-all",children:[h.model,e.jsx("span",{className:"sr-only",children:h.key})]})},{id:"provider",header:"Provider",cell:h=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:h.provider})},{id:"input",header:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[`${y} in / out $ / 1M`,e.jsx(Vt,{})]}),align:"end",allowsSorting:!0,cell:h=>{const N=Ke(h,u);return e.jsx(Qt,{primary:N.inputPrice,secondary:N.outputPrice,rowKey:h.key,primaryLabel:"input",secondaryLabel:"output",onEdit:()=>p(h.key)})}},{id:"caching",header:`Caching ${u==null?"policy":y}`,align:"end",cell:h=>e.jsx(Zt,{rates:Ke(h,u),rowKey:h.key,onEdit:()=>p(h.key)})},{id:"policy",header:"Pricing policy",align:"end",cell:h=>e.jsx(ei,{row:h,onEdit:()=>p(h.key)})}]},[u,p]),I=c.useCallback(y=>y.key===l?"bg-[var(--otari-brand-tint)]":void 0,[l]);return e.jsx(It,{ariaLabel:"Models",columns:k,rows:t,getRowKey:wt,isLoading:i,emptyContent:r,selectionMode:"multiple",selectedKeys:P,onSelectionChange:j,sortDescriptor:a,onSortChange:n,onRowAction:m,rowClassName:I})}function ii({providers:t}){if(t.length===0)return null;const i=t.filter(l=>!l.discovery_unsupported),r=t.filter(l=>l.discovery_unsupported),a=l=>l.map(m=>m.provider).join(", "),n=l=>l.length===1;return e.jsxs(St,{tone:"warning",children:[i.length>0?e.jsxs("span",{className:"block",children:["Could not list ",a(i),". Check ",n(i)?"that provider's":"those providers'"," ","credentials in config.yml; ",n(i)?"its":"their"," models are missing from the list below."]}):null,r.length>0?e.jsxs("span",{className:"block",children:[a(r)," ",n(r)?"does":"do"," not offer model discovery, so"," ",n(r)?"its":"their"," models are missing from the list below."," ",n(r)?"The provider":"They"," may still serve requests; declare the model ids"," ",n(r)?"it serves":"they serve"," under the ",e.jsx("code",{children:"models:"})," key in config.yml to list them here."]}):null]})}function pi(){var Ie,Le,$e;const t=gt(),[i]=vt(),r=_t(),a=bt(),n=jt(),l=yt(),m=je(),[p,u]=c.useState(""),[P,j]=c.useState(0),[k,I]=c.useState(Ut),[y,h]=c.useState(null),[N,O]=c.useState(null),[S,Q]=c.useState(Jt),W=Mt(),[He,ue]=c.useState(!1),[Ge,ye]=c.useState(!1),[Je,Pe]=c.useState(void 0);c.useEffect(()=>{try{window.localStorage.setItem(Ue,JSON.stringify(S))}catch{}},[S]);const[D,Ne]=c.useState(i.get("provider")||"all"),[K,Xe]=c.useState("all"),[q,Qe]=c.useState("all"),[U,Ze]=c.useState("all"),[de,et]=c.useState("0"),[Z,tt]=c.useState(""),[ee,it]=c.useState("all"),[pe,rt]=c.useState(""),F=((Ie=l.data)==null?void 0:Ie.models)??{},nt=((Le=l.data)==null?void 0:Le.available)??!1,Se=c.useMemo(()=>{var s;return new Set((((s=n.data)==null?void 0:s.providers)??[]).flatMap(x=>x.models.map(o=>o.key)))},[n.data]),lt=s=>{u(s),j(0)},R=s=>x=>{s(x),j(0)},te=c.useMemo(()=>{var M,v,_,A,L,w,Ae;const s=new Map(At(a.data??[]).map(d=>[d.model_key,d])),x=[],o=new Set,g=(d,ve,Ee,f)=>{if(o.has(d))return;o.add(d);const C=s.get(d);x.push({key:d,model:Be(ve,Ee),provider:Ee,isDiscovered:Se.has(d),contextWindow:(f==null?void 0:f.contextWindow)??null,inputPrice:C?C.input_price_per_million:(f==null?void 0:f.inputPrice)??null,outputPrice:C?C.output_price_per_million:(f==null?void 0:f.outputPrice)??null,cacheReadPrice:C?C.cache_read_price_per_million:(f==null?void 0:f.cacheReadPrice)??null,cacheWritePrice:C?C.cache_write_price_per_million:(f==null?void 0:f.cacheWritePrice)??null,cacheWrite1hPrice:C?C.cache_write_1h_price_per_million??null:(f==null?void 0:f.cacheWrite1hPrice)??null,pricingTiers:C?C.pricing_tiers??[]:(f==null?void 0:f.pricingTiers)??[],source:C?"configured":(f==null?void 0:f.source)??"none"})};for(const d of((M=r.data)==null?void 0:M.data)??[]){if(d.owned_by===Et)continue;const ve=d.pricing_source==="default"?"default":d.pricing?"configured":"none";g(d.id,d.id,d.owned_by||Oe(d.id),{key:d.id,model:d.id,provider:d.owned_by,contextWindow:d.context_window,inputPrice:((v=d.pricing)==null?void 0:v.input_price_per_million)??null,outputPrice:((_=d.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:((A=d.pricing)==null?void 0:A.cache_read_price_per_million)??null,cacheWritePrice:((L=d.pricing)==null?void 0:L.cache_write_price_per_million)??null,cacheWrite1hPrice:((w=d.pricing)==null?void 0:w.cache_write_1h_price_per_million)??null,pricingTiers:((Ae=d.pricing)==null?void 0:Ae.pricing_tiers)??[],source:ve})}for(const d of s.keys())g(d,d,Oe(d));return x},[r.data,a.data,Se]),Ce=c.useMemo(()=>new Map(te.map(s=>[s.key,s])),[te]),ie=c.useMemo(()=>{var o,g,M;const s=te.map(v=>{var _,A;return{...v,contextWindow:v.contextWindow??((_=F[v.key])==null?void 0:_.context_window)??null,releaseDate:((A=F[v.key])==null?void 0:A.release_date)??null}}),x=new Set(s.map(v=>v.key));for(const v of((o=n.data)==null?void 0:o.providers)??[])for(const _ of v.models)x.has(_.key)||(x.add(_.key),s.push({key:_.key,model:Be(_.key,v.provider),provider:v.provider,isDiscovered:!0,contextWindow:((g=F[_.key])==null?void 0:g.context_window)??null,releaseDate:((M=F[_.key])==null?void 0:M.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return s},[te,n.data,F]),st=((($e=n.data)==null?void 0:$e.providers)??[]).filter(s=>!s.ok),re=c.useMemo(()=>{const s=Array.from(new Set(ie.map(x=>x.provider))).sort((x,o)=>x.localeCompare(o));return[{value:"all",label:"All providers"},...s.map(x=>({value:x,label:x}))]},[ie]);c.useEffect(()=>{D==="all"||re.length<=1||re.some(s=>s.value===D)||Ne("all")},[re,D]);const H=p.trim().toLowerCase(),he=Number(de)||0,me=Z===""?Number.POSITIVE_INFINITY:Number(Z),at=pe===""?null:Number(pe),xe=ee==="all"?null:Date.now()-Number(ee)*Rt,G=c.useMemo(()=>{const s=o=>{if(H&&!o.key.toLowerCase().includes(H)&&!o.provider.toLowerCase().includes(H)||D!=="all"&&o.provider!==D||K==="configured"&&o.source!=="configured"||K==="default"&&o.source!=="default"||K==="priced"&&o.inputPrice==null||K==="unpriced"&&o.inputPrice!=null||q==="discovered"&&!o.isDiscovered||q==="custom"&&o.isDiscovered)return!1;if(U!=="all"){const g=De.find(v=>v.value===U),M=F[o.key];if(!g||!M||!g.test(M))return!1}if(he>0&&(o.contextWindow==null||o.contextWindowme))return!1;if(xe!=null){const g=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(g)||g{const M=S.dir==="asc"?1:-1;if(S.col==="model")return o.model.localeCompare(g.model)*M;if(S.col==="released"){const L=o.releaseDate??null,w=g.releaseDate??null;return!L&&!w?o.model.localeCompare(g.model):L?w?(Lw?1:0)*M||o.model.localeCompare(g.model):-1:1}const v=L=>S.col==="input"?L.inputPrice:L.outputPrice,_=v(o),A=v(g);return _==null&&A==null?o.model.localeCompare(g.model):_==null?1:A==null?-1:(_-A)*M||o.model.localeCompare(g.model)};return ie.filter(s).sort(x)},[ie,H,D,K,q,U,he,me,xe,F,S]),J=G.length,ct=Math.max(1,Math.ceil(J/k)),ke=Math.min(P,ct-1),Me=ke*k,fe=G.slice(Me,Me+k),ot={column:S.col,direction:S.dir==="asc"?"ascending":"descending"},ut=s=>{Q({col:String(s.column),dir:s.direction==="ascending"?"asc":"desc"}),j(0)},dt=c.useCallback(s=>h(x=>x===s?null:s),[]),ge=fe.map(s=>s.key),X=Wt(W.selectedKeys,ge),pt=ge.length>0&&X.length===ge.length&&J>X.length,ht=W.allMatching?G.map(s=>s.key):X,We=W.allMatching?J:X.length,Te=y?G.find(s=>s.key===y)??Ce.get(y)??null:null,mt=async s=>{ye(!0),Pe(void 0);try{for(const x of ht)await m.mutateAsync({model_key:x,input_price_per_million:s.input_price_per_million,output_price_per_million:s.output_price_per_million,cache_read_price_per_million:s.cache_read_price_per_million??null,cache_write_price_per_million:s.cache_write_price_per_million??null,cache_write_1h_price_per_million:null,pricing_tiers:[]});W.clear(),ue(!1)}catch(x){Pe(x)}finally{ye(!1)}},xt=r.isLoading||a.isLoading||n.isLoading,ft=H!==""||D!=="all"||K!=="all"||q!=="all"||U!=="all"||de!=="0"||Z!==""||ee!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",ne=N?G.find(s=>s.key===N)??Ce.get(N)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Pt,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(Nt,{error:r.error??a.error??n.error??l.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${ne?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ht,{value:p,onChange:lt,placeholder:"Search models…"}),e.jsx(B,{ariaLabel:"Filter by provider",value:D,onChange:R(Ne),options:re}),e.jsx(B,{ariaLabel:"Filter by pricing",value:K,onChange:R(Xe),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(B,{ariaLabel:"Filter by source",value:q,onChange:R(Qe),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(B,{ariaLabel:"Filter by capability",value:U,onChange:R(Ze),options:[{value:"all",label:"Any capability"},...De.map(s=>({value:s.value,label:s.label}))]}),e.jsx(B,{ariaLabel:"Minimum context window",value:de,onChange:R(et),options:Dt}),e.jsx(B,{ariaLabel:"Maximum input price",value:Z,onChange:R(tt),options:Ft}),e.jsx(B,{ariaLabel:"Compare prices at context",value:pe,onChange:rt,options:Bt}),e.jsx(B,{ariaLabel:"Filter by release date",value:ee,onChange:R(it),options:Kt})]}),e.jsx(ii,{providers:st}),X.length>0?e.jsx(Tt,{selectedCount:We,allMatching:W.allMatching,matchingTotal:J,canSelectAllMatching:pt,onSelectAllMatching:W.enableAllMatching,onClear:W.clear,children:e.jsx($,{size:"sm",variant:"primary",onPress:()=>ue(!0),children:"Set pricing"})}):null,e.jsx(ti,{rows:fe,isLoading:xt,empty:ft,sortDescriptor:ot,onSortChange:ut,selectedKey:N,onSelect:O,onEditPricing:dt,comparisonContextTokens:at,selectedKeys:W.selectedKeys,onSelectionChange:W.onSelectionChange}),Te?e.jsx(ae,{children:e.jsxs(ae.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Edit pricing"}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>h(null),children:"Close"})]}),e.jsx(Xt,{row:Te,onClose:()=>h(null)})]})}):null,e.jsx(Lt,{page:ke,pageSize:k,total:J,rowsOnPage:fe.length,onPageChange:j,onPageSizeChange:s=>{I(s),j(0)},pageSizeOptions:[15,25,50]})]}),ne?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(qt,{row:ne,metadata:F[ne.key],metadataAvailable:nt,onMakeAlias:s=>t(`/aliases?target=${encodeURIComponent(s)}`),onClose:()=>O(null)})}):null]}),e.jsx($t,{isOpen:He,onOpenChange:ue,targetCount:We,isPending:Ge,error:Je,onSubmit:mt,title:"Set pricing",description:s=>`Apply these per-1M rates to ${s.toLocaleString()} selected ${s===1?"model":"models"}. This replaces each model's price; pricing tiers and the 1h cache rate are cleared. Edit a single model for tiers.`})]})}export{pi as ModelsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{i as gt,u as vt,r as c}from"./react-dgEcD0HR.js";import{L as _t,M as bt,o as jt,O as yt,Q as je,P as Pt,E as Nt,F as B,I as St,S as se,T as Re,s as we,U as be,V as Ct,W as kt,X as E}from"./index-BTsnhpZj.js";import{u as Mt,r as Wt,B as Tt}from"./tableSelection-CojkFPwd.js";import{D as It}from"./DataTable-CrQq0sYf.js";import{T as Lt,S as $t}from"./TablePagination-Yoj0U_GE.js";import{B as $,d as ae,f as V}from"./heroui-DZj66Arc.js";function Oe(t){const i=t.indexOf(":");return i>0?t.slice(0,i):"—"}function At(t,i=Date.now()){const r=new Map;for(const n of t){const l=r.get(n.model_key)??[];l.push(n),r.set(n.model_key,l)}const a=[];for(const n of r.values()){const l=[...n].sort((p,u)=>Date.parse(p.effective_at)-Date.parse(u.effective_at)),m=[...l].reverse().find(p=>Date.parse(p.effective_at)<=i);a.push(m??l[0])}return a.sort((n,l)=>n.model_key.localeCompare(l.model_key))}const Et="otari",De=[{value:"vision",label:"Vision",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("image")},{value:"tool_call",label:"Tool calling",test:t=>!!t.tool_call},{value:"reasoning",label:"Reasoning",test:t=>!!t.reasoning},{value:"structured_output",label:"Structured output",test:t=>!!t.structured_output},{value:"attachment",label:"Attachments",test:t=>!!t.attachment},{value:"audio",label:"Audio",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("audio")},{value:"pdf",label:"PDF",test:t=>Array.isArray(t.input_modalities)&&t.input_modalities.includes("pdf")}],Ot=[{key:"reasoning",label:"Reasoning"},{key:"tool_call",label:"Tool calling"},{key:"structured_output",label:"Structured output"},{key:"attachment",label:"Attachments"},{key:"temperature",label:"Temperature"}],Fe={text:"Text",image:"Image",audio:"Audio",video:"Video",pdf:"PDF"},Dt=[{value:"0",label:"Any context"},{value:"8000",label:"≥ 8K"},{value:"32000",label:"≥ 32K"},{value:"128000",label:"≥ 128K"},{value:"200000",label:"≥ 200K"},{value:"1000000",label:"≥ 1M"}],Ft=[{value:"",label:"Any price"},{value:"1",label:"≤ $1 / 1M in"},{value:"3",label:"≤ $3 / 1M in"},{value:"10",label:"≤ $10 / 1M in"},{value:"30",label:"≤ $30 / 1M in"}],Bt=[{value:"",label:"Base prices"},{value:"8000",label:"Compare at 8K"},{value:"128000",label:"Compare at 128K"},{value:"200000",label:"Compare at 200K"},{value:"500000",label:"Compare at 500K"},{value:"1000000",label:"Compare at 1M"}],Kt=[{value:"all",label:"Any release date"},{value:"365",label:"Past year"},{value:"730",label:"Past 2 years"},{value:"1095",label:"Past 3 years"}],Rt=1440*60*1e3,wt=t=>t.key;function Be(t,i){const r=`${i}:`;return t.startsWith(r)?t.slice(r.length):t}function Ke(t,i){const r={inputPrice:t.inputPrice,outputPrice:t.outputPrice,cacheReadPrice:t.cacheReadPrice,cacheWritePrice:t.cacheWritePrice,cacheWrite1hPrice:t.cacheWrite1hPrice};if(i==null)return r;const a=t.pricingTiers.filter(n=>n.min_input_tokens<=i).sort((n,l)=>l.min_input_tokens-n.min_input_tokens)[0];return a?{inputPrice:a.input_price_per_million??r.inputPrice,outputPrice:a.output_price_per_million??r.outputPrice,cacheReadPrice:a.cache_read_price_per_million??r.cacheReadPrice,cacheWritePrice:a.cache_write_price_per_million??r.cacheWritePrice,cacheWrite1hPrice:a.cache_write_1h_price_per_million??r.cacheWrite1hPrice}:r}function ce(t){const i=Number(t);return t.trim()!==""&&Number.isFinite(i)&&i>=0}function z(t){if(t.trim()==="")return!0;const i=Number(t);return Number.isFinite(i)&&i>=0}function Y(t){return t.trim()===""?null:Number(t)}function ze(t){return t.map((i,r)=>({id:r,minInputTokens:String(i.min_input_tokens),input:i.input_price_per_million==null?"":String(i.input_price_per_million),output:i.output_price_per_million==null?"":String(i.output_price_per_million),cacheRead:i.cache_read_price_per_million==null?"":String(i.cache_read_price_per_million),cacheWrite:i.cache_write_price_per_million==null?"":String(i.cache_write_price_per_million),cacheWrite1h:i.cache_write_1h_price_per_million==null?"":String(i.cache_write_1h_price_per_million)}))}function Ve(t){const i=new Set;return t.every(r=>{const a=Number(r.minInputTokens),n=[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].some(l=>l.trim()!=="");return!Number.isInteger(a)||a<=0||i.has(a)||!n?!1:(i.add(a),[r.input,r.output,r.cacheRead,r.cacheWrite,r.cacheWrite1h].every(z))})}function Ye(t){return t.map(i=>({min_input_tokens:Number(i.minInputTokens),...i.input.trim()===""?{}:{input_price_per_million:Number(i.input)},...i.output.trim()===""?{}:{output_price_per_million:Number(i.output)},...i.cacheRead.trim()===""?{}:{cache_read_price_per_million:Number(i.cacheRead)},...i.cacheWrite.trim()===""?{}:{cache_write_price_per_million:Number(i.cacheWrite)},...i.cacheWrite1h.trim()===""?{}:{cache_write_1h_price_per_million:Number(i.cacheWrite1h)}}))}function b({value:t,onChange:i,ariaLabel:r}){return e.jsx("input",{type:"number",step:"any",min:"0",inputMode:"decimal","aria-label":r,value:t,onChange:a=>i(a.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})}function qe({tiers:t,onChange:i}){const r=(n,l,m)=>{i(t.map(p=>p.id===n?{...p,[l]:m}:p))},a=()=>{const n=t.reduce((l,m)=>Math.max(l,m.id),-1)+1;i([...t,{id:n,minInputTokens:"128000",input:"",output:"",cacheRead:"",cacheWrite:"",cacheWrite1h:""}])};return e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-[var(--otari-line)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium text-[var(--otari-ink)]",children:"Long-context price tiers"}),e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"At a threshold, listed rates replace the base rate for the whole request."})]}),e.jsx($,{size:"sm",variant:"outline",onPress:a,children:"Add tier"})]}),t.map(n=>e.jsxs("div",{className:"flex flex-wrap items-end gap-2 border-t border-[var(--otari-line)] pt-2",children:[e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Context ≥ tokens",e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":"Tier context threshold",value:n.minInputTokens,onChange:l=>r(n.id,"minInputTokens",l.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Input",e.jsx(b,{value:n.input,onChange:l=>r(n.id,"input",l),ariaLabel:"Tier input price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Output",e.jsx(b,{value:n.output,onChange:l=>r(n.id,"output",l),ariaLabel:"Tier output price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache read",e.jsx(b,{value:n.cacheRead,onChange:l=>r(n.id,"cacheRead",l),ariaLabel:"Tier cache read price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["Cache write",e.jsx(b,{value:n.cacheWrite,onChange:l=>r(n.id,"cacheWrite",l),ariaLabel:"Tier cache write price"})]}),e.jsxs("label",{className:"flex flex-col gap-1 text-xs text-[var(--otari-muted)]",children:["1h write",e.jsx(b,{value:n.cacheWrite1h,onChange:l=>r(n.id,"cacheWrite1h",l),ariaLabel:"Tier 1 hour cache write price"})]}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>i(t.filter(l=>l.id!==n.id)),children:"Remove"})]},n.id))]})}function zt({source:t}){return t==="configured"?e.jsx(V,{size:"sm",color:"default",children:"configured"}):t==="default"||t==="alias"?e.jsx(V,{size:"sm",color:"accent",children:t}):e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not priced"})}function oe({label:t,tone:i="info",children:r}){const a=c.useId();return e.jsxs("span",{className:"group relative inline-flex items-center font-normal normal-case",children:[e.jsx("button",{type:"button","aria-label":t,"aria-describedby":a,className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] leading-none ${i==="warning"?"border-[#c2843a] text-[#b45309]":"border-[var(--otari-line)] text-[var(--otari-muted)] hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand)]"}`,children:"i"}),e.jsx("span",{id:a,role:"tooltip",className:"pointer-events-none absolute top-full right-0 z-20 mt-1.5 w-72 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-surface)] px-3 py-2 text-left text-xs font-normal whitespace-normal break-words text-[var(--otari-ink)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:r})]})}function Vt(){const t=kt();return t.data?t.data.default_pricing?e.jsx(oe,{label:"How unpriced models are metered",tone:"info",children:"Default pricing is on: models without a configured price are metered using community-maintained rates (the bundled genai-prices dataset). Set a price to override the fallback."}):e.jsxs(oe,{label:"How unpriced models are metered",tone:"warning",children:["Default pricing is off: only models with a configured price are metered.",t.data.require_pricing?" Requests for any other model are rejected (HTTP 402) because require_pricing is on.":" Other models are served without cost tracking."]}):null}function T({label:t,value:i}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:t}),e.jsx("span",{className:"text-right text-sm text-[var(--otari-ink)] tabular-nums",children:i})]})}function le({title:t,children:i}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-[var(--otari-muted)]",children:t}),i]})}function Yt({row:t}){const i=je(),r=Re(),[a,n]=c.useState(!1),[l,m]=c.useState(""),[p,u]=c.useState(""),[P,j]=c.useState(""),[k,I]=c.useState(""),[y,h]=c.useState(""),[N,O]=c.useState([]),S=()=>{m(t.inputPrice==null?"":String(t.inputPrice)),u(t.outputPrice==null?"":String(t.outputPrice)),j(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),I(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),h(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),O(ze(t.pricingTiers)),n(!0)},Q=ce(l)&&ce(p)&&z(P)&&z(k)&&z(y)&&Ve(N),W=()=>{Q&&i.mutate({model_key:t.key,input_price_per_million:Number(l),output_price_per_million:Number(p),cache_read_price_per_million:Y(P),cache_write_price_per_million:Y(k),cache_write_1h_price_per_million:Y(y),pricing_tiers:Ye(N)},{onSuccess:()=>n(!1)})};return a?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Input $ / 1M"}),e.jsx(b,{value:l,onChange:m,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Output $ / 1M"}),e.jsx(b,{value:p,onChange:u,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache read $ / 1M"}),e.jsx(b,{value:P,onChange:j,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Cache write $ / 1M"}),e.jsx(b,{value:k,onChange:I,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"1h cache write $ / 1M"}),e.jsx(b,{value:y,onChange:h,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx(qe,{tiers:N,onChange:O}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:"sm",variant:"primary",isDisabled:i.isPending||!Q,onPress:W,children:"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:i.isPending,onPress:()=>n(!1),children:"Cancel"})]}),i.error?e.jsx("span",{className:"text-xs text-red-700",children:be(i.error)}):null]}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(T,{label:"Input",value:t.inputPrice==null?"—":`${E(t.inputPrice)} / 1M`}),e.jsx(T,{label:"Output",value:t.outputPrice==null?"—":`${E(t.outputPrice)} / 1M`}),e.jsx(T,{label:"Cache read",value:t.cacheReadPrice==null?"—":`${E(t.cacheReadPrice)} / 1M`}),e.jsx(T,{label:"Cache write",value:t.cacheWritePrice==null?"—":`${E(t.cacheWritePrice)} / 1M`}),e.jsx(T,{label:"1h cache write",value:t.cacheWrite1hPrice==null?"—":`${E(t.cacheWrite1hPrice)} / 1M`}),e.jsx(T,{label:"Context tiers",value:t.pricingTiers.length?`${t.pricingTiers.length} configured`:"—"}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsx($,{size:"sm",variant:"outline",onPress:S,children:t.source==="configured"?"Edit price":"Set price"}),t.source==="configured"?e.jsxs(e.Fragment,{children:[e.jsx(we,{confirmLabel:"Reset",isPending:r.isPending,onConfirm:()=>r.mutate(t.key),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error)}):null]})]})}function qt({row:t,metadata:i,metadataAvailable:r,onMakeAlias:a,onClose:n}){const l=(i==null?void 0:i.input_modalities)??[],m=(i==null?void 0:i.output_modalities)??[],p=Ot.filter(({key:u})=>i==null?void 0:i[u]);return e.jsx(ae,{children:e.jsxs(ae.Content,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold break-all text-[var(--otari-ink)]",children:t.model}),i!=null&&i.deprecated?e.jsx(V,{size:"sm",color:"danger",children:"deprecated"}):null]}),e.jsxs("p",{className:"mt-1 text-xs break-all text-[var(--otari-muted)]",children:["Selector: ",e.jsx("code",{children:t.key})]}),i!=null&&i.family?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:i.family}):null]}),e.jsx("button",{type:"button","aria-label":"Close model details",onClick:n,className:"-mt-1 -mr-1 shrink-0 rounded-md px-1.5 py-0.5 text-lg leading-none text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]",children:"✕"})]}),i!=null&&i.description?e.jsx("p",{className:"text-sm text-[var(--otari-ink)]",children:i.description}):null,e.jsxs(le,{title:"Pricing",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(zt,{source:t.source}),t.isDiscovered?null:e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"not discovered"})]}),e.jsx(Yt,{row:t},t.key),e.jsx($,{size:"sm",variant:"outline",onPress:()=>a(t.key),children:"Make an alias"})]}),e.jsxs(le,{title:"Specs",children:[e.jsx(T,{label:"Context window",value:se(t.contextWindow)}),e.jsx(T,{label:"Max output",value:se((i==null?void 0:i.max_output_tokens)??null)}),e.jsx(T,{label:"Knowledge cutoff",value:(i==null?void 0:i.knowledge_cutoff)??"—"}),e.jsx(T,{label:"Released",value:Ct(i==null?void 0:i.release_date)}),e.jsx(T,{label:"Open weights",value:i?i.open_weights?"Yes":"No":"—"})]}),e.jsx(le,{title:"Modalities",children:l.length===0&&m.length===0?e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:"Unknown."}):e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"In:"}),l.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("span",{children:"Out:"}),m.map(u=>e.jsx(V,{size:"sm",color:"default",children:Fe[u]??u},u))]})]})}),e.jsx(le,{title:"Capabilities",children:p.length>0?e.jsx("div",{className:"flex flex-wrap gap-1.5",children:p.map(({key:u,label:P})=>e.jsx(V,{size:"sm",color:"default",children:P},u))}):e.jsx("span",{className:"text-sm text-[var(--otari-muted)]",children:r?"None reported.":"Extended metadata unavailable (models.dev disabled or unreachable)."})})]})})}const Ut=15;function Ht({value:t,onChange:i,placeholder:r}){return e.jsx("input",{type:"search",value:t,onChange:a=>i(a.target.value),placeholder:r,"aria-label":r,className:"w-full max-w-xs rounded-md border border-[var(--otari-line)] bg-white px-3 py-1.5 text-sm focus:border-[var(--otari-brand)] focus:outline-none"})}const Ue="otari.dashboard.modelsSort",_e={col:"model",dir:"asc"},Gt=["model","released","input","output"];function Jt(){if(typeof window>"u")return _e;try{const t=window.localStorage.getItem(Ue);if(!t)return _e;const i=JSON.parse(t);if(Gt.includes(i.col)&&(i.dir==="asc"||i.dir==="desc"))return{col:i.col,dir:i.dir}}catch{}return _e}function Xt({row:t,onClose:i}){const r=je(),a=Re(),[n,l]=c.useState(t.inputPrice==null?"":String(t.inputPrice)),[m,p]=c.useState(t.outputPrice==null?"":String(t.outputPrice)),[u,P]=c.useState(t.cacheReadPrice==null?"":String(t.cacheReadPrice)),[j,k]=c.useState(t.cacheWritePrice==null?"":String(t.cacheWritePrice)),[I,y]=c.useState(t.cacheWrite1hPrice==null?"":String(t.cacheWrite1hPrice)),[h,N]=c.useState(ze(t.pricingTiers)),O=ce(n)&&ce(m)&&z(u)&&z(j)&&z(I)&&Ve(h),S=()=>{O&&r.mutate({model_key:t.key,input_price_per_million:Number(n),output_price_per_million:Number(m),cache_read_price_per_million:Y(u),cache_write_price_per_million:Y(j),cache_write_1h_price_per_million:Y(I),pricing_tiers:Ye(h)},{onSuccess:i})};return e.jsxs("div",{className:"flex flex-col gap-3 px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"text-xs font-medium break-all text-[var(--otari-muted)]",children:t.key}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Input $ / 1M",e.jsx(b,{value:n,onChange:l,ariaLabel:`Input price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Output $ / 1M",e.jsx(b,{value:m,onChange:p,ariaLabel:`Output price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache read $ / 1M",e.jsx(b,{value:u,onChange:P,ariaLabel:`Cache read price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["Cache write $ / 1M",e.jsx(b,{value:j,onChange:k,ariaLabel:`Cache write price for ${t.key}`})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:["1h cache write $ / 1M",e.jsx(b,{value:I,onChange:y,ariaLabel:`1 hour cache write price for ${t.key}`})]}),e.jsx($,{size:"sm",variant:"primary",isDisabled:r.isPending||!O,onPress:S,children:r.isPending?"Saving…":"Save"}),e.jsx($,{size:"sm",variant:"ghost",isDisabled:r.isPending,onPress:i,children:"Cancel"}),t.source==="configured"?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(we,{confirmLabel:"Reset",isPending:a.isPending,onConfirm:()=>a.mutate(t.key,{onSuccess:i}),children:"Reset"}),e.jsx(oe,{label:"What reset does",children:"Removes the custom price. The model reverts to the default rate (genai-prices) when default pricing is on, otherwise it is metered at no cost."})]}):null,r.error||a.error?e.jsx("span",{className:"text-xs text-red-700",children:be(r.error??a.error)}):null]}),e.jsx(qe,{tiers:h,onChange:N})]})}function Qt({primary:t,secondary:i,rowKey:r,primaryLabel:a,secondaryLabel:n,onEdit:l}){const m=(p,u)=>e.jsx("button",{type:"button","aria-label":`Edit ${u} price for ${r}`,className:"tabular-nums hover:text-[var(--otari-brand-dark)] hover:underline",onClick:P=>{P.stopPropagation(),l()},children:p==null?"—":E(p)});return e.jsxs("span",{className:"inline-flex items-center justify-end gap-1",children:[m(t,a),e.jsx("span",{className:"text-[var(--otari-muted)]",children:"/"}),m(i,n)]})}function Zt({rates:t,rowKey:i,onEdit:r}){const a=[t.cacheReadPrice==null?null:`R ${E(t.cacheReadPrice)}`,t.cacheWritePrice==null?null:`W ${E(t.cacheWritePrice)}`,t.cacheWrite1hPrice==null?null:`1h ${E(t.cacheWrite1hPrice)}`].filter(n=>n!==null);return e.jsx("button",{type:"button","aria-label":`Edit caching price for ${i}`,className:"max-w-44 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),r()},children:a.length>0?a.join(" · "):"Input-rate fallback"})}function ei({row:t,onEdit:i}){const r=[...t.pricingTiers].sort((n,l)=>n.min_input_tokens-l.min_input_tokens).map(n=>se(n.min_input_tokens)),a=r.length===0?"Base only":`${r.length} tier${r.length===1?"":"s"} · ≥ ${r.join(", ")}`;return e.jsx("button",{type:"button","aria-label":`Edit pricing policy for ${t.key}`,className:"max-w-40 text-right text-xs leading-5 text-[var(--otari-muted)] hover:text-[var(--otari-brand-dark)] hover:underline",onClick:n=>{n.stopPropagation(),i()},children:a})}function ti({rows:t,isLoading:i,empty:r,sortDescriptor:a,onSortChange:n,selectedKey:l,onSelect:m,onEditPricing:p,comparisonContextTokens:u,selectedKeys:P,onSelectionChange:j}){const k=c.useMemo(()=>{const y=u==null?"Base":`at ${se(u)}`;return[{id:"model",header:"Model",isRowHeader:!0,allowsSorting:!0,cell:h=>e.jsxs("span",{className:"font-medium break-all",children:[h.model,e.jsx("span",{className:"sr-only",children:h.key})]})},{id:"provider",header:"Provider",cell:h=>e.jsx("span",{className:"text-[var(--otari-muted)]",children:h.provider})},{id:"input",header:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[`${y} in / out $ / 1M`,e.jsx(Vt,{})]}),align:"end",allowsSorting:!0,cell:h=>{const N=Ke(h,u);return e.jsx(Qt,{primary:N.inputPrice,secondary:N.outputPrice,rowKey:h.key,primaryLabel:"input",secondaryLabel:"output",onEdit:()=>p(h.key)})}},{id:"caching",header:`Caching ${u==null?"policy":y}`,align:"end",cell:h=>e.jsx(Zt,{rates:Ke(h,u),rowKey:h.key,onEdit:()=>p(h.key)})},{id:"policy",header:"Pricing policy",align:"end",cell:h=>e.jsx(ei,{row:h,onEdit:()=>p(h.key)})}]},[u,p]),I=c.useCallback(y=>y.key===l?"bg-[var(--otari-brand-tint)]":void 0,[l]);return e.jsx(It,{ariaLabel:"Models",columns:k,rows:t,getRowKey:wt,isLoading:i,emptyContent:r,selectionMode:"multiple",selectedKeys:P,onSelectionChange:j,sortDescriptor:a,onSortChange:n,onRowAction:m,rowClassName:I})}function ii({providers:t}){if(t.length===0)return null;const i=t.filter(l=>!l.discovery_unsupported),r=t.filter(l=>l.discovery_unsupported),a=l=>l.map(m=>m.provider).join(", "),n=l=>l.length===1;return e.jsxs(St,{tone:"warning",children:[i.length>0?e.jsxs("span",{className:"block",children:["Could not list ",a(i),". Check ",n(i)?"that provider's":"those providers'"," ","credentials in config.yml; ",n(i)?"its":"their"," models are missing from the list below."]}):null,r.length>0?e.jsxs("span",{className:"block",children:[a(r)," ",n(r)?"does":"do"," not offer model discovery, so"," ",n(r)?"its":"their"," models are missing from the list below."," ",n(r)?"The provider":"They"," may still serve requests; declare the model ids"," ",n(r)?"it serves":"they serve"," under the ",e.jsx("code",{children:"models:"})," key in config.yml to list them here."]}):null]})}function pi(){var Ie,Le,$e;const t=gt(),[i]=vt(),r=_t(),a=bt(),n=jt(),l=yt(),m=je(),[p,u]=c.useState(""),[P,j]=c.useState(0),[k,I]=c.useState(Ut),[y,h]=c.useState(null),[N,O]=c.useState(null),[S,Q]=c.useState(Jt),W=Mt(),[He,ue]=c.useState(!1),[Ge,ye]=c.useState(!1),[Je,Pe]=c.useState(void 0);c.useEffect(()=>{try{window.localStorage.setItem(Ue,JSON.stringify(S))}catch{}},[S]);const[D,Ne]=c.useState(i.get("provider")||"all"),[K,Xe]=c.useState("all"),[q,Qe]=c.useState("all"),[U,Ze]=c.useState("all"),[de,et]=c.useState("0"),[Z,tt]=c.useState(""),[ee,it]=c.useState("all"),[pe,rt]=c.useState(""),F=((Ie=l.data)==null?void 0:Ie.models)??{},nt=((Le=l.data)==null?void 0:Le.available)??!1,Se=c.useMemo(()=>{var s;return new Set((((s=n.data)==null?void 0:s.providers)??[]).flatMap(x=>x.models.map(o=>o.key)))},[n.data]),lt=s=>{u(s),j(0)},R=s=>x=>{s(x),j(0)},te=c.useMemo(()=>{var M,v,_,A,L,w,Ae;const s=new Map(At(a.data??[]).map(d=>[d.model_key,d])),x=[],o=new Set,g=(d,ve,Ee,f)=>{if(o.has(d))return;o.add(d);const C=s.get(d);x.push({key:d,model:Be(ve,Ee),provider:Ee,isDiscovered:Se.has(d),contextWindow:(f==null?void 0:f.contextWindow)??null,inputPrice:C?C.input_price_per_million:(f==null?void 0:f.inputPrice)??null,outputPrice:C?C.output_price_per_million:(f==null?void 0:f.outputPrice)??null,cacheReadPrice:C?C.cache_read_price_per_million:(f==null?void 0:f.cacheReadPrice)??null,cacheWritePrice:C?C.cache_write_price_per_million:(f==null?void 0:f.cacheWritePrice)??null,cacheWrite1hPrice:C?C.cache_write_1h_price_per_million??null:(f==null?void 0:f.cacheWrite1hPrice)??null,pricingTiers:C?C.pricing_tiers??[]:(f==null?void 0:f.pricingTiers)??[],source:C?"configured":(f==null?void 0:f.source)??"none"})};for(const d of((M=r.data)==null?void 0:M.data)??[]){if(d.owned_by===Et)continue;const ve=d.pricing_source==="default"?"default":d.pricing?"configured":"none";g(d.id,d.id,d.owned_by||Oe(d.id),{key:d.id,model:d.id,provider:d.owned_by,contextWindow:d.context_window,inputPrice:((v=d.pricing)==null?void 0:v.input_price_per_million)??null,outputPrice:((_=d.pricing)==null?void 0:_.output_price_per_million)??null,cacheReadPrice:((A=d.pricing)==null?void 0:A.cache_read_price_per_million)??null,cacheWritePrice:((L=d.pricing)==null?void 0:L.cache_write_price_per_million)??null,cacheWrite1hPrice:((w=d.pricing)==null?void 0:w.cache_write_1h_price_per_million)??null,pricingTiers:((Ae=d.pricing)==null?void 0:Ae.pricing_tiers)??[],source:ve})}for(const d of s.keys())g(d,d,Oe(d));return x},[r.data,a.data,Se]),Ce=c.useMemo(()=>new Map(te.map(s=>[s.key,s])),[te]),ie=c.useMemo(()=>{var o,g,M;const s=te.map(v=>{var _,A;return{...v,contextWindow:v.contextWindow??((_=F[v.key])==null?void 0:_.context_window)??null,releaseDate:((A=F[v.key])==null?void 0:A.release_date)??null}}),x=new Set(s.map(v=>v.key));for(const v of((o=n.data)==null?void 0:o.providers)??[])for(const _ of v.models)x.has(_.key)||(x.add(_.key),s.push({key:_.key,model:Be(_.key,v.provider),provider:v.provider,isDiscovered:!0,contextWindow:((g=F[_.key])==null?void 0:g.context_window)??null,releaseDate:((M=F[_.key])==null?void 0:M.release_date)??null,inputPrice:null,outputPrice:null,cacheReadPrice:null,cacheWritePrice:null,cacheWrite1hPrice:null,pricingTiers:[],source:"none"}));return s},[te,n.data,F]),st=((($e=n.data)==null?void 0:$e.providers)??[]).filter(s=>!s.ok),re=c.useMemo(()=>{const s=Array.from(new Set(ie.map(x=>x.provider))).sort((x,o)=>x.localeCompare(o));return[{value:"all",label:"All providers"},...s.map(x=>({value:x,label:x}))]},[ie]);c.useEffect(()=>{D==="all"||re.length<=1||re.some(s=>s.value===D)||Ne("all")},[re,D]);const H=p.trim().toLowerCase(),he=Number(de)||0,me=Z===""?Number.POSITIVE_INFINITY:Number(Z),at=pe===""?null:Number(pe),xe=ee==="all"?null:Date.now()-Number(ee)*Rt,G=c.useMemo(()=>{const s=o=>{if(H&&!o.key.toLowerCase().includes(H)&&!o.provider.toLowerCase().includes(H)||D!=="all"&&o.provider!==D||K==="configured"&&o.source!=="configured"||K==="default"&&o.source!=="default"||K==="priced"&&o.inputPrice==null||K==="unpriced"&&o.inputPrice!=null||q==="discovered"&&!o.isDiscovered||q==="custom"&&o.isDiscovered)return!1;if(U!=="all"){const g=De.find(v=>v.value===U),M=F[o.key];if(!g||!M||!g.test(M))return!1}if(he>0&&(o.contextWindow==null||o.contextWindowme))return!1;if(xe!=null){const g=o.releaseDate?Date.parse(o.releaseDate):Number.NaN;if(Number.isNaN(g)||g{const M=S.dir==="asc"?1:-1;if(S.col==="model")return o.model.localeCompare(g.model)*M;if(S.col==="released"){const L=o.releaseDate??null,w=g.releaseDate??null;return!L&&!w?o.model.localeCompare(g.model):L?w?(Lw?1:0)*M||o.model.localeCompare(g.model):-1:1}const v=L=>S.col==="input"?L.inputPrice:L.outputPrice,_=v(o),A=v(g);return _==null&&A==null?o.model.localeCompare(g.model):_==null?1:A==null?-1:(_-A)*M||o.model.localeCompare(g.model)};return ie.filter(s).sort(x)},[ie,H,D,K,q,U,he,me,xe,F,S]),J=G.length,ct=Math.max(1,Math.ceil(J/k)),ke=Math.min(P,ct-1),Me=ke*k,fe=G.slice(Me,Me+k),ot={column:S.col,direction:S.dir==="asc"?"ascending":"descending"},ut=s=>{Q({col:String(s.column),dir:s.direction==="ascending"?"asc":"desc"}),j(0)},dt=c.useCallback(s=>h(x=>x===s?null:s),[]),ge=fe.map(s=>s.key),X=Wt(W.selectedKeys,ge),pt=ge.length>0&&X.length===ge.length&&J>X.length,ht=W.allMatching?G.map(s=>s.key):X,We=W.allMatching?J:X.length,Te=y?G.find(s=>s.key===y)??Ce.get(y)??null:null,mt=async s=>{ye(!0),Pe(void 0);try{for(const x of ht)await m.mutateAsync({model_key:x,input_price_per_million:s.input_price_per_million,output_price_per_million:s.output_price_per_million,cache_read_price_per_million:s.cache_read_price_per_million??null,cache_write_price_per_million:s.cache_write_price_per_million??null,cache_write_1h_price_per_million:null,pricing_tiers:[]});W.clear(),ue(!1)}catch(x){Pe(x)}finally{ye(!1)}},xt=r.isLoading||a.isLoading||n.isLoading,ft=H!==""||D!=="all"||K!=="all"||q!=="all"||U!=="all"||de!=="0"||Z!==""||ee!=="all"?"No models match your filters.":"No models yet. Add a provider on the Providers page, or price a model below.",ne=N?G.find(s=>s.key===N)??Ce.get(N)??null:null;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Pt,{title:"Models",description:"Every model your providers can serve. Set a price on any model so budgets and usage tracking work."}),e.jsx(Nt,{error:r.error??a.error??n.error??l.error}),e.jsxs("div",{className:`grid gap-4 lg:items-start ${ne?"lg:grid-cols-[minmax(0,1fr)_360px]":"grid-cols-1"}`,children:[e.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Ht,{value:p,onChange:lt,placeholder:"Search models…"}),e.jsx(B,{ariaLabel:"Filter by provider",value:D,onChange:R(Ne),options:re}),e.jsx(B,{ariaLabel:"Filter by pricing",value:K,onChange:R(Xe),options:[{value:"all",label:"Any pricing"},{value:"configured",label:"Custom price"},{value:"default",label:"Default price"},{value:"priced",label:"Priced"},{value:"unpriced",label:"Unpriced"}]}),e.jsx(B,{ariaLabel:"Filter by source",value:q,onChange:R(Qe),options:[{value:"all",label:"Any source"},{value:"discovered",label:"Discovered"},{value:"custom",label:"Custom (not discovered)"}]}),e.jsx(B,{ariaLabel:"Filter by capability",value:U,onChange:R(Ze),options:[{value:"all",label:"Any capability"},...De.map(s=>({value:s.value,label:s.label}))]}),e.jsx(B,{ariaLabel:"Minimum context window",value:de,onChange:R(et),options:Dt}),e.jsx(B,{ariaLabel:"Maximum input price",value:Z,onChange:R(tt),options:Ft}),e.jsx(B,{ariaLabel:"Compare prices at context",value:pe,onChange:rt,options:Bt}),e.jsx(B,{ariaLabel:"Filter by release date",value:ee,onChange:R(it),options:Kt})]}),e.jsx(ii,{providers:st}),X.length>0?e.jsx(Tt,{selectedCount:We,allMatching:W.allMatching,matchingTotal:J,canSelectAllMatching:pt,onSelectAllMatching:W.enableAllMatching,onClear:W.clear,children:e.jsx($,{size:"sm",variant:"primary",onPress:()=>ue(!0),children:"Set pricing"})}):null,e.jsx(ti,{rows:fe,isLoading:xt,empty:ft,sortDescriptor:ot,onSortChange:ut,selectedKey:N,onSelect:O,onEditPricing:dt,comparisonContextTokens:at,selectedKeys:W.selectedKeys,onSelectionChange:W.onSelectionChange}),Te?e.jsx(ae,{children:e.jsxs(ae.Content,{className:"p-0",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--otari-line)] px-4 py-2",children:[e.jsx("span",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Edit pricing"}),e.jsx($,{size:"sm",variant:"ghost",onPress:()=>h(null),children:"Close"})]}),e.jsx(Xt,{row:Te,onClose:()=>h(null)})]})}):null,e.jsx(Lt,{page:ke,pageSize:k,total:J,rowsOnPage:fe.length,onPageChange:j,onPageSizeChange:s=>{I(s),j(0)},pageSizeOptions:[15,25,50]})]}),ne?e.jsx("aside",{className:"lg:sticky lg:top-4",children:e.jsx(qt,{row:ne,metadata:F[ne.key],metadataAvailable:nt,onMakeAlias:s=>t(`/aliases?target=${encodeURIComponent(s)}`),onClose:()=>O(null)})}):null]}),e.jsx($t,{isOpen:He,onOpenChange:ue,targetCount:We,isPending:Ge,error:Je,onSubmit:mt,title:"Set pricing",description:s=>`Apply these per-1M rates to ${s.toLocaleString()} selected ${s===1?"model":"models"}. This replaces each model's price; pricing tiers and the 1h cache rate are cleared. Edit a single model for tiers.`})]})}export{pi as ModelsPage}; diff --git a/src/gateway/static/dashboard/assets/OverviewPage-BOO3r0BN.js b/src/gateway/static/dashboard/assets/OverviewPage-ycwh77Rn.js similarity index 98% rename from src/gateway/static/dashboard/assets/OverviewPage-BOO3r0BN.js rename to src/gateway/static/dashboard/assets/OverviewPage-ycwh77Rn.js index cfef09ada..b5e0f3ea5 100644 --- a/src/gateway/static/dashboard/assets/OverviewPage-BOO3r0BN.js +++ b/src/gateway/static/dashboard/assets/OverviewPage-ycwh77Rn.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as y,i as st,N as Y}from"./react-dgEcD0HR.js";import{Z as nt,_ as ot,g as j,$ as it,v as lt,c as dt,u as ct,d as ut,a0 as w,P as mt,R as vt,E as V,a1 as b,a2 as D,a3 as N,a4 as R,a5 as E,a6 as ht,N as _}from"./index-DMrbj_xn.js";import{S as U}from"./charts-DNysd9jl.js";import{D as xt}from"./DataTable-CrQq0sYf.js";import{d as M,B as ft}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function K(e){return e==="neutral"?void 0:e}const pt=.02,gt=.1;function W(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,a=n>=gt?"alert":n>=pt?"warn":"ok";return{rate:n,status:a}}function bt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy+e.degraded===0?"alert":"warn"}const yt=.8;function St(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(o=>o.max_budget!==null&&o.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let a=0,l=0,r,m=-1;for(const o of n){const s=o.max_budget*o.user_count,i=s>0?o.total_spend/s:0;i>=1?a+=1:i>=yt&&(l+=1),i>m&&(m=i,r={name:o.name??o.budget_id,spent:o.total_spend,allocated:s,pct:i})}const d=a>0?"alert":l>0?"warn":"ok",h=a>0?`${a} over limit`:l>0?`${l} near limit`:"All within budget";return{status:d,label:h,overCount:a,nearCount:l,cappedCount:n.length,worst:r}}const G=864e5,I=30;function T(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function jt(){const[e,n]=y.useState(T);return y.useEffect(()=>{const a=()=>{if(document.visibilityState==="visible"){const l=T();n(r=>r===l?r:l)}};return document.addEventListener("visibilitychange",a),window.addEventListener("focus",a),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}},[]),y.useMemo(()=>{const a=Date.now(),l=new Date(a);return{today:new Date(l.getFullYear(),l.getMonth(),l.getDate()).toISOString(),periodStart:new Date(a-I*G).toISOString(),prevStart:new Date(a-2*I*G).toISOString()}},[e])}const wt={ok:"Healthy",warn:"Elevated",alert:"High"},Nt={ok:"On track",warn:"Near limit",alert:"Over budget"};function Bt(){const e=nt();return e.isLoading?t.jsx(ot,{}):t.jsx(Rt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function Rt({needsSetup:e=!1}){var $,L,A,F,P,q,B,H;const n=jt(),a=y.useMemo(()=>({start_date:n.today}),[n]),l=y.useMemo(()=>({start_date:n.periodStart}),[n]),r=y.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=j(a,"hour",_),d=j(l,"day",_),h=j(r,"day",_),o=it(),s=lt(),i=dt(),x=ct(),f=ut({},0,5),C=($=m.data)==null?void 0:$.totals,v=(L=d.data)==null?void 0:L.totals,p=(A=h.data)==null?void 0:A.totals,S=((F=d.data)==null?void 0:F.series)??[],k=S.length>1,c=W(v),O=W(p),Z=c.rate!==null&&O.rate!==null?w(c.rate,O.rate):null,u=St(s.data??[]),z=bt(o.data),J=(i.data??[]).filter(g=>g.is_active).length,Q=(x.data??[]).filter(g=>!g.blocked).length,X=(((P=f.data)==null?void 0:P.length)??0)>0,tt=e&&f.isSuccess&&!X,et=m.error??d.error??o.error??s.error??i.error??x.error,rt=()=>{m.refetch(),d.refetch(),h.refetch(),o.refetch(),s.refetch(),i.refetch(),x.refetch(),f.refetch()},at=m.isFetching||d.isFetching||h.isFetching||o.isFetching||s.isFetching||i.isFetching||x.isFetching||f.isFetching;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(mt,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway.",action:t.jsx(vt,{onRefresh:rt,isFetching:at,updatedAt:d.dataUpdatedAt})}),tt?t.jsx(_t,{}):null,t.jsx(V,{error:et}),t.jsx(Et,{providerHealth:z,healthy:((q=o.data)==null?void 0:q.healthy)??0,degraded:((B=o.data)==null?void 0:B.degraded)??0,total:((H=o.data)==null?void 0:H.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:o.isSuccess&&s.isSuccess&&d.isSuccess,failed:o.isError||s.isError||d.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(b,{label:"Spend today",value:C?D(C.cost):"—"}),t.jsx(b,{label:"Spend, last 30 days",value:v?D(v.cost):"—",hint:v?t.jsx(N,{fraction:w(v.cost,p==null?void 0:p.cost)}):null,chart:k?t.jsx(U,{values:S.map(g=>g.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Requests, last 30 days",value:v?R(v.request_count):"—",hint:v?t.jsx(N,{fraction:w(v.request_count,p==null?void 0:p.request_count)}):null,chart:k?t.jsx(U,{values:S.map(g=>g.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Error rate, last 30 days",value:c.rate===null?"—":E(c.rate),status:K(c.status),statusLabel:c.status==="neutral"?void 0:wt[c.status],hint:c.rate!==null?t.jsx(N,{fraction:Z}):null}),t.jsx(b,{label:"Budget health",value:s.data&&u.worst?E(u.worst.pct):"—",status:s.data?K(u.status):void 0,statusLabel:s.data&&u.status!=="neutral"?Nt[u.status]:void 0,hint:s.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(b,{label:"Active keys",value:i.data?R(J):"—",to:"/keys"}),t.jsx(b,{label:"Active users",value:x.data?R(Q):"—",to:"/users"})]}),t.jsx(kt,{entries:f.data??[],loading:f.isLoading,error:f.error})]})}function _t(){const e=st();return t.jsx(M,{children:t.jsxs(M.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(ft,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function Dt({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function Et({providerHealth:e,healthy:n,degraded:a,total:l,budget:r,errStatus:m,errRate:d,ready:h,failed:o}){if(o)return t.jsx(Dt,{text:"Some status data could not be loaded."});if(!h)return null;const s=[];if((e==="warn"||e==="alert")&&l>0){const i=l-n-a;i>0&&s.push({text:`${i} provider${i===1?"":"s"} unreachable`,to:"/providers"}),a>0&&s.push({text:`${a} provider${a===1?"":"s"} without model discovery`,to:"/providers"})}return r.overCount>0?s.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&s.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),m==="alert"&&d!==null&&s.push({text:`error rate ${E(d)}`,to:"/activity?status=error"}),s.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),s.map((i,x)=>t.jsxs("span",{className:"flex items-center gap-2",children:[x>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(Y,{to:i.to,className:"underline underline-offset-2 hover:text-amber-950",children:i.text})]},i.to+i.text))]})}function Ct(e){return e==="error"?"error":"ok"}function kt({entries:e,loading:n,error:a}){const l=[{id:"time",header:"Time",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(r.timestamp).toLocaleString(),children:ht(r.timestamp)})},{id:"model",header:"Model",isRowHeader:!0,cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:r.model})},{id:"cost",header:"Cost",align:"end",cell:r=>r.cost===null?"—":D(r.cost)},{id:"status",header:"Status",cell:r=>t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Ct(r.status)})}];return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(Y,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(V,{error:a}),t.jsx(xt,{ariaLabel:"Recent activity",columns:l,rows:e,getRowKey:r=>r.id,isLoading:n,emptyContent:"No requests yet. Once the gateway serves traffic, it appears here."})]})}export{Bt as OverviewIndex,Rt as OverviewPage,T as localDayKey}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{r as y,i as st,N as Y}from"./react-dgEcD0HR.js";import{Z as nt,_ as ot,g as j,$ as it,v as lt,c as dt,u as ct,d as ut,a0 as w,P as mt,R as vt,E as V,a1 as b,a2 as D,a3 as N,a4 as R,a5 as E,a6 as ht,N as _}from"./index-BTsnhpZj.js";import{S as U}from"./charts-d2MDwLL0.js";import{D as xt}from"./DataTable-CrQq0sYf.js";import{d as M,B as ft}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function K(e){return e==="neutral"?void 0:e}const pt=.02,gt=.1;function W(e){if(!e||e.request_count===0)return{rate:null,status:"neutral"};const n=e.error_count/e.request_count,a=n>=gt?"alert":n>=pt?"warn":"ok";return{rate:n,status:a}}function bt(e){return!e||e.total===0?"neutral":e.healthy>=e.total?"ok":e.healthy+e.degraded===0?"alert":"warn"}const yt=.8;function St(e){if(e.length===0)return{status:"neutral",label:"No budgets configured",overCount:0,nearCount:0,cappedCount:0};const n=e.filter(o=>o.max_budget!==null&&o.user_count>0);if(n.length===0)return{status:"neutral",label:"No capped budgets",overCount:0,nearCount:0,cappedCount:0};let a=0,l=0,r,m=-1;for(const o of n){const s=o.max_budget*o.user_count,i=s>0?o.total_spend/s:0;i>=1?a+=1:i>=yt&&(l+=1),i>m&&(m=i,r={name:o.name??o.budget_id,spent:o.total_spend,allocated:s,pct:i})}const d=a>0?"alert":l>0?"warn":"ok",h=a>0?`${a} over limit`:l>0?`${l} near limit`:"All within budget";return{status:d,label:h,overCount:a,nearCount:l,cappedCount:n.length,worst:r}}const G=864e5,I=30;function T(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function jt(){const[e,n]=y.useState(T);return y.useEffect(()=>{const a=()=>{if(document.visibilityState==="visible"){const l=T();n(r=>r===l?r:l)}};return document.addEventListener("visibilitychange",a),window.addEventListener("focus",a),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("focus",a)}},[]),y.useMemo(()=>{const a=Date.now(),l=new Date(a);return{today:new Date(l.getFullYear(),l.getMonth(),l.getDate()).toISOString(),periodStart:new Date(a-I*G).toISOString(),prevStart:new Date(a-2*I*G).toISOString()}},[e])}const wt={ok:"Healthy",warn:"Elevated",alert:"High"},Nt={ok:"On track",warn:"Near limit",alert:"Over budget"};function Bt(){const e=nt();return e.isLoading?t.jsx(ot,{}):t.jsx(Rt,{needsSetup:e.isSuccess&&e.data.providers.length===0})}function Rt({needsSetup:e=!1}){var $,L,A,F,P,q,B,H;const n=jt(),a=y.useMemo(()=>({start_date:n.today}),[n]),l=y.useMemo(()=>({start_date:n.periodStart}),[n]),r=y.useMemo(()=>({start_date:n.prevStart,end_date:n.periodStart}),[n]),m=j(a,"hour",_),d=j(l,"day",_),h=j(r,"day",_),o=it(),s=lt(),i=dt(),x=ct(),f=ut({},0,5),C=($=m.data)==null?void 0:$.totals,v=(L=d.data)==null?void 0:L.totals,p=(A=h.data)==null?void 0:A.totals,S=((F=d.data)==null?void 0:F.series)??[],k=S.length>1,c=W(v),O=W(p),Z=c.rate!==null&&O.rate!==null?w(c.rate,O.rate):null,u=St(s.data??[]),z=bt(o.data),J=(i.data??[]).filter(g=>g.is_active).length,Q=(x.data??[]).filter(g=>!g.blocked).length,X=(((P=f.data)==null?void 0:P.length)??0)>0,tt=e&&f.isSuccess&&!X,et=m.error??d.error??o.error??s.error??i.error??x.error,rt=()=>{m.refetch(),d.refetch(),h.refetch(),o.refetch(),s.refetch(),i.refetch(),x.refetch(),f.refetch()},at=m.isFetching||d.isFetching||h.isFetching||o.isFetching||s.isFetching||i.isFetching||x.isFetching||f.isFetching;return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(mt,{title:"Overview",description:"At-a-glance spend, traffic, and health across the gateway.",action:t.jsx(vt,{onRefresh:rt,isFetching:at,updatedAt:d.dataUpdatedAt})}),tt?t.jsx(_t,{}):null,t.jsx(V,{error:et}),t.jsx(Et,{providerHealth:z,healthy:((q=o.data)==null?void 0:q.healthy)??0,degraded:((B=o.data)==null?void 0:B.degraded)??0,total:((H=o.data)==null?void 0:H.total)??0,budget:u,errStatus:c.status,errRate:c.rate,ready:o.isSuccess&&s.isSuccess&&d.isSuccess,failed:o.isError||s.isError||d.isError}),t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-4",children:[t.jsx(b,{label:"Spend today",value:C?D(C.cost):"—"}),t.jsx(b,{label:"Spend, last 30 days",value:v?D(v.cost):"—",hint:v?t.jsx(N,{fraction:w(v.cost,p==null?void 0:p.cost)}):null,chart:k?t.jsx(U,{values:S.map(g=>g.cost),ariaLabel:"Spend trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Requests, last 30 days",value:v?R(v.request_count):"—",hint:v?t.jsx(N,{fraction:w(v.request_count,p==null?void 0:p.request_count)}):null,chart:k?t.jsx(U,{values:S.map(g=>g.requests),ariaLabel:"Request volume trend over the last 30 days"}):void 0}),t.jsx(b,{label:"Error rate, last 30 days",value:c.rate===null?"—":E(c.rate),status:K(c.status),statusLabel:c.status==="neutral"?void 0:wt[c.status],hint:c.rate!==null?t.jsx(N,{fraction:Z}):null}),t.jsx(b,{label:"Budget health",value:s.data&&u.worst?E(u.worst.pct):"—",status:s.data?K(u.status):void 0,statusLabel:s.data&&u.status!=="neutral"?Nt[u.status]:void 0,hint:s.data?u.worst?`${u.label} · worst: ${u.worst.name}`:u.label:void 0,to:"/budgets"}),t.jsx(b,{label:"Active keys",value:i.data?R(J):"—",to:"/keys"}),t.jsx(b,{label:"Active users",value:x.data?R(Q):"—",to:"/users"})]}),t.jsx(kt,{entries:f.data??[],loading:f.isLoading,error:f.error})]})}function _t(){const e=st();return t.jsx(M,{children:t.jsxs(M.Content,{className:"flex flex-col gap-3 p-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Get started with Otari"}),t.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Add a provider to begin serving models. Once it is configured, this page will show your gateway’s traffic, spend, and health."})]}),t.jsx("div",{children:t.jsx(ft,{variant:"primary",onPress:()=>e("/providers"),children:"Add your first provider"})})]})})}function Dt({text:e}){return t.jsx("div",{role:"status",className:"flex items-center gap-2 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-bg)] px-4 py-3 text-sm text-[var(--otari-muted)]",children:e})}function Et({providerHealth:e,healthy:n,degraded:a,total:l,budget:r,errStatus:m,errRate:d,ready:h,failed:o}){if(o)return t.jsx(Dt,{text:"Some status data could not be loaded."});if(!h)return null;const s=[];if((e==="warn"||e==="alert")&&l>0){const i=l-n-a;i>0&&s.push({text:`${i} provider${i===1?"":"s"} unreachable`,to:"/providers"}),a>0&&s.push({text:`${a} provider${a===1?"":"s"} without model discovery`,to:"/providers"})}return r.overCount>0?s.push({text:`${r.overCount} budget${r.overCount===1?"":"s"} over limit`,to:"/budgets"}):r.nearCount>0&&s.push({text:`${r.nearCount} budget${r.nearCount===1?"":"s"} near limit`,to:"/budgets"}),m==="alert"&&d!==null&&s.push({text:`error rate ${E(d)}`,to:"/activity?status=error"}),s.length===0?null:t.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 sm:flex-row sm:flex-wrap sm:items-center",children:[t.jsx("span",{className:"font-medium",children:"Needs attention:"}),s.map((i,x)=>t.jsxs("span",{className:"flex items-center gap-2",children:[x>0?t.jsx("span",{"aria-hidden":!0,className:"text-amber-400",children:"·"}):null,t.jsx(Y,{to:i.to,className:"underline underline-offset-2 hover:text-amber-950",children:i.text})]},i.to+i.text))]})}function Ct(e){return e==="error"?"error":"ok"}function kt({entries:e,loading:n,error:a}){const l=[{id:"time",header:"Time",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",title:new Date(r.timestamp).toLocaleString(),children:ht(r.timestamp)})},{id:"model",header:"Model",isRowHeader:!0,cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:r.model})},{id:"cost",header:"Cost",align:"end",cell:r=>r.cost===null?"—":D(r.cost)},{id:"status",header:"Status",cell:r=>t.jsx("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium ${r.status==="error"?"border-red-200 bg-red-50 text-red-700":"border-[var(--otari-line)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]"}`,children:Ct(r.status)})}];return t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Recent activity"}),t.jsx(Y,{to:"/activity",className:"text-sm text-[var(--otari-brand-dark)] hover:underline",children:"View all →"})]}),t.jsx(V,{error:a}),t.jsx(xt,{ariaLabel:"Recent activity",columns:l,rows:e,getRowKey:r=>r.id,isLoading:n,emptyContent:"No requests yet. Once the gateway serves traffic, it appears here."})]})}export{Bt as OverviewIndex,Rt as OverviewPage,T as localDayKey}; diff --git a/src/gateway/static/dashboard/assets/ProvidersPage-enPv456e.js b/src/gateway/static/dashboard/assets/ProvidersPage-CYdIqkvJ.js similarity index 99% rename from src/gateway/static/dashboard/assets/ProvidersPage-enPv456e.js rename to src/gateway/static/dashboard/assets/ProvidersPage-CYdIqkvJ.js index 200308025..aa24970ed 100644 --- a/src/gateway/static/dashboard/assets/ProvidersPage-enPv456e.js +++ b/src/gateway/static/dashboard/assets/ProvidersPage-CYdIqkvJ.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as m,L as Z}from"./react-dgEcD0HR.js";import{Z as J,a7 as Q,W as X,$ as ee,a8 as te,a9 as se,aa as ae,P as re,E as I,I as ne,ab as ie,ac as oe,a6 as q,s as de,ad as F,ae as le,U as H,af as ce,ag as ue}from"./index-DMrbj_xn.js";import{F as C}from"./Field-DEJ6Wjg9.js";import{D as me}from"./DataTable-CrQq0sYf.js";import{B as j,d as w,f as xe,T as pe,L as U,I as z,D as he,S as ve,C as T,a as ge,b as fe}from"./heroui-DZj66Arc.js";function E({value:t,onChange:s,label:a,placeholder:n,description:i}){return e.jsxs(pe,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(z,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),i?e.jsx(he,{className:"text-xs text-[var(--otari-muted)]",children:i}):null]})}function M({label:t,value:s,onChange:a,description:n,placeholder:i,extra:c=[],includeCatalog:d=!0}){var k;const b=ce(),x=m.useMemo(()=>d?[...c,...(b.data??[]).map(o=>({id:o.id,name:o.name}))]:c,[b.data,c,d]),[v,u]=m.useState(()=>{var o;return((o=x.find(y=>y.id===s))==null?void 0:o.name)??""}),f=((k=x.find(o=>o.id===s))==null?void 0:k.name)??"",g=v.trim()===f.trim()?"":v.trim().toLowerCase(),l=x.filter(o=>!g||o.name.toLowerCase().includes(g)||o.id.toLowerCase().includes(g)).slice(0,50);return e.jsxs(T.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:v,onInputChange:u,onSelectionChange:o=>{var y;o!=null?(a(String(o)),u(((y=x.find(N=>N.id===String(o)))==null?void 0:y.name)??"")):(a(""),u(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(T.InputGroup,{children:[e.jsx(z,{placeholder:i??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:o=>o.currentTarget.select()}),e.jsx(T.Trigger,{})]}),e.jsx(T.Popover,{children:e.jsx(ge,{items:l,className:"max-h-72 overflow-auto",children:o=>e.jsx(fe,{id:o.id,textValue:o.name,children:o.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function Y({getPayload:t}){const s=ue(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:H(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):s.data.discovery_unsupported?e.jsxs("span",{className:"block max-w-md break-words text-xs text-amber-800",children:["This provider does not list models, so the key could not be verified here. Save it and use the provider; declare its model ids under ",e.jsx("code",{children:"models:"})," to have them show up in the catalogue. If you did not expect this, check the provider's reply below.",s.data.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:s.data.error}):null]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function je({onClose:t}){var _;const s=F(),[a,n]=m.useState(""),[i,c]=m.useState(""),[d,b]=m.useState(!1),[x,v]=m.useState(""),[u,f]=m.useState(""),g=le(a),l=((_=g.data)==null?void 0:_.id)===a?g.data:void 0;m.useEffect(()=>{l&&v(l.default_api_base??"")},[l]);const k=(l==null?void 0:l.env_key_present)??!1,o=((l==null?void 0:l.requires_api_key)??!0)&&!k,y=u.trim()!==""&&u.trim()!==a,N=/[:/]/.test(u),P=a!==""&&!N&&(!o||i.trim()!=="")&&!s.isPending,A=()=>{P&&s.mutate({instance:y?u.trim():a,provider_type:y?a:null,api_base:x.trim()||null,api_key:i.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsx(M,{label:"Provider",value:a,onChange:S=>{n(S),f(""),v("")},description:"Its endpoint is built in."}),e.jsx(E,{value:i,onChange:c,label:l&&!o?"API key (optional)":"API key",description:l?o?`${l.name}'s endpoint is built in — just add your key.`:k?`${l.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${l.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>b(S=>!S),children:d?"Hide advanced":"Advanced (API base, rename)"}),d?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"API base",value:x,onChange:v,placeholder:(l==null?void 0:l.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(C,{label:"Name",value:u,onChange:f,placeholder:a||"instance name",description:N?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!P,onPress:A,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(Y,{getPayload:()=>a===""?null:{instance:y?u.trim():a,provider_type:y?a:null,api_base:x.trim()||null,api_key:i.trim()||null}})]})]})}function be({onClose:t}){const s=F(),[a,n]=m.useState(""),[i,c]=m.useState("openai-compatible"),[d,b]=m.useState(""),[x,v]=m.useState(""),u=/[:/]/.test(a),f=a.trim()!==""&&!u&&d.trim()!==""&&!s.isPending,g=()=>{f&&s.mutate({instance:a.trim(),provider_type:i||"openai-compatible",api_base:d.trim(),api_key:x.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:u?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(M,{label:"Compatible with",value:i,onChange:c,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(C,{label:"API base",value:d,onChange:b,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(E,{value:x,onChange:v,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!f,onPress:g,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(Y,{getPayload:()=>a.trim()===""||d.trim()===""?null:{instance:a.trim(),provider_type:i||"openai-compatible",api_base:d.trim(),api_key:x.trim()||null}})]})]})}function ye({onClose:t}){const[s,a]=m.useState("known");return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,i])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:i},n))})}),s==="known"?e.jsx(je,{onClose:t}):e.jsx(be,{onClose:t})]})})}function ke({provider:t,onClose:s,onSaved:a}){const n=ie(),[i,c]=m.useState(t.provider_type??""),[d,b]=m.useState(t.api_base??""),[x,v]=m.useState(!1),[u,f]=m.useState(""),g=()=>{if(n.isPending)return;const l={provider_type:i.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};x&&u.trim()&&(l.api_key=u.trim()),n.mutate({instance:t.instance,body:l},{onSuccess:()=>{a(t.instance),s()}})};return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(I,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"Provider type",value:i,onChange:c,placeholder:"openai"}),e.jsx(C,{label:"API base",value:d,onChange:b,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:x?e.jsxs(e.Fragment,{children:[e.jsx(E,{value:u,onChange:f,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{v(!1),f("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>v(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:n.isPending,onPress:g,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Pe(t,s){const a=new Map((s??[]).map(c=>[c.instance,c])),n=new Map((t??[]).map(c=>[c.instance,c]));return[...new Set([...a.keys(),...n.keys()])].sort().map(c=>{const d=a.get(c);return{instance:c,source:d?"stored":"config",stored:d,meta:n.get(c)}})}function Ne({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(ve,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):t.discovery_unsupported?e.jsxs("span",{className:"block max-w-xs break-words text-xs text-amber-800",children:["Could not list models, so the key could not be verified. It may still work for requests.",t.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:t.error}):null]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function _e({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=!t.ok&&t.discovery_unsupported,a=t.ok?"border-green-200 bg-green-50 text-green-700":s?"border-amber-200 bg-amber-50 text-amber-800":"border-red-200 bg-red-50 text-red-700",n=t.ok?"bg-green-500":s?"bg-amber-500":"bg-red-500",i=t.checked_at?`Last checked ${q(t.checked_at)}`:"Not checked yet",c=s?`${t.error??"This provider does not list models."} Requests to it may still work.`:t.error??"Unreachable",d=t.ok?i:`${c} · ${i}`;return e.jsxs("span",{title:d,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${n}`}),t.ok?"Reachable":s?"No model discovery":"Unreachable"]})}function Se({healthy:t,degraded:s,total:a,checkedAt:n}){const c=t===a?"bg-green-500":t+s===a?"bg-amber-500":"bg-red-500",d=oe();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${c}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s>0?e.jsxs("span",{className:"text-amber-800",children:[s," without model discovery"]}):null,n?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",q(n)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:d.isPending,onPress:()=>d.mutate(),children:d.isPending?"Re-checking…":"Re-check all"})]})}function R({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ce({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n,secretKeyConfigured:i}){return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(R,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(R,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(R,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",isDisabled:!i,onPress:t,children:"Add your first provider"})})]})})}function Ke(){var D,L,O,$;const t=J(),s=Q(),a=X(),n=ee(),i=te(),c=se(),d=ae(),[b,x]=m.useState(!1),[v,u]=m.useState(null),[f,g]=m.useState({}),l=Pe((D=t.data)==null?void 0:D.providers,s.data),k=new Map((((L=n.data)==null?void 0:L.providers)??[]).map(r=>[r.instance,r])),o=t.isLoading||s.isLoading,y=((O=s.data)==null?void 0:O.find(r=>r.instance===v))??null,N=(($=a.data)==null?void 0:$.require_pricing)===!0&&a.data.default_pricing===!1,P=a.data?a.data.secret_key_configured!==!1:!a.isError,A=!o&&l.length===0&&!b,_=m.useRef({}),S=r=>{const p=(_.current[r]??0)+1;return _.current[r]=p,p},K=r=>{S(r),g(p=>{if(!Object.hasOwn(p,r))return p;const h={...p};return delete h[r],h})},B=(r,p,h)=>{_.current[r]===p&&g(G=>({...G,[r]:h}))},V=async r=>{const p=S(r);g(h=>({...h,[r]:{status:"pending"}}));try{const h=await c.mutateAsync(r);B(r,p,{status:"done",...h})}catch(h){B(r,p,{status:"done",ok:!1,model_count:0,error:H(h),discovery_unsupported:!1})}},W=[{id:"provider",header:"Provider",isRowHeader:!0,cell:r=>e.jsx(Z,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"font-medium text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})},{id:"type",header:"Type",cell:r=>{var p,h;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:((p=r.meta)==null?void 0:p.provider_type)??((h=r.stored)==null?void 0:h.provider_type)??r.instance})}},{id:"source",header:"Source",cell:r=>e.jsx(xe,{size:"sm",color:r.source==="stored"?"accent":"default",children:r.source==="stored"?"stored":"config"})},{id:"api_key",header:"API key",cell:r=>{var p,h;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:(p=r.stored)!=null&&p.last4?`••••${r.stored.last4}`:"none set"}):(h=r.meta)!=null&&h.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"})}},{id:"status",header:"Status",cell:r=>e.jsx(_e,{health:k.get(r.instance)})},{id:"actions",header:"Actions",align:"end",cell:r=>{var p,h;return r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((p=f[r.instance])==null?void 0:p.status)==="pending"||((h=r.stored)==null?void 0:h.decryptable)===!1,onPress:()=>void V(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{x(!1),u(r.instance)},children:"Edit"}),e.jsx(de,{confirmLabel:"Delete",isPending:i.isPending,onConfirm:()=>i.mutate(r.instance,{onSuccess:()=>K(r.instance)}),children:"Delete"})]}),e.jsx(Ne,{state:f[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})}}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:b||A?null:e.jsx(j,{variant:"primary",isDisabled:!P,onPress:()=>{u(null),x(!0)},children:"Add provider"})}),e.jsx(I,{error:t.error??s.error??a.error??n.error??d.error??i.error}),P?null:e.jsxs(ne,{tone:"warning",children:[e.jsx("code",{children:"OTARI_SECRET_KEY"})," is not set, so provider keys can't be encrypted at rest and adding providers from the dashboard is disabled. Set it on the server and restart to add providers here. Providers defined in"," ",e.jsx("code",{children:"config.yml"})," keep working without it."]}),A?e.jsx(Ce,{onAddProvider:()=>{u(null),x(!0)},needsPricing:N,onEnablePricing:()=>d.mutate({default_pricing:!0}),enabling:d.isPending,secretKeyConfigured:P}):null,b&&P?e.jsx(ye,{onClose:()=>x(!1)}):null,y?e.jsx(ke,{provider:y,onClose:()=>u(null),onSaved:K}):null,!o&&l.length>0&&n.data&&n.data.total>0?e.jsx(Se,{healthy:n.data.healthy,degraded:n.data.degraded,total:n.data.total,checkedAt:n.data.checked_at}):null,A?null:e.jsx(me,{ariaLabel:"Providers",columns:W,rows:l,getRowKey:r=>r.instance,isLoading:o,emptyContent:"No providers yet. Add your first provider to start serving models."})]})}export{Ke as ProvidersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as m,L as Z}from"./react-dgEcD0HR.js";import{Z as J,a7 as Q,W as X,$ as ee,a8 as te,a9 as se,aa as ae,P as re,E as I,I as ne,ab as ie,ac as oe,a6 as q,s as de,ad as F,ae as le,U as H,af as ce,ag as ue}from"./index-BTsnhpZj.js";import{F as C}from"./Field-DEJ6Wjg9.js";import{D as me}from"./DataTable-CrQq0sYf.js";import{B as j,d as w,f as xe,T as pe,L as U,I as z,D as he,S as ve,C as T,a as ge,b as fe}from"./heroui-DZj66Arc.js";function E({value:t,onChange:s,label:a,placeholder:n,description:i}){return e.jsxs(pe,{value:t,onChange:s,className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:a}),e.jsx(z,{type:"password",placeholder:n??"sk-…",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),i?e.jsx(he,{className:"text-xs text-[var(--otari-muted)]",children:i}):null]})}function M({label:t,value:s,onChange:a,description:n,placeholder:i,extra:c=[],includeCatalog:d=!0}){var k;const b=ce(),x=m.useMemo(()=>d?[...c,...(b.data??[]).map(o=>({id:o.id,name:o.name}))]:c,[b.data,c,d]),[v,u]=m.useState(()=>{var o;return((o=x.find(y=>y.id===s))==null?void 0:o.name)??""}),f=((k=x.find(o=>o.id===s))==null?void 0:k.name)??"",g=v.trim()===f.trim()?"":v.trim().toLowerCase(),l=x.filter(o=>!g||o.name.toLowerCase().includes(g)||o.id.toLowerCase().includes(g)).slice(0,50);return e.jsxs(T.Root,{allowsEmptyCollection:!0,menuTrigger:"focus",inputValue:v,onInputChange:u,onSelectionChange:o=>{var y;o!=null?(a(String(o)),u(((y=x.find(N=>N.id===String(o)))==null?void 0:y.name)??"")):(a(""),u(""))},className:"flex max-w-md flex-col gap-1",children:[e.jsx(U,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsxs(T.InputGroup,{children:[e.jsx(z,{placeholder:i??"Search providers…",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true",onFocus:o=>o.currentTarget.select()}),e.jsx(T.Trigger,{})]}),e.jsx(T.Popover,{children:e.jsx(ge,{items:l,className:"max-h-72 overflow-auto",children:o=>e.jsx(fe,{id:o.id,textValue:o.name,children:o.name})})}),n?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:n}):null]})}function Y({getPayload:t}){const s=ue(),a=t();return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(j,{variant:"outline",isDisabled:a===null||s.isPending,onPress:()=>{a&&s.mutate(a)},children:s.isPending?"Testing…":"Test connection"}),e.jsx("span",{role:"status","aria-live":"polite",children:s.isPending?null:s.error?e.jsx("span",{className:"text-xs text-red-700",children:H(s.error)}):s.data?s.data.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",s.data.model_count," model",s.data.model_count===1?"":"s"," available."]}):s.data.discovery_unsupported?e.jsxs("span",{className:"block max-w-md break-words text-xs text-amber-800",children:["This provider does not list models, so the key could not be verified here. Save it and use the provider; declare its model ids under ",e.jsx("code",{children:"models:"})," to have them show up in the catalogue. If you did not expect this, check the provider's reply below.",s.data.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:s.data.error}):null]}):e.jsx("span",{className:"block max-w-md break-words text-xs text-red-700",children:s.data.error??"Connection failed."}):null})]})}function je({onClose:t}){var _;const s=F(),[a,n]=m.useState(""),[i,c]=m.useState(""),[d,b]=m.useState(!1),[x,v]=m.useState(""),[u,f]=m.useState(""),g=le(a),l=((_=g.data)==null?void 0:_.id)===a?g.data:void 0;m.useEffect(()=>{l&&v(l.default_api_base??"")},[l]);const k=(l==null?void 0:l.env_key_present)??!1,o=((l==null?void 0:l.requires_api_key)??!0)&&!k,y=u.trim()!==""&&u.trim()!==a,N=/[:/]/.test(u),P=a!==""&&!N&&(!o||i.trim()!=="")&&!s.isPending,A=()=>{P&&s.mutate({instance:y?u.trim():a,provider_type:y?a:null,api_base:x.trim()||null,api_key:i.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsx(M,{label:"Provider",value:a,onChange:S=>{n(S),f(""),v("")},description:"Its endpoint is built in."}),e.jsx(E,{value:i,onChange:c,label:l&&!o?"API key (optional)":"API key",description:l?o?`${l.name}'s endpoint is built in — just add your key.`:k?`${l.env_key} is set on the server, so a key is optional here. Paste one to override it.`:`${l.name} needs no API key.`:"Stored encrypted. Requires OTARI_SECRET_KEY on the server."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>b(S=>!S),children:d?"Hide advanced":"Advanced (API base, rename)"}),d?e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"API base",value:x,onChange:v,placeholder:(l==null?void 0:l.default_api_base)??"https://…/v1",description:"Only if you route through a proxy. Blank uses the built-in default."}),e.jsx(C,{label:"Name",value:u,onChange:f,placeholder:a||"instance name",description:N?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Rename to run two instances of the same provider."})]}):null,e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!P,onPress:A,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(Y,{getPayload:()=>a===""?null:{instance:y?u.trim():a,provider_type:y?a:null,api_base:x.trim()||null,api_key:i.trim()||null}})]})]})}function be({onClose:t}){const s=F(),[a,n]=m.useState(""),[i,c]=m.useState("openai-compatible"),[d,b]=m.useState(""),[x,v]=m.useState(""),u=/[:/]/.test(a),f=a.trim()!==""&&!u&&d.trim()!==""&&!s.isPending,g=()=>{f&&s.mutate({instance:a.trim(),provider_type:i||"openai-compatible",api_base:d.trim(),api_key:x.trim()||null},{onSuccess:t})};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{error:s.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"Name",value:a,onChange:n,placeholder:"my-local-llm",isRequired:!0,autoFocus:!0,description:u?e.jsx("span",{className:"text-red-700",children:"A name cannot contain “:” or “/”."}):"Call it whatever you want."}),e.jsx(M,{label:"Compatible with",value:i,onChange:c,includeCatalog:!1,description:"The API this endpoint speaks.",extra:[{id:"openai-compatible",name:"OpenAI"},{id:"anthropic-compatible",name:"Anthropic"}]})]}),e.jsx(C,{label:"API base",value:d,onChange:b,placeholder:"http://localhost:8000/v1",isRequired:!0,description:"The endpoint URL of your server."}),e.jsx(E,{value:x,onChange:v,label:"API key (optional)",description:"Many local backends need none. Stored encrypted."}),e.jsxs("div",{className:"flex flex-wrap items-start gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:!f,onPress:g,children:s.isPending?"Adding…":"Add provider"}),e.jsx(j,{variant:"ghost",onPress:t,children:"Cancel"}),e.jsx(Y,{getPayload:()=>a.trim()===""||d.trim()===""?null:{instance:a.trim(),provider_type:i||"openai-compatible",api_base:d.trim(),api_key:x.trim()||null}})]})]})}function ye({onClose:t}){const[s,a]=m.useState("known");return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"flex items-center justify-between",children:e.jsx("div",{className:"flex items-center gap-1 rounded-lg bg-[var(--otari-bg)] p-1",children:[["known","Known provider"],["custom","Custom endpoint"]].map(([n,i])=>e.jsx("button",{type:"button","aria-pressed":s===n,onClick:()=>a(n),className:s===n?"rounded-md bg-white px-3 py-1.5 text-sm font-medium text-[var(--otari-ink)] shadow-sm":"rounded-md px-3 py-1.5 text-sm text-[var(--otari-muted)] hover:text-[var(--otari-ink)]",children:i},n))})}),s==="known"?e.jsx(je,{onClose:t}):e.jsx(be,{onClose:t})]})})}function ke({provider:t,onClose:s,onSaved:a}){const n=ie(),[i,c]=m.useState(t.provider_type??""),[d,b]=m.useState(t.api_base??""),[x,v]=m.useState(!1),[u,f]=m.useState(""),g=()=>{if(n.isPending)return;const l={provider_type:i.trim()||null,api_base:d.trim()||null,expected_updated_at:t.updated_at};x&&u.trim()&&(l.api_key=u.trim()),n.mutate({instance:t.instance,body:l},{onSuccess:()=>{a(t.instance),s()}})};return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.instance})]}),e.jsx(I,{error:n.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(C,{label:"Provider type",value:i,onChange:c,placeholder:"openai"}),e.jsx(C,{label:"API base",value:d,onChange:b,placeholder:"https://api.openai.com/v1"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:x?e.jsxs(e.Fragment,{children:[e.jsx(E,{value:u,onChange:f,label:"New API key",description:"Stored encrypted. The old key is replaced when you save."}),e.jsx("button",{type:"button",className:"self-start text-xs font-medium text-[var(--otari-brand-dark)]",onClick:()=>{v(!1),f("")},children:"Keep the current key"})]}):e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-sm text-[var(--otari-muted)]",children:["API key: ",e.jsx("code",{children:t.last4?`••••${t.last4}`:"none set"})]}),e.jsx(j,{size:"sm",variant:"outline",onPress:()=>v(!0),children:"Replace key"})]})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(j,{variant:"primary",isDisabled:n.isPending,onPress:g,children:n.isPending?"Saving…":"Save changes"}),e.jsx(j,{variant:"ghost",onPress:s,children:"Cancel"})]})]})})}function Pe(t,s){const a=new Map((s??[]).map(c=>[c.instance,c])),n=new Map((t??[]).map(c=>[c.instance,c]));return[...new Set([...a.keys(),...n.keys()])].sort().map(c=>{const d=a.get(c);return{instance:c,source:d?"stored":"config",stored:d,meta:n.get(c)}})}function Ne({state:t}){return t?t.status==="pending"?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(ve,{size:"sm"})," Testing…"]}):t.ok?e.jsxs("span",{className:"text-xs font-medium text-green-700",children:["Connected. ",t.model_count," model",t.model_count===1?"":"s"," available."]}):t.discovery_unsupported?e.jsxs("span",{className:"block max-w-xs break-words text-xs text-amber-800",children:["Could not list models, so the key could not be verified. It may still work for requests.",t.error?e.jsx("span",{className:"mt-0.5 block text-[var(--otari-muted)]",children:t.error}):null]}):e.jsx("span",{className:"block max-w-xs break-words text-xs text-red-700",children:t.error??"Connection failed."}):null}function _e({health:t}){if(!t)return e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"—"});const s=!t.ok&&t.discovery_unsupported,a=t.ok?"border-green-200 bg-green-50 text-green-700":s?"border-amber-200 bg-amber-50 text-amber-800":"border-red-200 bg-red-50 text-red-700",n=t.ok?"bg-green-500":s?"bg-amber-500":"bg-red-500",i=t.checked_at?`Last checked ${q(t.checked_at)}`:"Not checked yet",c=s?`${t.error??"This provider does not list models."} Requests to it may still work.`:t.error??"Unreachable",d=t.ok?i:`${c} · ${i}`;return e.jsxs("span",{title:d,className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${a}`,children:[e.jsx("span",{"aria-hidden":!0,className:`h-1.5 w-1.5 rounded-full ${n}`}),t.ok?"Reachable":s?"No model discovery":"Unreachable"]})}function Se({healthy:t,degraded:s,total:a,checkedAt:n}){const c=t===a?"bg-green-500":t+s===a?"bg-amber-500":"bg-red-500",d=oe();return e.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] px-4 py-2.5 text-sm",children:[e.jsx("span",{"aria-hidden":!0,className:`h-2 w-2 rounded-full ${c}`}),e.jsxs("span",{className:"font-medium text-[var(--otari-ink)]",children:[t," of ",a," provider",a===1?"":"s"," reachable"]}),s>0?e.jsxs("span",{className:"text-amber-800",children:[s," without model discovery"]}):null,n?e.jsxs("span",{className:"text-[var(--otari-muted)]",children:["Last checked ",q(n)]}):null,e.jsx(j,{size:"sm",variant:"ghost",className:"ml-auto",isDisabled:d.isPending,onPress:()=>d.mutate(),children:d.isPending?"Re-checking…":"Re-check all"})]})}function R({n:t,title:s,children:a}){return e.jsxs("li",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-[var(--otari-brand-tint)] text-xs font-semibold text-[var(--otari-brand-dark)]",children:t}),e.jsxs("div",{className:"text-sm",children:[e.jsx("div",{className:"font-medium text-[var(--otari-ink)]",children:s}),e.jsx("div",{className:"text-[var(--otari-muted)]",children:a})]})]})}function Ce({onAddProvider:t,needsPricing:s,onEnablePricing:a,enabling:n,secretKeyConfigured:i}){return e.jsx(w,{children:e.jsxs(w.Content,{className:"flex flex-col gap-4 p-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Welcome to Otari"}),e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"You are signed in. Add a provider to start serving models: three quick steps."})]}),e.jsxs("ol",{className:"flex flex-col gap-3",children:[e.jsxs(R,{n:1,title:"Add a provider",children:["Enter a provider name (like ",e.jsx("code",{children:"openai"}),") and its API key. Keys are encrypted at rest."]}),e.jsxs(R,{n:2,title:"Test the connection",children:["Use ",e.jsx("strong",{children:"Test"})," on the provider row to confirm the key works and see how many models it serves."]}),e.jsxs(R,{n:3,title:"Send your first request",children:["Point your app at ",e.jsx("code",{children:"/v1"})," on this gateway with the API key printed in the server logs (",e.jsx("code",{children:"gw-…"}),"). See the"," ",e.jsx("a",{href:"/welcome",className:"font-medium text-[var(--otari-brand-dark)]",children:"quickstart"}),"."]})]}),s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Tip: ",e.jsx("code",{children:"require_pricing"})," is on, so requests are rejected until pricing is set."," ",e.jsx("button",{type:"button",className:"font-medium text-[var(--otari-brand-dark)] disabled:opacity-50",disabled:n,onClick:a,children:"Enable default pricing"})," ","to meter new models with public rates."]}):null,e.jsx("div",{children:e.jsx(j,{variant:"primary",isDisabled:!i,onPress:t,children:"Add your first provider"})})]})})}function Ke(){var D,L,O,$;const t=J(),s=Q(),a=X(),n=ee(),i=te(),c=se(),d=ae(),[b,x]=m.useState(!1),[v,u]=m.useState(null),[f,g]=m.useState({}),l=Pe((D=t.data)==null?void 0:D.providers,s.data),k=new Map((((L=n.data)==null?void 0:L.providers)??[]).map(r=>[r.instance,r])),o=t.isLoading||s.isLoading,y=((O=s.data)==null?void 0:O.find(r=>r.instance===v))??null,N=(($=a.data)==null?void 0:$.require_pricing)===!0&&a.data.default_pricing===!1,P=a.data?a.data.secret_key_configured!==!1:!a.isError,A=!o&&l.length===0&&!b,_=m.useRef({}),S=r=>{const p=(_.current[r]??0)+1;return _.current[r]=p,p},K=r=>{S(r),g(p=>{if(!Object.hasOwn(p,r))return p;const h={...p};return delete h[r],h})},B=(r,p,h)=>{_.current[r]===p&&g(G=>({...G,[r]:h}))},V=async r=>{const p=S(r);g(h=>({...h,[r]:{status:"pending"}}));try{const h=await c.mutateAsync(r);B(r,p,{status:"done",...h})}catch(h){B(r,p,{status:"done",ok:!1,model_count:0,error:H(h),discovery_unsupported:!1})}},W=[{id:"provider",header:"Provider",isRowHeader:!0,cell:r=>e.jsx(Z,{to:`/models?provider=${encodeURIComponent(r.instance)}`,className:"font-medium text-[var(--otari-ink)] hover:text-[var(--otari-brand-dark)] hover:underline",children:r.instance})},{id:"type",header:"Type",cell:r=>{var p,h;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:((p=r.meta)==null?void 0:p.provider_type)??((h=r.stored)==null?void 0:h.provider_type)??r.instance})}},{id:"source",header:"Source",cell:r=>e.jsx(xe,{size:"sm",color:r.source==="stored"?"accent":"default",children:r.source==="stored"?"stored":"config"})},{id:"api_key",header:"API key",cell:r=>{var p,h;return e.jsx("span",{className:"text-[var(--otari-muted)]",children:r.source==="stored"?r.stored&&!r.stored.decryptable?e.jsx("span",{className:"text-amber-700",title:"This key can't be decrypted with the current OTARI_SECRET_KEY. Replace the key, or restore the original OTARI_SECRET_KEY.",children:"⚠ key unreadable"}):e.jsx("code",{children:(p=r.stored)!=null&&p.last4?`••••${r.stored.last4}`:"none set"}):(h=r.meta)!=null&&h.env_key?e.jsxs("span",{children:["via ",e.jsx("code",{children:r.meta.env_key})]}):"config.yml"})}},{id:"status",header:"Status",cell:r=>e.jsx(_e,{health:k.get(r.instance)})},{id:"actions",header:"Actions",align:"end",cell:r=>{var p,h;return r.source==="stored"?e.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(j,{size:"sm",variant:"outline",isDisabled:((p=f[r.instance])==null?void 0:p.status)==="pending"||((h=r.stored)==null?void 0:h.decryptable)===!1,onPress:()=>void V(r.instance),children:"Test"}),e.jsx(j,{size:"sm",variant:"ghost",onPress:()=>{x(!1),u(r.instance)},children:"Edit"}),e.jsx(de,{confirmLabel:"Delete",isPending:i.isPending,onConfirm:()=>i.mutate(r.instance,{onSuccess:()=>K(r.instance)}),children:"Delete"})]}),e.jsx(Ne,{state:f[r.instance]})]}):e.jsx("span",{className:"block text-right text-xs text-[var(--otari-muted)]",children:"managed in config.yml"})}}];return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(re,{title:"Providers",description:"Add provider API keys here to serve models without editing config.yml. Keys are encrypted at rest.",action:b||A?null:e.jsx(j,{variant:"primary",isDisabled:!P,onPress:()=>{u(null),x(!0)},children:"Add provider"})}),e.jsx(I,{error:t.error??s.error??a.error??n.error??d.error??i.error}),P?null:e.jsxs(ne,{tone:"warning",children:[e.jsx("code",{children:"OTARI_SECRET_KEY"})," is not set, so provider keys can't be encrypted at rest and adding providers from the dashboard is disabled. Set it on the server and restart to add providers here. Providers defined in"," ",e.jsx("code",{children:"config.yml"})," keep working without it."]}),A?e.jsx(Ce,{onAddProvider:()=>{u(null),x(!0)},needsPricing:N,onEnablePricing:()=>d.mutate({default_pricing:!0}),enabling:d.isPending,secretKeyConfigured:P}):null,b&&P?e.jsx(ye,{onClose:()=>x(!1)}):null,y?e.jsx(ke,{provider:y,onClose:()=>u(null),onSaved:K}):null,!o&&l.length>0&&n.data&&n.data.total>0?e.jsx(Se,{healthy:n.data.healthy,degraded:n.data.degraded,total:n.data.total,checkedAt:n.data.checked_at}):null,A?null:e.jsx(me,{ariaLabel:"Providers",columns:W,rows:l,getRowKey:r=>r.instance,isLoading:o,emptyContent:"No providers yet. Add your first provider to start serving models."})]})}export{Ke as ProvidersPage}; diff --git a/src/gateway/static/dashboard/assets/SettingsPage-VWHKo1Ho.js b/src/gateway/static/dashboard/assets/SettingsPage-pwhQKVhQ.js similarity index 99% rename from src/gateway/static/dashboard/assets/SettingsPage-VWHKo1Ho.js rename to src/gateway/static/dashboard/assets/SettingsPage-pwhQKVhQ.js index cd358bfc2..79c858542 100644 --- a/src/gateway/static/dashboard/assets/SettingsPage-VWHKo1Ho.js +++ b/src/gateway/static/dashboard/assets/SettingsPage-pwhQKVhQ.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{W as R,aa as C,P,E as y,_ as E,ah as T,ai as _,aj as D,F as A,ak as O,a7 as F,al as I,I as w}from"./index-DMrbj_xn.js";import{d as v,B as h,A as d,g as K,I as z}from"./heroui-DZj66Arc.js";function b(t,r){return{[t]:r}}function M(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function L(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||M(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(A,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function U({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function V({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(V,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function W({source:t}){const r=O(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:K({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(G,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function X(){var o;const t=F(),r=I(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(W,{source:t}),e.jsx(X,{})]})})]})}function Q({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=T(),r=_(),s=D(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(Q,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&L(l,n)),k=ee(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,t.isLoading?e.jsx(E,{}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(U,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,L as fieldMatches}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{W as R,aa as C,P,E as y,_ as E,ah as T,ai as _,aj as D,F as A,ak as O,a7 as F,al as I,I as w}from"./index-BTsnhpZj.js";import{d as v,B as h,A as d,g as K,I as z}from"./heroui-DZj66Arc.js";function b(t,r){return{[t]:r}}function M(t,r){let s=0;for(const a of r)if(a===t[s]&&(s+=1),s===t.length)return!0;return t.length===0}function L(t,r){const s=r.trim().toLowerCase();if(s==="")return!0;const a=`${t.key} ${t.description??""} ${t.group}`.toLowerCase(),n=t.key.toLowerCase().replace(/[^a-z0-9]/g,"");return s.split(/\s+/).every(i=>a.includes(i)||M(i,n))}function B({checked:t,onChange:r,label:s,disabled:a}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,"aria-label":s,disabled:a,onClick:()=>r(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors disabled:opacity-50 ${t?"bg-[var(--otari-brand)]":"bg-[var(--otari-line)]"}`,children:e.jsx("span",{className:`inline-block h-5 w-5 transform rounded-full bg-white shadow transition-transform ${t?"translate-x-5":"translate-x-0.5"}`})})}function $({field:t,onSave:r,disabled:s}){const a=typeof t.value=="number"?t.value:0,[n,i]=u.useState(String(a)),o=t.type==="float";u.useEffect(()=>{i(String(a))},[a]);const c=Number(n),p=n.trim()!==""&&Number.isFinite(c)&&(o||Number.isInteger(c)),m=t.minimum??void 0,x=t.exclusive_minimum??void 0,g=x!==void 0?c>x:m!==void 0?c>=m:c>=0,l=p&&g&&c!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{type:"number",min:"0",step:o?"any":"1",inputMode:o?"decimal":"numeric","aria-label":t.key,value:n,disabled:s,onChange:f=>i(f.target.value),className:"w-28 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-right text-sm tabular-nums focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!l,onPress:()=>r(c),children:"Save"})]})}function H({field:t,onSave:r,disabled:s}){const a=typeof t.value=="string"?t.value:"",[n,i]=u.useState(a);u.useEffect(()=>{i(a)},[a]);const o=n!==a;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text","aria-label":t.key,value:n,disabled:s,placeholder:"unset",onChange:c=>i(c.target.value),className:"w-56 rounded-md border border-[var(--otari-line)] bg-white px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50"}),e.jsx(h,{size:"sm",variant:"primary","aria-label":`Save ${t.key}`,isDisabled:s||!o,onPress:()=>r(n.trim()===""?null:n),children:"Save"})]})}function Y(t){const{value:r}=t;return r==null?"unset":typeof r=="boolean"?r?"on":"off":Array.isArray(r)?r.length?r.join(", "):"none":String(r)}function q({field:t,patch:r,disabled:s}){return t.settable?t.type==="bool"?e.jsx(B,{checked:t.value===!0,onChange:a=>r(b(t.key,a)),label:t.key,disabled:s}):t.options&&t.options.length>0?e.jsx(A,{ariaLabel:t.key,value:String(t.value??""),onChange:a=>r(b(t.key,a)),options:t.options.map(a=>({value:a,label:a}))}):t.type==="int"||t.type==="float"?e.jsx($,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsx(H,{field:t,onSave:a=>r(b(t.key,a)),disabled:s}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm tabular-nums text-[var(--otari-ink)]",children:Y(t)}),e.jsx("span",{className:"rounded-full border border-[var(--otari-line)] px-2 py-0.5 text-xs text-[var(--otari-muted)]",children:"startup-only"})]})}function U({field:t,patch:r,disabled:s}){return e.jsxs("div",{className:"flex items-start justify-between gap-6 py-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:t.key}),t.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t.description}):null]}),e.jsx("div",{className:"shrink-0 pt-0.5",children:e.jsx(q,{field:t,patch:r,disabled:s})})]})}function V({value:t,fieldRef:r}){const s=u.useRef(null),a=r??s,[n,i]=u.useState(!1),[o,c]=u.useState(!1),p=async()=>{var m,x,g;(m=a.current)==null||m.focus(),(x=a.current)==null||x.select();try{if((g=navigator.clipboard)!=null&&g.writeText){await navigator.clipboard.writeText(t),i(!0),c(!1),window.setTimeout(()=>i(!1),2e3);return}}catch{}c(!0)};return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--otari-muted)]",children:"New master key"}),e.jsx(h,{size:"sm",variant:"outline",onPress:p,children:n?"Copied":"Copy"})]}),e.jsx("input",{ref:a,readOnly:!0,value:t,onFocus:m=>m.currentTarget.select(),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":"true"}),e.jsx("span",{"aria-live":"polite",className:"text-xs text-[var(--otari-brand-dark)]",children:n?"Copied to clipboard.":""}),o?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"Selected. Press Ctrl/Cmd-C to copy."}):null]})}function G({masterKey:t,error:r,isPending:s,onRegenerate:a,onClose:n}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;t!==void 0&&((o=i.current)==null||o.focus(),(c=i.current)==null||c.select())},[t]),e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:t!==void 0?"Master key regenerated":"Regenerate master key?"})}),e.jsx(d.Body,{className:"flex flex-col gap-4",children:t!==void 0?e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"Copy this key now. It is shown once and cannot be retrieved again after you close this dialog."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The previous master key has stopped working. This browser tab now uses the new key."}),e.jsx(V,{value:t,fieldRef:i})]}):e.jsxs(e.Fragment,{children:[e.jsx(w,{tone:"warning",children:"This immediately invalidates the current dashboard master key. Other signed-in dashboard sessions will need the new key to continue."}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"The replacement key will be shown once. Save it before closing the next screen."}),e.jsx(y,{error:r})]})}),e.jsx(d.Footer,{children:t!==void 0?e.jsx(h,{variant:"primary",onPress:n,children:"I’ve saved this key"}):e.jsxs(e.Fragment,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Cancel"}),e.jsx(h,{variant:"danger",isPending:s,onPress:a,children:"Regenerate key"})]})})]})})})}function W({source:t}){const r=O(),[s,a]=u.useState(!1),[n,i]=u.useState(),o=t==="generated",c=()=>r.mutate(void 0,{onSuccess:x=>{i(x.master_key)}}),p=()=>{a(!1),i(void 0),r.reset()},m=x=>{x?(r.reset(),a(!0)):n===void 0&&p()};return e.jsx("div",{className:"flex flex-col gap-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"master_key"}),e.jsx("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:o?"This gateway uses its first-run generated dashboard key. Regeneration invalidates the current key immediately.":"This gateway uses a key managed through OTARI_MASTER_KEY or config.yml. Rotate it in configuration, then restart the gateway."})]}),e.jsxs(d,{isOpen:s,onOpenChange:m,children:[o?e.jsx(d.Trigger,{className:K({size:"sm",variant:"danger-soft"}),children:"Regenerate"}):e.jsx(h,{size:"sm",variant:"danger-soft",isDisabled:!0,children:"Managed in configuration"}),s?e.jsx(G,{masterKey:n,error:r.error,isPending:r.isPending,onRegenerate:c,onClose:p}):null]})]})})}function X(){var o;const t=F(),r=I(),s=r.data,a=((o=t.data)==null?void 0:o.length)??0,n=(t.data??[]).filter(c=>!c.decryptable).length,i=a>0;return e.jsxs("div",{className:"flex flex-col gap-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"OTARI_SECRET_KEY"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Generate a new key with ",e.jsx("code",{children:"uv run otari gen-secret-key"}),", then restart with"," ",e.jsx("code",{children:"OTARI_SECRET_KEY=,"}),". Re-encrypt the stored provider keys, then restart with ",e.jsx("code",{children:"OTARI_SECRET_KEY="})," once none are unreadable."]})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(h,{size:"sm",variant:"outline",isDisabled:!i||r.isPending,onPress:()=>r.mutate(),children:r.isPending?"Re-encrypting…":"Re-encrypt provider keys"})})]}),e.jsx(y,{error:t.error??r.error}),n>0?e.jsxs(w,{tone:"warning",children:[n," stored provider key",n===1?"":"s"," cannot be decrypted with the current"," ",e.jsx("code",{children:"OTARI_SECRET_KEY"}),". Restore the old secret key and re-encrypt, or edit each affected provider and replace its key."]}):null,s?e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",role:"status","aria-live":"polite",children:["Re-encrypted ",s.reencrypted," provider key",s.reencrypted===1?"":"s",".",s.unreadable>0?` ${s.unreadable} still need replacement.`:" All decryptable stored keys now use the primary secret key."]}):!t.isLoading&&!i?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No stored provider keys need re-encryption."}):null]})}function J({masterKeySource:t}){return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Credential security ",e.jsx("span",{className:"font-normal text-[var(--otari-muted)]",children:"(2)"})]}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:[e.jsx(W,{source:t}),e.jsx(X,{})]})})]})}function Q({preview:t,error:r,isPending:s,onAccept:a,onReject:n}){return e.jsx(d.Backdrop,{children:e.jsx(d.Container,{placement:"center",size:"lg",children:e.jsxs(d.Dialog,{children:[e.jsx(d.Header,{children:e.jsx(d.Heading,{children:"Review default price updates"})}),e.jsxs(d.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:[t.added_count," added, ",t.changed_count," changed, and ",t.removed_count," removed upstream model prices. The accepted catalog is saved in the database with source ",e.jsx("code",{children:"genai-prices"})," and reloads after a restart. Your ",t.protected_model_count," custom model price",t.protected_model_count===1?"":"s"," remain unchanged."]}),t.changes.length>0?e.jsx("ul",{className:"max-h-60 list-disc overflow-auto pl-5 text-sm text-[var(--otari-ink)]",children:t.changes.map(i=>e.jsxs("li",{children:[i.model_key,": ",i.change]},i.model_key))}):null,t.changes_truncated?e.jsx("p",{className:"text-xs text-[var(--otari-muted)]",children:"Only the first 100 changes are shown."}):null,e.jsx(y,{error:r})]}),e.jsxs(d.Footer,{children:[e.jsx(h,{variant:"ghost",isDisabled:s,onPress:n,children:"Reject changes"}),e.jsx(h,{variant:"primary",isPending:s,onPress:a,children:"Accept price updates"})]})]})})})}function Z(){const t=T(),r=_(),s=D(),a=t.data,n=r.isPending||s.isPending,i=()=>{a===void 0||n||s.mutate(void 0,{onSuccess:t.reset})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Default pricing catalog"}),e.jsx(v,{children:e.jsxs(v.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-[var(--otari-ink)]",children:"genai-prices defaults"}),e.jsxs("p",{className:"mt-1 max-w-3xl text-sm text-[var(--otari-muted)]",children:["Fetch the latest upstream catalog, review the proposed change summary, then accept or reject it. Accepted data is stored as ",e.jsx("code",{children:"genai-prices"}),"; custom prices remain separate and always take precedence."]})]}),e.jsx(h,{size:"sm",variant:"outline",isDisabled:t.isPending||n,onPress:()=>t.mutate(),children:t.isPending?"Checking prices…":"Check for price updates"})]}),e.jsx(y,{error:t.error})]})}),e.jsxs(d,{isOpen:a!==void 0,onOpenChange:o=>o?void 0:i(),children:[e.jsx(d.Trigger,{className:"hidden",children:"Review price updates"}),a?e.jsx(Q,{preview:a,error:r.error??s.error,isPending:n,onAccept:()=>r.mutate(void 0,{onSuccess:t.reset}),onReject:i}):null]})]})}function ee(t){const r=[],s=new Map;for(const a of t){let n=s.get(a.group);n||(n={name:a.group,fields:[]},s.set(a.group,n),r.push(n)),n.fields.push(a)}return r}function ne(){const t=R(),r=C(),s=t.data,a=r.isPending,[n,i]=u.useState(""),[o,c]=u.useState(!1),p=u.useRef(null);u.useEffect(()=>{function l(f){var N;const j=f.target,S=j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT");f.key==="/"&&!S&&(f.preventDefault(),(N=p.current)==null||N.focus())}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[]);const m=l=>r.mutate(l),x=(s==null?void 0:s.config)??[],g=x.filter(l=>(o?l.settable:!0)&&L(l,n)),k=ee(g);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Settings",description:"Every effective gateway setting. Settable fields apply immediately and persist across restarts; startup-only fields are shown for reference and change only via config.yml or environment variables (then a restart)."}),e.jsx(y,{error:t.error??r.error}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("input",{ref:p,type:"search","aria-label":"Search settings",placeholder:"Search settings (press / to focus)…",value:n,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Escape"&&i("")},className:"min-w-0 flex-1 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none"}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:l=>c(l.target.checked),className:"h-4 w-4 accent-[var(--otari-brand)]"}),"Settable only"]})]}),s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",g.length," of ",x.length," settings"]}):null,s&&g.length===0?e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:"No settings match your search."}):null,t.isLoading?e.jsx(E,{}):null,k.map(l=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:[l.name," ",e.jsxs("span",{className:"font-normal text-[var(--otari-muted)]",children:["(",l.fields.length,")"]})]}),e.jsx(v,{children:e.jsx(v.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:l.fields.map(f=>e.jsx(U,{field:f,patch:m,disabled:!s||a},f.key))})})]},l.name)),s?e.jsx(Z,{}):null,s?e.jsx(J,{masterKeySource:s.master_key_source}):null,s?e.jsxs("p",{className:"text-xs text-[var(--otari-muted)]",children:["Mode: ",s.mode," · Version ",s.version,s.require_pricing?" · require_pricing on":""]}):null]})}export{ne as SettingsPage,L as fieldMatches}; diff --git a/src/gateway/static/dashboard/assets/TablePagination-D_2uYqKa.js b/src/gateway/static/dashboard/assets/TablePagination-Yoj0U_GE.js similarity index 98% rename from src/gateway/static/dashboard/assets/TablePagination-D_2uYqKa.js rename to src/gateway/static/dashboard/assets/TablePagination-Yoj0U_GE.js index 46453d02d..444e07e6c 100644 --- a/src/gateway/static/dashboard/assets/TablePagination-D_2uYqKa.js +++ b/src/gateway/static/dashboard/assets/TablePagination-Yoj0U_GE.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{I as w,E as M,F as D}from"./index-DMrbj_xn.js";import{A as o,B as x,T as F,L as $,I as T,S as y}from"./heroui-DZj66Arc.js";function _({label:t,value:r,onChange:a,isRequired:c,autoFocus:i}){return e.jsxs(F,{value:r,onChange:a,isRequired:c,className:"flex flex-col gap-1",children:[e.jsx($,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsx(T,{inputMode:"decimal",placeholder:"0.00",autoFocus:i})]})}function R(t){const r=t.trim();if(r==="")return null;const a=Number(r);return Number.isFinite(a)&&a>=0?a:Number.NaN}const C=t=>`Recompute cost for ${t.toLocaleString()} imported ${t===1?"row":"rows"} from each row's own token counts at these per-1M rates. Enforced gateway rows are never affected.`;function W({isOpen:t,onOpenChange:r,targetCount:a,isPending:c,error:i,onSubmit:E,title:I="Set price",description:L=C}){const[j,p]=u.useState(""),[n,h]=u.useState(""),[b,N]=u.useState(""),[f,v]=u.useState("");u.useEffect(()=>{t&&(p(""),h(""),N(""),v(""))},[t]);const m=R(j),l=R(n),d=R(b),s=R(f),g=m===null||Number.isNaN(m)||l===null||Number.isNaN(l)||Number.isNaN(d??0)||Number.isNaN(s??0),S=()=>{g||m===null||l===null||E({input_price_per_million:m,output_price_per_million:l,...d!==null&&!Number.isNaN(d)?{cache_read_price_per_million:d}:{},...s!==null&&!Number.isNaN(s)?{cache_write_price_per_million:s}:{}})};return e.jsx(o,{isOpen:t,onOpenChange:r,children:t?e.jsx(o.Backdrop,{children:e.jsx(o.Container,{placement:"center",size:"lg",children:e.jsxs(o.Dialog,{children:[e.jsx(o.Header,{children:e.jsx(o.Heading,{children:I})}),e.jsxs(o.Body,{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:L(a)}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(_,{label:"Input $ / 1M",value:j,onChange:p,isRequired:!0,autoFocus:!0}),e.jsx(_,{label:"Output $ / 1M",value:n,onChange:h,isRequired:!0}),e.jsx(_,{label:"Cache read $ / 1M",value:b,onChange:N}),e.jsx(_,{label:"Cache write $ / 1M",value:f,onChange:v})]}),e.jsx(w,{tone:"info",children:"Leave a cache rate blank to bill those tokens at the input rate."}),e.jsx(M,{error:i})]}),e.jsxs(o.Footer,{children:[e.jsx(x,{variant:"ghost",isDisabled:c,onPress:()=>r(!1),children:"Cancel"}),e.jsx(x,{variant:"primary",isDisabled:g,isPending:c,onPress:S,children:"Set price"})]})]})})}):null})}const P=[25,50,100];function q({page:t,pageSize:r,total:a,rowsOnPage:c,onPageChange:i,onPageSizeChange:E,pageSizeOptions:I=P,isFetching:L=!1,hasNextFallback:j=!1}){const p=u.useId(),n=a!=null?Math.max(1,Math.ceil(a/r)):null,h=t===0,b=n!=null?t>=n-1:!j,N=c>0?t*r+1:0,f=t*r+c,v=a!=null?a===0?"0 of 0":`${N.toLocaleString()}–${f.toLocaleString()} of ${a.toLocaleString()}`:c>0?`${N.toLocaleString()}–${f.toLocaleString()}`:"0",[m,l]=u.useState(String(t+1));u.useEffect(()=>{l(String(t+1))},[t]);const d=()=>{const s=Number.parseInt(m,10);if(Number.isNaN(s)){l(String(t+1));return}const g=n??Number.MAX_SAFE_INTEGER,S=Math.min(Math.max(s,1),g);S-1!==t?i(S-1):l(String(t+1))};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:p,className:"text-sm text-[var(--otari-muted)]",children:"Rows"}),e.jsx(D,{id:p,ariaLabel:"Rows per page",value:String(r),onChange:s=>E(Number.parseInt(s,10)),options:I.map(s=>({value:String(s),label:String(s)}))}),L?e.jsx(y,{size:"sm"}):null]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[var(--otari-muted)] tabular-nums",children:v}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"outline","aria-label":"First page",isDisabled:h,onPress:()=>i(0),children:"«"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Previous page",isDisabled:h,onPress:()=>i(t-1),children:"‹"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{"aria-label":"Page number",inputMode:"numeric",value:m,onChange:s=>l(s.target.value.replace(/[^0-9]/g,"")),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()},onBlur:d,className:"w-12 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-2 py-1 text-center text-sm text-[var(--otari-ink)] tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"}),n!=null?e.jsxs("span",{className:"tabular-nums",children:["/ ",n.toLocaleString()]}):null]}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Next page",isDisabled:b,onPress:()=>i(t+1),children:"›"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Last page",isDisabled:n==null||b,onPress:()=>n!=null&&i(n-1),children:"»"})]})]})]})}export{P,W as S,q as T}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as u}from"./react-dgEcD0HR.js";import{I as w,E as M,F as D}from"./index-BTsnhpZj.js";import{A as o,B as x,T as F,L as $,I as T,S as y}from"./heroui-DZj66Arc.js";function _({label:t,value:r,onChange:a,isRequired:c,autoFocus:i}){return e.jsxs(F,{value:r,onChange:a,isRequired:c,className:"flex flex-col gap-1",children:[e.jsx($,{className:"text-sm font-medium text-[var(--otari-ink)]",children:t}),e.jsx(T,{inputMode:"decimal",placeholder:"0.00",autoFocus:i})]})}function R(t){const r=t.trim();if(r==="")return null;const a=Number(r);return Number.isFinite(a)&&a>=0?a:Number.NaN}const C=t=>`Recompute cost for ${t.toLocaleString()} imported ${t===1?"row":"rows"} from each row's own token counts at these per-1M rates. Enforced gateway rows are never affected.`;function W({isOpen:t,onOpenChange:r,targetCount:a,isPending:c,error:i,onSubmit:E,title:I="Set price",description:L=C}){const[j,p]=u.useState(""),[n,h]=u.useState(""),[b,N]=u.useState(""),[f,v]=u.useState("");u.useEffect(()=>{t&&(p(""),h(""),N(""),v(""))},[t]);const m=R(j),l=R(n),d=R(b),s=R(f),g=m===null||Number.isNaN(m)||l===null||Number.isNaN(l)||Number.isNaN(d??0)||Number.isNaN(s??0),S=()=>{g||m===null||l===null||E({input_price_per_million:m,output_price_per_million:l,...d!==null&&!Number.isNaN(d)?{cache_read_price_per_million:d}:{},...s!==null&&!Number.isNaN(s)?{cache_write_price_per_million:s}:{}})};return e.jsx(o,{isOpen:t,onOpenChange:r,children:t?e.jsx(o.Backdrop,{children:e.jsx(o.Container,{placement:"center",size:"lg",children:e.jsxs(o.Dialog,{children:[e.jsx(o.Header,{children:e.jsx(o.Heading,{children:I})}),e.jsxs(o.Body,{className:"flex flex-col gap-4",children:[e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:L(a)}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(_,{label:"Input $ / 1M",value:j,onChange:p,isRequired:!0,autoFocus:!0}),e.jsx(_,{label:"Output $ / 1M",value:n,onChange:h,isRequired:!0}),e.jsx(_,{label:"Cache read $ / 1M",value:b,onChange:N}),e.jsx(_,{label:"Cache write $ / 1M",value:f,onChange:v})]}),e.jsx(w,{tone:"info",children:"Leave a cache rate blank to bill those tokens at the input rate."}),e.jsx(M,{error:i})]}),e.jsxs(o.Footer,{children:[e.jsx(x,{variant:"ghost",isDisabled:c,onPress:()=>r(!1),children:"Cancel"}),e.jsx(x,{variant:"primary",isDisabled:g,isPending:c,onPress:S,children:"Set price"})]})]})})}):null})}const P=[25,50,100];function q({page:t,pageSize:r,total:a,rowsOnPage:c,onPageChange:i,onPageSizeChange:E,pageSizeOptions:I=P,isFetching:L=!1,hasNextFallback:j=!1}){const p=u.useId(),n=a!=null?Math.max(1,Math.ceil(a/r)):null,h=t===0,b=n!=null?t>=n-1:!j,N=c>0?t*r+1:0,f=t*r+c,v=a!=null?a===0?"0 of 0":`${N.toLocaleString()}–${f.toLocaleString()} of ${a.toLocaleString()}`:c>0?`${N.toLocaleString()}–${f.toLocaleString()}`:"0",[m,l]=u.useState(String(t+1));u.useEffect(()=>{l(String(t+1))},[t]);const d=()=>{const s=Number.parseInt(m,10);if(Number.isNaN(s)){l(String(t+1));return}const g=n??Number.MAX_SAFE_INTEGER,S=Math.min(Math.max(s,1),g);S-1!==t?i(S-1):l(String(t+1))};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:p,className:"text-sm text-[var(--otari-muted)]",children:"Rows"}),e.jsx(D,{id:p,ariaLabel:"Rows per page",value:String(r),onChange:s=>E(Number.parseInt(s,10)),options:I.map(s=>({value:String(s),label:String(s)}))}),L?e.jsx(y,{size:"sm"}):null]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-[var(--otari-muted)] tabular-nums",children:v}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(x,{size:"sm",variant:"outline","aria-label":"First page",isDisabled:h,onPress:()=>i(0),children:"«"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Previous page",isDisabled:h,onPress:()=>i(t-1),children:"‹"}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-[var(--otari-muted)]",children:[e.jsx("input",{"aria-label":"Page number",inputMode:"numeric",value:m,onChange:s=>l(s.target.value.replace(/[^0-9]/g,"")),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()},onBlur:d,className:"w-12 rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-2 py-1 text-center text-sm text-[var(--otari-ink)] tabular-nums focus:border-[var(--otari-brand)] focus:outline-none"}),n!=null?e.jsxs("span",{className:"tabular-nums",children:["/ ",n.toLocaleString()]}):null]}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Next page",isDisabled:b,onPress:()=>i(t+1),children:"›"}),e.jsx(x,{size:"sm",variant:"outline","aria-label":"Last page",isDisabled:n==null||b,onPress:()=>n!=null&&i(n-1),children:"»"})]})]})]})}export{P,W as S,q as T}; diff --git a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-CBa0KCZv.js b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-Digl65z3.js similarity index 99% rename from src/gateway/static/dashboard/assets/ToolsGuardrailsPage-CBa0KCZv.js rename to src/gateway/static/dashboard/assets/ToolsGuardrailsPage-Digl65z3.js index 5cfd6daf4..68631d309 100644 --- a/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-CBa0KCZv.js +++ b/src/gateway/static/dashboard/assets/ToolsGuardrailsPage-Digl65z3.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x}from"./react-dgEcD0HR.js";import{am as L,an as C,P,E,_ as R,U as w,ao as D,F as U}from"./index-DMrbj_xn.js";import{d as N,B as g}from"./heroui-DZj66Arc.js";function M(s,t){return{[s]:t}}const B=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=x.useState(null),a=x.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function z({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",b="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r),[m,p]=x.useState(null),c=D();x.useEffect(()=>{i(r)},[r]);const o=l.trim()!==r,d=l.trim(),h=m!==null&&m===d;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:l,disabled:n,placeholder:"unset",onChange:v=>{i(v.target.value),c.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(d===""?null:d),children:"Save"}),e.jsx(g,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:d===""||c.isPending,onPress:()=>{p(d),c.mutate({service:s.service,url:d})},children:c.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:c.isPending||!h?null:c.error?e.jsx("span",{className:"text-red-700",children:w(c.error)}):c.data?e.jsx("span",{className:c.data.ok?"font-medium text-green-700":"text-red-700",children:c.data.reason}):null}),e.jsx(j,{message:a})]})]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:p=>i(p.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(l.trim()===""?null:l.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l.trim(),p=Number(m),o=(m===""||Number.isInteger(p)&&p>=1)&&m!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:d=>i(d.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(m===""?null:p),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(U,{ariaLabel:s.key,value:r,onChange:l=>t(l==="default"?null:l==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function O({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(F,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n})}function V(){const s=L(),t=C(),[a,n]=$(),[r,l]=x.useState({}),i=s.data,m=!i||t.isPending,p=new Map(((i==null?void 0:i.fields)??[]).map(o=>[o.key,o])),c=(o,d)=>{l(h=>{const{[o.key]:v,...u}=h;return u}),t.mutate(M(o.key,d),{onSuccess:()=>n(`${o.key} saved`),onError:h=>l(v=>({...v,[o.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(E,{error:s.error}),s.isLoading?e.jsx(R,{}):null,B.map(o=>{const d=o.order.map(u=>p.get(u)).filter(u=>u!==void 0),h=((i==null?void 0:i.fields)??[]).filter(u=>u.service===o.key&&!o.order.includes(u.key)),v=[...d,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:o.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:o.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(O,{field:u,onSave:T=>c(u,T),saveError:r[u.key],disabled:m},u.key))})})]},o.key)}),e.jsx(z,{message:a})]})}export{V as ToolsGuardrailsPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as x}from"./react-dgEcD0HR.js";import{am as L,an as C,P,E,_ as R,U as w,ao as D,F as U}from"./index-BTsnhpZj.js";import{d as N,B as g}from"./heroui-DZj66Arc.js";function M(s,t){return{[s]:t}}const B=[{key:"web_search",label:"Web search",blurb:"Backend for otari_web_search tools (a SearXNG instance or a search adapter).",order:["web_search_url","web_search_engines","web_search_max_results","web_search_extract","web_search_purpose_hint"]},{key:"sandbox",label:"Code execution",blurb:"Backend for otari_code_execution tools (the sandbox that runs generated code).",order:["sandbox_url","sandbox_purpose_hint"]},{key:"guardrails",label:"Guardrails",blurb:"Default input-guardrails service used when a request does not pass its own guardrail URL.",order:["guardrails_url"]}];function $(){const[s,t]=x.useState(null),a=x.useRef(void 0),n=r=>{t(r),window.clearTimeout(a.current),a.current=window.setTimeout(()=>t(null),2500)};return x.useEffect(()=>()=>window.clearTimeout(a.current),[]),[s,n]}function z({message:s}){return s?e.jsxs("div",{role:"status","aria-live":"polite",className:"fixed right-4 bottom-4 z-50 flex items-center gap-2 rounded-lg border border-green-200 bg-green-50 px-4 py-3 text-sm font-medium text-green-700 shadow-lg",children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"h-5 w-5",children:e.jsx("path",{d:"M20 6 9 17l-5-5",strokeLinecap:"round",strokeLinejoin:"round"})}),s]}):null}const S="rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2 py-1 text-sm focus:border-[var(--otari-brand)] focus:outline-none disabled:opacity-50",b="grid gap-x-4 gap-y-1.5 py-4 sm:grid-cols-[minmax(0,1fr)_16rem_10rem] sm:items-start",_=`w-full sm:col-start-2 ${S}`,k="flex items-center gap-2 sm:col-start-3",f="flex flex-col gap-1 sm:col-span-2 sm:col-start-2";function j({message:s}){return s?e.jsx("span",{className:"break-words text-xs text-red-700",children:s}):null}function y({field:s,help:t}){return e.jsxs("div",{className:"min-w-0 sm:col-start-1",children:[e.jsx("code",{className:"text-sm font-medium text-[var(--otari-ink)]",children:s.key}),s.description?e.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:s.description}):null,t?e.jsx("p",{className:"mt-1 text-xs text-[var(--otari-muted)]",children:t}):null]})}function G({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r),[m,p]=x.useState(null),c=D();x.useEffect(()=>{i(r)},[r]);const o=l.trim()!==r,d=l.trim(),h=m!==null&&m===d;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank and Save to fall back to the configured default."}),e.jsx("input",{type:"text",inputMode:"url","aria-label":s.key,value:l,disabled:n,placeholder:"unset",onChange:v=>{i(v.target.value),c.reset()},className:_}),e.jsxs("div",{className:k,children:[e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(d===""?null:d),children:"Save"}),e.jsx(g,{size:"sm",variant:"outline","aria-label":`Test ${s.service}`,isDisabled:d===""||c.isPending,onPress:()=>{p(d),c.mutate({service:s.service,url:d})},children:c.isPending?"Testing…":"Test"})]}),e.jsxs("div",{className:f,children:[e.jsx("span",{role:"status","aria-live":"polite",className:"block break-words text-xs",children:c.isPending||!h?null:c.error?e.jsx("span",{className:"text-red-700",children:w(c.error)}):c.data?e.jsx("span",{className:c.data.ok?"font-medium text-green-700":"text-red-700",children:c.data.reason}):null}),e.jsx(j,{message:a})]})]})}function I({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="string"?s.value:"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("input",{type:"text","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:p=>i(p.target.value),className:_}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!m,onPress:()=>t(l.trim()===""?null:l.trim()),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function A({field:s,onSave:t,saveError:a,disabled:n}){const r=typeof s.value=="number"?String(s.value):"",[l,i]=x.useState(r);x.useEffect(()=>{i(r)},[r]);const m=l.trim(),p=Number(m),o=(m===""||Number.isInteger(p)&&p>=1)&&m!==r;return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s,help:"Leave blank to use the backend default."}),e.jsx("input",{type:"number",min:"1",step:"1",inputMode:"numeric","aria-label":s.key,value:l,disabled:n,placeholder:"default",onChange:d=>i(d.target.value),className:`w-full text-right tabular-nums sm:col-start-2 sm:w-28 sm:justify-self-end ${S}`}),e.jsx("div",{className:k,children:e.jsx(g,{size:"sm",variant:"primary","aria-label":`Save ${s.key}`,isDisabled:n||!o,onPress:()=>t(m===""?null:p),children:"Save"})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function F({field:s,onSave:t,saveError:a,disabled:n}){const r=s.value===!0?"on":s.value===!1?"off":"default";return e.jsxs("div",{className:b,children:[e.jsx(y,{field:s}),e.jsx("div",{className:"sm:col-start-2 sm:justify-self-start",children:e.jsx(U,{ariaLabel:s.key,value:r,onChange:l=>t(l==="default"?null:l==="on"),options:[{value:"default",label:"Default"},{value:"on",label:"On"},{value:"off",label:"Off"}],disabled:n})}),a?e.jsx("div",{className:f,children:e.jsx(j,{message:a})}):null]})}function O({field:s,onSave:t,saveError:a,disabled:n}){return s.type==="url"?e.jsx(G,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="int"?e.jsx(A,{field:s,onSave:t,saveError:a,disabled:n}):s.type==="bool"?e.jsx(F,{field:s,onSave:t,saveError:a,disabled:n}):e.jsx(I,{field:s,onSave:t,saveError:a,disabled:n})}function V(){const s=L(),t=C(),[a,n]=$(),[r,l]=x.useState({}),i=s.data,m=!i||t.isPending,p=new Map(((i==null?void 0:i.fields)??[]).map(o=>[o.key,o])),c=(o,d)=>{l(h=>{const{[o.key]:v,...u}=h;return u}),t.mutate(M(o.key,d),{onSuccess:()=>n(`${o.key} saved`),onError:h=>l(v=>({...v,[o.key]:w(h)}))})};return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(P,{title:"Tools & Guardrails",description:"Configure the built-in tool and guardrail service endpoints without a restart. Changes apply immediately and persist. URLs are validated for shape (http/https) and can be tested for reachability before saving; the network-safety gates for these services live on the Settings page."}),e.jsx(E,{error:s.error}),s.isLoading?e.jsx(R,{}):null,B.map(o=>{const d=o.order.map(u=>p.get(u)).filter(u=>u!==void 0),h=((i==null?void 0:i.fields)??[]).filter(u=>u.service===o.key&&!o.order.includes(u.key)),v=[...d,...h];return v.length===0?null:e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:o.label}),e.jsx("p",{className:"text-sm text-[var(--otari-muted)]",children:o.blurb}),e.jsx(N,{children:e.jsx(N.Content,{className:"flex flex-col divide-y divide-[var(--otari-line)] px-5 py-1",children:v.map(u=>e.jsx(O,{field:u,onSave:T=>c(u,T),saveError:r[u.key],disabled:m},u.key))})})]},o.key)}),e.jsx(z,{message:a})]})}export{V as ToolsGuardrailsPage}; diff --git a/src/gateway/static/dashboard/assets/UsagePage-5U02HhO3.js b/src/gateway/static/dashboard/assets/UsagePage-1stKL9u3.js similarity index 99% rename from src/gateway/static/dashboard/assets/UsagePage-5U02HhO3.js rename to src/gateway/static/dashboard/assets/UsagePage-1stKL9u3.js index b018abc61..e12787d6d 100644 --- a/src/gateway/static/dashboard/assets/UsagePage-5U02HhO3.js +++ b/src/gateway/static/dashboard/assets/UsagePage-1stKL9u3.js @@ -1 +1 @@ -import{j as t}from"./tanstack-query-1t81HyiD.js";import{i as _t,r as d}from"./react-dgEcD0HR.js";import{u as yt,c as bt,n as ke,i as xt,g as _e,ap as ft,aq as gt,a0 as X,ar as He,P as jt,E as St,m as ye,f as wt,R as Nt,as as We,B as Ct,a1 as I,a3 as J,a2 as xe,a5 as Be,at as K,F as Et,h as Lt,N as Tt,r as Ft}from"./index-DMrbj_xn.js";import{S as ee,C as Rt,T as Ot}from"./charts-DNysd9jl.js";import{D as At}from"./DataTable-CrQq0sYf.js";import{F as Pt}from"./FilterChips-BLdhUEZK.js";import{B as R,S as Ue}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function te(c){return c.toLocaleString()}function qt(c){return c===null?"—":c<1e3?`${Math.round(c)} ms`:`${(c/1e3).toFixed(2)} s`}function Dt(c,x){const f=new Date(c);return Number.isNaN(f.getTime())?c:x==="hour"?f.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):f.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const Me=Lt(We,He),be=15,$e=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}],Bt=[{value:"",label:"None"},{value:"model",label:"Model"},{value:"user_id",label:"User"},{value:"api_key_id",label:"API key"},{value:"source",label:"Source"}],Ut=[{key:"fresh",label:"Fresh input",color:"var(--otari-ink)"},{key:"cache_read",label:"Cache read",color:"var(--otari-brand)"},{key:"cache_write",label:"Cache write",color:"var(--otari-brand-soft)"},{key:"output",label:"Output",color:"var(--otari-brand-dark)"}],Mt=[{key:"success",label:"Succeeded",color:"var(--otari-brand)"},{key:"errors",label:"Failed",color:"var(--otari-danger)"}],Ie=["var(--otari-cat-1)","var(--otari-cat-2)","var(--otari-cat-3)","var(--otari-cat-4)","var(--otari-cat-5)","var(--otari-cat-6)","var(--otari-cat-7)","var(--otari-cat-8)"],$t="var(--otari-cat-other)";function It(c){return c==="cost"?xe:c==="tokens"?K:te}const Ke="__other__",ze="__unknown__";function Ge({dimensionLabel:c,rows:x,totalCost:f,emptyLabel:b,unknownLabel:se="(unknown)",onDrill:L,loading:O}){const[h,P]=d.useState(!1),z=h?x:x.slice(0,be),G=x.length-z.length,re=r=>r.is_other?Ke:r.key??ze,H=[{id:"name",header:c,isRowHeader:!0,cell:r=>{const q=f>0?r.cost/f:0;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"truncate text-[var(--otari-ink)]",children:r.is_other?`Other (${r.requests.toLocaleString()} req)`:r.key===null?se:r.key}),t.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:t.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,q*100)}%`}})})]})}},{id:"requests",header:"Requests",align:"end",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:te(r.requests)})},{id:"tokens",header:"Tokens",align:"end",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:K(r.tokens)})},{id:"spend",header:"Spend",align:"end",cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:xe(r.cost)})}];return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(At,{ariaLabel:`Spend by ${c.toLowerCase()}`,columns:H,rows:z,getRowKey:re,isLoading:O,emptyContent:b,onRowAction:r=>{r!==Ke&&r!==ze&&L(r)}}),!O&&G>0?t.jsxs(R,{size:"sm",variant:"ghost",onPress:()=>P(!0),children:["Show all ",x.length]}):null,!O&&h&&x.length>be?t.jsxs(R,{size:"sm",variant:"ghost",onPress:()=>P(!1),children:["Show top ",be]}):null]})}const Kt=["model","user","source_label","endpoint","provider","source"],zt=["model"];function Jt(){var Oe,Ae,Pe,qe;const c=_t(),x=yt(),f=bt(),[b,se]=d.useState(Me),[L,O]=d.useState(()=>ke(Me.seconds??0)),[h,P]=d.useState(!1),[z,G]=d.useState(),[re,H]=d.useState(),[r,q]=d.useState(""),[k,ae]=d.useState(""),[p,oe]=d.useState(""),[u,Ye]=d.useState("cost"),[T,Ze]=d.useState(""),v=h?z:L,g=h?re:void 0,w=h?v?xt(v,g):"day":b.bucket,N=d.useMemo(()=>({start_date:v,end_date:g,model:r.trim()||void 0,user_id:k||void 0,api_key_id:p||void 0}),[v,g,r,k,p]),D=d.useMemo(()=>{if(h){if(!v||!g)return null;const e=new Date(g).getTime()-new Date(v).getTime();return e>0?{...N,start_date:new Date(new Date(v).getTime()-e).toISOString(),end_date:v}:null}return!L||b.seconds===null?null:{...N,start_date:new Date(new Date(L).getTime()-b.seconds*1e3).toISOString(),end_date:L}},[h,v,g,N,b.seconds,L]),j=_e(N,w,Kt),ne=_e(D??N,w,Tt,D!==null),C=ft(N,w,T||null),le=T!==""&&C.error instanceof gt&&C.error.status===404,F=le?"":T,s=j.data,a=s==null?void 0:s.totals,_=D!==null?(Oe=ne.data)==null?void 0:Oe.totals:void 0,fe=a?X(a.cost,_==null?void 0:_.cost):null,Qe=d.useMemo(()=>({...N,model:void 0}),[N]),ge=_e(Qe,w,zt),ie=((Pe=(Ae=ge.data)==null?void 0:Ae.by_model)==null?void 0:Pe.filter(e=>!e.is_other&&e.key!==null).map(e=>e.key))??[],je=(x.data??[]).map(e=>({value:e.user_id,label:e.alias?`${e.alias} (${e.user_id})`:e.user_id})),ce=(f.data??[]).map(e=>({value:e.id,label:e.key_name??`${e.id.slice(0,8)}…`})),Ve=e=>{var n;return((n=ce.find(l=>l.value===e))==null?void 0:n.label)??e},Xe=(r&&!ie.includes(r)?[r,...ie]:ie).map(e=>({value:e,label:e})),Je=h||b.key!==He,de=!!(r.trim()||k||p||Je),Se=(e,n)=>{var l;return((l=e.find(o=>o.value===n))==null?void 0:l.label)??n},et=()=>{q(""),ae(""),oe("")},tt=[...k?[{key:"user",label:"User",value:Se(je,k),onClear:()=>ae("")}]:[],...r.trim()?[{key:"model",label:"Model",value:r.trim(),onClear:()=>q("")}]:[],...p?[{key:"key",label:"API key",value:Se(ce,p),onClear:()=>oe("")}]:[]],st=!!(s&&a&&a.request_count===0&&!de),rt=(s==null?void 0:s.start_date)??v,at=(s==null?void 0:s.end_date)??g,we=e=>{P(!1),se(e),O(ke(e.seconds??0)),G(void 0),H(void 0)},ot=(e,n)=>{P(!0),G(e),H(n)},nt=()=>{h||O(ke(b.seconds??0)),j.refetch(),ge.refetch(),D!==null&&ne.refetch(),T&&C.refetch()},A=e=>{const n=new URLSearchParams;v&&n.set("start_date",v),g&&n.set("end_date",g);for(const[l,o]of Object.entries(e))o&&n.set(l,o);c(`/activity?${n.toString()}`)},lt=a&&a.request_count>0?a.error_count/a.request_count:0,Ne=((s==null?void 0:s.by_source)??[]).filter(e=>!e.is_other).length>1,it=Ne||T==="source",m=(s==null?void 0:s.series)??[],W=m.length>1,Ce=a==null?void 0:a.billed_input_tokens,Y=a===void 0?null:Ce!==void 0?Ce+(a.billed_output_tokens??a.completion_tokens):a.total_tokens,ct=_===void 0?null:_.billed_input_tokens!==void 0?_.billed_input_tokens+(_.billed_output_tokens??_.completion_tokens):_.total_tokens,Ee=e=>{let n=0,l=0,o=0;for(const y of e)n+=y.input_tokens??0,l+=y.cache_read_tokens??0,o+=y.cache_write_tokens??0;return{input:n,read:l,write:o}},B=Ee(m),Z=B.input>0?B.read/B.input:null,ue=Ee(D!==null?((qe=ne.data)==null?void 0:qe.series)??[]:[]),Le=ue.input>0?ue.read/ue.input:void 0,Te=e=>e.input_tokens!==void 0?e.input_tokens+(e.output_tokens??0):e.tokens,me=m.some(e=>(e.input_tokens??0)>0),Fe=m.some(e=>(e.errors??0)>0),E=d.useMemo(()=>{var l;const e=m.map(o=>o.bucket_start);if(F){const o=C.data;if(!o)return{series:[],data:[]};const y=o.groups.map((i,S)=>({key:`g${S}`,label:i.is_other?"Other":i.key===null?"(unknown)":F==="api_key_id"?Ve(i.key):i.key,color:i.is_other?$t:Ie[S%Ie.length]})),V=new Map(o.groups.map((i,S)=>[`${i.is_other}|${i.key}`,`g${S}`])),$=new Map(e.map(i=>[i,{x:i,...Object.fromEntries(y.map(S=>[S.key,0]))}]));for(const i of o.points){const S=V.get(`${i.is_other}|${i.key}`),De=$.get(i.bucket_start);!S||!De||(De[S]=u==="cost"?i.cost:u==="tokens"?i.tokens:i.requests)}return{series:y,data:[...$.values()]}}return u==="tokens"&&me?{series:Ut,data:m.map(o=>{const y=o.input_tokens??0,V=o.cache_read_tokens??0,$=o.cache_write_tokens??0;return{x:o.bucket_start,fresh:Math.max(0,y-V-$),cache_read:V,cache_write:$,output:o.output_tokens??0}})}:u==="requests"&&Fe?{series:Mt,data:m.map(o=>{const y=Math.min(o.errors??0,o.requests);return{x:o.bucket_start,success:o.requests-y,errors:y}})}:{series:[{key:u,label:((l=$e.find(o=>o.key===u))==null?void 0:l.label)??u,color:"var(--otari-brand)"}],data:m.map(o=>({x:o.bucket_start,[u]:u==="cost"?o.cost:u==="tokens"?Te(o):o.requests}))}},[m,F,C.data,u,me,Fe,f.data]),Re=It(u),dt=j.isLoading||!!F&&C.isLoading,ut=E.data.length?Math.max(...E.data.map(e=>E.series.reduce((n,l)=>n+(typeof e[l.key]=="number"?e[l.key]:0),0))):0,mt=m.map(e=>e.bucket_start),ht=(e,n)=>{const l=Ft(mt,e,n,w);l&&ot(l.startIso,l.endIso)},he=[{key:"model",label:"Model",rows:(s==null?void 0:s.by_model)??[],drill:e=>A({model:e,user_id:k||void 0,api_key_id:p||void 0})},{key:"user",label:"User",rows:(s==null?void 0:s.by_user)??[],drill:e=>A({user_id:e,model:r.trim()||void 0,api_key_id:p||void 0})}],pt=[{key:"source_label",label:"Session",rows:(s==null?void 0:s.by_source_label)??[],unknownLabel:"(no session)",drill:e=>A({source_label:e,model:r.trim()||void 0,user_id:k||void 0,api_key_id:p||void 0})},{key:"endpoint",label:"Endpoint",rows:(s==null?void 0:s.by_endpoint)??[],drill:e=>A({endpoint:e,model:r.trim()||void 0,user_id:k||void 0,api_key_id:p||void 0})},{key:"provider",label:"Provider",rows:(s==null?void 0:s.by_provider)??[],drill:e=>A({provider:e,model:r.trim()||void 0,user_id:k||void 0,api_key_id:p||void 0})},{key:"source",label:"Source",rows:(s==null?void 0:s.by_source)??[],drill:e=>A({source:e,model:r.trim()||void 0,user_id:k||void 0,api_key_id:p||void 0})}],[pe,vt]=d.useState("model"),[Q,kt]=d.useState("source_label"),U=he.find(e=>e.key===pe)??he[0],ve=pt.filter(e=>e.key!=="source"||Ne||Q==="source"),M=ve.find(e=>e.key===Q)??ve[0];return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(jt,{title:"Usage & analytics",description:"Spend, tokens, cache use, and request volume over time. Group the chart by model, user, key, or source, and click a breakdown row to drill into the request log."}),t.jsx(St,{error:j.error??(T!==""&&!le?C.error:null)}),t.jsxs(Pt,{chips:tt,onClearAll:et,start:We.map(e=>t.jsx(R,{size:"sm",variant:!h&&b.key===e.key?"primary":"outline",onPress:()=>we(e),children:e.label},e.key)),end:t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",wt(rt,at)," · UTC"]}),t.jsx(Nt,{onRefresh:nt,isFetching:j.isFetching,updatedAt:j.dataUpdatedAt})]}),children:[t.jsx(ye,{label:"User",value:k,onChange:ae,options:je,placeholder:"All users"}),t.jsx(ye,{label:"Model",value:r,onChange:q,options:Xe,placeholder:"All models"}),t.jsx(ye,{label:"API key",value:p,onChange:oe,options:ce,placeholder:"All keys"})]}),st?t.jsx(Ct,{title:"No usage yet",description:"Once the gateway serves requests, spend and volume appear here."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-5",children:[t.jsx(I,{label:"Tracked cost",value:a?xe(a.cost):"—",hint:a?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t.jsx(J,{fraction:fe}),a.unpriced_requests?`${fe!==null?" · ":""}${te(a.unpriced_requests)} unpriced`:null]}):null,chart:W?t.jsx(ee,{values:m.map(e=>e.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),t.jsx(I,{label:"Requests",value:a?te(a.request_count):"—",hint:a?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Be(lt)," errors",_?t.jsxs(t.Fragment,{children:[" · ",t.jsx(J,{fraction:X(a.request_count,_.request_count)})]}):null]}):null,chart:W?t.jsx(ee,{values:m.map(e=>e.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),t.jsx(I,{label:"Tokens (billed)",value:Y!==null?K(Y):"—",hint:Y!==null?t.jsx(J,{fraction:X(Y,ct??void 0)}):null,chart:W?t.jsx(ee,{values:m.map(Te),ariaLabel:"Billed token trend over the selected window"}):void 0}),t.jsx(I,{label:"Cache hit rate",value:Z!==null?Be(Z):"—",hint:a?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Z!==null&&Le!==void 0?t.jsxs(t.Fragment,{children:[t.jsx(J,{fraction:X(Z,Le)})," · "]}):null,K(B.read)," read · ",K(B.write)," written"]}):null,chart:W&&me?t.jsx(ee,{values:m.map(e=>(e.input_tokens??0)>0?(e.cache_read_tokens??0)/(e.input_tokens??1):0),ariaLabel:"Cache hit rate trend over the selected window"}):void 0}),t.jsx(I,{label:"Avg latency",value:a?qt(a.avg_latency_ms):"—"})]}),t.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("div",{className:"inline-flex gap-1.5",children:$e.map(e=>t.jsx(R,{size:"sm",variant:u===e.key?"primary":"outline","aria-pressed":u===e.key,onPress:()=>Ye(e.key),children:e.label},e.key))}),t.jsxs("div",{className:"flex items-center gap-2",children:[h?t.jsx(R,{size:"sm",variant:"ghost",onPress:()=>we(b),children:"Reset zoom"}):null,j.isFetching||F&&C.isFetching?t.jsx(Ue,{size:"sm"}):null,t.jsx(Et,{ariaLabel:"Group by",value:T,onChange:e=>Ze(e),options:Bt.filter(e=>e.value!=="source"||it).map(e=>({value:e.value,label:e.value?`By ${e.label.toLowerCase()}`:"No grouping"}))})]})]}),le?t.jsx("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:"The running gateway predates grouped series, so the chart shows ungrouped totals. Restart the gateway on this build to enable grouping."}):null,t.jsx(Rt,{series:E.series}),dt?t.jsx("div",{className:"flex h-64 items-center justify-center",children:t.jsx(Ue,{size:"sm"})}):E.data.length===0?t.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):t.jsxs("figure",{className:"flex flex-col gap-2",children:[t.jsx(Ot,{data:E.data,series:E.series,formatValue:Re,formatXTick:e=>Dt(e,w),ariaLabel:`${u} per ${w}${F?`, grouped by ${F}`:""}`,height:260,showYAxis:!0,showTotal:!0,onSelectRange:ht}),t.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[Re(ut)," peak · ",E.data.length," ",w==="hour"?"hours":"days"," (times in UTC) · drag across the chart to zoom"]})]})]}),t.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Spend by ",U.label.toLowerCase()]}),t.jsx("div",{className:"inline-flex gap-1.5",children:he.map(e=>t.jsx(R,{size:"sm",variant:pe===e.key?"primary":"outline","aria-pressed":pe===e.key,onPress:()=>vt(e.key),children:e.label},e.key))})]}),t.jsx(Ge,{dimensionLabel:U.label,rows:U.rows,totalCost:(a==null?void 0:a.cost)??0,emptyLabel:de?"No usage matches these filters.":"No usage recorded yet.",unknownLabel:U.unknownLabel,onDrill:U.drill,loading:j.isLoading})]}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Spend by ",M.label.toLowerCase()]}),t.jsx("div",{className:"inline-flex gap-1.5",children:ve.map(e=>t.jsx(R,{size:"sm",variant:Q===e.key?"primary":"outline","aria-pressed":Q===e.key,onPress:()=>kt(e.key),children:e.label},e.key))})]}),t.jsx(Ge,{dimensionLabel:M.label,rows:M.rows,totalCost:(a==null?void 0:a.cost)??0,emptyLabel:de?"No usage matches these filters.":"No usage recorded yet.",unknownLabel:M.unknownLabel,onDrill:M.drill,loading:j.isLoading})]})]})]})]})}export{Jt as UsagePage}; +import{j as t}from"./tanstack-query-1t81HyiD.js";import{i as _t,r as d}from"./react-dgEcD0HR.js";import{u as yt,c as bt,n as ke,i as xt,g as _e,ap as ft,aq as gt,a0 as X,ar as He,P as jt,E as St,m as ye,f as wt,R as Nt,as as We,B as Ct,a1 as I,a3 as J,a2 as xe,a5 as Be,at as K,F as Et,h as Lt,N as Tt,r as Ft}from"./index-BTsnhpZj.js";import{S as ee,C as Rt,T as Ot}from"./charts-d2MDwLL0.js";import{D as At}from"./DataTable-CrQq0sYf.js";import{F as Pt}from"./FilterChips-BLdhUEZK.js";import{B as R,S as Ue}from"./heroui-DZj66Arc.js";import"./recharts-BwTTRGtj.js";function te(c){return c.toLocaleString()}function qt(c){return c===null?"—":c<1e3?`${Math.round(c)} ms`:`${(c/1e3).toFixed(2)} s`}function Dt(c,x){const f=new Date(c);return Number.isNaN(f.getTime())?c:x==="hour"?f.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):f.toLocaleDateString(void 0,{month:"short",day:"numeric",timeZone:"UTC"})}const Me=Lt(We,He),be=15,$e=[{key:"cost",label:"Cost"},{key:"tokens",label:"Tokens"},{key:"requests",label:"Requests"}],Bt=[{value:"",label:"None"},{value:"model",label:"Model"},{value:"user_id",label:"User"},{value:"api_key_id",label:"API key"},{value:"source",label:"Source"}],Ut=[{key:"fresh",label:"Fresh input",color:"var(--otari-ink)"},{key:"cache_read",label:"Cache read",color:"var(--otari-brand)"},{key:"cache_write",label:"Cache write",color:"var(--otari-brand-soft)"},{key:"output",label:"Output",color:"var(--otari-brand-dark)"}],Mt=[{key:"success",label:"Succeeded",color:"var(--otari-brand)"},{key:"errors",label:"Failed",color:"var(--otari-danger)"}],Ie=["var(--otari-cat-1)","var(--otari-cat-2)","var(--otari-cat-3)","var(--otari-cat-4)","var(--otari-cat-5)","var(--otari-cat-6)","var(--otari-cat-7)","var(--otari-cat-8)"],$t="var(--otari-cat-other)";function It(c){return c==="cost"?xe:c==="tokens"?K:te}const Ke="__other__",ze="__unknown__";function Ge({dimensionLabel:c,rows:x,totalCost:f,emptyLabel:b,unknownLabel:se="(unknown)",onDrill:L,loading:O}){const[h,P]=d.useState(!1),z=h?x:x.slice(0,be),G=x.length-z.length,re=r=>r.is_other?Ke:r.key??ze,H=[{id:"name",header:c,isRowHeader:!0,cell:r=>{const q=f>0?r.cost/f:0;return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("span",{className:"truncate text-[var(--otari-ink)]",children:r.is_other?`Other (${r.requests.toLocaleString()} req)`:r.key===null?se:r.key}),t.jsx("span",{className:"h-1 w-full overflow-hidden rounded-full bg-[var(--otari-line)]",children:t.jsx("span",{className:"block h-full rounded-full bg-[var(--otari-brand)]",style:{width:`${Math.min(100,q*100)}%`}})})]})}},{id:"requests",header:"Requests",align:"end",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:te(r.requests)})},{id:"tokens",header:"Tokens",align:"end",cell:r=>t.jsx("span",{className:"text-[var(--otari-muted)]",children:K(r.tokens)})},{id:"spend",header:"Spend",align:"end",cell:r=>t.jsx("span",{className:"text-[var(--otari-ink)]",children:xe(r.cost)})}];return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx(At,{ariaLabel:`Spend by ${c.toLowerCase()}`,columns:H,rows:z,getRowKey:re,isLoading:O,emptyContent:b,onRowAction:r=>{r!==Ke&&r!==ze&&L(r)}}),!O&&G>0?t.jsxs(R,{size:"sm",variant:"ghost",onPress:()=>P(!0),children:["Show all ",x.length]}):null,!O&&h&&x.length>be?t.jsxs(R,{size:"sm",variant:"ghost",onPress:()=>P(!1),children:["Show top ",be]}):null]})}const Kt=["model","user","source_label","endpoint","provider","source"],zt=["model"];function Jt(){var Oe,Ae,Pe,qe;const c=_t(),x=yt(),f=bt(),[b,se]=d.useState(Me),[L,O]=d.useState(()=>ke(Me.seconds??0)),[h,P]=d.useState(!1),[z,G]=d.useState(),[re,H]=d.useState(),[r,q]=d.useState(""),[k,ae]=d.useState(""),[p,oe]=d.useState(""),[u,Ye]=d.useState("cost"),[T,Ze]=d.useState(""),v=h?z:L,g=h?re:void 0,w=h?v?xt(v,g):"day":b.bucket,N=d.useMemo(()=>({start_date:v,end_date:g,model:r.trim()||void 0,user_id:k||void 0,api_key_id:p||void 0}),[v,g,r,k,p]),D=d.useMemo(()=>{if(h){if(!v||!g)return null;const e=new Date(g).getTime()-new Date(v).getTime();return e>0?{...N,start_date:new Date(new Date(v).getTime()-e).toISOString(),end_date:v}:null}return!L||b.seconds===null?null:{...N,start_date:new Date(new Date(L).getTime()-b.seconds*1e3).toISOString(),end_date:L}},[h,v,g,N,b.seconds,L]),j=_e(N,w,Kt),ne=_e(D??N,w,Tt,D!==null),C=ft(N,w,T||null),le=T!==""&&C.error instanceof gt&&C.error.status===404,F=le?"":T,s=j.data,a=s==null?void 0:s.totals,_=D!==null?(Oe=ne.data)==null?void 0:Oe.totals:void 0,fe=a?X(a.cost,_==null?void 0:_.cost):null,Qe=d.useMemo(()=>({...N,model:void 0}),[N]),ge=_e(Qe,w,zt),ie=((Pe=(Ae=ge.data)==null?void 0:Ae.by_model)==null?void 0:Pe.filter(e=>!e.is_other&&e.key!==null).map(e=>e.key))??[],je=(x.data??[]).map(e=>({value:e.user_id,label:e.alias?`${e.alias} (${e.user_id})`:e.user_id})),ce=(f.data??[]).map(e=>({value:e.id,label:e.key_name??`${e.id.slice(0,8)}…`})),Ve=e=>{var n;return((n=ce.find(l=>l.value===e))==null?void 0:n.label)??e},Xe=(r&&!ie.includes(r)?[r,...ie]:ie).map(e=>({value:e,label:e})),Je=h||b.key!==He,de=!!(r.trim()||k||p||Je),Se=(e,n)=>{var l;return((l=e.find(o=>o.value===n))==null?void 0:l.label)??n},et=()=>{q(""),ae(""),oe("")},tt=[...k?[{key:"user",label:"User",value:Se(je,k),onClear:()=>ae("")}]:[],...r.trim()?[{key:"model",label:"Model",value:r.trim(),onClear:()=>q("")}]:[],...p?[{key:"key",label:"API key",value:Se(ce,p),onClear:()=>oe("")}]:[]],st=!!(s&&a&&a.request_count===0&&!de),rt=(s==null?void 0:s.start_date)??v,at=(s==null?void 0:s.end_date)??g,we=e=>{P(!1),se(e),O(ke(e.seconds??0)),G(void 0),H(void 0)},ot=(e,n)=>{P(!0),G(e),H(n)},nt=()=>{h||O(ke(b.seconds??0)),j.refetch(),ge.refetch(),D!==null&&ne.refetch(),T&&C.refetch()},A=e=>{const n=new URLSearchParams;v&&n.set("start_date",v),g&&n.set("end_date",g);for(const[l,o]of Object.entries(e))o&&n.set(l,o);c(`/activity?${n.toString()}`)},lt=a&&a.request_count>0?a.error_count/a.request_count:0,Ne=((s==null?void 0:s.by_source)??[]).filter(e=>!e.is_other).length>1,it=Ne||T==="source",m=(s==null?void 0:s.series)??[],W=m.length>1,Ce=a==null?void 0:a.billed_input_tokens,Y=a===void 0?null:Ce!==void 0?Ce+(a.billed_output_tokens??a.completion_tokens):a.total_tokens,ct=_===void 0?null:_.billed_input_tokens!==void 0?_.billed_input_tokens+(_.billed_output_tokens??_.completion_tokens):_.total_tokens,Ee=e=>{let n=0,l=0,o=0;for(const y of e)n+=y.input_tokens??0,l+=y.cache_read_tokens??0,o+=y.cache_write_tokens??0;return{input:n,read:l,write:o}},B=Ee(m),Z=B.input>0?B.read/B.input:null,ue=Ee(D!==null?((qe=ne.data)==null?void 0:qe.series)??[]:[]),Le=ue.input>0?ue.read/ue.input:void 0,Te=e=>e.input_tokens!==void 0?e.input_tokens+(e.output_tokens??0):e.tokens,me=m.some(e=>(e.input_tokens??0)>0),Fe=m.some(e=>(e.errors??0)>0),E=d.useMemo(()=>{var l;const e=m.map(o=>o.bucket_start);if(F){const o=C.data;if(!o)return{series:[],data:[]};const y=o.groups.map((i,S)=>({key:`g${S}`,label:i.is_other?"Other":i.key===null?"(unknown)":F==="api_key_id"?Ve(i.key):i.key,color:i.is_other?$t:Ie[S%Ie.length]})),V=new Map(o.groups.map((i,S)=>[`${i.is_other}|${i.key}`,`g${S}`])),$=new Map(e.map(i=>[i,{x:i,...Object.fromEntries(y.map(S=>[S.key,0]))}]));for(const i of o.points){const S=V.get(`${i.is_other}|${i.key}`),De=$.get(i.bucket_start);!S||!De||(De[S]=u==="cost"?i.cost:u==="tokens"?i.tokens:i.requests)}return{series:y,data:[...$.values()]}}return u==="tokens"&&me?{series:Ut,data:m.map(o=>{const y=o.input_tokens??0,V=o.cache_read_tokens??0,$=o.cache_write_tokens??0;return{x:o.bucket_start,fresh:Math.max(0,y-V-$),cache_read:V,cache_write:$,output:o.output_tokens??0}})}:u==="requests"&&Fe?{series:Mt,data:m.map(o=>{const y=Math.min(o.errors??0,o.requests);return{x:o.bucket_start,success:o.requests-y,errors:y}})}:{series:[{key:u,label:((l=$e.find(o=>o.key===u))==null?void 0:l.label)??u,color:"var(--otari-brand)"}],data:m.map(o=>({x:o.bucket_start,[u]:u==="cost"?o.cost:u==="tokens"?Te(o):o.requests}))}},[m,F,C.data,u,me,Fe,f.data]),Re=It(u),dt=j.isLoading||!!F&&C.isLoading,ut=E.data.length?Math.max(...E.data.map(e=>E.series.reduce((n,l)=>n+(typeof e[l.key]=="number"?e[l.key]:0),0))):0,mt=m.map(e=>e.bucket_start),ht=(e,n)=>{const l=Ft(mt,e,n,w);l&&ot(l.startIso,l.endIso)},he=[{key:"model",label:"Model",rows:(s==null?void 0:s.by_model)??[],drill:e=>A({model:e,user_id:k||void 0,api_key_id:p||void 0})},{key:"user",label:"User",rows:(s==null?void 0:s.by_user)??[],drill:e=>A({user_id:e,model:r.trim()||void 0,api_key_id:p||void 0})}],pt=[{key:"source_label",label:"Session",rows:(s==null?void 0:s.by_source_label)??[],unknownLabel:"(no session)",drill:e=>A({source_label:e,model:r.trim()||void 0,user_id:k||void 0,api_key_id:p||void 0})},{key:"endpoint",label:"Endpoint",rows:(s==null?void 0:s.by_endpoint)??[],drill:e=>A({endpoint:e,model:r.trim()||void 0,user_id:k||void 0,api_key_id:p||void 0})},{key:"provider",label:"Provider",rows:(s==null?void 0:s.by_provider)??[],drill:e=>A({provider:e,model:r.trim()||void 0,user_id:k||void 0,api_key_id:p||void 0})},{key:"source",label:"Source",rows:(s==null?void 0:s.by_source)??[],drill:e=>A({source:e,model:r.trim()||void 0,user_id:k||void 0,api_key_id:p||void 0})}],[pe,vt]=d.useState("model"),[Q,kt]=d.useState("source_label"),U=he.find(e=>e.key===pe)??he[0],ve=pt.filter(e=>e.key!=="source"||Ne||Q==="source"),M=ve.find(e=>e.key===Q)??ve[0];return t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(jt,{title:"Usage & analytics",description:"Spend, tokens, cache use, and request volume over time. Group the chart by model, user, key, or source, and click a breakdown row to drill into the request log."}),t.jsx(St,{error:j.error??(T!==""&&!le?C.error:null)}),t.jsxs(Pt,{chips:tt,onClearAll:et,start:We.map(e=>t.jsx(R,{size:"sm",variant:!h&&b.key===e.key?"primary":"outline",onPress:()=>we(e),children:e.label},e.key)),end:t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Showing ",wt(rt,at)," · UTC"]}),t.jsx(Nt,{onRefresh:nt,isFetching:j.isFetching,updatedAt:j.dataUpdatedAt})]}),children:[t.jsx(ye,{label:"User",value:k,onChange:ae,options:je,placeholder:"All users"}),t.jsx(ye,{label:"Model",value:r,onChange:q,options:Xe,placeholder:"All models"}),t.jsx(ye,{label:"API key",value:p,onChange:oe,options:ce,placeholder:"All keys"})]}),st?t.jsx(Ct,{title:"No usage yet",description:"Once the gateway serves requests, spend and volume appear here."}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 xl:grid-cols-5",children:[t.jsx(I,{label:"Tracked cost",value:a?xe(a.cost):"—",hint:a?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t.jsx(J,{fraction:fe}),a.unpriced_requests?`${fe!==null?" · ":""}${te(a.unpriced_requests)} unpriced`:null]}):null,chart:W?t.jsx(ee,{values:m.map(e=>e.cost),ariaLabel:"Spend trend over the selected window"}):void 0}),t.jsx(I,{label:"Requests",value:a?te(a.request_count):"—",hint:a?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Be(lt)," errors",_?t.jsxs(t.Fragment,{children:[" · ",t.jsx(J,{fraction:X(a.request_count,_.request_count)})]}):null]}):null,chart:W?t.jsx(ee,{values:m.map(e=>e.requests),ariaLabel:"Request volume trend over the selected window"}):void 0}),t.jsx(I,{label:"Tokens (billed)",value:Y!==null?K(Y):"—",hint:Y!==null?t.jsx(J,{fraction:X(Y,ct??void 0)}):null,chart:W?t.jsx(ee,{values:m.map(Te),ariaLabel:"Billed token trend over the selected window"}):void 0}),t.jsx(I,{label:"Cache hit rate",value:Z!==null?Be(Z):"—",hint:a?t.jsxs("span",{className:"text-[var(--otari-muted)]",children:[Z!==null&&Le!==void 0?t.jsxs(t.Fragment,{children:[t.jsx(J,{fraction:X(Z,Le)})," · "]}):null,K(B.read)," read · ",K(B.write)," written"]}):null,chart:W&&me?t.jsx(ee,{values:m.map(e=>(e.input_tokens??0)>0?(e.cache_read_tokens??0)/(e.input_tokens??1):0),ariaLabel:"Cache hit rate trend over the selected window"}):void 0}),t.jsx(I,{label:"Avg latency",value:a?qt(a.avg_latency_ms):"—"})]}),t.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-[var(--otari-line)] bg-[var(--otari-surface)] p-4",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("div",{className:"inline-flex gap-1.5",children:$e.map(e=>t.jsx(R,{size:"sm",variant:u===e.key?"primary":"outline","aria-pressed":u===e.key,onPress:()=>Ye(e.key),children:e.label},e.key))}),t.jsxs("div",{className:"flex items-center gap-2",children:[h?t.jsx(R,{size:"sm",variant:"ghost",onPress:()=>we(b),children:"Reset zoom"}):null,j.isFetching||F&&C.isFetching?t.jsx(Ue,{size:"sm"}):null,t.jsx(Et,{ariaLabel:"Group by",value:T,onChange:e=>Ze(e),options:Bt.filter(e=>e.value!=="source"||it).map(e=>({value:e.value,label:e.value?`By ${e.label.toLowerCase()}`:"No grouping"}))})]})]}),le?t.jsx("div",{className:"rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:"The running gateway predates grouped series, so the chart shows ungrouped totals. Restart the gateway on this build to enable grouping."}):null,t.jsx(Rt,{series:E.series}),dt?t.jsx("div",{className:"flex h-64 items-center justify-center",children:t.jsx(Ue,{size:"sm"})}):E.data.length===0?t.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-[var(--otari-muted)]",children:"No data in this range."}):t.jsxs("figure",{className:"flex flex-col gap-2",children:[t.jsx(Ot,{data:E.data,series:E.series,formatValue:Re,formatXTick:e=>Dt(e,w),ariaLabel:`${u} per ${w}${F?`, grouped by ${F}`:""}`,height:260,showYAxis:!0,showTotal:!0,onSelectRange:ht}),t.jsxs("figcaption",{className:"text-xs text-[var(--otari-muted)]",children:[Re(ut)," peak · ",E.data.length," ",w==="hour"?"hours":"days"," (times in UTC) · drag across the chart to zoom"]})]})]}),t.jsxs("div",{className:"grid gap-6 xl:grid-cols-2",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Spend by ",U.label.toLowerCase()]}),t.jsx("div",{className:"inline-flex gap-1.5",children:he.map(e=>t.jsx(R,{size:"sm",variant:pe===e.key?"primary":"outline","aria-pressed":pe===e.key,onPress:()=>vt(e.key),children:e.label},e.key))})]}),t.jsx(Ge,{dimensionLabel:U.label,rows:U.rows,totalCost:(a==null?void 0:a.cost)??0,emptyLabel:de?"No usage matches these filters.":"No usage recorded yet.",unknownLabel:U.unknownLabel,onDrill:U.drill,loading:j.isLoading})]}),t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("h2",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Spend by ",M.label.toLowerCase()]}),t.jsx("div",{className:"inline-flex gap-1.5",children:ve.map(e=>t.jsx(R,{size:"sm",variant:Q===e.key?"primary":"outline","aria-pressed":Q===e.key,onPress:()=>kt(e.key),children:e.label},e.key))})]}),t.jsx(Ge,{dimensionLabel:M.label,rows:M.rows,totalCost:(a==null?void 0:a.cost)??0,emptyLabel:de?"No usage matches these filters.":"No usage recorded yet.",unknownLabel:M.unknownLabel,onDrill:M.drill,loading:j.isLoading})]})]})]})]})}export{Jt as UsagePage}; diff --git a/src/gateway/static/dashboard/assets/UsersPage-AJZgT8Wn.js b/src/gateway/static/dashboard/assets/UsersPage-B5EUpDH1.js similarity index 98% rename from src/gateway/static/dashboard/assets/UsersPage-AJZgT8Wn.js rename to src/gateway/static/dashboard/assets/UsersPage-B5EUpDH1.js index 1625ad686..5d3954a74 100644 --- a/src/gateway/static/dashboard/assets/UsersPage-AJZgT8Wn.js +++ b/src/gateway/static/dashboard/assets/UsersPage-B5EUpDH1.js @@ -1 +1 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r}from"./react-dgEcD0HR.js";import{u as Q,v as M,z as K,au as X,P as Y,E as A,B as Z,av as ee,F as se}from"./index-DMrbj_xn.js";import{u as te,r as ae,B as ne}from"./tableSelection-CojkFPwd.js";import{C as re}from"./ConfirmDialog-D3P-vj-t.js";import{D as le}from"./DataTable-CrQq0sYf.js";import{F as D}from"./Field-DEJ6Wjg9.js";import{a as ie,M as R}from"./ModelScopeControl-wPC6RjBJ.js";import{f as I,B as d,d as S,A as f}from"./heroui-DZj66Arc.js";const de=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return de.format(t)}const oe=t=>t.user_id,B=t=>t.startsWith("apikey-");function H(t){return t.split("-")[0]}function z(t){return t.name??H(t.budget_id)}function $({value:t,onChange:l,budgets:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>l(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),n.map(a=>e.jsxs("option",{value:a.budget_id,children:[z(a),a.max_budget===null?" · no limit":` · ${U(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function ce({onClose:t}){const l=ee(),n=M(),[a,i]=r.useState(""),[o,u]=r.useState(""),[c,g]=r.useState(null),[p,m]=r.useState(null),[b,j]=r.useState(!0),x=()=>{if(l.isPending||!b||a.trim()==="")return;const h={user_id:a.trim(),alias:o.trim()||null,budget_id:c,allowed_models:p};l.mutate(h,{onSuccess:t})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:l.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(D,{label:"User ID",value:a,onChange:i,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(D,{label:"Alias (optional)",value:o,onChange:u,placeholder:"Alice"})]}),e.jsx($,{value:c,onChange:g,budgets:n.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{m(h),j(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:l.isPending||!b||a.trim()==="",onPress:x,children:l.isPending?"Creating…":"Create user"}),e.jsx(d,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ue({user:t,onClose:l}){const n=K(),a=M(),[i,o]=r.useState(t.alias??""),[u,c]=r.useState(t.budget_id),[g,p]=r.useState(t.allowed_models),[m,b]=r.useState(!0),j=()=>{if(n.isPending||!m)return;const x={alias:i.trim()||null,budget_id:u,allowed_models:g};n.mutate({id:t.user_id,body:x},{onSuccess:l})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:n.error}),e.jsx(D,{label:"Alias",value:i,onChange:o,placeholder:"Alice"}),e.jsx($,{value:u,onChange:c,budgets:a.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(x,h)=>{p(x),b(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:n.isPending||!m,onPress:j,children:n.isPending?"Saving…":"Save changes"}),e.jsx(d,{variant:"ghost",onPress:l,children:"Cancel"})]})]})})}function ge({trigger:t,message:l,confirmLabel:n,isPending:a,onConfirm:i}){const[o,u]=r.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:l}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(d,{size:"sm",variant:"danger",isDisabled:a,onPress:i,children:n}),e.jsx(d,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>u(!1),children:"Cancel"})]})]}):e.jsx(d,{size:"sm",variant:"danger-soft",onPress:()=>u(!0),children:t})}function me({user:t}){return t.blocked?e.jsx(I,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(I,{size:"sm",color:"accent",children:"Active"})}function xe({allowed:t}){const{text:l,tone:n}=ie(t),a=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",i=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:i,children:l})}function he({isOpen:t,onOpenChange:l,budgets:n,count:a,isPending:i,error:o,onAssign:u}){const[c,g]=r.useState("");return r.useEffect(()=>{t&&g("")},[t]),e.jsx(f,{isOpen:t,onOpenChange:l,children:t?e.jsx(f.Backdrop,{children:e.jsx(f.Container,{placement:"center",size:"md",children:e.jsxs(f.Dialog,{children:[e.jsx(f.Header,{children:e.jsx(f.Heading,{children:"Assign budget"})}),e.jsxs(f.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Assign a budget to ",a," selected ",a===1?"user":"users","."]}),e.jsx(se,{label:"Budget",value:c,onChange:g,options:[{value:"",label:"Select a budget…"},...n.map(p=>({value:p.budget_id,label:z(p)}))]}),e.jsx(A,{error:o})]}),e.jsxs(f.Footer,{children:[e.jsx(d,{variant:"ghost",isDisabled:i,onPress:()=>l(!1),children:"Cancel"}),e.jsx(d,{variant:"primary",isDisabled:!c,isPending:i,onPress:()=>u(c),children:"Assign"})]})]})})}):null})}function Ae(){const t=Q(),l=M(),n=K(),a=X(),[i,o]=r.useState(!1),[u,c]=r.useState(null),[g,p]=r.useState(!1),m=t.data??[],b=t.isLoading,j=m.filter(s=>B(s.user_id)).length,x=g?m:m.filter(s=>!B(s.user_id)),h=m.find(s=>s.user_id===u)??null,C=!b&&x.length===0&&!i,P=r.useMemo(()=>new Map((l.data??[]).map(s=>[s.budget_id,s])),[l.data]),y=te(),[q,_]=r.useState(!1),[W,N]=r.useState(!1),[E,F]=r.useState(void 0),[T,L]=r.useState(!1),G=x.map(s=>s.user_id),v=ae(y.selectedKeys,G),O=r.useCallback((s,k)=>n.mutate({id:s.user_id,body:{blocked:k}}),[n.mutate]),V=async(s,k)=>{L(!0),F(void 0);try{for(const w of v)await s(w);y.clear(),k()}catch(w){F(w)}finally{L(!1)}},J=r.useMemo(()=>[{id:"user",header:"User",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-medium text-[var(--otari-ink)]",children:s.user_id}),B(s.user_id)?e.jsx(I,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})},{id:"status",header:"Status",cell:s=>e.jsx(me,{user:s})},{id:"budget",header:"Budget",cell:s=>s.budget_id?e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.budget_id,children:P.get(s.budget_id)?z(P.get(s.budget_id)):H(s.budget_id)}):e.jsx("span",{className:"text-[var(--otari-muted)]",children:"—"})},{id:"spend",header:"Spend",cell:s=>e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[U(s.spend),s.reserved>0?e.jsxs("span",{children:[" (+",U(s.reserved)," held)"]}):null]})},{id:"access",header:"Model access",cell:s=>e.jsx(xe,{allowed:s.allowed_models})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(d,{size:"sm",variant:"outline",isDisabled:n.isPending,onPress:()=>O(s,!s.blocked),children:s.blocked?"Unblock":"Block"}),e.jsx(d,{size:"sm",variant:"ghost",onPress:()=>{o(!1),c(s.user_id)},children:"Edit"}),e.jsx(ge,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})}],[P,n.isPending,a.isPending,a.mutate,O]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:i?null:e.jsx(d,{variant:"primary",onPress:()=>{c(null),o(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??n.error??a.error}),C?e.jsx(Z,{title:"No users yet",description:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page.",actionLabel:"Create your first user",onAction:()=>{c(null),o(!0)}}):null,j>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>p(s.target.checked)}),"Show auto-created (virtual) users (",j,")"]}):null,i?e.jsx(ce,{onClose:()=>o(!1)}):null,h?e.jsx(ue,{user:h,onClose:()=>c(null)},h.user_id):null,v.length>0?e.jsxs(ne,{selectedCount:v.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:y.clear,children:[e.jsx(d,{size:"sm",variant:"primary",onPress:()=>N(!0),children:"Assign budget"}),e.jsx(d,{size:"sm",variant:"danger",onPress:()=>_(!0),children:"Delete"})]}):null,C?null:e.jsx(le,{ariaLabel:"Users",columns:J,rows:x,getRowKey:oe,isLoading:b,emptyContent:"No users yet. Create one, or create an API key to auto-create one.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange}),e.jsx(re,{isOpen:q,onOpenChange:_,heading:"Delete users",body:`Delete ${v.length} ${v.length===1?"user":"users"}? This deactivates their API keys and hides them; usage history is preserved.`,confirmLabel:"Delete",isPending:T,error:E,onConfirm:()=>V(s=>a.mutateAsync(s),()=>_(!1))}),e.jsx(he,{isOpen:W,onOpenChange:N,budgets:l.data??[],count:v.length,isPending:T,error:E,onAssign:s=>V(k=>n.mutateAsync({id:k,body:{budget_id:s}}),()=>N(!1))})]})}export{Ae as UsersPage}; +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r}from"./react-dgEcD0HR.js";import{u as Q,v as M,z as K,au as X,P as Y,E as A,B as Z,av as ee,F as se}from"./index-BTsnhpZj.js";import{u as te,r as ae,B as ne}from"./tableSelection-CojkFPwd.js";import{C as re}from"./ConfirmDialog-WxOAhWT-.js";import{D as le}from"./DataTable-CrQq0sYf.js";import{F as D}from"./Field-DEJ6Wjg9.js";import{a as ie,M as R}from"./ModelScopeControl-DeZ3FzjH.js";import{f as I,B as d,d as S,A as f}from"./heroui-DZj66Arc.js";const de=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:4});function U(t){return de.format(t)}const oe=t=>t.user_id,B=t=>t.startsWith("apikey-");function H(t){return t.split("-")[0]}function z(t){return t.name??H(t.budget_id)}function $({value:t,onChange:l,budgets:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{htmlFor:"user-budget",className:"text-sm font-medium text-[var(--otari-ink)]",children:"Budget"}),e.jsxs("select",{id:"user-budget",value:t??"",onChange:a=>l(a.target.value||null),className:"w-full rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)]",children:[e.jsx("option",{value:"",children:"No budget (unlimited)"}),n.map(a=>e.jsxs("option",{value:a.budget_id,children:[z(a),a.max_budget===null?" · no limit":` · ${U(a.max_budget)}`]},a.budget_id))]}),e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:"The spending limit this user is held to. Manage budgets on the Budgets page."})]})}function ce({onClose:t}){const l=ee(),n=M(),[a,i]=r.useState(""),[o,u]=r.useState(""),[c,g]=r.useState(null),[p,m]=r.useState(null),[b,j]=r.useState(!0),x=()=>{if(l.isPending||!b||a.trim()==="")return;const h={user_id:a.trim(),alias:o.trim()||null,budget_id:c,allowed_models:p};l.mutate(h,{onSuccess:t})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsx("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:"Create user"}),e.jsx(A,{error:l.error}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(D,{label:"User ID",value:a,onChange:i,placeholder:"alice@example.com",isRequired:!0,autoFocus:!0,description:"The identifier callers send as the `user` field; spend and budgets track against it."}),e.jsx(D,{label:"Alias (optional)",value:o,onChange:u,placeholder:"Alice"})]}),e.jsx($,{value:c,onChange:g,budgets:n.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:null,onChange:(h,C)=>{m(h),j(C)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:l.isPending||!b||a.trim()==="",onPress:x,children:l.isPending?"Creating…":"Create user"}),e.jsx(d,{variant:"ghost",onPress:t,children:"Cancel"})]})]})})}function ue({user:t,onClose:l}){const n=K(),a=M(),[i,o]=r.useState(t.alias??""),[u,c]=r.useState(t.budget_id),[g,p]=r.useState(t.allowed_models),[m,b]=r.useState(!0),j=()=>{if(n.isPending||!m)return;const x={alias:i.trim()||null,budget_id:u,allowed_models:g};n.mutate({id:t.user_id,body:x},{onSuccess:l})};return e.jsx(S,{children:e.jsxs(S.Content,{className:"flex flex-col gap-4 p-5",children:[e.jsxs("div",{className:"text-sm font-semibold text-[var(--otari-ink)]",children:["Edit ",e.jsx("code",{children:t.user_id})]}),e.jsx(A,{error:n.error}),e.jsx(D,{label:"Alias",value:i,onChange:o,placeholder:"Alice"}),e.jsx($,{value:u,onChange:c,budgets:a.data??[]}),e.jsx(R,{title:"Model access (default for this user's keys)",description:"The models this user's keys may list and call by default. A key can narrow this, but never exceed it.",initial:t.allowed_models,onChange:(x,h)=>{p(x),b(h)}}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{variant:"primary",isDisabled:n.isPending||!m,onPress:j,children:n.isPending?"Saving…":"Save changes"}),e.jsx(d,{variant:"ghost",onPress:l,children:"Cancel"})]})]})})}function ge({trigger:t,message:l,confirmLabel:n,isPending:a,onConfirm:i}){const[o,u]=r.useState(!1);return o?e.jsxs("div",{className:"flex flex-col items-end gap-1.5 rounded-lg border border-amber-200 bg-amber-50 p-2 text-right",children:[e.jsx("span",{className:"max-w-xs text-xs text-amber-800",children:l}),e.jsxs("span",{className:"inline-flex gap-1",children:[e.jsx(d,{size:"sm",variant:"danger",isDisabled:a,onPress:i,children:n}),e.jsx(d,{size:"sm",variant:"ghost",isDisabled:a,onPress:()=>u(!1),children:"Cancel"})]})]}):e.jsx(d,{size:"sm",variant:"danger-soft",onPress:()=>u(!0),children:t})}function me({user:t}){return t.blocked?e.jsx(I,{size:"sm",color:"warning",children:"Blocked"}):e.jsx(I,{size:"sm",color:"accent",children:"Active"})}function xe({allowed:t}){const{text:l,tone:n}=ie(t),a=n==="danger"?"text-red-700 font-medium":n==="muted"?"text-[var(--otari-muted)]":"text-[var(--otari-brand-dark)] font-medium",i=t&&t.length>0?t.join(", "):void 0;return e.jsx("span",{className:`text-xs ${a}`,title:i,children:l})}function he({isOpen:t,onOpenChange:l,budgets:n,count:a,isPending:i,error:o,onAssign:u}){const[c,g]=r.useState("");return r.useEffect(()=>{t&&g("")},[t]),e.jsx(f,{isOpen:t,onOpenChange:l,children:t?e.jsx(f.Backdrop,{children:e.jsx(f.Container,{placement:"center",size:"md",children:e.jsxs(f.Dialog,{children:[e.jsx(f.Header,{children:e.jsx(f.Heading,{children:"Assign budget"})}),e.jsxs(f.Body,{className:"flex flex-col gap-4",children:[e.jsxs("p",{className:"text-sm text-[var(--otari-muted)]",children:["Assign a budget to ",a," selected ",a===1?"user":"users","."]}),e.jsx(se,{label:"Budget",value:c,onChange:g,options:[{value:"",label:"Select a budget…"},...n.map(p=>({value:p.budget_id,label:z(p)}))]}),e.jsx(A,{error:o})]}),e.jsxs(f.Footer,{children:[e.jsx(d,{variant:"ghost",isDisabled:i,onPress:()=>l(!1),children:"Cancel"}),e.jsx(d,{variant:"primary",isDisabled:!c,isPending:i,onPress:()=>u(c),children:"Assign"})]})]})})}):null})}function Ae(){const t=Q(),l=M(),n=K(),a=X(),[i,o]=r.useState(!1),[u,c]=r.useState(null),[g,p]=r.useState(!1),m=t.data??[],b=t.isLoading,j=m.filter(s=>B(s.user_id)).length,x=g?m:m.filter(s=>!B(s.user_id)),h=m.find(s=>s.user_id===u)??null,C=!b&&x.length===0&&!i,P=r.useMemo(()=>new Map((l.data??[]).map(s=>[s.budget_id,s])),[l.data]),y=te(),[q,_]=r.useState(!1),[W,N]=r.useState(!1),[E,F]=r.useState(void 0),[T,L]=r.useState(!1),G=x.map(s=>s.user_id),v=ae(y.selectedKeys,G),O=r.useCallback((s,k)=>n.mutate({id:s.user_id,body:{blocked:k}}),[n.mutate]),V=async(s,k)=>{L(!0),F(void 0);try{for(const w of v)await s(w);y.clear(),k()}catch(w){F(w)}finally{L(!1)}},J=r.useMemo(()=>[{id:"user",header:"User",isRowHeader:!0,cell:s=>e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx("code",{className:"text-xs font-medium text-[var(--otari-ink)]",children:s.user_id}),B(s.user_id)?e.jsx(I,{size:"sm",color:"default",children:"virtual"}):null]}),s.alias?e.jsx("span",{className:"text-xs text-[var(--otari-muted)]",children:s.alias}):null]})},{id:"status",header:"Status",cell:s=>e.jsx(me,{user:s})},{id:"budget",header:"Budget",cell:s=>s.budget_id?e.jsx("span",{className:"text-[var(--otari-muted)]",title:s.budget_id,children:P.get(s.budget_id)?z(P.get(s.budget_id)):H(s.budget_id)}):e.jsx("span",{className:"text-[var(--otari-muted)]",children:"—"})},{id:"spend",header:"Spend",cell:s=>e.jsxs("span",{className:"text-[var(--otari-muted)]",children:[U(s.spend),s.reserved>0?e.jsxs("span",{children:[" (+",U(s.reserved)," held)"]}):null]})},{id:"access",header:"Model access",cell:s=>e.jsx(xe,{allowed:s.allowed_models})},{id:"actions",header:"Actions",align:"end",cell:s=>e.jsxs("div",{className:"flex items-center justify-end gap-1.5",children:[e.jsx(d,{size:"sm",variant:"outline",isDisabled:n.isPending,onPress:()=>O(s,!s.blocked),children:s.blocked?"Unblock":"Block"}),e.jsx(d,{size:"sm",variant:"ghost",onPress:()=>{o(!1),c(s.user_id)},children:"Edit"}),e.jsx(ge,{trigger:"Delete",confirmLabel:"Delete user",isPending:a.isPending,message:e.jsxs(e.Fragment,{children:["Delete ",e.jsx("strong",{children:s.user_id}),"? This deactivates its API keys and hides the user; usage history is preserved."]}),onConfirm:()=>a.mutate(s.user_id)})]})}],[P,n.isPending,a.isPending,a.mutate,O]);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{title:"Users",description:"People and teams that own API keys. Set each one's budget and default model access here; issue their keys on the API keys page.",action:i?null:e.jsx(d,{variant:"primary",onPress:()=>{c(null),o(!0)},children:"Create user"})}),e.jsx(A,{error:t.error??n.error??a.error}),C?e.jsx(Z,{title:"No users yet",description:"A user owns API keys and carries the budget and default model access those keys inherit. Create a user here, then issue its keys on the API keys page.",actionLabel:"Create your first user",onAction:()=>{c(null),o(!0)}}):null,j>0?e.jsxs("label",{className:"flex w-fit items-center gap-2 text-xs text-[var(--otari-muted)]",children:[e.jsx("input",{type:"checkbox",checked:g,onChange:s=>p(s.target.checked)}),"Show auto-created (virtual) users (",j,")"]}):null,i?e.jsx(ce,{onClose:()=>o(!1)}):null,h?e.jsx(ue,{user:h,onClose:()=>c(null)},h.user_id):null,v.length>0?e.jsxs(ne,{selectedCount:v.length,allMatching:!1,matchingTotal:null,canSelectAllMatching:!1,onSelectAllMatching:()=>{},onClear:y.clear,children:[e.jsx(d,{size:"sm",variant:"primary",onPress:()=>N(!0),children:"Assign budget"}),e.jsx(d,{size:"sm",variant:"danger",onPress:()=>_(!0),children:"Delete"})]}):null,C?null:e.jsx(le,{ariaLabel:"Users",columns:J,rows:x,getRowKey:oe,isLoading:b,emptyContent:"No users yet. Create one, or create an API key to auto-create one.",selectionMode:"multiple",selectedKeys:y.selectedKeys,onSelectionChange:y.onSelectionChange}),e.jsx(re,{isOpen:q,onOpenChange:_,heading:"Delete users",body:`Delete ${v.length} ${v.length===1?"user":"users"}? This deactivates their API keys and hides them; usage history is preserved.`,confirmLabel:"Delete",isPending:T,error:E,onConfirm:()=>V(s=>a.mutateAsync(s),()=>_(!1))}),e.jsx(he,{isOpen:W,onOpenChange:N,budgets:l.data??[],count:v.length,isPending:T,error:E,onAssign:s=>V(k=>n.mutateAsync({id:k,body:{budget_id:s}}),()=>N(!1))})]})}export{Ae as UsersPage}; diff --git a/src/gateway/static/dashboard/assets/charts-DNysd9jl.js b/src/gateway/static/dashboard/assets/charts-DNysd9jl.js deleted file mode 100644 index 883194024..000000000 --- a/src/gateway/static/dashboard/assets/charts-DNysd9jl.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as T}from"./react-dgEcD0HR.js";import{R as C,L,a as A,B,X as D,Y as S,T as E,b as O,c as N}from"./recharts-BwTTRGtj.js";const I="var(--otari-brand)";function F({active:n,label:a,payload:i,formatValue:d,formatLabel:x,showTotal:m=!1}){const l=(i??[]).filter(r=>typeof r.value=="number");if(!n||l.length===0)return null;const b=typeof a=="string"&&x?x(a):a,f=l.length>1?l.filter(r=>r.value>0):l,h=l.reduce((r,p)=>r+p.value,0);return e.jsxs("div",{className:"rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2.5 py-1.5 text-xs shadow-sm",children:[e.jsx("div",{className:"text-[var(--otari-muted)]",children:b}),e.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:f.map((r,p)=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[var(--otari-muted)]",children:[l.length>1?e.jsx("span",{"aria-hidden":!0,className:"h-2 w-2 rounded-sm",style:{backgroundColor:r.color}}):null,r.name]}),e.jsx("span",{className:"font-medium tabular-nums text-[var(--otari-ink)]",children:d(r.value)})]},p))}),m&&l.length>1?e.jsxs("div",{className:"mt-1 flex items-center justify-between gap-4 border-t border-[var(--otari-line)] pt-1",children:[e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Total"}),e.jsx("span",{className:"font-semibold tabular-nums text-[var(--otari-ink)]",children:d(h)})]}):null]})}function W({series:n}){return n.length<2?null:e.jsx("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:n.map(a=>e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx("span",{"aria-hidden":!0,className:"h-2 w-2 rounded-sm",style:{backgroundColor:a.color}}),a.label]},a.key))})}function j(n){const a=n==null?void 0:n.activeTooltipIndex,i=typeof a=="string"?Number(a):a;return typeof i=="number"&&Number.isFinite(i)?i:null}function Y({data:n,series:a,formatValue:i,formatXTick:d,ariaLabel:x,height:m=200,showYAxis:l=!1,showTotal:b,onSelectRange:f,window:h}){const[r,p]=T.useState(null),u=T.useRef(r),v=t=>{u.current=t,p(t)},k=n.length-1,c=t=>Math.min(Math.max(t,0),Math.max(k,0)),y=()=>{const t=u.current;if(v(null),!t||!f||t.start===t.end)return;const s=c(Math.min(t.start,t.end)),M=c(Math.max(t.start,t.end));s!==M&&f(s,M)},g=!!f&&n.length>1,o=h&&n.length>0?{startIndex:c(h.startIndex),endIndex:c(h.endIndex)}:null,w=o!==null&&(o.startIndex>0||o.endIndex{if(!g)return;const s=j(t);s!==null&&v({start:s,end:s})},onMouseMove:t=>{const s=j(t);u.current&&s!==null&&v({...u.current,end:s})},onMouseUp:y,onMouseLeave:y,onTouchStart:t=>{if(!g)return;const s=j(t);s!==null&&v({start:s,end:s})},onTouchMove:t=>{const s=j(t);u.current&&s!==null&&v({...u.current,end:s})},onTouchEnd:y,children:[e.jsx(D,{dataKey:"x",tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:40,tickFormatter:d,tick:{fontSize:10,fill:"var(--otari-muted)"}}),l?e.jsx(S,{width:52,tickLine:!1,axisLine:!1,tickFormatter:t=>i(t),tick:{fontSize:10,fill:"var(--otari-muted)"}}):null,e.jsx(E,{cursor:{fill:"var(--otari-line)",opacity:.35},content:e.jsx(F,{formatValue:i,formatLabel:d,showTotal:b})}),a.map(t=>e.jsx(O,{dataKey:t.key,name:t.label,stackId:"stack",fill:t.color,stroke:"var(--otari-surface)",strokeWidth:a.length>1?1:0,radius:a.length>1?0:[2,2,0,0],isAnimationActive:!1},t.key)),w&&o&&o.startIndex>0?e.jsx(N,{x1:n[0].x,x2:n[o.startIndex-1].x,fill:"var(--otari-bg)",fillOpacity:.75,stroke:"none"}):null,w&&o&&o.endIndex({index:m,value:x}));return e.jsx("div",{role:"img","aria-label":a,className:"w-full",children:e.jsx(C,{width:"100%",height:i,children:e.jsx(L,{data:d,margin:{top:2,right:2,left:2,bottom:2},children:e.jsx(A,{type:"monotone",dataKey:"value",stroke:I,strokeWidth:1.5,dot:!1,isAnimationActive:!1})})})})}export{W as C,G as S,Y as T}; diff --git a/src/gateway/static/dashboard/assets/charts-d2MDwLL0.js b/src/gateway/static/dashboard/assets/charts-d2MDwLL0.js new file mode 100644 index 000000000..5c139a1bd --- /dev/null +++ b/src/gateway/static/dashboard/assets/charts-d2MDwLL0.js @@ -0,0 +1 @@ +import{j as e}from"./tanstack-query-1t81HyiD.js";import{r as T}from"./react-dgEcD0HR.js";import{R as L,L as B,a as C,B as S,X as D,Y as E,T as O,b as F,c as N}from"./recharts-BwTTRGtj.js";const w="var(--otari-brand)";function A({color:n}){return e.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 8 8",className:"h-2 w-2 shrink-0",children:e.jsx("rect",{width:"8",height:"8",rx:"1.5",fill:n})})}function K({active:n,label:s,payload:i,formatValue:x,formatLabel:d,showTotal:m=!1}){const l=(i??[]).filter(r=>typeof r.value=="number");if(!n||l.length===0)return null;const b=typeof s=="string"&&d?d(s):s,f=l.length>1?l.filter(r=>r.value>0):l,h=l.reduce((r,p)=>r+p.value,0);return e.jsxs("div",{className:"rounded-md border border-[var(--otari-line)] bg-[var(--otari-surface)] px-2.5 py-1.5 text-xs shadow-sm",children:[e.jsx("div",{className:"text-[var(--otari-muted)]",children:b}),e.jsx("div",{className:"mt-0.5 flex flex-col gap-0.5",children:f.map((r,p)=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[var(--otari-muted)]",children:[l.length>1&&r.color?e.jsx(A,{color:r.color}):null,r.name]}),e.jsx("span",{className:"font-medium tabular-nums text-[var(--otari-ink)]",children:x(r.value)})]},p))}),m&&l.length>1?e.jsxs("div",{className:"mt-1 flex items-center justify-between gap-4 border-t border-[var(--otari-line)] pt-1",children:[e.jsx("span",{className:"text-[var(--otari-muted)]",children:"Total"}),e.jsx("span",{className:"font-semibold tabular-nums text-[var(--otari-ink)]",children:x(h)})]}):null]})}function Y({series:n}){return n.length<2?null:e.jsx("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:n.map(s=>e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-[var(--otari-muted)]",children:[e.jsx(A,{color:s.color}),s.label]},s.key))})}function j(n){const s=n==null?void 0:n.activeTooltipIndex,i=typeof s=="string"?Number(s):s;return typeof i=="number"&&Number.isFinite(i)?i:null}function G({data:n,series:s,formatValue:i,formatXTick:x,ariaLabel:d,height:m=200,showYAxis:l=!1,showTotal:b,onSelectRange:f,window:h}){const[r,p]=T.useState(null),u=T.useRef(r),v=t=>{u.current=t,p(t)},k=n.length-1,c=t=>Math.min(Math.max(t,0),Math.max(k,0)),y=()=>{const t=u.current;if(v(null),!t||!f||t.start===t.end)return;const a=c(Math.min(t.start,t.end)),M=c(Math.max(t.start,t.end));a!==M&&f(a,M)},g=!!f&&n.length>1,o=h&&n.length>0?{startIndex:c(h.startIndex),endIndex:c(h.endIndex)}:null,I=o!==null&&(o.startIndex>0||o.endIndex{if(!g)return;const a=j(t);a!==null&&v({start:a,end:a})},onMouseMove:t=>{const a=j(t);u.current&&a!==null&&v({...u.current,end:a})},onMouseUp:y,onMouseLeave:y,onTouchStart:t=>{if(!g)return;const a=j(t);a!==null&&v({start:a,end:a})},onTouchMove:t=>{const a=j(t);u.current&&a!==null&&v({...u.current,end:a})},onTouchEnd:y,children:[e.jsx(D,{dataKey:"x",tickLine:!1,axisLine:!1,interval:"preserveStartEnd",minTickGap:40,tickFormatter:x,tick:{fontSize:10,fill:"var(--otari-muted)"}}),l?e.jsx(E,{width:52,tickLine:!1,axisLine:!1,tickFormatter:t=>i(t),tick:{fontSize:10,fill:"var(--otari-muted)"}}):null,e.jsx(O,{cursor:{fill:"var(--otari-line)",opacity:.35},content:e.jsx(K,{formatValue:i,formatLabel:x,showTotal:b})}),s.map(t=>e.jsx(F,{dataKey:t.key,name:t.label,stackId:"stack",fill:t.color,stroke:"var(--otari-surface)",strokeWidth:s.length>1?1:0,radius:s.length>1?0:[2,2,0,0],isAnimationActive:!1},t.key)),I&&o&&o.startIndex>0?e.jsx(N,{x1:n[0].x,x2:n[o.startIndex-1].x,fill:"var(--otari-bg)",fillOpacity:.75,stroke:"none"}):null,I&&o&&o.endIndex({index:m,value:d}));return e.jsx("div",{role:"img","aria-label":s,className:"w-full",children:e.jsx(L,{width:"100%",height:i,children:e.jsx(B,{data:x,margin:{top:2,right:2,left:2,bottom:2},children:e.jsx(C,{type:"monotone",dataKey:"value",stroke:w,strokeWidth:1.5,dot:!1,isAnimationActive:!1})})})})}export{Y as C,U as S,G as T}; diff --git a/src/gateway/static/dashboard/assets/index-DMrbj_xn.js b/src/gateway/static/dashboard/assets/index-BTsnhpZj.js similarity index 96% rename from src/gateway/static/dashboard/assets/index-DMrbj_xn.js rename to src/gateway/static/dashboard/assets/index-BTsnhpZj.js index fc323c7dd..4ae1d07fa 100644 --- a/src/gateway/static/dashboard/assets/index-DMrbj_xn.js +++ b/src/gateway/static/dashboard/assets/index-BTsnhpZj.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-CcRVRd0J.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/charts-DNysd9jl.js","assets/recharts-BwTTRGtj.js","assets/heroui-DZj66Arc.js","assets/tableSelection-CojkFPwd.js","assets/ConfirmDialog-D3P-vj-t.js","assets/DataTable-CrQq0sYf.js","assets/FilterChips-BLdhUEZK.js","assets/TablePagination-D_2uYqKa.js","assets/AliasesPage-CXPQdDm6.js","assets/Field-DEJ6Wjg9.js","assets/UserComboBox-nt7pHfqn.js","assets/BudgetsPage-Cnrtd_az.js","assets/DocsPage-BgBskDDe.js","assets/KeysPage-D9JSwodo.js","assets/ModelScopeControl-wPC6RjBJ.js","assets/ModelsPage-CH43id2j.js","assets/OverviewPage-BOO3r0BN.js","assets/ProvidersPage-enPv456e.js","assets/SettingsPage-VWHKo1Ho.js","assets/ToolsGuardrailsPage-CBa0KCZv.js","assets/UsagePage-5U02HhO3.js","assets/UsersPage-AJZgT8Wn.js"])))=>i.map(i=>d[i]); -var Ie=Object.defineProperty;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>qe(e,typeof t!="symbol"?t+"":t,r);import{u as g,j as n,a as p,b as x,k as z,Q as Re,c as Oe}from"./tanstack-query-1t81HyiD.js";import{d as Me,r as o,N as ee,L as Fe,O as Ue,H as Ke,e as Be,f as j,h as $e}from"./react-dgEcD0HR.js";import{B as C,C as K,L as xe,I as ye,a as ze,b as Qe,d as I,S as Ve,c as _,T as We,e as He}from"./heroui-DZj66Arc.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ge=Me();const Je="modulepreload",Ye=function(e){return"/"+e},ue={},P=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let u=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(r.map(y=>{if(y=Ye(y),y in ue)return;ue[y]=!0;const h=y.endsWith(".css"),b=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Je,h||(m.as="script"),m.crossOrigin="",m.href=y,f&&m.setAttribute("nonce",f),document.head.appendChild(m),h)return new Promise((N,M)=>{m.addEventListener("load",N),m.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};class L extends Error{constructor(r,s){super(s);ce(this,"status");this.name="ApiError",this.status=r}}let B=null;function de(e){B=e}async function te(e){try{const t=await e.json();if(typeof t.detail=="string")return t.detail;if(t.detail!=null)return JSON.stringify(t.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Xe(e){let t;try{t=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(t.status===401||t.status===403)return!1;if(!t.ok)throw new L(t.status,await te(t));return!0}async function Ze(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function l(e,t={}){const r=new Headers(t.headers);r.set("Accept","application/json"),t.body!=null&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let s;try{s=await fetch(e,{...t,headers:r})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(s.status===401||s.status===403)throw B==null||B(),new L(s.status,await te(s));if(!s.ok)throw new L(s.status,await te(s));if(s.status!==204)return await s.json()}const ne="otari.dashboard.hasSession",ve=o.createContext(null);function et(){try{return window.localStorage.getItem(ne)==="1"}catch{return!1}}function tt({children:e}){const t=g(),[r,s]=o.useState(et),a=o.useCallback(()=>{Ze(),s(!1),t.clear();try{window.localStorage.removeItem(ne)}catch{}},[t]),i=o.useCallback(()=>{t.clear(),s(!0);try{window.localStorage.setItem(ne,"1")}catch{}},[t]);o.useEffect(()=>(de(a),()=>de(null)),[a]);const u=o.useMemo(()=>({isAuthenticated:r,login:i,logout:a}),[r,i,a]);return n.jsx(ve.Provider,{value:u,children:e})}function re(){const e=o.useContext(ve);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function nt(e){return e instanceof L&&e.status===0}function rt(){const e=g(),[t,r]=o.useState(!1);return o.useEffect(()=>{const s=e.getQueryCache(),a=()=>s.getAll().some(i=>i.state.status==="error"&&nt(i.state.error));return r(a()),s.subscribe(()=>r(a()))},[e]),t}function st(){return rt()?n.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const Q=3600,T=86400,at=365*T,dn=[{key:"1h",label:"Last hour",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:T,bucket:"hour"},{key:"7d",label:"7d",seconds:7*T,bucket:"day"},{key:"30d",label:"30d",seconds:30*T,bucket:"day"},{key:"90d",label:"90d",seconds:90*T,bucket:"day"},{key:"12mo",label:"12mo",seconds:at,bucket:"day"}],mn="30d",fn=[{key:"1h",label:"1h",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:T,bucket:"hour"},{key:"7d",label:"7d",seconds:7*T,bucket:"day"},{key:"30d",label:"30d",seconds:30*T,bucket:"day"},{key:"all",label:"All",seconds:null,bucket:"day"}],hn="24h",xn="custom";function yn(e,t){return e.find(r=>r.key===t)}function it(e,t=Date.now()){return new Date(t-e*1e3).toISOString()}function ot(e){return(e==="hour"?Q:T)*1e3}function vn(e,t,r=Date.now()){const s=new Date(e).getTime();return(t?new Date(t).getTime():r)-s<=T*1e3?"hour":"day"}function gn(e,t,r,s){if(e.length===0)return null;const a=Math.max(0,Math.min(t,r)),i=Math.min(e.length-1,Math.max(t,r)),u=new Date(e[a]).getTime(),d=new Date(e[i]).getTime()+ot(s);return{startIso:new Date(u).toISOString(),endIso:new Date(d).toISOString()}}function pn(e,t,r){const s=e.length;if(s===0)return{startIndex:0,endIndex:0};const a=e.map(d=>new Date(d).getTime());let i=0;if(t){const d=new Date(t).getTime();for(let f=0;fl("/v1/models"),staleTime:6e4})}function dt(){return p({queryKey:[ct],queryFn:()=>l("/dashboard-build.json"),refetchInterval:ut,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function jn(){return p({queryKey:[ae],queryFn:()=>l("/v1/models/discoverable"),staleTime:5*6e4})}function Sn(){return p({queryKey:[ie],queryFn:()=>l("/v1/providers"),staleTime:5*6e4})}function kn(){return p({queryKey:["provider-catalog"],queryFn:()=>l("/v1/providers/catalog"),staleTime:1/0})}function En(e){return p({queryKey:["provider-catalog",e],queryFn:()=>l(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Pn(){return p({queryKey:[oe],queryFn:()=>l("/v1/providers/health"),staleTime:me,refetchInterval:me})}function Nn(){const e=g();return x({mutationFn:()=>l("/v1/providers/health?refresh=true"),onSuccess:t=>e.setQueryData([oe],t)})}function Cn(){return p({queryKey:[be],queryFn:()=>l("/v1/provider-credentials"),staleTime:6e4})}function W(e){e.invalidateQueries({queryKey:[be]}),e.invalidateQueries({queryKey:[ie]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]}),e.invalidateQueries({queryKey:[oe]})}function _n(){const e=g();return x({mutationFn:t=>l("/v1/provider-credentials",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>W(e)})}function Tn(){const e=g();return x({mutationFn:({instance:t,body:r})=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>W(e)})}function Ln(){const e=g();return x({mutationFn:t=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>W(e)})}function Dn(){const e=g();return x({mutationFn:()=>l("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>W(e)})}function An(){return x({mutationFn:e=>l(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function In(){return x({mutationFn:e=>l("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function qn(){return p({queryKey:[lt],queryFn:()=>l("/v1/models/metadata"),staleTime:10*6e4})}function Rn(){return p({queryKey:[se],queryFn:()=>l("/v1/aliases"),staleTime:6e4})}function On(){const e=g();return x({mutationFn:t=>l("/v1/aliases",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function Mn(){const e=g();return x({mutationFn:({name:t,userId:r})=>{const s=r==null?"":`?user_id=${encodeURIComponent(r)}`;return l(`/v1/aliases/${encodeURIComponent(t)}${s}`,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function mt(){return p({queryKey:[ge],queryFn:()=>l("/v1/settings"),staleTime:6e4})}function ft(){const e=g();return x({mutationFn:t=>l("/v1/settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([ge],t),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]})}})}function Fn(){return x({mutationFn:()=>l("/v1/settings/master-key/rotate",{method:"POST"})})}function Un(){return p({queryKey:[pe],queryFn:()=>l("/v1/tool-settings"),staleTime:6e4})}function Kn(){const e=g();return x({mutationFn:t=>l("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([pe],t)}})}function Bn(){return x({mutationFn:({service:e,url:t})=>l(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:t})})})}const G=1e3,ht=100;async function xt(){const e=[];for(let t=0;tl("/v1/pricing",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Qn(){const e=g();return x({mutationFn:t=>l(`/v1/pricing/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Vn(){return x({mutationFn:()=>l("/v1/pricing/refresh",{method:"POST"})})}function Wn(){const e=g();return x({mutationFn:()=>l("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ie]})}})}function Hn(){return x({mutationFn:()=>l("/v1/pricing/refresh/reject",{method:"POST"})})}const J=1e3,yt=100;async function vt(){const e=[];for(let t=0;tl("/v1/keys",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Yn(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Xn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Zn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}const Y=1e3,gt=100;async function pt(){const e=[];for(let t=0;tl(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function nr(){const e=g();return x({mutationFn:t=>l("/v1/budgets",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function rr(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function sr(){const e=g();return x({mutationFn:t=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}const X=1e3,bt=100;async function wt(){const e=[];for(let t=0;tl("/v1/users",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>le(e)})}function or(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>le(e)})}function lr(){const e=g();return x({mutationFn:t=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{le(e),e.invalidateQueries({queryKey:[R]})}})}function U(e){const t=new URLSearchParams;return e.start_date&&t.set("start_date",e.start_date),e.end_date&&t.set("end_date",e.end_date),e.status&&t.set("status",e.status),e.model&&t.set("model",e.model),e.endpoint&&t.set("endpoint",e.endpoint),e.provider&&t.set("provider",e.provider),e.user_id&&t.set("user_id",e.user_id),e.api_key_id&&t.set("api_key_id",e.api_key_id),e.source&&t.set("source",e.source),e.source_label&&t.set("source_label",e.source_label),e.priced!==void 0&&t.set("priced",String(e.priced)),e.counts_toward_budget!==void 0&&t.set("counts_toward_budget",String(e.counts_toward_budget)),t}function cr(e,t,r){return p({queryKey:[q,"list",e,t,r],queryFn:()=>{const s=U(e);return s.set("skip",String(t*r)),s.set("limit",String(r)),l(`/v1/usage?${s.toString()}`)},placeholderData:z,staleTime:1e4})}function ur(e,t=!0){return p({queryKey:[q,"count",e],queryFn:()=>l(`/v1/usage/count?${U(e).toString()}`),enabled:t,placeholderData:z,staleTime:1e4})}const jt=6e4;function St(e,t=!0){return p({queryKey:[q,"count","failures",e],queryFn:()=>{const r={status:"error",source:"gateway",start_date:it(e)};return l(`/v1/usage/count?${U(r).toString()}`)},enabled:t,refetchInterval:jt,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function dr(){const e=g();return x({mutationFn:t=>l("/v1/usage",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}function mr(){const e=g();return x({mutationFn:t=>l("/v1/usage/set-price",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}const fr=[];function hr(e,t,r,s=!0){return p({queryKey:[q,"summary",e,t,r??"all"],queryFn:()=>{const a=U(e);if(a.set("bucket",t),r)for(const i of r.length>0?r:["none"])a.append("dimensions",i);return l(`/v1/usage/summary?${a.toString()}`)},enabled:s,placeholderData:z,staleTime:3e4})}function xr(e,t,r,s=!0){return p({queryKey:[q,"series",e,t,r],queryFn:()=>{const a=U(e);return a.set("bucket",t),a.set("group_by",r),l(`/v1/usage/series?${a.toString()}`)},enabled:s&&r!==null,placeholderData:z,staleTime:3e4,retry:(a,i)=>!(i instanceof L&&i.status===404)&&a<3})}function yr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function vr(e){if(e==null)return"$0.00";const t=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}function gr(e){if(e==null)return"—";if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){const t=Math.round(e/1e3);return t>=1e3?"1M":`${t}K`}return String(e)}const kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pr(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})/.exec(e);if(!t)return e;const r=Number(t[2])-1;return r<0||r>11?t[1]:`${kt[r]} ${t[1]}`}const Et=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function br(e){return Et.format(e)}function wr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Pt(e){return`${(e*100).toFixed(1)}%`}function jr(e,t){return t===void 0||t===0?null:(e-t)/t}function Nt(e,t=Date.now()){if(!e)return"never";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const s=Math.round((t-r.getTime())/1e3),a=s<0,i=Math.abs(s),u=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let d=i,f="second";for(const[h,b]of u){if(f=h,d0?"▲":e<0?"▼":"•";return n.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t," ",Pt(Math.abs(e))," vs prev"]})}function Ct(e){return e instanceof L||e instanceof Error?e.message:"Something went wrong."}function _t({error:e}){return e?n.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:Ct(e)}):null}function Tt({tone:e="info",children:t}){const r=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return n.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${r}`,children:t})}function Er({title:e,description:t,action:r}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),r?n.jsx("div",{className:"flex flex-wrap gap-2",children:r}):null]})}function Lt(e){const[t,r]=o.useState(()=>Date.now());return o.useEffect(()=>{let s;const a=()=>{s===void 0&&(s=setInterval(()=>r(Date.now()),e))},i=()=>{s!==void 0&&(clearInterval(s),s=void 0)},u=()=>{r(Date.now()),document.visibilityState==="visible"?a():i()};return u(),document.addEventListener("visibilitychange",u),()=>{i(),document.removeEventListener("visibilitychange",u)}},[e]),t}function Pr({onRefresh:e,isFetching:t=!1,updatedAt:r,label:s="Refresh"}){const a=Lt(15e3),i=r?Nt(new Date(r).toISOString(),a):null;return n.jsxs("span",{className:"inline-flex items-center gap-2",children:[i?n.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Updated ",i]}):null,n.jsx(C,{variant:"outline",size:"sm",isIconOnly:!0,isDisabled:t,onPress:e,"aria-label":s,children:n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`h-4 w-4 ${t?"animate-spin":""}`,"aria-hidden":"true",children:[n.jsx("path",{d:"M20 11a8 8 0 1 0-.5 4",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M20 4v5h-5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function Nr({title:e,description:t,actionLabel:r,onAction:s,isActionDisabled:a,children:i}){return n.jsx(I,{children:n.jsxs(I.Content,{className:"flex flex-col gap-4 p-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),i,r&&s?n.jsx("div",{children:n.jsx(C,{variant:"primary",isDisabled:a,onPress:s,children:r})}):null]})})}function Cr({label:e="Loading…"}){return n.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 px-4 py-10 text-sm text-[var(--otari-muted)]",children:[n.jsx(Ve,{size:"sm"}),n.jsx("span",{children:e})]})}function _r({children:e,confirmLabel:t,onConfirm:r,isPending:s}){const[a,i]=o.useState(!1);return a?n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(C,{size:"sm",variant:"danger",isDisabled:s,onPress:r,children:t}),n.jsx(C,{size:"sm",variant:"ghost",isDisabled:s,onPress:()=>i(!1),children:"Cancel"})]}):n.jsx(C,{size:"sm",variant:"danger-soft",onPress:()=>i(!0),children:e})}const Dt="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Tr({id:e,label:t,ariaLabel:r,value:s,onChange:a,options:i,children:u,disabled:d}){const f=o.useId(),y=e??(t?f:void 0),h=n.jsx("select",{id:y,"aria-label":t?void 0:r,value:s,disabled:d,onChange:b=>a(b.target.value),className:Dt,children:i?i.map(b=>n.jsx("option",{value:b.value,children:b.label},b.value)):u});return t?n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),h]}):h}function Lr({label:e,value:t,onChange:r,options:s,placeholder:a,maxVisible:i=50,allowsCustom:u=!1}){const d=m=>{var N;return((N=s.find(M=>M.value===m))==null?void 0:N.label)??m},[f,y]=o.useState(()=>d(t));o.useEffect(()=>{y(d(t))},[t]);const h=f.trim().toLowerCase(),b=s.filter(m=>!h||m.value.toLowerCase().includes(h)||m.label.toLowerCase().includes(h)).slice(0,i);return n.jsxs(K.Root,{allowsEmptyCollection:!0,allowsCustomValue:u,menuTrigger:"focus",inputValue:f,onInputChange:m=>{y(m),u?r(m.trim()):m.trim()===""&&r("")},onSelectionChange:m=>{m!=null&&r(String(m))},className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),n.jsxs(K.InputGroup,{children:[n.jsx(ye,{placeholder:a,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),n.jsx(K.Trigger,{})]}),n.jsx(K.Popover,{children:n.jsx(ze,{items:b,className:"max-h-72 overflow-auto",children:m=>n.jsx(Qe,{id:m.value,textValue:m.label,children:m.label})})})]})}function At(){var f,y;const e=mt(),t=ft(),[r,s]=o.useState(!1),i=((f=e.data)==null?void 0:f.require_pricing)===!0&&e.data.default_pricing===!1&&!r,d=((y=St(Q,i).data)==null?void 0:y.total)??0;return i?n.jsx("div",{className:"shrink-0 px-6 pt-3",children:n.jsx(Tt,{tone:"warning",children:n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("span",{children:["Requests are rejected until pricing is set (",n.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away.",d>0?n.jsxs(n.Fragment,{children:[" ",n.jsxs("strong",{className:"font-semibold",children:[d.toLocaleString()," ",d===1?"request":"requests"," failed in the last hour."]})," ",n.jsx(Fe,{to:"/activity?status=error&range=1h&source=gateway",className:"underline underline-offset-2",children:"View failed requests"})]}):null]}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(C,{size:"sm",variant:"primary",isDisabled:t.isPending,onPress:()=>t.mutate({default_pricing:!0}),children:t.isPending?"Enabling…":"Enable default pricing"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Dismiss"})]})]})})}):null}function It(){const{data:e}=dt(),t=o.useRef(null);return e&&t.current===null&&(t.current=e.build),e!=null&&t.current!=null&&e.build!==t.current}function qt(){const e=It(),[t,r]=o.useState(!1);return!e||t?null:n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:n.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),n.jsx(C,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>r(!0),children:"Later"})]})})}const je=200,Se=480,Z=240,Rt=60,ke="otari.dashboard.sidebarWidth",Ee="otari.dashboard.sidebarCollapsed",he=16,Pe="(max-width: 767px)",$=e=>Math.min(Se,Math.max(je,e));function Ot(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(Pe).matches}const Mt='a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ft(e){return e?Array.from(e.querySelectorAll(Mt)).filter(t=>t.offsetParent!==null||t===document.activeElement):[]}function Ut(){if(typeof window>"u")return Z;try{const e=window.localStorage.getItem(ke),t=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(t)?Z:$(t)}catch{return Z}}function Kt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ee)==="1"}catch{return!1}}const Bt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],$t=[{to:"/",section:"home",label:"Overview",end:!0,icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),n.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),n.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),n.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),n.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function zt(){const{logout:e}=re(),t=o.useRef(null),r=o.useRef(null),s=o.useRef(null),[a,i]=o.useState(Ut),[u,d]=o.useState(Kt),[f,y]=o.useState(!1),[h,b]=o.useState(Ot),[m,N]=o.useState(!1);o.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const c=window.matchMedia(Pe),v=w=>{b(w.matches),w.matches||N(!1)};return typeof c.addEventListener=="function"?(c.addEventListener("change",v),()=>c.removeEventListener("change",v)):(c.addListener(v),()=>c.removeListener(v))},[]),o.useEffect(()=>{if(!m)return;const c=v=>{v.key==="Escape"&&N(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[m]),o.useEffect(()=>{var c,v,w;h&&(m?(c=t.current)==null||c.focus():(v=t.current)!=null&&v.contains(document.activeElement)&&((w=s.current)==null||w.focus()))},[h,m]);const M=o.useCallback(c=>{if(c.key!=="Tab")return;const v=Ft(t.current);if(v.length===0)return;const w=v[0],k=v[v.length-1],F=document.activeElement;c.shiftKey&&(F===w||F===t.current)?(c.preventDefault(),k.focus()):!c.shiftKey&&F===k&&(c.preventDefault(),w.focus())},[]);o.useEffect(()=>{const c=window.setTimeout(()=>{try{window.localStorage.setItem(ke,String(Math.round(a)))}catch{}},200);return()=>window.clearTimeout(c)},[a]),o.useEffect(()=>{try{window.localStorage.setItem(Ee,u?"1":"0")}catch{}},[u]);const Ce=o.useCallback(c=>{c.preventDefault(),c.currentTarget.setPointerCapture(c.pointerId),y(!0)},[]),_e=o.useCallback(c=>{var w;if(!c.currentTarget.hasPointerCapture(c.pointerId))return;const v=((w=t.current)==null?void 0:w.getBoundingClientRect().left)??0;i($(c.clientX-v))},[]),Te=o.useCallback(c=>{c.currentTarget.hasPointerCapture(c.pointerId)&&c.currentTarget.releasePointerCapture(c.pointerId),y(!1)},[]),Le=o.useCallback(c=>{var v;c.preventDefault(),(v=r.current)==null||v.focus()},[]),De=o.useCallback(c=>{c.key==="ArrowLeft"?(c.preventDefault(),i(v=>$(v-he))):c.key==="ArrowRight"&&(c.preventDefault(),i(v=>$(v+he)))},[]),Ae=u?Rt:a,S=h?!1:u,H=h&&m?!0:void 0;return n.jsxs("div",{className:_("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[n.jsx("button",{type:"button",inert:H,onClick:Le,className:"sr-only focus:not-sr-only focus:absolute focus:top-3 focus:left-3 focus:z-50 focus:rounded-lg focus:border focus:border-[var(--otari-brand)] focus:bg-[var(--otari-surface)] focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-[var(--otari-brand-dark)] focus:shadow-md focus:outline-none",children:"Skip to main content"}),n.jsxs("header",{inert:H,className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("button",{type:"button",ref:s,onClick:()=>N(c=>!c),"aria-label":m?"Close navigation":"Open navigation","aria-expanded":m,"aria-controls":"app-sidebar",className:"-ml-1 flex h-8 w-8 items-center justify-center rounded-lg text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)] md:hidden",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5",children:n.jsx("path",{d:"M4 6h16M4 12h16M4 18h16",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),n.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),n.jsx(C,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),n.jsx(qt,{}),n.jsx(st,{}),n.jsx(At,{}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[h&&m?n.jsx("div",{"aria-hidden":"true",onClick:()=>N(!1),className:"fixed inset-0 z-30 bg-black/40 md:hidden"}):null,n.jsxs("aside",{ref:t,id:"app-sidebar",role:h?"dialog":void 0,"aria-modal":h&&m?!0:void 0,"aria-label":h?"Navigation":void 0,tabIndex:h?-1:void 0,inert:h&&!m?!0:void 0,onKeyDown:h&&m?M:void 0,style:h?void 0:{width:Ae},className:_("flex flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)] focus:outline-none",h?_("fixed inset-y-0 left-0 z-40 w-[17rem] shadow-xl transition-transform duration-200",m?"translate-x-0":"-translate-x-full"):_("relative shrink-0",!f&&"transition-[width] duration-150")),children:[n.jsx("button",{type:"button",onClick:()=>d(c=>!c),"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-pressed":u,title:u?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 hidden h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)] md:flex",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:_("h-3.5 w-3.5 transition-transform",u&&"rotate-180"),children:n.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("nav",{className:_("flex flex-col py-4",S?"px-2":"px-3"),children:Bt.map((c,v)=>{const w=$t.filter(k=>k.section===c.key);return w.length===0?null:n.jsxs("div",{className:v>0?"mt-4":void 0,children:[!S&&c.label?n.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:c.label}):null,v>0&&(S||!c.label)?n.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,n.jsx("div",{className:"flex flex-col gap-1",children:w.map(k=>n.jsxs(ee,{to:k.to,end:k.end,onClick:()=>N(!1),"aria-label":S?k.label:void 0,title:S?k.label:void 0,className:({isActive:F})=>_("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"justify-center px-0":"gap-3 px-3",F?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,S?null:k.label]},k.to))})]},c.key)})}),n.jsxs("div",{className:"mt-auto flex flex-col gap-1 pb-3",children:[n.jsxs(ee,{to:"/docs",onClick:()=>N(!1),"aria-label":S?"User guide":void 0,title:S?"User guide":void 0,className:({isActive:c})=>_("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"mx-2 justify-center px-0":"mx-3 gap-3 px-3",c?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[n.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.5V18c4 0 6.5.5 8 2 1.5-1.5 4-2 8-2V4.5c-4 0-6.5.5-8 2z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 6.5V20",strokeLinecap:"round"})]}),S?null:"User guide"]}),n.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai: the hosted Otari gateway",className:_("flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",S?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),S?null:n.jsxs("span",{className:"flex-1",children:["otari.ai ",n.jsx("span",{"aria-hidden":!0,children:"↗"})]})]})]}),u||h?null:n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(a),"aria-valuemin":je,"aria-valuemax":Se,tabIndex:0,onPointerDown:Ce,onPointerMove:_e,onPointerUp:Te,onKeyDown:De,className:_("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),n.jsx("main",{ref:r,id:"main-content",tabIndex:-1,inert:H,className:"flex-1 overflow-y-auto focus:outline-none",children:n.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-4 py-5 md:px-6 md:py-6",children:n.jsx(Ue,{})})})]})]})}function Qt(){const{login:e}=re(),[t,r]=o.useState(""),[s,a]=o.useState(null),[i,u]=o.useState(!1),d=async()=>{const f=t.trim();if(!(!f||i)){u(!0),a(null);try{await Xe(f)?e():a(new Error("Invalid master key."))}catch(y){a(y)}finally{u(!1)}}};return n.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:n.jsx(I,{className:"w-full max-w-md",children:n.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),n.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),d()},children:[n.jsxs(We,{value:t,onChange:f=>{r(f),s&&a(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),n.jsx(ye,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),n.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[n.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),n.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",n.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",n.jsx("code",{children:"Your master key:"})," (for example, run"," ",n.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),n.jsx(_t,{error:s}),n.jsx(C,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!t.trim()||i,children:i?"Signing in…":"Sign in"})]}),n.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),n.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:n.jsx(He,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const Vt=o.lazy(async()=>({default:(await P(async()=>{const{ActivityPage:e}=await import("./ActivityPage-CcRVRd0J.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))).ActivityPage})),Wt=o.lazy(async()=>({default:(await P(async()=>{const{AliasesPage:e}=await import("./AliasesPage-CXPQdDm6.js");return{AliasesPage:e}},__vite__mapDeps([11,1,2,6,5,7,8,12,13]))).AliasesPage})),Ht=o.lazy(async()=>({default:(await P(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-Cnrtd_az.js");return{BudgetsPage:e}},__vite__mapDeps([14,1,2,6,5,7,8,12]))).BudgetsPage})),Gt=o.lazy(async()=>({default:(await P(async()=>{const{DocsPage:e}=await import("./DocsPage-BgBskDDe.js");return{DocsPage:e}},__vite__mapDeps([15,1,2,5]))).DocsPage})),Jt=o.lazy(async()=>({default:(await P(async()=>{const{KeysPage:e}=await import("./KeysPage-D9JSwodo.js");return{KeysPage:e}},__vite__mapDeps([16,1,2,6,5,7,8,12,17,13]))).KeysPage})),Yt=o.lazy(async()=>({default:(await P(async()=>{const{ModelsPage:e}=await import("./ModelsPage-CH43id2j.js");return{ModelsPage:e}},__vite__mapDeps([18,1,2,6,5,8,10]))).ModelsPage})),Xt=o.lazy(async()=>({default:(await P(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-BOO3r0BN.js");return{OverviewIndex:e}},__vite__mapDeps([19,1,2,3,4,5,8]))).OverviewIndex})),Zt=o.lazy(async()=>({default:(await P(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-enPv456e.js");return{ProvidersPage:e}},__vite__mapDeps([20,1,2,12,5,8]))).ProvidersPage})),en=o.lazy(async()=>({default:(await P(async()=>{const{SettingsPage:e}=await import("./SettingsPage-VWHKo1Ho.js");return{SettingsPage:e}},__vite__mapDeps([21,1,2,5]))).SettingsPage})),tn=o.lazy(async()=>({default:(await P(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-CBa0KCZv.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([22,1,2,5]))).ToolsGuardrailsPage})),nn=o.lazy(async()=>({default:(await P(async()=>{const{UsagePage:e}=await import("./UsagePage-5U02HhO3.js");return{UsagePage:e}},__vite__mapDeps([23,1,2,3,4,5,8,9]))).UsagePage})),rn=o.lazy(async()=>({default:(await P(async()=>{const{UsersPage:e}=await import("./UsersPage-AJZgT8Wn.js");return{UsersPage:e}},__vite__mapDeps([24,1,2,6,5,7,8,12,17]))).UsersPage}));function E(e){return n.jsx(o.Suspense,{fallback:n.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function sn(){const{isAuthenticated:e}=re();return e?n.jsx(Ke,{children:n.jsx(Be,{children:n.jsxs(j,{element:n.jsx(zt,{}),children:[n.jsx(j,{index:!0,element:E(n.jsx(Xt,{}))}),n.jsx(j,{path:"providers",element:E(n.jsx(Zt,{}))}),n.jsx(j,{path:"keys",element:E(n.jsx(Jt,{}))}),n.jsx(j,{path:"users",element:E(n.jsx(rn,{}))}),n.jsx(j,{path:"budgets",element:E(n.jsx(Ht,{}))}),n.jsx(j,{path:"activity",element:E(n.jsx(Vt,{}))}),n.jsx(j,{path:"usage",element:E(n.jsx(nn,{}))}),n.jsx(j,{path:"models",element:E(n.jsx(Yt,{}))}),n.jsx(j,{path:"aliases",element:E(n.jsx(Wt,{}))}),n.jsx(j,{path:"tools",element:E(n.jsx(tn,{}))}),n.jsx(j,{path:"settings",element:E(n.jsx(en,{}))}),n.jsx(j,{path:"docs",element:E(n.jsx(Gt,{}))}),n.jsx(j,{path:"*",element:n.jsx($e,{to:"/",replace:!0})})]})})}):n.jsx(Qt,{})}function an({children:e}){const[t]=o.useState(()=>new Re({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(r,s)=>s instanceof L&&(s.status===401||s.status===403)?!1:r<2}}}));return n.jsx(Oe,{client:t,children:n.jsx(tt,{children:e})})}const Ne=document.getElementById("root");if(!Ne)throw new Error("Root element #root not found");Ge.createRoot(Ne).render(n.jsx(o.StrictMode,{children:n.jsx(an,{children:n.jsx(sn,{})})}));export{Pn as $,hn as A,Nr as B,xn as C,tr as D,_t as E,Tr as F,Yn as G,Xn as H,Tt as I,Zn as J,Jn as K,wn as L,$n as M,fr as N,qn as O,Er as P,zn as Q,Pr as R,gr as S,Qn as T,Ct as U,pr as V,mt as W,vr as X,at as Y,Sn as Z,Cr as _,ot as a,jr as a0,Sr as a1,br as a2,kr as a3,yr as a4,Pt as a5,Nt as a6,Cn as a7,Ln as a8,An as a9,ft as aa,Tn as ab,Nn as ac,_n as ad,En as ae,kn as af,In as ag,Vn as ah,Wn as ai,Hn as aj,Fn as ak,Dn as al,Un as am,Kn as an,Bn as ao,xr as ap,L as aq,mn as ar,dn as as,wr as at,lr as au,ir as av,pn as b,Gn as c,cr as d,ur as e,bn as f,hr as g,yn as h,vn as i,dr as j,mr as k,fn as l,Lr as m,it as n,jn as o,Rn as p,Mn as q,gn as r,_r as s,On as t,ar as u,er as v,nr as w,rr as x,sr as y,or as z}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ActivityPage-DBBA5cYp.js","assets/tanstack-query-1t81HyiD.js","assets/react-dgEcD0HR.js","assets/charts-d2MDwLL0.js","assets/recharts-BwTTRGtj.js","assets/heroui-DZj66Arc.js","assets/tableSelection-CojkFPwd.js","assets/ConfirmDialog-WxOAhWT-.js","assets/DataTable-CrQq0sYf.js","assets/FilterChips-BLdhUEZK.js","assets/TablePagination-Yoj0U_GE.js","assets/AliasesPage-DB2HBhyO.js","assets/Field-DEJ6Wjg9.js","assets/UserComboBox-nt7pHfqn.js","assets/BudgetsPage-ByNysHbI.js","assets/DocsPage-BB_QbZI8.js","assets/KeysPage-CI1KTehV.js","assets/ModelScopeControl-DeZ3FzjH.js","assets/ModelsPage-NAEvt-Hx.js","assets/OverviewPage-ycwh77Rn.js","assets/ProvidersPage-CYdIqkvJ.js","assets/SettingsPage-pwhQKVhQ.js","assets/ToolsGuardrailsPage-Digl65z3.js","assets/UsagePage-1stKL9u3.js","assets/UsersPage-B5EUpDH1.js"])))=>i.map(i=>d[i]); +var Ie=Object.defineProperty;var qe=(e,t,r)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ce=(e,t,r)=>qe(e,typeof t!="symbol"?t+"":t,r);import{u as g,j as n,a as p,b as x,k as z,Q as Re,c as Oe}from"./tanstack-query-1t81HyiD.js";import{d as Me,r as o,N as ee,L as Fe,O as Ue,H as Ke,e as Be,f as j,h as $e}from"./react-dgEcD0HR.js";import{B as C,C as K,L as xe,I as ye,a as ze,b as Qe,d as I,S as Ve,c as _,T as We,e as He}from"./heroui-DZj66Arc.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const u of i.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Ge=Me();const Je="modulepreload",Ye=function(e){return"/"+e},ue={},P=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let u=function(y){return Promise.all(y.map(h=>Promise.resolve(h).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=u(r.map(y=>{if(y=Ye(y),y in ue)return;ue[y]=!0;const h=y.endsWith(".css"),b=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${b}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":Je,h||(m.as="script"),m.crossOrigin="",m.href=y,f&&m.setAttribute("nonce",f),document.head.appendChild(m),h)return new Promise((N,M)=>{m.addEventListener("load",N),m.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function i(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return a.then(u=>{for(const d of u||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};class L extends Error{constructor(r,s){super(s);ce(this,"status");this.name="ApiError",this.status=r}}let B=null;function de(e){B=e}async function te(e){try{const t=await e.json();if(typeof t.detail=="string")return t.detail;if(t.detail!=null)return JSON.stringify(t.detail)}catch{}return e.statusText||`Request failed (${e.status})`}async function Xe(e){let t;try{t=await fetch("/v1/auth/session",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({master_key:e})})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(t.status===401||t.status===403)return!1;if(!t.ok)throw new L(t.status,await te(t));return!0}async function Ze(){try{await fetch("/v1/auth/session",{method:"DELETE"})}catch{}}async function l(e,t={}){const r=new Headers(t.headers);r.set("Accept","application/json"),t.body!=null&&!r.has("Content-Type")&&r.set("Content-Type","application/json");let s;try{s=await fetch(e,{...t,headers:r})}catch{throw new L(0,"Network error: could not reach the gateway.")}if(s.status===401||s.status===403)throw B==null||B(),new L(s.status,await te(s));if(!s.ok)throw new L(s.status,await te(s));if(s.status!==204)return await s.json()}const ne="otari.dashboard.hasSession",ve=o.createContext(null);function et(){try{return window.localStorage.getItem(ne)==="1"}catch{return!1}}function tt({children:e}){const t=g(),[r,s]=o.useState(et),a=o.useCallback(()=>{Ze(),s(!1),t.clear();try{window.localStorage.removeItem(ne)}catch{}},[t]),i=o.useCallback(()=>{t.clear(),s(!0);try{window.localStorage.setItem(ne,"1")}catch{}},[t]);o.useEffect(()=>(de(a),()=>de(null)),[a]);const u=o.useMemo(()=>({isAuthenticated:r,login:i,logout:a}),[r,i,a]);return n.jsx(ve.Provider,{value:u,children:e})}function re(){const e=o.useContext(ve);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function nt(e){return e instanceof L&&e.status===0}function rt(){const e=g(),[t,r]=o.useState(!1);return o.useEffect(()=>{const s=e.getQueryCache(),a=()=>s.getAll().some(i=>i.state.status==="error"&&nt(i.state.error));return r(a()),s.subscribe(()=>r(a()))},[e]),t}function st(){return rt()?n.jsxs("div",{role:"alert","aria-live":"assertive",className:"fixed right-4 bottom-4 z-50 flex max-w-sm items-start gap-2.5 rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700 shadow-lg",children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":!0,className:"mt-0.5 h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 9v4M12 17h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",strokeLinejoin:"round"})]}),n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"Can’t reach the gateway."})," The backend isn’t responding; data won’t load or save until the connection is restored."]})]}):null}const Q=3600,T=86400,at=365*T,dn=[{key:"1h",label:"Last hour",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:T,bucket:"hour"},{key:"7d",label:"7d",seconds:7*T,bucket:"day"},{key:"30d",label:"30d",seconds:30*T,bucket:"day"},{key:"90d",label:"90d",seconds:90*T,bucket:"day"},{key:"12mo",label:"12mo",seconds:at,bucket:"day"}],mn="30d",fn=[{key:"1h",label:"1h",seconds:Q,bucket:"hour"},{key:"24h",label:"24h",seconds:T,bucket:"hour"},{key:"7d",label:"7d",seconds:7*T,bucket:"day"},{key:"30d",label:"30d",seconds:30*T,bucket:"day"},{key:"all",label:"All",seconds:null,bucket:"day"}],hn="24h",xn="custom";function yn(e,t){return e.find(r=>r.key===t)}function it(e,t=Date.now()){return new Date(t-e*1e3).toISOString()}function ot(e){return(e==="hour"?Q:T)*1e3}function vn(e,t,r=Date.now()){const s=new Date(e).getTime();return(t?new Date(t).getTime():r)-s<=T*1e3?"hour":"day"}function gn(e,t,r,s){if(e.length===0)return null;const a=Math.max(0,Math.min(t,r)),i=Math.min(e.length-1,Math.max(t,r)),u=new Date(e[a]).getTime(),d=new Date(e[i]).getTime()+ot(s);return{startIso:new Date(u).toISOString(),endIso:new Date(d).toISOString()}}function pn(e,t,r){const s=e.length;if(s===0)return{startIndex:0,endIndex:0};const a=e.map(d=>new Date(d).getTime());let i=0;if(t){const d=new Date(t).getTime();for(let f=0;fl("/v1/models"),staleTime:6e4})}function dt(){return p({queryKey:[ct],queryFn:()=>l("/dashboard-build.json"),refetchInterval:ut,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function jn(){return p({queryKey:[ae],queryFn:()=>l("/v1/models/discoverable"),staleTime:5*6e4})}function Sn(){return p({queryKey:[ie],queryFn:()=>l("/v1/providers"),staleTime:5*6e4})}function kn(){return p({queryKey:["provider-catalog"],queryFn:()=>l("/v1/providers/catalog"),staleTime:1/0})}function En(e){return p({queryKey:["provider-catalog",e],queryFn:()=>l(`/v1/providers/catalog/${encodeURIComponent(e)}`),enabled:e!=="",staleTime:1/0})}function Pn(){return p({queryKey:[oe],queryFn:()=>l("/v1/providers/health"),staleTime:me,refetchInterval:me})}function Nn(){const e=g();return x({mutationFn:()=>l("/v1/providers/health?refresh=true"),onSuccess:t=>e.setQueryData([oe],t)})}function Cn(){return p({queryKey:[be],queryFn:()=>l("/v1/provider-credentials"),staleTime:6e4})}function W(e){e.invalidateQueries({queryKey:[be]}),e.invalidateQueries({queryKey:[ie]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]}),e.invalidateQueries({queryKey:[oe]})}function _n(){const e=g();return x({mutationFn:t=>l("/v1/provider-credentials",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>W(e)})}function Tn(){const e=g();return x({mutationFn:({instance:t,body:r})=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>W(e)})}function Ln(){const e=g();return x({mutationFn:t=>l(`/v1/provider-credentials/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>W(e)})}function Dn(){const e=g();return x({mutationFn:()=>l("/v1/provider-credentials/reencrypt",{method:"POST"}),onSuccess:()=>W(e)})}function An(){return x({mutationFn:e=>l(`/v1/provider-credentials/${encodeURIComponent(e)}/test`,{method:"POST"})})}function In(){return x({mutationFn:e=>l("/v1/provider-credentials/test",{method:"POST",body:JSON.stringify(e)})})}function qn(){return p({queryKey:[lt],queryFn:()=>l("/v1/models/metadata"),staleTime:10*6e4})}function Rn(){return p({queryKey:[se],queryFn:()=>l("/v1/aliases"),staleTime:6e4})}function On(){const e=g();return x({mutationFn:t=>l("/v1/aliases",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function Mn(){const e=g();return x({mutationFn:({name:t,userId:r})=>{const s=r==null?"":`?user_id=${encodeURIComponent(r)}`;return l(`/v1/aliases/${encodeURIComponent(t)}${s}`,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:[se]}),e.invalidateQueries({queryKey:[D]})}})}function mt(){return p({queryKey:[ge],queryFn:()=>l("/v1/settings"),staleTime:6e4})}function ft(){const e=g();return x({mutationFn:t=>l("/v1/settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([ge],t),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ae]})}})}function Fn(){return x({mutationFn:()=>l("/v1/settings/master-key/rotate",{method:"POST"})})}function Un(){return p({queryKey:[pe],queryFn:()=>l("/v1/tool-settings"),staleTime:6e4})}function Kn(){const e=g();return x({mutationFn:t=>l("/v1/tool-settings",{method:"PATCH",body:JSON.stringify(t)}),onSuccess:t=>{e.setQueryData([pe],t)}})}function Bn(){return x({mutationFn:({service:e,url:t})=>l(`/v1/tool-settings/${encodeURIComponent(e)}/test`,{method:"POST",body:JSON.stringify({url:t})})})}const G=1e3,ht=100;async function xt(){const e=[];for(let t=0;tl("/v1/pricing",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Qn(){const e=g();return x({mutationFn:t=>l(`/v1/pricing/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]})}})}function Vn(){return x({mutationFn:()=>l("/v1/pricing/refresh",{method:"POST"})})}function Wn(){const e=g();return x({mutationFn:()=>l("/v1/pricing/refresh/confirm",{method:"POST"}),onSuccess:()=>{e.invalidateQueries({queryKey:[V]}),e.invalidateQueries({queryKey:[D]}),e.invalidateQueries({queryKey:[ie]})}})}function Hn(){return x({mutationFn:()=>l("/v1/pricing/refresh/reject",{method:"POST"})})}const J=1e3,yt=100;async function vt(){const e=[];for(let t=0;tl("/v1/keys",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Yn(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Xn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}/rotate`,{method:"POST"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}function Zn(){const e=g();return x({mutationFn:t=>l(`/v1/keys/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[R]})})}const Y=1e3,gt=100;async function pt(){const e=[];for(let t=0;tl(`/v1/budgets/${encodeURIComponent(e)}/reset-logs`),enabled:e!==null,staleTime:6e4})}function nr(){const e=g();return x({mutationFn:t=>l("/v1/budgets",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function rr(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}function sr(){const e=g();return x({mutationFn:t=>l(`/v1/budgets/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>void e.invalidateQueries({queryKey:[O]})})}const X=1e3,bt=100;async function wt(){const e=[];for(let t=0;tl("/v1/users",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>le(e)})}function or(){const e=g();return x({mutationFn:({id:t,body:r})=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify(r)}),onSuccess:()=>le(e)})}function lr(){const e=g();return x({mutationFn:t=>l(`/v1/users/${encodeURIComponent(t)}`,{method:"DELETE"}),onSuccess:()=>{le(e),e.invalidateQueries({queryKey:[R]})}})}function U(e){const t=new URLSearchParams;return e.start_date&&t.set("start_date",e.start_date),e.end_date&&t.set("end_date",e.end_date),e.status&&t.set("status",e.status),e.model&&t.set("model",e.model),e.endpoint&&t.set("endpoint",e.endpoint),e.provider&&t.set("provider",e.provider),e.user_id&&t.set("user_id",e.user_id),e.api_key_id&&t.set("api_key_id",e.api_key_id),e.source&&t.set("source",e.source),e.source_label&&t.set("source_label",e.source_label),e.priced!==void 0&&t.set("priced",String(e.priced)),e.counts_toward_budget!==void 0&&t.set("counts_toward_budget",String(e.counts_toward_budget)),t}function cr(e,t,r){return p({queryKey:[q,"list",e,t,r],queryFn:()=>{const s=U(e);return s.set("skip",String(t*r)),s.set("limit",String(r)),l(`/v1/usage?${s.toString()}`)},placeholderData:z,staleTime:1e4})}function ur(e,t=!0){return p({queryKey:[q,"count",e],queryFn:()=>l(`/v1/usage/count?${U(e).toString()}`),enabled:t,placeholderData:z,staleTime:1e4})}const jt=6e4;function St(e,t=!0){return p({queryKey:[q,"count","failures",e],queryFn:()=>{const r={status:"error",source:"gateway",start_date:it(e)};return l(`/v1/usage/count?${U(r).toString()}`)},enabled:t,refetchInterval:jt,refetchOnWindowFocus:!0,staleTime:0,retry:!1})}function dr(){const e=g();return x({mutationFn:t=>l("/v1/usage",{method:"DELETE",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}function mr(){const e=g();return x({mutationFn:t=>l("/v1/usage/set-price",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:[q]})}})}const fr=[];function hr(e,t,r,s=!0){return p({queryKey:[q,"summary",e,t,r??"all"],queryFn:()=>{const a=U(e);if(a.set("bucket",t),r)for(const i of r.length>0?r:["none"])a.append("dimensions",i);return l(`/v1/usage/summary?${a.toString()}`)},enabled:s,placeholderData:z,staleTime:3e4})}function xr(e,t,r,s=!0){return p({queryKey:[q,"series",e,t,r],queryFn:()=>{const a=U(e);return a.set("bucket",t),a.set("group_by",r),l(`/v1/usage/series?${a.toString()}`)},enabled:s&&r!==null,placeholderData:z,staleTime:3e4,retry:(a,i)=>!(i instanceof L&&i.status===404)&&a<3})}function yr(e){return e==null?"0":new Intl.NumberFormat("en-US").format(e)}function vr(e){if(e==null)return"$0.00";const t=e!==0&&Math.abs(e)<.01?4:2;return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:t}).format(e)}function gr(e){if(e==null)return"—";if(e>=1e6){const t=e/1e6;return`${Number.isInteger(t)?t:t.toFixed(1)}M`}if(e>=1e3){const t=Math.round(e/1e3);return t>=1e3?"1M":`${t}K`}return String(e)}const kt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pr(e){if(!e)return"—";const t=/^(\d{4})-(\d{2})/.exec(e);if(!t)return e;const r=Number(t[2])-1;return r<0||r>11?t[1]:`${kt[r]} ${t[1]}`}const Et=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:2});function br(e){return Et.format(e)}function wr(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Pt(e){return`${(e*100).toFixed(1)}%`}function jr(e,t){return t===void 0||t===0?null:(e-t)/t}function Nt(e,t=Date.now()){if(!e)return"never";const r=new Date(e);if(Number.isNaN(r.getTime()))return e;const s=Math.round((t-r.getTime())/1e3),a=s<0,i=Math.abs(s),u=[["second",60],["minute",60],["hour",24],["day",30],["month",12],["year",Number.POSITIVE_INFINITY]];let d=i,f="second";for(const[h,b]of u){if(f=h,d0?"▲":e<0?"▼":"•";return n.jsxs("span",{className:"text-[var(--otari-muted)]",children:[t," ",Pt(Math.abs(e))," vs prev"]})}function Ct(e){return e instanceof L||e instanceof Error?e.message:"Something went wrong."}function _t({error:e}){return e?n.jsx("div",{role:"alert",className:"rounded-lg border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:Ct(e)}):null}function Tt({tone:e="info",children:t}){const r=e==="warning"?"border-amber-200 bg-amber-50 text-amber-800":"border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]";return n.jsx("div",{className:`rounded-lg border px-4 py-3 text-sm ${r}`,children:t})}function Er({title:e,description:t,action:r}){return n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),r?n.jsx("div",{className:"flex flex-wrap gap-2",children:r}):null]})}function Lt(e){const[t,r]=o.useState(()=>Date.now());return o.useEffect(()=>{let s;const a=()=>{s===void 0&&(s=setInterval(()=>r(Date.now()),e))},i=()=>{s!==void 0&&(clearInterval(s),s=void 0)},u=()=>{r(Date.now()),document.visibilityState==="visible"?a():i()};return u(),document.addEventListener("visibilitychange",u),()=>{i(),document.removeEventListener("visibilitychange",u)}},[e]),t}function Pr({onRefresh:e,isFetching:t=!1,updatedAt:r,label:s="Refresh"}){const a=Lt(15e3),i=r?Nt(new Date(r).toISOString(),a):null;return n.jsxs("span",{className:"inline-flex items-center gap-2",children:[i?n.jsxs("span",{className:"text-xs text-[var(--otari-muted)]",children:["Updated ",i]}):null,n.jsx(C,{variant:"outline",size:"sm",isIconOnly:!0,isDisabled:t,onPress:e,"aria-label":s,children:n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`h-4 w-4 ${t?"animate-spin":""}`,"aria-hidden":"true",children:[n.jsx("path",{d:"M20 11a8 8 0 1 0-.5 4",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M20 4v5h-5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}function Nr({title:e,description:t,actionLabel:r,onAction:s,isActionDisabled:a,children:i}){return n.jsx(I,{children:n.jsxs(I.Content,{className:"flex flex-col gap-4 p-6",children:[n.jsxs("div",{children:[n.jsx("h2",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:e}),t?n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:t}):null]}),i,r&&s?n.jsx("div",{children:n.jsx(C,{variant:"primary",isDisabled:a,onPress:s,children:r})}):null]})})}function Cr({label:e="Loading…"}){return n.jsxs("div",{role:"status",className:"flex items-center justify-center gap-2 px-4 py-10 text-sm text-[var(--otari-muted)]",children:[n.jsx(Ve,{size:"sm"}),n.jsx("span",{children:e})]})}function _r({children:e,confirmLabel:t,onConfirm:r,isPending:s}){const[a,i]=o.useState(!1);return a?n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(C,{size:"sm",variant:"danger",isDisabled:s,onPress:r,children:t}),n.jsx(C,{size:"sm",variant:"ghost",isDisabled:s,onPress:()=>i(!1),children:"Cancel"})]}):n.jsx(C,{size:"sm",variant:"danger-soft",onPress:()=>i(!0),children:e})}const Dt="rounded-lg border border-[var(--otari-line)] bg-[var(--otari-bg)] px-3 py-2 text-sm text-[var(--otari-ink)] focus:border-[var(--otari-brand)] focus:outline-none";function Tr({id:e,label:t,ariaLabel:r,value:s,onChange:a,options:i,children:u,disabled:d}){const f=o.useId(),y=e??(t?f:void 0),h=n.jsx("select",{id:y,"aria-label":t?void 0:r,value:s,disabled:d,onChange:b=>a(b.target.value),className:Dt,children:i?i.map(b=>n.jsx("option",{value:b.value,children:b.label},b.value)):u});return t?n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("label",{htmlFor:y,className:"text-xs font-medium text-[var(--otari-muted)]",children:t}),h]}):h}function Lr({label:e,value:t,onChange:r,options:s,placeholder:a,maxVisible:i=50,allowsCustom:u=!1}){const d=m=>{var N;return((N=s.find(M=>M.value===m))==null?void 0:N.label)??m},[f,y]=o.useState(()=>d(t));o.useEffect(()=>{y(d(t))},[t]);const h=f.trim().toLowerCase(),b=s.filter(m=>!h||m.value.toLowerCase().includes(h)||m.label.toLowerCase().includes(h)).slice(0,i);return n.jsxs(K.Root,{allowsEmptyCollection:!0,allowsCustomValue:u,menuTrigger:"focus",inputValue:f,onInputChange:m=>{y(m),u?r(m.trim()):m.trim()===""&&r("")},onSelectionChange:m=>{m!=null&&r(String(m))},className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-xs font-medium text-[var(--otari-muted)]",children:e}),n.jsxs(K.InputGroup,{children:[n.jsx(ye,{placeholder:a,autoComplete:"off",onFocus:m=>m.currentTarget.select()}),n.jsx(K.Trigger,{})]}),n.jsx(K.Popover,{children:n.jsx(ze,{items:b,className:"max-h-72 overflow-auto",children:m=>n.jsx(Qe,{id:m.value,textValue:m.label,children:m.label})})})]})}function At(){var f,y;const e=mt(),t=ft(),[r,s]=o.useState(!1),i=((f=e.data)==null?void 0:f.require_pricing)===!0&&e.data.default_pricing===!1&&!r,d=((y=St(Q,i).data)==null?void 0:y.total)??0;return i?n.jsx("div",{className:"shrink-0 px-6 pt-3",children:n.jsx(Tt,{tone:"warning",children:n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("span",{children:["Requests are rejected until pricing is set (",n.jsx("code",{children:"require_pricing"})," is on). Enable default pricing to meter new models with public rates right away.",d>0?n.jsxs(n.Fragment,{children:[" ",n.jsxs("strong",{className:"font-semibold",children:[d.toLocaleString()," ",d===1?"request":"requests"," failed in the last hour."]})," ",n.jsx(Fe,{to:"/activity?status=error&range=1h&source=gateway",className:"underline underline-offset-2",children:"View failed requests"})]}):null]}),n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx(C,{size:"sm",variant:"primary",isDisabled:t.isPending,onPress:()=>t.mutate({default_pricing:!0}),children:t.isPending?"Enabling…":"Enable default pricing"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>s(!0),children:"Dismiss"})]})]})})}):null}function It(){const{data:e}=dt(),t=o.useRef(null);return e&&t.current===null&&(t.current=e.build),e!=null&&t.current!=null&&e.build!==t.current}function qt(){const e=It(),[t,r]=o.useState(!1);return!e||t?null:n.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-50 flex justify-center",children:n.jsxs("div",{role:"status",className:"pointer-events-auto mt-1.5 flex items-center gap-3 rounded-full border border-[var(--otari-brand)] bg-[var(--otari-brand-tint)] py-1.5 pr-1.5 pl-4 text-sm text-[var(--otari-brand-dark)] shadow-md",children:[n.jsxs("span",{children:[n.jsx("strong",{className:"font-semibold",children:"An update is available."})," Reloading keeps you signed in."]}),n.jsx(C,{size:"sm",variant:"primary",onPress:()=>window.location.reload(),children:"Update now"}),n.jsx(C,{size:"sm",variant:"ghost",onPress:()=>r(!0),children:"Later"})]})})}const je=200,Se=480,Z=240,Rt=60,ke="otari.dashboard.sidebarWidth",Ee="otari.dashboard.sidebarCollapsed",he=16,Pe="(max-width: 767px)",$=e=>Math.min(Se,Math.max(je,e));function Ot(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(Pe).matches}const Mt='a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';function Ft(e){return e?Array.from(e.querySelectorAll(Mt)).filter(t=>t.offsetParent!==null||t===document.activeElement):[]}function Ut(){if(typeof window>"u")return Z;try{const e=window.localStorage.getItem(ke),t=e?Number.parseInt(e,10):Number.NaN;return Number.isNaN(t)?Z:$(t)}catch{return Z}}function Kt(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Ee)==="1"}catch{return!1}}const Bt=[{key:"home"},{key:"observability",label:"Observability"},{key:"catalog",label:"Catalog"},{key:"access",label:"Access"},{key:"system"}],$t=[{to:"/",section:"home",label:"Overview",end:!0,icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.5",strokeLinejoin:"round"})]})},{to:"/activity",section:"observability",label:"Activity",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M3 12h4l2.5-6 4 12 2.5-6H21",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/usage",section:"observability",label:"Usage",icon:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:n.jsx("path",{d:"M4 20V10M10 20V4M16 20v-7M22 20H2",strokeLinecap:"round",strokeLinejoin:"round"})})},{to:"/providers",section:"catalog",label:"Providers",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("rect",{x:"3.5",y:"13.5",width:"17",height:"6",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M7 7.5h.01M7 16.5h.01",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/users",section:"access",label:"Users",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"9",cy:"8",r:"3.2",strokeLinejoin:"round"}),n.jsx("path",{d:"M3.5 19a5.5 5.5 0 0 1 11 0",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 5.2a3.2 3.2 0 0 1 0 5.6M17.5 19a5.5 5.5 0 0 0-3-4.9",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/keys",section:"access",label:"API keys",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"7.5",cy:"15.5",r:"3.5"}),n.jsx("path",{d:"M10 13l7-7M14 5l3 3M16.5 7.5l2-2",strokeLinecap:"round",strokeLinejoin:"round"})]})},{to:"/budgets",section:"access",label:"Budgets",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1.5 1.5 0 0 1 1.5 1.5V9",strokeLinejoin:"round"}),n.jsx("rect",{x:"3",y:"7.5",width:"18",height:"12",rx:"1.5",strokeLinejoin:"round"}),n.jsx("path",{d:"M16 13.5h.01",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M21 12v3h-3.5a1.5 1.5 0 0 1 0-3H21z",strokeLinejoin:"round"})]})},{to:"/models",section:"catalog",label:"Models",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 12l8-4.5M12 12v9M12 12L4 7.5",strokeLinejoin:"round"})]})},{to:"/aliases",section:"catalog",label:"Aliases",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M20.6 13.4L13.4 20.6a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 12.2V5a2 2 0 0 1 2-2h7.2a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8z",strokeLinejoin:"round"}),n.jsx("circle",{cx:"7.5",cy:"7.5",r:"1.5"})]})},{to:"/tools",section:"system",label:"Tools & Guardrails",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M14.7 6.3a4 4 0 0 1 5 5l-8.4 8.4a2 2 0 0 1-2.8 0l-2.2-2.2a2 2 0 0 1 0-2.8z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 9 5 16",strokeLinecap:"round"})]})},{to:"/settings",section:"system",label:"Settings",icon:n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("circle",{cx:"12",cy:"12",r:"3"}),n.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",strokeLinejoin:"round"})]})}];function zt(){const{logout:e}=re(),t=o.useRef(null),r=o.useRef(null),s=o.useRef(null),[a,i]=o.useState(Ut),[u,d]=o.useState(Kt),[f,y]=o.useState(!1),[h,b]=o.useState(Ot),[m,N]=o.useState(!1);o.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const c=window.matchMedia(Pe),v=w=>{b(w.matches),w.matches||N(!1)};return typeof c.addEventListener=="function"?(c.addEventListener("change",v),()=>c.removeEventListener("change",v)):(c.addListener(v),()=>c.removeListener(v))},[]),o.useEffect(()=>{if(!m)return;const c=v=>{v.key==="Escape"&&N(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[m]),o.useEffect(()=>{var c,v,w;h&&(m?(c=t.current)==null||c.focus():(v=t.current)!=null&&v.contains(document.activeElement)&&((w=s.current)==null||w.focus()))},[h,m]);const M=o.useCallback(c=>{if(c.key!=="Tab")return;const v=Ft(t.current);if(v.length===0)return;const w=v[0],k=v[v.length-1],F=document.activeElement;c.shiftKey&&(F===w||F===t.current)?(c.preventDefault(),k.focus()):!c.shiftKey&&F===k&&(c.preventDefault(),w.focus())},[]);o.useEffect(()=>{const c=window.setTimeout(()=>{try{window.localStorage.setItem(ke,String(Math.round(a)))}catch{}},200);return()=>window.clearTimeout(c)},[a]),o.useEffect(()=>{try{window.localStorage.setItem(Ee,u?"1":"0")}catch{}},[u]);const Ce=o.useCallback(c=>{c.preventDefault(),c.currentTarget.setPointerCapture(c.pointerId),y(!0)},[]),_e=o.useCallback(c=>{var w;if(!c.currentTarget.hasPointerCapture(c.pointerId))return;const v=((w=t.current)==null?void 0:w.getBoundingClientRect().left)??0;i($(c.clientX-v))},[]),Te=o.useCallback(c=>{c.currentTarget.hasPointerCapture(c.pointerId)&&c.currentTarget.releasePointerCapture(c.pointerId),y(!1)},[]),Le=o.useCallback(c=>{var v;c.preventDefault(),(v=r.current)==null||v.focus()},[]),De=o.useCallback(c=>{c.key==="ArrowLeft"?(c.preventDefault(),i(v=>$(v-he))):c.key==="ArrowRight"&&(c.preventDefault(),i(v=>$(v+he)))},[]),Ae=u?Rt:a,S=h?!1:u,H=h&&m?!0:void 0;return n.jsxs("div",{className:_("relative flex h-full flex-col overflow-hidden",f&&"cursor-col-resize select-none"),children:[n.jsx("button",{type:"button",inert:H,onClick:Le,className:"sr-only focus:not-sr-only focus:absolute focus:top-3 focus:left-3 focus:z-50 focus:rounded-lg focus:border focus:border-[var(--otari-brand)] focus:bg-[var(--otari-surface)] focus:px-4 focus:py-2 focus:text-sm focus:font-medium focus:text-[var(--otari-brand-dark)] focus:shadow-md focus:outline-none",children:"Skip to main content"}),n.jsxs("header",{inert:H,className:"flex shrink-0 items-center justify-between border-b border-[var(--otari-line)] bg-[var(--otari-surface)] px-5 py-3",children:[n.jsxs("div",{className:"flex items-center gap-2.5",children:[n.jsx("button",{type:"button",ref:s,onClick:()=>N(c=>!c),"aria-label":m?"Close navigation":"Open navigation","aria-expanded":m,"aria-controls":"app-sidebar",className:"-ml-1 flex h-8 w-8 items-center justify-center rounded-lg text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)] md:hidden",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5",children:n.jsx("path",{d:"M4 6h16M4 12h16M4 18h16",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("img",{src:"/favicon.svg",alt:"",className:"h-7 w-7 shrink-0"}),n.jsx("span",{className:"text-base font-semibold text-[var(--otari-ink)]",children:"Otari"})]}),n.jsx(C,{size:"sm",variant:"outline",onPress:e,"aria-label":"Sign out",children:"Sign out"})]}),n.jsx(qt,{}),n.jsx(st,{}),n.jsx(At,{}),n.jsxs("div",{className:"flex min-h-0 flex-1",children:[h&&m?n.jsx("div",{"aria-hidden":"true",onClick:()=>N(!1),className:"fixed inset-0 z-30 bg-black/40 md:hidden"}):null,n.jsxs("aside",{ref:t,id:"app-sidebar",role:h?"dialog":void 0,"aria-modal":h&&m?!0:void 0,"aria-label":h?"Navigation":void 0,tabIndex:h?-1:void 0,inert:h&&!m?!0:void 0,onKeyDown:h&&m?M:void 0,style:h?void 0:{width:Ae},className:_("flex flex-col border-r border-[var(--otari-line)] bg-[var(--otari-surface)] focus:outline-none",h?_("fixed inset-y-0 left-0 z-40 w-[17rem] shadow-xl transition-transform duration-200",m?"translate-x-0":"-translate-x-full"):_("relative shrink-0",!f&&"transition-[width] duration-150")),children:[n.jsx("button",{type:"button",onClick:()=>d(c=>!c),"aria-label":u?"Expand sidebar":"Collapse sidebar","aria-pressed":u,title:u?"Expand sidebar":"Collapse sidebar",className:"absolute -right-3 top-4 z-30 hidden h-6 w-6 items-center justify-center rounded-full border border-[var(--otari-line)] bg-[var(--otari-surface)] text-[var(--otari-muted)] shadow-sm transition-colors hover:border-[var(--otari-brand)] hover:text-[var(--otari-brand-dark)] md:flex",children:n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:_("h-3.5 w-3.5 transition-transform",u&&"rotate-180"),children:n.jsx("path",{d:"M15 6l-6 6 6 6",strokeLinecap:"round",strokeLinejoin:"round"})})}),n.jsx("nav",{className:_("flex flex-col py-4",S?"px-2":"px-3"),children:Bt.map((c,v)=>{const w=$t.filter(k=>k.section===c.key);return w.length===0?null:n.jsxs("div",{className:v>0?"mt-4":void 0,children:[!S&&c.label?n.jsx("div",{className:"px-3 pb-1 text-[11px] font-semibold tracking-wider text-[var(--otari-muted)] uppercase",children:c.label}):null,v>0&&(S||!c.label)?n.jsx("div",{className:"mx-1 mb-2 border-t border-[var(--otari-line)]"}):null,n.jsx("div",{className:"flex flex-col gap-1",children:w.map(k=>n.jsxs(ee,{to:k.to,end:k.end,onClick:()=>N(!1),"aria-label":S?k.label:void 0,title:S?k.label:void 0,className:({isActive:F})=>_("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"justify-center px-0":"gap-3 px-3",F?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[k.icon,S?null:k.label]},k.to))})]},c.key)})}),n.jsxs("div",{className:"mt-auto flex flex-col gap-1 pb-3",children:[n.jsxs(ee,{to:"/docs",onClick:()=>N(!1),"aria-label":S?"User guide":void 0,title:S?"User guide":void 0,className:({isActive:c})=>_("flex items-center rounded-lg py-2 text-sm font-medium transition-colors",S?"mx-2 justify-center px-0":"mx-3 gap-3 px-3",c?"bg-[var(--otari-brand-tint)] text-[var(--otari-brand-dark)]":"text-[var(--otari-muted)] hover:bg-[var(--otari-bg)] hover:text-[var(--otari-ink)]"),children:[n.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0",children:[n.jsx("path",{d:"M12 6.5C10.5 5 8 4.5 4 4.5V18c4 0 6.5.5 8 2 1.5-1.5 4-2 8-2V4.5c-4 0-6.5.5-8 2z",strokeLinejoin:"round"}),n.jsx("path",{d:"M12 6.5V20",strokeLinecap:"round"})]}),S?null:"User guide"]}),n.jsxs("a",{href:"https://otari.ai",target:"_blank",rel:"noreferrer",title:"otari.ai: the hosted Otari gateway",className:_("flex items-center rounded-lg py-2 text-xs font-medium text-[var(--otari-muted)] transition-colors hover:bg-[var(--otari-bg)] hover:text-[var(--otari-brand-dark)]",S?"mx-2 justify-center px-0":"mx-3 gap-2 px-3"),children:[n.jsx("svg",{"aria-hidden":!0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-4 w-4 shrink-0",children:n.jsx("path",{d:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",strokeLinejoin:"round"})}),S?null:n.jsxs("span",{className:"flex-1",children:["otari.ai ",n.jsx("span",{"aria-hidden":!0,children:"↗"})]})]})]}),u||h?null:n.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":Math.round(a),"aria-valuemin":je,"aria-valuemax":Se,tabIndex:0,onPointerDown:Ce,onPointerMove:_e,onPointerUp:Te,onKeyDown:De,className:_("absolute top-0 right-0 z-10 h-full w-1.5 cursor-col-resize touch-none transition-colors","hover:bg-[var(--otari-brand)] focus-visible:bg-[var(--otari-brand)] focus:outline-none",f?"bg-[var(--otari-brand)]":"bg-transparent")})]}),n.jsx("main",{ref:r,id:"main-content",tabIndex:-1,inert:H,className:"flex-1 overflow-y-auto focus:outline-none",children:n.jsx("div",{className:"mx-auto flex max-w-[1800px] flex-col gap-6 px-4 py-5 md:px-6 md:py-6",children:n.jsx(Ue,{})})})]})]})}function Qt(){const{login:e}=re(),[t,r]=o.useState(""),[s,a]=o.useState(null),[i,u]=o.useState(!1),d=async()=>{const f=t.trim();if(!(!f||i)){u(!0),a(null);try{await Xe(f)?e():a(new Error("Invalid master key."))}catch(y){a(y)}finally{u(!1)}}};return n.jsx("div",{className:"flex min-h-full items-center justify-center p-6",children:n.jsx(I,{className:"w-full max-w-md",children:n.jsxs(I.Content,{className:"flex flex-col gap-5 p-7",children:[n.jsxs("div",{className:"flex flex-col items-center gap-3 text-center",children:[n.jsx("img",{src:"/favicon.svg",alt:"Otari",className:"h-12 w-12"}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-lg font-semibold text-[var(--otari-ink)]",children:"Otari Dashboard"}),n.jsx("p",{className:"mt-1 text-sm text-[var(--otari-muted)]",children:"Sign in with your master key to browse models, set pricing, and manage settings."})]})]}),n.jsxs("form",{className:"flex flex-col gap-4",onSubmit:f=>{f.preventDefault(),d()},children:[n.jsxs(We,{value:t,onChange:f=>{r(f),s&&a(null)},type:"password",isRequired:!0,className:"flex flex-col gap-1",children:[n.jsx(xe,{className:"text-sm font-medium text-[var(--otari-ink)]",children:"Master key"}),n.jsx(ye,{placeholder:"otari-mk-… or your master key",autoFocus:!0,autoComplete:"off"})]}),n.jsxs("details",{className:"text-xs text-[var(--otari-muted)]",children:[n.jsx("summary",{className:"cursor-pointer font-medium text-[var(--otari-brand-dark)]",children:"First run? Where to find your key"}),n.jsxs("p",{className:"mt-2 leading-relaxed",children:["If you did not set ",n.jsx("code",{children:"OTARI_MASTER_KEY"}),", Otari generated one and printed it to the server logs on startup. Look for the line ",n.jsx("code",{children:"Your master key:"})," (for example, run"," ",n.jsx("code",{children:"docker logs "}),") and paste it above."]})]}),n.jsx(_t,{error:s}),n.jsx(C,{type:"submit",variant:"primary",fullWidth:!0,isDisabled:!t.trim()||i,children:i?"Signing in…":"Sign in"})]}),n.jsx("p",{className:"text-center text-xs text-[var(--otari-muted)]",children:"The key is sent once to this gateway and exchanged for a session cookie; it is never stored in the browser."}),n.jsx("div",{className:"border-t border-[var(--otari-line)] pt-4 text-center",children:n.jsx(He,{href:"/welcome",className:"text-sm font-medium text-[var(--otari-brand-dark)]",children:"New to Otari? Open the welcome guide"})})]})})})}const Vt=o.lazy(async()=>({default:(await P(async()=>{const{ActivityPage:e}=await import("./ActivityPage-DBBA5cYp.js");return{ActivityPage:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))).ActivityPage})),Wt=o.lazy(async()=>({default:(await P(async()=>{const{AliasesPage:e}=await import("./AliasesPage-DB2HBhyO.js");return{AliasesPage:e}},__vite__mapDeps([11,1,2,6,5,7,8,12,13]))).AliasesPage})),Ht=o.lazy(async()=>({default:(await P(async()=>{const{BudgetsPage:e}=await import("./BudgetsPage-ByNysHbI.js");return{BudgetsPage:e}},__vite__mapDeps([14,1,2,6,5,7,8,12]))).BudgetsPage})),Gt=o.lazy(async()=>({default:(await P(async()=>{const{DocsPage:e}=await import("./DocsPage-BB_QbZI8.js");return{DocsPage:e}},__vite__mapDeps([15,1,2,5]))).DocsPage})),Jt=o.lazy(async()=>({default:(await P(async()=>{const{KeysPage:e}=await import("./KeysPage-CI1KTehV.js");return{KeysPage:e}},__vite__mapDeps([16,1,2,6,5,7,8,12,17,13]))).KeysPage})),Yt=o.lazy(async()=>({default:(await P(async()=>{const{ModelsPage:e}=await import("./ModelsPage-NAEvt-Hx.js");return{ModelsPage:e}},__vite__mapDeps([18,1,2,6,5,8,10]))).ModelsPage})),Xt=o.lazy(async()=>({default:(await P(async()=>{const{OverviewIndex:e}=await import("./OverviewPage-ycwh77Rn.js");return{OverviewIndex:e}},__vite__mapDeps([19,1,2,3,4,5,8]))).OverviewIndex})),Zt=o.lazy(async()=>({default:(await P(async()=>{const{ProvidersPage:e}=await import("./ProvidersPage-CYdIqkvJ.js");return{ProvidersPage:e}},__vite__mapDeps([20,1,2,12,5,8]))).ProvidersPage})),en=o.lazy(async()=>({default:(await P(async()=>{const{SettingsPage:e}=await import("./SettingsPage-pwhQKVhQ.js");return{SettingsPage:e}},__vite__mapDeps([21,1,2,5]))).SettingsPage})),tn=o.lazy(async()=>({default:(await P(async()=>{const{ToolsGuardrailsPage:e}=await import("./ToolsGuardrailsPage-Digl65z3.js");return{ToolsGuardrailsPage:e}},__vite__mapDeps([22,1,2,5]))).ToolsGuardrailsPage})),nn=o.lazy(async()=>({default:(await P(async()=>{const{UsagePage:e}=await import("./UsagePage-1stKL9u3.js");return{UsagePage:e}},__vite__mapDeps([23,1,2,3,4,5,8,9]))).UsagePage})),rn=o.lazy(async()=>({default:(await P(async()=>{const{UsersPage:e}=await import("./UsersPage-B5EUpDH1.js");return{UsersPage:e}},__vite__mapDeps([24,1,2,6,5,7,8,12,17]))).UsersPage}));function E(e){return n.jsx(o.Suspense,{fallback:n.jsx("div",{role:"status",children:"Loading page…"}),children:e})}function sn(){const{isAuthenticated:e}=re();return e?n.jsx(Ke,{children:n.jsx(Be,{children:n.jsxs(j,{element:n.jsx(zt,{}),children:[n.jsx(j,{index:!0,element:E(n.jsx(Xt,{}))}),n.jsx(j,{path:"providers",element:E(n.jsx(Zt,{}))}),n.jsx(j,{path:"keys",element:E(n.jsx(Jt,{}))}),n.jsx(j,{path:"users",element:E(n.jsx(rn,{}))}),n.jsx(j,{path:"budgets",element:E(n.jsx(Ht,{}))}),n.jsx(j,{path:"activity",element:E(n.jsx(Vt,{}))}),n.jsx(j,{path:"usage",element:E(n.jsx(nn,{}))}),n.jsx(j,{path:"models",element:E(n.jsx(Yt,{}))}),n.jsx(j,{path:"aliases",element:E(n.jsx(Wt,{}))}),n.jsx(j,{path:"tools",element:E(n.jsx(tn,{}))}),n.jsx(j,{path:"settings",element:E(n.jsx(en,{}))}),n.jsx(j,{path:"docs",element:E(n.jsx(Gt,{}))}),n.jsx(j,{path:"*",element:n.jsx($e,{to:"/",replace:!0})})]})})}):n.jsx(Qt,{})}function an({children:e}){const[t]=o.useState(()=>new Re({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:(r,s)=>s instanceof L&&(s.status===401||s.status===403)?!1:r<2}}}));return n.jsx(Oe,{client:t,children:n.jsx(tt,{children:e})})}const Ne=document.getElementById("root");if(!Ne)throw new Error("Root element #root not found");Ge.createRoot(Ne).render(n.jsx(o.StrictMode,{children:n.jsx(an,{children:n.jsx(sn,{})})}));export{Pn as $,hn as A,Nr as B,xn as C,tr as D,_t as E,Tr as F,Yn as G,Xn as H,Tt as I,Zn as J,Jn as K,wn as L,$n as M,fr as N,qn as O,Er as P,zn as Q,Pr as R,gr as S,Qn as T,Ct as U,pr as V,mt as W,vr as X,at as Y,Sn as Z,Cr as _,ot as a,jr as a0,Sr as a1,br as a2,kr as a3,yr as a4,Pt as a5,Nt as a6,Cn as a7,Ln as a8,An as a9,ft as aa,Tn as ab,Nn as ac,_n as ad,En as ae,kn as af,In as ag,Vn as ah,Wn as ai,Hn as aj,Fn as ak,Dn as al,Un as am,Kn as an,Bn as ao,xr as ap,L as aq,mn as ar,dn as as,wr as at,lr as au,ir as av,pn as b,Gn as c,cr as d,ur as e,bn as f,hr as g,yn as h,vn as i,dr as j,mr as k,fn as l,Lr as m,it as n,jn as o,Rn as p,Mn as q,gn as r,_r as s,On as t,ar as u,er as v,nr as w,rr as x,sr as y,or as z}; diff --git a/src/gateway/static/dashboard/assets/index-BJ3N7V3K.css b/src/gateway/static/dashboard/assets/index-DZJUM2JE.css similarity index 94% rename from src/gateway/static/dashboard/assets/index-BJ3N7V3K.css rename to src/gateway/static/dashboard/assets/index-DZJUM2JE.css index d686ff464..5d6aebfbc 100644 --- a/src/gateway/static/dashboard/assets/index-BJ3N7V3K.css +++ b/src/gateway/static/dashboard/assets/index-DZJUM2JE.css @@ -1 +1 @@ -/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--tw-content:"";--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-space-y-reverse:0;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-700:oklch(50.5% .213 27.518);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-500:oklch(72.3% .219 149.579);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-xl:calc(var(--radius) * 1.5);--radius-2xl:calc(var(--radius) * 2);--radius-3xl:calc(var(--radius) * 3);--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow-surface:var(--surface-shadow);--shadow-overlay:var(--overlay-shadow);--border-width-field:var(--field-border-width,var(--border-width));--ease-smooth:ease;--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-fluid:cubic-bezier(.32, .72, 0, 1);--ease-linear:linear}@layer theme.base{:root,.light,.default,[data-theme=light],[data-theme=default]{color-scheme:light;--white:oklch(100% 0 0);--black:oklch(0% 0 0);--snow:oklch(99.11% 0 0);--eclipse:oklch(21.03% .0059 285.89);--spacing:.25rem;--border-width:1px;--field-border-width:0px;--disabled-opacity:.5;--ring-offset-width:2px;--cursor-interactive:pointer;--cursor-disabled:not-allowed;--radius:.5rem;--field-radius:calc(var(--radius) * 1.5);--background:oklch(97.02% 0 0);--foreground:var(--eclipse);--surface:var(--white);--surface-foreground:var(--foreground);--surface-secondary:oklch(95.24% .0013 286.37);--surface-secondary-foreground:var(--foreground);--surface-tertiary:oklch(93.73% .0013 286.37);--surface-tertiary-foreground:var(--foreground);--overlay:var(--white);--overlay-foreground:var(--foreground);--muted:oklch(55.17% .0138 285.94);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(94% .001 286.375);--default-foreground:var(--eclipse);--accent:oklch(62.04% .195 253.83);--accent-foreground:var(--snow);--field-background:var(--white);--field-foreground:oklch(21.03% .0059 285.89);--field-placeholder:var(--muted);--field-border:transparent;--success:oklch(73.29% .1935 150.81);--success-foreground:var(--eclipse);--warning:oklch(78.19% .1585 72.33);--warning-foreground:var(--eclipse);--danger:oklch(65.32% .2328 25.74);--danger-foreground:var(--snow);--segment:var(--white);--segment-foreground:var(--eclipse);--border:oklch(90% .004 286.32);--separator:oklch(92% .004 286.32);--focus:var(--accent);--link:var(--foreground);--backdrop:#00000080;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:color-mix(in oklab, var(--accent) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 70%, var(--foreground) 30%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:color-mix(in oklab, var(--accent) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 70%, var(--foreground) 40%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:color-mix(in oklab, var(--warning) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 70%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:color-mix(in oklab, var(--warning) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:color-mix(in oklab, var(--success) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 60%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:color-mix(in oklab, var(--success) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--overlay-shadow:0 2px 8px 0 #0000000f, 0 -6px 12px 0 #00000008, 0 14px 28px 0 #00000014;--field-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--skeleton-animation:shimmer;--tooltip-delay:1.5s;--tooltip-close-delay:.5s}.dark,[data-theme=dark]{color-scheme:dark;--background:oklch(12% .005 285.823);--foreground:var(--snow);--surface:oklch(21.03% .0059 285.89);--surface-foreground:var(--foreground);--surface-secondary:oklch(25.7% .0037 286.14);--surface-tertiary:oklch(27.21% .0024 247.91);--overlay:oklch(21.03% .0059 285.89);--overlay-foreground:var(--foreground);--muted:oklch(70.5% .015 286.067);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}.dark,[data-theme=dark]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(27.4% .006 286.033);--default-foreground:var(--snow);--field-background:oklch(21.03% .0059 285.89);--field-foreground:var(--foreground);--warning:oklch(82.03% .1388 76.34);--warning-foreground:var(--eclipse);--danger:oklch(59.4% .1967 24.63);--danger-foreground:var(--snow);--segment:oklch(39.64% .01 285.93);--segment-foreground:var(--foreground);--border:oklch(28% .006 286.033);--separator:oklch(25% .006 286.033);--focus:var(--accent);--link:var(--foreground);--backdrop:#0009;--surface-shadow:0 0 0 0 transparent inset;--overlay-shadow:0 0 1px 0 #ffffff4d inset;--field-shadow:0 0 0 0 transparent inset;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}.dark,[data-theme=dark]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}.dark,[data-theme=dark]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}.dark,[data-theme=dark]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}.dark,[data-theme=dark]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}.dark,[data-theme=dark]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}.dark,[data-theme=dark]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}.dark,[data-theme=dark]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}.dark,[data-theme=dark]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}.dark,[data-theme=dark]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}.dark,[data-theme=dark]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}.dark,[data-theme=dark]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}.dark,[data-theme=dark]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}.dark,[data-theme=dark]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft:color-mix(in oklab, var(--accent) 12%, transparent)}}.dark,[data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-hover:color-mix(in oklab, var(--accent) 16%, transparent)}}.dark,[data-theme=dark]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}.dark,[data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}.dark,[data-theme=dark]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft:color-mix(in oklab, var(--warning) 12%, transparent)}}.dark,[data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-hover:color-mix(in oklab, var(--warning) 16%, transparent)}}.dark,[data-theme=dark]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft:color-mix(in oklab, var(--success) 12%, transparent)}}.dark,[data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-hover:color-mix(in oklab, var(--success) 16%, transparent)}}.dark,[data-theme=dark]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}.dark,[data-theme=dark]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}.dark,[data-theme=dark]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}.dark,[data-theme=dark]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}}@layer components;}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--border,currentColor)}::file-selector-button{border-color:var(--border,currentColor)}:root{view-transition-name:none}::view-transition{pointer-events:none}[data-scrollbar=thin]{--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--scrollbar-gutter:auto}[data-scrollbar=default]{--scrollbar-width:auto;--scrollbar-color:auto;--scrollbar-gutter:auto}[data-scrollbar=none]{--scrollbar-width:none;--scrollbar-color:auto;--scrollbar-gutter:auto}}@layer components{.close-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),color .15s var(--ease-out),background-color .1s var(--ease-out),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.close-button:focus-visible:not(:focus),.close-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.close-button:disabled,.close-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.close-button[data-pending=true]{pointer-events:none}.close-button svg{pointer-events:none;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);flex-shrink:0;align-self:center}.close-button--default{background-color:var(--default);color:var(--muted)}@media(hover:hover){.close-button--default:hover,.close-button--default[data-hovered=true]{background-color:var(--default-hover)}}.close-button--default:active,.close-button--default[data-pressed=true]{transform:scale(.93)}.description{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted)}.error-message{height:auto;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *),.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.field-error{height:0;padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);opacity:0}.field-error[data-visible]{opacity:1;height:auto}.field-error{transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *),.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox>.field-error,.checkbox>[data-slot=field-error],.switch>.field-error,.switch>[data-slot=field-error],.radio>.field-error,.radio>[data-slot=field-error]{height:auto;min-height:0;color:var(--muted);opacity:1;margin:0;padding:0;transition:none}.label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}:is(.label--required,[data-required=true]:not([role=group]):not([role=radiogroup]):not([role=checkboxgroup])>.label,[data-required=true]:not([data-slot=radio]):not([data-slot=checkbox])>.label):after{margin-left:calc(var(--spacing) * .5);color:var(--danger);--tw-content:"*";content:var(--tw-content)}.label--disabled,[data-disabled=true] .label{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.label--invalid,[data-invalid=true] .label,[aria-invalid=true] .label{color:var(--danger)}.accordion{contain:layout style;width:100%}.accordion__body{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.accordion__body-inner{padding-inline:calc(var(--spacing) * 4);padding-top:0;padding-bottom:calc(var(--spacing) * 4);color:var(--muted)}.accordion__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__indicator[data-expanded=true]{rotate:-180deg}.accordion__item{--tw-border-style:none;border-style:none;position:relative}.accordion__item:after{content:"";border-radius:calc(var(--radius) * .25);background-color:var(--separator);width:100%;height:1px;position:absolute;bottom:0;left:0}.accordion__item:last-child:after{content:none}.accordion__item[data-hide-separator=true]:after{display:none}.accordion__trigger{cursor:var(--cursor-interactive);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 4);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-tap-highlight-color:transparent;transition:opacity .15s var(--ease-out),box-shadow .15s var(--ease-out);flex:1;justify-content:space-between;align-items:center;display:flex}.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:color-mix(in oklab,var(--foreground) 3%,transparent 90%)}}}.accordion__trigger:focus-visible:not(:focus),.accordion__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.accordion__trigger:disabled,.accordion__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.accordion__panel{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__panel[data-expanded=true]{will-change:height,opacity;opacity:1}.accordion--surface{background-color:var(--surface);border-radius:min(32px,var(--radius-3xl))}@media(hover:hover){.accordion--surface .accordion__trigger:hover:not([aria-expanded=true]),.accordion--surface .accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--default)}}.accordion--surface .accordion__item:after{background-color:var(--surface-foreground)}@supports (color:color-mix(in lab,red,red)){.accordion--surface .accordion__item:after{background-color:color-mix(in oklab,var(--surface-foreground) 6%,transparent)}}.accordion--surface .accordion__item:after{width:94%;left:3%}.accordion--surface .accordion__item:first-child [data-slot=accordion-trigger]{border-top-left-radius:min(32px,var(--radius-3xl));border-top-right-radius:min(32px,var(--radius-3xl))}.accordion--surface .accordion__item:last-child:not(:has([data-slot=accordion-trigger][aria-expanded=true])) [data-slot=accordion-trigger]{border-bottom-left-radius:min(32px,var(--radius-3xl));border-bottom-right-radius:min(32px,var(--radius-3xl))}.breadcrumbs{align-items:center;display:flex}.breadcrumbs .breadcrumbs__link{padding-inline:calc(var(--spacing) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);opacity:1;text-decoration-line:none;position:relative}.breadcrumbs .breadcrumbs__link:hover,.breadcrumbs .breadcrumbs__link[data-hovered=true]{text-decoration-line:underline}.breadcrumbs .breadcrumbs__link[data-current=true]{color:var(--link);opacity:1}.breadcrumbs .breadcrumbs__item{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);padding-inline:calc(var(--spacing) * .5);flex-shrink:0;display:flex}.breadcrumbs .breadcrumbs__separator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:var(--muted)}.breadcrumbs .breadcrumbs__separator:where(:dir(rtl),[dir=rtl],[dir=rtl] *){rotate:180deg}.disclosure-group{contain:layout style;width:100%}.disclosure{position:relative}.accordion__heading{display:flex}.disclosure__trigger{cursor:var(--cursor-interactive);-webkit-tap-highlight-color:transparent;display:inline-block}.disclosure__trigger:focus-visible:not(:focus),.disclosure__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.disclosure__trigger:disabled,.disclosure__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.disclosure__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:inherit;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__indicator[data-expanded=true]{rotate:-180deg}.disclosure__content{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__content[data-expanded=true]{will-change:height,opacity;opacity:1}.disclosure__body{padding:calc(var(--spacing) * 2)}.link{border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);width:fit-content;height:fit-content;font-weight:var(--font-weight-medium);color:var(--link);text-decoration-line:none;-webkit-text-decoration-color:var(--separator-tertiary);text-decoration-color:var(--separator-tertiary);text-underline-offset:4px;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .1s var(--ease-out);align-items:center;text-decoration-thickness:1.5px;display:inline-flex;position:relative}.link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link{cursor:var(--cursor-interactive)}@media(hover:hover){.link:hover,.link[data-hovered=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.link:hover,.link[data-hovered=true]{-webkit-text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent);text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent)}}:is(.link:hover,.link[data-hovered=true]) .link__icon{opacity:1}}.link:active,.link[data-pressed=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}:is(.link:active,.link[data-pressed=true]) .link__icon{opacity:1}.link:focus-visible:not(:focus),.link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}:is(.link:focus-visible:not(:focus),.link[data-focus-visible=true]) .link__icon{opacity:1}.link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.link .link__icon{pointer-events:none;color:currentColor;opacity:.6;width:.75em;height:.75em;transition:opacity .15s var(--ease-out);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link .link__icon svg{transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.link .link__icon[data-default-icon=true]{margin-left:var(--spacing);padding-bottom:calc(var(--spacing) * 1.5)}.link.button{gap:0;text-decoration-line:none}.pagination{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);flex-direction:column;width:100%;display:flex}@media(min-width:40rem){.pagination{flex-direction:row}}.pagination__summary{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__summary{align-self:center}}.pagination__content{align-items:center;gap:var(--spacing);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__content{align-self:center}}.pagination__item{display:inline-flex}.pagination__link{isolation:isolate;width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);transform-origin:50%;border-radius:calc(var(--radius) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}@media(min-width:48rem){.pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.pagination__link{--pagination-link-bg:transparent;--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover);--pagination-link-fg:var(--default-foreground);background-color:var(--pagination-link-bg);color:var(--pagination-link-fg)}.pagination__link:focus-visible,.pagination__link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.pagination__link:disabled,.pagination__link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.pagination__link:hover,.pagination__link[data-hovered=true]{background-color:var(--pagination-link-bg-hover)}}.pagination__link:active,.pagination__link[data-pressed=true]{background-color:var(--pagination-link-bg-pressed);transform:scale(.97)}.pagination__link[data-active=true]{--pagination-link-bg:var(--default);--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover)}.pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:inline-flex}@media(min-width:48rem){.pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link--nav{gap:calc(var(--spacing) * 1.5);width:auto;padding-inline:calc(var(--spacing) * 2.5)}.pagination--sm .pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__link{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__link:active,.pagination--sm .pagination__link[data-pressed=true]{transform:scale(.98)}.pagination--sm .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 2)}.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.pagination--lg .pagination__link{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__link{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__link:active,.pagination--lg .pagination__link[data-pressed=true]{transform:scale(.96)}.pagination--lg .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 3)}.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__summary{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.tabs{gap:calc(var(--spacing) * 2);display:flex}.tabs[data-orientation=horizontal]{flex-direction:column}.tabs[data-orientation=vertical]{flex-direction:row}.tabs__list-container{position:relative}.tabs__list{background-color:var(--default);padding:var(--spacing);border-radius:calc(var(--radius) * 2.5);display:inline-flex}.tabs__list[data-orientation=horizontal]{flex-direction:row;width:100%}.tabs__list[data-orientation=vertical]{gap:var(--spacing);flex-direction:column}.tabs__list[data-orientation=vertical] .tabs__tab{min-width:calc(var(--spacing) * 20)}.tabs__tab{z-index:1;cursor:var(--cursor-interactive);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);width:100%;padding-inline:calc(var(--spacing) * 4);text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .15s var(--ease-smooth);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__tab[data-selected=true]{color:var(--segment-foreground)}.tabs__tab[data-selected=true] .tabs__separator,.tabs__tab[data-selected=true]+.tabs__tab .tabs__separator{opacity:0}.tabs__tab:disabled,.tabs__tab[data-disabled=true],.tabs__tab[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.tabs__tab:not([data-selected=true]):not([data-disabled=true]):hover,.tabs__tab[data-hovered=true]:not([data-selected=true]):not([data-disabled=true]){opacity:.7}}.tabs__tab:focus-visible:not(:focus),.tabs__tab[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tabs__separator{border-radius:calc(var(--radius) * .5);background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.tabs__separator{background-color:color-mix(in oklab,var(--muted) 25%,transparent)}}.tabs__separator{pointer-events:none;transition:opacity .15s var(--ease-smooth);position:absolute}.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__list[data-orientation=horizontal] .tabs__separator{width:1px;height:50%;top:25%;left:0}.tabs__list[data-orientation=vertical] .tabs__separator{width:90%;height:1px;top:0;left:5%}.tabs__panel{width:100%;padding:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none}.tabs__panel[data-exiting=true]{width:100%;position:absolute;top:0;left:0}.tabs__panel[data-orientation=horizontal]{margin-top:calc(var(--spacing) * 4)}.tabs__panel[data-orientation=vertical]{margin-left:calc(var(--spacing) * 4)}.tabs__indicator{box-shadow:var(--shadow-surface);z-index:-1;border-radius:var(--radius-3xl);background-color:var(--segment);width:100%;height:100%;transition-property:translate,width,height;transition-duration:.25s;transition-timing-function:var(--ease-out-fluid);position:absolute;top:0;left:0}.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs--secondary>.tabs__list-container>.tabs__list{background-color:#0000;border-radius:0;padding:0}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=horizontal]{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border);max-width:100%;overflow:auto clip}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=vertical]{border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--border)}.tabs--secondary>.tabs__list-container .tabs__tab{border-radius:0}.tabs--secondary>.tabs__list-container .tabs__tab[data-selected=true]{color:var(--foreground)}.tabs--secondary>.tabs__list-container .tabs__separator{display:none}.tabs--secondary>.tabs__list-container .tabs__indicator{background-color:var(--accent);box-shadow:none;border-radius:0}.tabs--secondary[data-orientation=horizontal]>.tabs__list-container .tabs__indicator{height:2px;top:auto;bottom:0}.tabs--secondary[data-orientation=vertical]>.tabs__list-container .tabs__indicator{width:2px;height:100%;top:0;left:0}.button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.button{height:calc(var(--spacing) * 9)}}.button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button{cursor:var(--cursor-interactive);--button-bg:transparent;--button-bg-hover:var(--button-bg);--button-bg-pressed:var(--button-bg-hover);--button-fg:currentColor;background-color:var(--button-bg);color:var(--button-fg)}.button:focus-visible:not(:focus),.button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.button:disabled,.button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.button[data-pending=true]{pointer-events:none}.button:active,.button[data-pressed=true]{background-color:var(--button-bg-pressed);transform:scale(.97)}@media(hover:hover){.button:hover,.button[data-hovered=true]{background-color:var(--button-bg-hover)}}.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.button--sm{height:calc(var(--spacing) * 8)}}.button--sm svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.button--sm:active,.button--sm[data-pressed=true]{transform:scale(.98)}.button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.button--lg{height:calc(var(--spacing) * 10)}}.button--lg:active,.button--lg[data-pressed=true]{transform:scale(.96)}.button--primary{--button-bg:var(--accent);--button-bg-hover:var(--accent-hover);--button-bg-pressed:var(--accent-hover);--button-fg:var(--accent-foreground)}.button--secondary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover);--button-fg:var(--accent-soft-foreground)}.button--tertiary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover)}.button--ghost,.button--outline{--button-bg:transparent;--button-bg-hover:var(--default);--button-bg-pressed:var(--default);--button-fg:var(--default-foreground)}.button--outline{border-style:var(--tw-border-style);border-width:1px;border-color:var(--border);--button-bg-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.button--outline{--button-bg-hover:color-mix(in srgb, var(--default) 60%, transparent)}}.button--danger{--button-bg:var(--danger);--button-bg-hover:var(--danger-hover);--button-bg-pressed:var(--danger-hover);--button-fg:var(--danger-foreground)}.button--danger-soft{--button-bg:var(--danger-soft);--button-bg-hover:var(--danger-soft-hover);--button-bg-pressed:var(--danger-soft-hover);--button-fg:var(--danger-soft-foreground)}.button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.button--icon-only{width:calc(var(--spacing) * 9)}}.button--icon-only.button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.button--icon-only.button--sm{width:calc(var(--spacing) * 8)}}.button--icon-only.button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.button--icon-only.button--lg{width:calc(var(--spacing) * 10)}}.button--full-width{width:100%}.button-group{justify-content:center;align-items:center;gap:0;height:auto;display:inline-flex}.button-group--horizontal{flex-direction:row}.button-group--vertical{flex-direction:column}.button-group .button{border-radius:0}.button-group--horizontal .button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.button-group--vertical .button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group .button:active,.button-group .button[data-pressed=true]{transform:none}.button-group .button:focus-visible:not(:focus),.button-group .button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button-group--horizontal .button-group__separator{width:1px;height:50%;top:25%;left:-1px}.button-group--vertical .button-group__separator{width:50%;height:1px;top:-1px;left:25%}.button-group--horizontal .button--outline:first-child{border-inline-end-style:var(--tw-border-style);border-inline-end-width:0}.button-group--horizontal .button--outline:last-child{border-inline-start-style:var(--tw-border-style);border-inline-start-width:0}.button-group--horizontal .button--outline:not(:first-child):not(:last-child){border-inline-style:var(--tw-border-style);border-inline-width:0}.button-group--vertical .button--outline:first-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.button-group--vertical .button--outline:last-child{border-top-style:var(--tw-border-style);border-top-width:0}.button-group--vertical .button--outline:not(:first-child):not(:last-child){border-block-style:var(--tw-border-style);border-block-width:0}.button-group--full-width{width:100%}.toggle-button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.toggle-button{height:calc(var(--spacing) * 9)}}.toggle-button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button{cursor:var(--cursor-interactive);--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover);--toggle-button-fg:currentColor;--toggle-button-bg-selected:var(--accent-soft);--toggle-button-bg-selected-hover:var(--accent-soft-hover);--toggle-button-bg-selected-pressed:var(--accent-soft-hover);--toggle-button-fg-selected:var(--accent-soft-foreground);background-color:var(--toggle-button-bg);color:var(--toggle-button-fg)}.toggle-button:focus-visible:not(:focus),.toggle-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.toggle-button:disabled,.toggle-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.toggle-button:hover,.toggle-button[data-hovered=true]{background-color:var(--toggle-button-bg-hover)}}.toggle-button:active,.toggle-button[data-pressed=true]{background-color:var(--toggle-button-bg-pressed);transform:scale(.97)}.toggle-button[data-selected=true]{background-color:var(--toggle-button-bg-selected);color:var(--toggle-button-fg-selected)}@media(hover:hover){.toggle-button[data-selected=true]:hover,.toggle-button[data-selected=true][data-hovered=true]{background-color:var(--toggle-button-bg-selected-hover)}}.toggle-button[data-selected=true]:active,.toggle-button[data-selected=true][data-pressed=true]{background-color:var(--toggle-button-bg-selected-pressed)}.toggle-button svg{pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.toggle-button svg{margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.toggle-button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.toggle-button--sm{height:calc(var(--spacing) * 8)}}.toggle-button--sm svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toggle-button--sm:active,.toggle-button--sm[data-pressed=true]{transform:scale(.98)}.toggle-button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.toggle-button--lg{height:calc(var(--spacing) * 10)}}.toggle-button--lg:active,.toggle-button--lg[data-pressed=true]{transform:scale(.96)}.toggle-button--default{--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover)}.toggle-button--ghost{--toggle-button-bg:transparent;--toggle-button-bg-hover:var(--default);--toggle-button-bg-pressed:var(--default);--toggle-button-fg:var(--default-foreground)}.toggle-button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.toggle-button--icon-only{width:calc(var(--spacing) * 9)}}.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 8)}}.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 10)}}.toggle-button-group{justify-content:center;align-items:center;gap:0;width:fit-content;height:auto;display:inline-flex}.toggle-button-group--horizontal{flex-direction:row}.toggle-button-group--vertical{flex-direction:column}.toggle-button-group--full-width{width:100%}.toggle-button-group .toggle-button{border-radius:0}.toggle-button-group--horizontal .toggle-button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group .toggle-button:active,.toggle-button-group .toggle-button[data-pressed=true]{transform:none}.toggle-button-group .toggle-button:focus-visible:not(:focus),.toggle-button-group .toggle-button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.toggle-button-group--full-width .toggle-button{flex:1}.toggle-button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button-group--horizontal .toggle-button-group__separator{width:1px;height:50%;top:25%;left:-1px}.toggle-button-group--vertical .toggle-button-group__separator{width:50%;height:1px;top:-1px;left:25%}.toggle-button-group--detached{gap:var(--spacing)}.toggle-button-group--detached .toggle-button{border-radius:calc(var(--radius) * 3)}.toggle-button-group--detached .toggle-button-group__separator{display:none}.toolbar{align-items:center;gap:calc(var(--spacing) * 2);grid-auto-flow:column;width:fit-content;display:grid}.toolbar .separator--vertical{align-self:center;height:50%}.toolbar .separator--horizontal{justify-content:center;justify-self:center;width:50%}.toolbar--vertical{grid-auto-flow:row;justify-content:flex-start;align-items:flex-start}.toolbar--vertical .button-group{justify-content:flex-start}.toolbar--attached{border-radius:calc(var(--radius) * 3);background-color:var(--surface);padding:var(--spacing);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dropdown{gap:var(--spacing);flex-direction:column;display:flex}.dropdown__trigger{--tw-outline-style:none;transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;display:inline-block}.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.dropdown__trigger{cursor:var(--cursor-interactive)}.dropdown__trigger:focus-visible:not(:focus),.dropdown__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.dropdown__trigger:disabled,.dropdown__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.dropdown__trigger[data-pending=true]{pointer-events:none}.dropdown__trigger:active,.dropdown__trigger[data-pressed=true]{transform:scale(.97)}.dropdown__popover{max-width:48svw;transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));padding:0;overflow-y:auto}@media(min-width:48rem){.dropdown__popover{min-width:calc(var(--spacing) * 55)}}.dropdown__popover{border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay)}.dropdown__popover:focus-visible:not(:focus),.dropdown__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.dropdown__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.dropdown__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.dropdown__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.dropdown__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.dropdown__popover[data-exiting=true],.dropdown__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.dropdown__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.dropdown__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.dropdown__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.dropdown__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.dropdown__popover [data-slot=dropdown-menu]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.dropdown__popover [data-slot=menu-item]{padding-inline:calc(var(--spacing) * 2.5)}.dropdown__menu{gap:calc(var(--spacing) * .5);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.dropdown__menu [data-slot=separator]{width:94%;margin-left:3%}.list-box-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item{cursor:var(--cursor-interactive)}.list-box-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.list-box-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.list-box-item:has(.list-box-item__indicator){padding-inline-end:calc(var(--spacing) * 7)}.list-box-item:focus-visible:not(:focus),.list-box-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.list-box-item:active,.list-box-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.list-box-item:hover,.list-box-item[data-hovered=true]{background-color:var(--default)}}.list-box-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.list-box-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--default-foreground);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-end:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]{transition:stroke-dashoffset .25s linear}:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item--danger .list-box-item__indicator,.list-box-item--danger [data-slot=label]{color:var(--danger)}.list-box-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.list-box{width:100%;padding:var(--spacing);position:relative;overflow:clip}.list-box>*+*{margin-top:var(--spacing)}.list-box [data-slot=separator][data-orientation=horizontal]{width:94%;margin-left:3%}.menu-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item{cursor:var(--cursor-interactive)}.menu-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.menu-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.menu-item [data-slot=submenu-indicator] svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.menu-item:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 7)}.menu-item[data-has-submenu=true]:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 7)}.menu-item:focus-visible:not(:focus),.menu-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.menu-item:active,.menu-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.menu-item:hover,.menu-item[data-hovered=true]{background-color:var(--default)}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]{transition:stroke-dashoffset .1s linear}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--dot]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.menu-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.menu-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-start:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item[data-has-submenu=true] .menu-item__indicator{inset-inline-start:auto;inset-inline-end:calc(var(--spacing) * 2)}.menu-item__indicator [data-slot=menu-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:0}.menu-item__indicator--submenu{color:var(--muted)}.menu-item__indicator--submenu svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.menu-item--danger .menu-item__indicator,.menu-item--danger [data-slot=label]{color:var(--danger)}.menu-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.menu{gap:var(--spacing);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.menu [data-slot=separator]{width:94%;margin-left:3%}.tag-group{gap:var(--spacing);flex-direction:column;display:flex;position:relative}.tag-group__list{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex;position:relative}.tag-group [slot=description],.tag-group [data-slot=description],.tag-group [slot=errorMessage],.tag-group [data-slot=error-message]{padding:var(--spacing)}.tag{--optical-offset:.031em;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:inline-flex;position:relative}.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tag{cursor:var(--cursor-interactive)}.tag svg{pointer-events:none;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:currentColor;flex-shrink:0;align-self:center}.tag:is([data-disabled=true],[aria-disabled=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tag:is(:focus-visible,[data-focus-visible]){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tag:is([data-selected=true],[aria-selected=true]){background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.tag:is([data-selected=true],[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-soft-hover)}}.tag--sm{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--md{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--lg{border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.tag--default{background-color:var(--default);color:var(--default-foreground)}@media(hover:hover){.tag--default:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--default-hover)}}.tag--surface{background-color:var(--surface);color:var(--surface-foreground)}@media(hover:hover){.tag--surface:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--surface-hover)}}.tag__remove-button{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:inherit}.tag__remove-button svg{width:inherit;height:inherit;color:currentColor;flex-shrink:0;align-self:center}.color-area{width:100%;max-width:calc(var(--spacing) * 56);border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;aspect-ratio:1;background:var(--color-area-background);flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-area[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-area--show-dots:after{content:"";pointer-events:none;border-radius:inherit;background-image:radial-gradient(circle,#fff3 1px,#0000 1px);background-size:8px 8px;position:absolute;top:0;right:0;bottom:0;left:0}.color-area__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);will-change:width,height;background-color:var(--color-area-thumb-color);transition:width .15s var(--ease-out),height .15s var(--ease-out);border:3px solid #fff;box-shadow:0 0 0 1px #0000001a,inset 0 0 0 1px #0000001a}.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-area__thumb[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-area__thumb[data-dragging=true]{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.color-area__thumb[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker{display:inline-flex}.color-picker__trigger{align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-flex}.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-picker__trigger [data-slot=label]{cursor:var(--cursor-interactive)}.color-picker__trigger:focus-visible:not(:focus),.color-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-picker__trigger:disabled,.color-picker__trigger[data-disabled=true],.color-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker__popover{min-width:calc(var(--spacing) * 62);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 3);box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5));gap:calc(var(--spacing) * 3);flex-direction:column;display:flex;overflow:hidden auto}.color-picker__popover:focus-visible:not(:focus),.color-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.color-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.color-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.color-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.color-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.color-picker__popover[data-exiting=true],.color-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.color-slider{gap:var(--spacing);grid-template:"label output""track track"/1fr auto;width:100%;display:grid}.color-slider:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template:"track"/1fr;gap:0}.color-slider:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-columns:1fr;grid-template-areas:"label""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output){grid-template-columns:1fr;grid-template-areas:"output""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output) .color-slider__output{justify-self:end}.color-slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.color-slider .color-slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.color-slider .color-slider__track{border-radius:calc(var(--radius) * 2);grid-area:track;position:relative}.color-slider .color-slider__track:before,.color-slider .color-slider__track:after{content:"";z-index:0;pointer-events:none;position:absolute}.color-slider .color-slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;border-style:var(--tw-border-style);border-width:3px;border-color:var(--color-white);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);z-index:1;transition:transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-slider .color-slider__thumb[data-dragging=true]{cursor:grabbing}.color-slider .color-slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-slider .color-slider__thumb[data-disabled=true]{cursor:default;background-color:var(--default)}.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]) [data-slot=label]{opacity:1}.color-slider[data-orientation=horizontal]{flex-direction:column}.color-slider[data-orientation=horizontal] .color-slider__track{height:calc(var(--spacing) * 5);border-radius:0;justify-self:center;width:calc(100% - 1.25rem);box-shadow:inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:before,.color-slider[data-orientation=horizontal] .color-slider__track:after{width:.625rem;height:100%;top:0}.color-slider[data-orientation=horizontal] .color-slider__track:before{border-top-left-radius:calc(var(--radius) * 2);border-bottom-left-radius:calc(var(--radius) * 2);background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;left:-.625rem;box-shadow:inset 1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:after{border-top-right-radius:calc(var(--radius) * 2);border-bottom-right-radius:calc(var(--radius) * 2);background-color:var(--track-end-color,transparent);right:-.625rem;box-shadow:inset -1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);top:50%}.color-slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;place-items:center;height:100%}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template-rows:1fr;grid-template-areas:"track";gap:0}.color-slider[data-orientation=vertical]:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-rows:1fr auto;grid-template-areas:"track""label"}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):has(.color-slider__output){grid-template-rows:auto 1fr;grid-template-areas:"output""track"}.color-slider[data-orientation=vertical] .color-slider__output,.color-slider[data-orientation=vertical] [data-slot=label]{text-align:center}.color-slider[data-orientation=vertical] .color-slider__track{width:calc(var(--spacing) * 5);border-radius:0;justify-self:center;height:calc(100% - 1.25rem);box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:before,.color-slider[data-orientation=vertical] .color-slider__track:after{width:100%;height:.625rem;left:0}.color-slider[data-orientation=vertical] .color-slider__track:before{background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;border-bottom-right-radius:999px;border-bottom-left-radius:999px;bottom:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:after{background-color:var(--track-end-color,transparent);border-top-left-radius:999px;border-top-right-radius:999px;top:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);left:50%}.color-swatch{box-sizing:border-box;width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);background:linear-gradient(var(--color-swatch-current),var(--color-swatch-current)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-swatch--circle{border-radius:calc(var(--radius) * 2)}.color-swatch--square{border-radius:calc(var(--radius) * .75)}.color-swatch--xs{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.color-swatch--xs.color-swatch--circle{border-radius:calc(var(--radius) * 1)}.color-swatch--sm{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.color-swatch--sm.color-swatch--circle{border-radius:calc(var(--radius) * 1.5)}.color-swatch--lg{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.color-swatch--lg.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.color-swatch--xl.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch-picker{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.color-swatch-picker__item{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);border-style:var(--tw-border-style);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:border-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);border-width:2px;border-color:#0000;outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__item:focus-visible,.color-swatch-picker__item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-swatch-picker__item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-swatch-picker__item[data-selected=true]{border-color:var(--color-swatch-current);box-shadow:var(--field-shadow)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{transform:scale(.77)}.color-swatch-picker__swatch{border-radius:inherit;width:100%;height:100%;transition:transform .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:block}.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-swatch-picker__swatch:hover{transform:scale(1.1)}}.color-swatch-picker__indicator{pointer-events:none;z-index:10;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.color-swatch-picker__indicator>*{width:33.3333%;height:33.3333%;color:var(--color-white);transition:transform .15s var(--ease-out);transform:scale(0)translateZ(0)}.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__indicator[data-light-color=true] .color-swatch-picker__indicator>*{color:var(--color-black)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__indicator>*{transform:scale(1)translateZ(0)}.color-swatch-picker--stack{flex-direction:column}.color-swatch-picker--xs .color-swatch-picker__item{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px}.color-swatch-picker--sm .color-swatch-picker__item{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);border-style:var(--tw-border-style);border-width:2px}.color-swatch-picker--lg .color-swatch-picker__item{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--xl .color-swatch-picker__item{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--square .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-input-group:hover:not(:focus-within),.color-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.color-input-group[data-focus-within=true],.color-input-group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.color-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group[data-invalid=true]:focus,.color-input-group[data-invalid=true]:focus-visible,.color-input-group[data-invalid=true][data-focused=true],.color-input-group[data-invalid=true][data-focus-visible=true],.color-input-group[data-invalid=true]:focus-within,.color-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.color-input-group[data-disabled=true],.color-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-input-group__input{cursor:text;border-style:var(--tw-border-style);height:100%;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;display:flex}@media(min-width:40rem){.color-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.color-input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}.color-input-group:has([data-slot=color-input-group-prefix]) .color-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.color-input-group:has([data-slot=color-input-group-suffix]) .color-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.color-input-group__input:focus,.color-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.color-input-group__prefix{color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group__suffix{color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--color-input-group-bg);--color-input-group-bg:var(--default);--color-input-group-bg-hover:var(--default-hover);--color-input-group-bg-focus:var(--default)}@media(hover:hover){.color-input-group--secondary:hover:not(:focus-within),.color-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--color-input-group-bg-hover)}}.color-input-group--secondary:focus-within,.color-input-group--secondary[data-focus-within=true]{background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group--secondary[data-invalid=true]:focus,.color-input-group--secondary[data-invalid=true]:focus-visible,.color-input-group--secondary[data-invalid=true][data-focused=true],.color-input-group--secondary[data-invalid=true][data-focus-visible=true],.color-input-group--secondary[data-invalid=true]:focus-within,.color-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary [data-slot=color-input-group-input]{background-color:#0000}.color-input-group--full-width{width:100%}.color-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.color-field[data-invalid=true],.color-field[aria-invalid=true]) [data-slot=description]{display:none}.color-field [data-slot=label]{width:fit-content}.color-field--full-width{width:100%}.slider{gap:var(--spacing);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.slider .slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.slider .slider__track{border-radius:calc(var(--radius) * 1.5);background-color:var(--default);grid-area:track;position:relative}.slider .slider__fill{pointer-events:none;background-color:var(--accent);position:absolute}.slider .slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 1.5);background-color:var(--accent);-webkit-tap-highlight-color:transparent;transition:background-color .25s var(--ease-smooth),transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.slider .slider__thumb:after{z-index:10;border-radius:calc(var(--radius) * 1);background-color:var(--accent-foreground);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);content:"";transform-origin:50%;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));position:relative}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:after:not(:is()){transition-property:none}}.slider .slider__thumb[data-dragging=true]{cursor:grabbing}.slider .slider__thumb[data-dragging=true]:after{scale:.9}@media(prefers-reduced-motion:reduce){.slider .slider__thumb[data-dragging=true]:after:not(:is()){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.slider .slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.slider .slider__thumb[data-disabled=true]{cursor:default}.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]) [data-slot=label]{opacity:1}.slider[data-orientation=horizontal]{flex-direction:column}.slider[data-orientation=horizontal] .slider__track{height:calc(var(--spacing) * 5);border-inline-style:var(--tw-border-style);border-inline-width:.75rem;border-inline-color:#0000;width:100%}.slider[data-orientation=horizontal] .slider__track[data-fill-start=true]{border-inline-start-color:var(--accent)}.slider[data-orientation=horizontal] .slider__track[data-fill-end=true]{border-inline-end-color:var(--accent)}.slider[data-orientation=horizontal] .slider__fill,.slider[data-orientation=horizontal] .slider__thumb{height:100%}.slider[data-orientation=horizontal] .slider__thumb{width:1.75rem;top:50%}.slider[data-orientation=horizontal] .slider__thumb:after{width:1.5rem;height:1rem}.slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;height:100%}.slider[data-orientation=vertical] .slider__output,.slider[data-orientation=vertical] [data-slot=label]{text-align:center}.slider[data-orientation=vertical] .slider__track{height:100%;width:calc(var(--spacing) * 5);border-block-style:var(--tw-border-style);border-block-width:.75rem;border-block-color:#0000;justify-self:center}.slider[data-orientation=vertical] .slider__track[data-fill-start=true]{border-bottom-color:var(--accent)}.slider[data-orientation=vertical] .slider__track[data-fill-end=true]{border-top-color:var(--accent)}.slider[data-orientation=vertical] .slider__fill,.slider[data-orientation=vertical] .slider__thumb{width:100%}.slider[data-orientation=vertical] .slider__thumb{height:1.75rem;left:50%}.slider[data-orientation=vertical] .slider__thumb:after{width:1rem;height:1.5rem}.switch{align-items:flex-start;gap:var(--spacing);-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);--switch-control-bg:var(--default);--switch-control-bg-hover:var(--switch-control-bg);flex-direction:column;display:flex}@supports (color:color-mix(in lab,red,red)){.switch{--switch-control-bg-hover:color-mix(in oklab, var(--switch-control-bg), transparent 20%)}}.switch{--switch-control-bg-pressed:var(--switch-control-bg-hover);--switch-control-bg-checked:var(--accent);--switch-control-bg-checked-hover:var(--accent-hover)}.switch[data-disabled=true],.switch[data-disabled=true] [data-slot=description],.switch[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.switch[data-disabled=true] .switch__thumb{background-color:var(--default-foreground)}@supports (color:color-mix(in lab,red,red)){.switch[data-disabled=true] .switch__thumb{background-color:color-mix(in oklab,var(--default-foreground) 20%,transparent)}}.switch>[data-slot=description]{width:100%;min-width:0;padding-inline-start:3.25rem}.switch>[data-slot=field-error]{width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--muted);padding-inline-start:3.25rem}.switch.switch--sm>[data-slot=description],.switch.switch--sm>[data-slot=field-error]{padding-inline-start:2.75rem}.switch.switch--lg>[data-slot=description],.switch.switch--lg>[data-slot=field-error]{padding-inline-start:3.75rem}:is(.switch:disabled[aria-checked=true],.switch:disabled[data-selected=true],.switch[data-disabled=true][aria-checked=true],.switch[data-disabled=true][data-selected=true],.switch[aria-disabled=true][aria-checked=true],.switch[aria-disabled=true][data-selected=true]) .switch__thumb{opacity:.4}.switch__control{border-radius:calc(var(--radius) * 1.5);background-color:var(--switch-control-bg);width:2.5rem;height:1.25rem;transition:background-color .25s var(--ease-smooth),box-shadow .15s var(--ease-out);flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch:focus-visible .switch__control,.switch:has([data-slot=switch-content][data-focus-visible=true]) .switch__control,.switch [data-slot=switch-content][data-focus-visible=true] .switch__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.switch:hover .switch__control,.switch:has([data-slot=switch-content][data-hovered=true]) .switch__control,.switch [data-slot=switch-content][data-hovered=true] .switch__control{background-color:var(--switch-control-bg-hover)}.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control{background-color:var(--switch-control-bg-pressed)}:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transform:none}@media(prefers-reduced-motion:reduce){:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transform:none}}.switch[aria-checked=true] .switch__control,.switch[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked)}.switch[aria-checked=true]:hover .switch__control,.switch[data-selected=true]:hover .switch__control,.switch[aria-checked=true][data-hovered=true] .switch__control,.switch[data-selected=true][data-hovered=true] .switch__control,.switch:has([data-slot=switch-content][data-hovered=true])[data-selected=true] .switch__control,.switch[aria-checked=true]:active .switch__control,.switch[data-selected=true]:active .switch__control,.switch[aria-checked=true][data-pressed=true] .switch__control,.switch[data-selected=true][data-pressed=true] .switch__control,.switch:has([data-slot=switch-content][data-pressed=true])[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked-hover)}.switch__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.switch--sm .switch__control{border-radius:calc(var(--radius) * 1);width:2rem;height:1rem}.switch--lg .switch__control{width:3rem;height:1.5rem}.switch__thumb{transform-origin:50%;border-radius:calc(var(--radius) * 1);background-color:var(--color-white);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);width:1.375rem;height:1rem;transition:margin .3s var(--ease-out-fluid),background-color .2s var(--ease-out);margin-inline-start:calc(var(--spacing) * .5);display:flex}.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch[aria-checked=true] .switch__thumb,.switch[data-selected=true] .switch__thumb{background-color:var(--accent-foreground);color:var(--accent);margin-inline-start:calc(100% - 1.5rem);box-shadow:0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d}.switch--sm .switch__thumb{border-radius:calc(var(--radius) * .75);width:1.03125rem;height:.75rem}.switch[aria-checked=true] :is(.switch--sm .switch__thumb),.switch[data-selected=true] :is(.switch--sm .switch__thumb){margin-inline-start:calc(100% - 1.15625rem)}.switch--lg .switch__thumb{border-radius:calc(var(--radius) * 1.5);width:1.71875rem;height:1.25rem}.switch[aria-checked=true] :is(.switch--lg .switch__thumb),.switch[data-selected=true] :is(.switch--lg .switch__thumb){margin-inline-start:calc(100% - 1.84375rem)}.switch__thumb>*{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.switch__label{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.switch [data-slot=label]{-webkit-user-select:none;user-select:none}.switch__content [data-slot=label]{cursor:var(--cursor-interactive)}.switch [data-slot=description]{cursor:default;-webkit-user-select:none;user-select:none}.switch-group{gap:calc(var(--spacing) * 6);flex-direction:column;display:flex}.switch-group__items{gap:calc(var(--spacing) * 4);display:flex}.switch-group--horizontal .switch-group__items{flex-direction:row}.switch-group--vertical .switch-group__items{flex-direction:column}.badge{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);min-height:calc(var(--spacing) * 7);min-width:calc(var(--spacing) * 7);border-radius:calc(var(--radius) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:1.34;--badge-bg:var(--default);--badge-fg:var(--default-foreground);--badge-border:var(--background);background-color:var(--badge-bg);color:var(--badge-fg);border:1px solid var(--badge-border);flex-shrink:0;line-height:1.34;display:inline-flex}.badge__label{padding-inline:calc(var(--spacing) * .5)}.badge-anchor{flex-shrink:0;display:inline-flex;position:relative}.badge--lg{min-height:calc(var(--spacing) * 8);min-width:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;line-height:1.43}.badge--sm{min-height:calc(var(--spacing) * 4);min-width:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);--tw-leading:1.34;font-size:10px;line-height:1.34}.badge--accent{--badge-fg:var(--accent-soft-foreground)}.badge--default{--badge-fg:var(--default-foreground)}.badge--success{--badge-fg:var(--success-soft-foreground)}.badge--warning{--badge-fg:var(--warning-soft-foreground)}.badge--danger{--badge-fg:var(--danger-soft-foreground)}.badge--top-right{position:absolute;top:0;right:0;transform:translate(25%,-25%)}.badge--top-left{position:absolute;top:0;left:0;transform:translate(-25%,-25%)}.badge--bottom-right{position:absolute;bottom:0;right:0;transform:translate(25%,25%)}.badge--bottom-left{position:absolute;bottom:0;left:0;transform:translate(-25%,25%)}.badge--primary.badge--accent{--badge-bg:var(--accent);--badge-fg:var(--accent-foreground)}.badge--primary.badge--default{--badge-bg:var(--default);--badge-fg:var(--default-foreground)}.badge--primary.badge--success{--badge-bg:var(--success);--badge-fg:var(--success-foreground)}.badge--primary.badge--warning{--badge-bg:var(--warning);--badge-fg:var(--warning-foreground)}.badge--primary.badge--danger{--badge-bg:var(--danger);--badge-fg:var(--danger-foreground)}.badge--soft.badge--accent{--badge-bg:var(--accent-soft);--badge-fg:var(--accent-soft-foreground)}.badge--soft.badge--default{--badge-bg:var(--default-soft);--badge-fg:var(--default-soft-foreground)}.badge--soft.badge--success{--badge-bg:var(--success-soft);--badge-fg:var(--success-soft-foreground)}.badge--soft.badge--warning{--badge-bg:var(--warning-soft);--badge-fg:var(--warning-soft-foreground)}.badge--soft.badge--danger{--badge-bg:var(--danger-soft);--badge-fg:var(--danger-soft-foreground)}.chip{align-items:center;gap:calc(var(--spacing) * .5);border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--chip-bg:var(--default);--chip-fg:currentColor;background-color:var(--chip-bg);color:var(--chip-fg);flex-shrink:0;display:inline-flex}.chip__label{padding-inline:calc(var(--spacing) * .5)}.chip--accent{--chip-fg:var(--accent-soft-foreground)}.chip--danger{--chip-fg:var(--danger-soft-foreground)}.chip--default{--chip-fg:var(--default-foreground)}.chip--success{--chip-fg:var(--success-soft-foreground)}.chip--warning{--chip-fg:var(--warning-soft-foreground)}.chip--tertiary{--chip-bg:transparent}.chip--sm{padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));padding-block:0}.chip--md{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.chip--lg{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.chip--primary.chip--accent{--chip-bg:var(--accent);--chip-fg:var(--accent-foreground)}.chip--primary.chip--success{--chip-bg:var(--success);--chip-fg:var(--success-foreground)}.chip--primary.chip--warning{--chip-bg:var(--warning);--chip-fg:var(--warning-foreground)}.chip--primary.chip--danger{--chip-bg:var(--danger);--chip-fg:var(--danger-foreground)}.chip--accent.chip--soft{--chip-bg:var(--accent-soft);--chip-fg:var(--accent-soft-foreground)}.chip--success.chip--soft{--chip-bg:var(--success-soft);--chip-fg:var(--success-soft-foreground)}.chip--warning.chip--soft{--chip-bg:var(--warning-soft);--chip-fg:var(--warning-soft-foreground)}.chip--danger.chip--soft{--chip-bg:var(--danger-soft);--chip-fg:var(--danger-soft-foreground)}.chip--default.chip--soft{--chip-bg:var(--default-soft);--chip-fg:var(--default-soft-foreground)}.table-root{grid-template-columns:minmax(0,1fr);width:100%;display:grid;position:relative;overflow:clip}.table__scroll-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;overflow-x:auto}.table-root--primary{background-color:var(--surface-secondary);padding-inline:var(--spacing);padding-bottom:var(--spacing);border-radius:min(32px,calc(var(--radius) * 2.5))}.table-root--secondary .table__header{border-bottom-style:var(--tw-border-style);background-color:#0000;border-bottom-width:0}.table-root--secondary .table__column{background-color:var(--surface-secondary)}.table-root--secondary :is(th.table__column:first-child,[role=row]>[role=presentation]:first-of-type>.table__column){border-start-start-radius:min(32px,var(--radius-2xl));border-end-start-radius:min(32px,var(--radius-2xl))}.table-root--secondary :is(th.table__column:last-child,[role=row]>[role=presentation]:last-of-type>.table__column){border-start-end-radius:min(32px,var(--radius-2xl));border-end-end-radius:min(32px,var(--radius-2xl))}.table-root--secondary .table__body{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table-root--secondary .table__body tr:first-child td:first-child,.table-root--secondary .table__body tr:first-child td:last-child,.table-root--secondary .table__body tr:last-child td:first-child,.table-root--secondary .table__body tr:last-child td:last-child{border-radius:0}.table-root--secondary .table__body:not(tbody){border-radius:0;overflow:visible}.table-root--secondary .table__row .table__cell{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row .table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table-root--secondary .table__row .table__cell{background-color:#0000}@media(hover:hover){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--default) 50%,transparent)}}}.table__content{border-collapse:separate;--tw-border-spacing-x:0;--tw-border-spacing-y:0;width:100%;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.table-root--primary .table__content{overflow:clip}.table__header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator)}@supports (color:color-mix(in lab,red,red)){.table__header{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__header{background-color:var(--surface-secondary)}.table__column{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);position:relative}.table__column:after{content:"";pointer-events:none;height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .5);background-color:var(--separator);inset-inline-end:calc(var(--spacing) * 0);position:absolute;top:50%}.table__column:last-child:not(:only-child):after{content:none}.table__column[data-allows-sorting=true]{cursor:var(--cursor-interactive)}@media(hover:hover){.table__column[data-allows-sorting=true]:hover,.table__column[data-allows-sorting=true][data-hovered=true]{color:var(--foreground)}}.table__column:focus-visible,.table__column[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}[role=row]>[role=presentation]:last-of-type:not(:only-of-type)>.table__column:after{content:none}.table__sortable-column-header{justify-content:space-between;align-items:center;display:flex}.table__sortable-column-indicator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out)}.table__sortable-column-indicator[data-direction=descending]{rotate:180deg}.table__body tr:first-child td:first-child{border-start-start-radius:min(32px,var(--radius-2xl))}.table__body tr:first-child td:last-child{border-start-end-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:first-child{border-end-start-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:last-child{border-end-end-radius:min(32px,var(--radius-2xl))}.table__body:not(tbody){border-radius:min(32px,var(--radius-2xl));height:100%;position:relative;overflow:clip}.table__row{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator);height:100%;position:relative}@supports (color:color-mix(in lab,red,red)){.table__row{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__row:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 40%,transparent)}}}.table__row[data-selected=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row[data-selected=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 10%,transparent)}}.table__row[aria-disabled=true],.table__row[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.table__row:focus-visible,.table__row[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.table__row[data-dragging=true]{opacity:.5}.table__row[data-drop-target=true] .table__cell{background-color:var(--accent-soft)}.table__cell{background-color:var(--surface);height:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);vertical-align:middle;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table__cell:focus-visible,.table__cell[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true]) :is(.table__cell,.table__column){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):only-child,.table__row:is(:focus-visible,[data-focus-visible=true])>:only-child :is(.table__cell,.table__column){border-radius:calc(var(--radius) * 1);--tw-shadow:inset 0 0 0 2px var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):first-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:first-child:not(:only-child) :is(.table__cell,.table__column){border-top-left-radius:calc(var(--radius) * 1);border-bottom-left-radius:calc(var(--radius) * 1);--tw-shadow:inset 2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):last-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:last-child:not(:only-child) :is(.table__cell,.table__column){border-top-right-radius:calc(var(--radius) * 1);border-bottom-right-radius:calc(var(--radius) * 1);--tw-shadow:inset -2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):not(:first-child):not(:last-child):not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:not(:first-child):not(:last-child):not(:only-child) :is(.table__cell,.table__column){--tw-shadow:inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__cell[data-tree-column]{padding-inline-start:calc(1rem * var(--table-row-level,1))}.table__footer{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);align-items:center;display:flex}.table__resizable-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;position:relative;overflow:auto}.table__column-resizer{height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;border-radius:calc(var(--radius) * .5);background-color:var(--separator);box-sizing:content-box;--tw-translate-x: 50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:col-resize;touch-action:none;padding-inline:calc(var(--spacing) * 2);--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-clip:content-box;border-style:none;outline-style:none;position:absolute;top:50%}.table__column-resizer[data-hovered=true],.table__column-resizer:hover,.table__column-resizer[data-resizing=true]{height:100%;width:calc(var(--spacing) * .5);background-color:var(--accent)}.table__column-resizer[data-focus-visible=true],.table__column-resizer:focus-visible{height:100%;width:calc(var(--spacing) * .5);background-color:var(--focus)}.table__column:has(.table__column-resizer):after{content:none}.table__load-more td,.table__load-more [role=rowheader]{padding-block:calc(var(--spacing) * 3);text-align:center}:is(.table__load-more td,.table__load-more [role=rowheader])>*{margin-inline:auto}.table__load-more-content{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 2);display:flex}.alert{justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 4);background-color:var(--surface);width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex}.alert__content{flex-direction:column;flex-grow:1;align-items:flex-start;height:100%;display:flex}.alert__indicator{padding:var(--spacing);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:flex}.alert__indicator [data-slot=alert-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.alert__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.alert__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.alert--default .alert__indicator,.alert--default .alert__title{color:var(--foreground)}.alert--accent .alert__indicator,.alert--accent .alert__title{color:var(--accent-soft-foreground)}.alert--success .alert__indicator,.alert--success .alert__title{color:var(--success-soft-foreground)}.alert--warning .alert__indicator,.alert--warning .alert__title{color:var(--warning-soft-foreground)}.alert--danger .alert__indicator,.alert--danger .alert__title{color:var(--danger-soft-foreground)}.empty-state{padding:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.skeleton{pointer-events:none;border-radius:calc(var(--radius) * .5);background-color:var(--surface-tertiary);position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.skeleton{background-color:color-mix(in oklab,var(--surface-tertiary) 70%,transparent)}}.skeleton--shimmer:after{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-gradient-position:to right;animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}@supports (background-image:linear-gradient(in lab,red,red)){.skeleton--shimmer:after{--tw-gradient-position:to right in oklab}}.skeleton--shimmer:after{background-image:linear-gradient(var(--tw-gradient-stops));--tw-gradient-from:transparent;--tw-gradient-via:var(--surface-tertiary);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));--tw-gradient-to:transparent;--tw-content:"";content:var(--tw-content)}.skeleton--shimmer:has(.skeleton):after{content:none}.skeleton--shimmer:has(.skeleton):before{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-content:"";content:var(--tw-content);z-index:10;pointer-events:none;mix-blend-mode:overlay;background:linear-gradient(90deg,#0000,#ffffff80,#0000);animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}.skeleton--shimmer:has(.skeleton) .skeleton:after{content:none}.skeleton--pulse{animation:var(--animate-pulse)}.meter{gap:var(--spacing);--meter-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.meter [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.meter .meter__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.meter .meter__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.meter .meter__fill{border-radius:calc(var(--radius) * .5);background-color:var(--meter-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]) [data-slot=label]{opacity:1}.meter--sm .meter__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.meter--sm .meter__fill{border-radius:calc(var(--radius) * .25)}.meter--lg .meter__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.meter--lg .meter__fill{border-radius:calc(var(--radius) * .75)}.meter--default{--meter-fill:var(--default-foreground)}.meter--accent{--meter-fill:var(--accent)}.meter--success{--meter-fill:var(--success)}.meter--warning{--meter-fill:var(--warning)}.meter--danger{--meter-fill:var(--danger)}.progress-bar{gap:var(--spacing);--progress-bar-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.progress-bar [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.progress-bar .progress-bar__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.progress-bar .progress-bar__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.progress-bar .progress-bar__fill{border-radius:calc(var(--radius) * .5);background-color:var(--progress-bar-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-bar:not([aria-valuenow]) .progress-bar__fill{width:40%;animation:1.5s cubic-bezier(.65,0,.35,1) infinite progress-bar-indeterminate}.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]) [data-slot=label]{opacity:1}@keyframes progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(350%)}}.progress-bar--sm .progress-bar__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.progress-bar--sm .progress-bar__fill{border-radius:calc(var(--radius) * .25)}.progress-bar--lg .progress-bar__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.progress-bar--lg .progress-bar__fill{border-radius:calc(var(--radius) * .75)}.progress-bar--default{--progress-bar-fill:var(--default-foreground)}.progress-bar--accent{--progress-bar-fill:var(--accent)}.progress-bar--success{--progress-bar-fill:var(--success)}.progress-bar--warning{--progress-bar-fill:var(--warning)}.progress-bar--danger{--progress-bar-fill:var(--danger)}.progress-circle{--progress-circle-stroke:var(--accent);--progress-circle-track-stroke:var(--default);justify-content:center;align-items:center;display:inline-flex}.progress-circle .progress-circle__track{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.progress-circle .progress-circle__track-circle{stroke:var(--progress-circle-track-stroke)}.progress-circle .progress-circle__fill-circle{stroke:var(--progress-circle-stroke);transition:stroke-dashoffset .3s var(--ease-out)}.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-circle:not([aria-valuenow]) .progress-circle__track{animation:1s linear infinite progress-circle-spin}.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-circle:disabled,.progress-circle[data-disabled=true],.progress-circle[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@keyframes progress-circle-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.progress-circle--sm .progress-circle__track{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.progress-circle--lg .progress-circle__track{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.progress-circle--default{--progress-circle-stroke:var(--default-foreground)}.progress-circle--accent{--progress-circle-stroke:var(--accent)}.progress-circle--success{--progress-circle-stroke:var(--success)}.progress-circle--warning{--progress-circle-stroke:var(--warning)}.progress-circle--danger{--progress-circle-stroke:var(--danger)}.spinner{pointer-events:none;width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);flex-shrink:0;animation:.75s linear infinite spin;display:inline-flex}.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *),.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.spinner--sm{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.spinner--lg{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.spinner--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.spinner--current{color:inherit}.spinner--accent{color:var(--accent)}.spinner--danger{color:var(--danger)}.spinner--success{color:var(--success)}.spinner--warning{color:var(--warning)}.toast-region{pointer-events:none;z-index:50;--tw-outline-style:none;outline-style:none;width:calc(100vw - 2rem);position:fixed}@media(min-width:40rem){.toast-region{width:auto;min-width:var(--toast-width)}}.toast-region{display:block}.toast-region--bottom{bottom:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--bottom-start{bottom:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--bottom-end{right:calc(var(--spacing) * 4);bottom:calc(var(--spacing) * 4)}.toast-region--top{top:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--top-start{top:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--top-end{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4)}.toast-region:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast{pointer-events:auto;justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 1.5);background-color:var(--surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex;position:absolute;left:0;right:0}.toast--bottom,.toast--bottom-start,.toast--bottom-end{bottom:0}.toast--top,.toast--top-start,.toast--top-end{top:0}.toast:not([data-frontmost=true]){pointer-events:none;height:var(--front-height);overflow:hidden}.toast:not([data-frontmost=true]) .toast__close-button{pointer-events:none;opacity:0;outline:none}.toast[data-hidden=true]{pointer-events:none;opacity:0;display:flex}.toast:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast--bottom,.toast--bottom-start,.toast--bottom-end{view-transition-class:toast-bottom}.toast--top,.toast--top-start,.toast--top-end{view-transition-class:toast-top}.toast__content{flex-direction:column;flex-grow:1;align-self:center;align-items:flex-start;height:100%;display:flex}.toast__indicator{padding:var(--spacing);color:var(--overlay-foreground);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.toast__indicator [data-slot=toast-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__indicator [data-slot=spinner],.toast__indicator [data-slot=spinner-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--overlay-foreground)}.toast__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.toast__close-button{pointer-events:none;top:calc(var(--spacing) * -1);right:calc(var(--spacing) * -1);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);border-color:var(--border);background-color:var(--default);opacity:0;position:absolute}@media(min-width:40rem){.toast__close-button{border-style:var(--tw-border-style);background-color:var(--overlay);border-width:1px}}.toast__close-button{transition:opacity .15s var(--ease-smooth)}.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(min-width:40rem){.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}}@media(hover:hover){.toast__close-button:hover,.toast__close-button[data-hovered=true]{background-color:var(--default)}}.toast[data-frontmost=true]:hover .toast__close-button{pointer-events:auto;opacity:1}.toast__action{margin-top:calc(var(--spacing) * 2)}@media(min-width:40rem){.toast__action{margin-top:0}}.toast--accent .toast__title{color:var(--accent-soft-foreground)}.toast--success .toast__title,.toast--success .toast__indicator{color:var(--success-soft-foreground)}.toast--warning .toast__title,.toast--warning .toast__indicator{color:var(--warning-soft-foreground)}.toast--danger .toast__title,.toast--danger .toast__indicator{color:var(--danger-soft-foreground)}::view-transition-old(*){will-change:translate,opacity}::view-transition-new(*){will-change:translate,opacity}::view-transition-new(.toast-bottom):only-child{animation:.35s toast-slide-bottom-in}::view-transition-old(.toast-bottom):only-child{animation:.35s forwards toast-slide-bottom-out}::view-transition-new(.toast-top):only-child{animation:.35s toast-slide-top-in}::view-transition-old(.toast-top):only-child{animation:.35s forwards toast-slide-top-out}@keyframes toast-slide-bottom-in{0%{opacity:0;translate:0 100%}}@keyframes toast-slide-bottom-out{to{opacity:0;translate:0 100%}}@keyframes toast-slide-top-in{0%{opacity:0;translate:0 -100%}}@keyframes toast-slide-top-out{to{opacity:0;translate:0 -100%}}.checkbox-group{flex-direction:column;display:flex}.checkbox-group [data-slot=checkbox]{margin-top:calc(var(--spacing) * 4)}.checkbox{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.checkbox>[data-slot=description],.checkbox>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.checkbox [data-slot=label]{-webkit-user-select:none;user-select:none}.checkbox .checkbox__content [data-slot=label]{cursor:var(--cursor-interactive)}.checkbox[data-disabled=true],.checkbox[data-disabled=true] [data-slot=description],.checkbox[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.checkbox[data-selected=true],.checkbox[data-indeterminate=true]) .checkbox__indicator{border-color:var(--accent-foreground)}.checkbox [data-slot=checkbox-default-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);stroke-width:2.5px;color:var(--accent-foreground);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.2s;transition-duration:.2s}.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox[data-selected=true] [data-slot=checkbox-default-indicator--checkmark]{transition:stroke-dashoffset .15s linear 15ms}.checkbox[data-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[data-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark]{color:var(--danger-foreground)}.checkbox[data-indeterminate=true] [data-slot=checkbox-default-indicator--indeterminate]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.checkbox[data-indeterminate=true][data-invalid=true] [data-slot=checkbox-default-indicator--indeterminate],.checkbox[data-indeterminate=true][aria-invalid=true] [data-slot=checkbox-default-indicator--indeterminate]{color:var(--danger-foreground)}.checkbox__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .75);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative;overflow:hidden}.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox__control{cursor:var(--cursor-interactive)}.checkbox__control:before{pointer-events:none;z-index:0;transform-origin:50%;--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);border-radius:calc(var(--radius) * .75);background-color:var(--accent);opacity:0;--tw-content:"";content:var(--tw-content);transition:scale .1s var(--ease-linear),opacity .2s var(--ease-linear),background-color .2s var(--ease-out);position:absolute;top:0;right:0;bottom:0;left:0}@media(prefers-reduced-motion:reduce){.checkbox__control:before:not(:is()){transition-property:none}}.checkbox:focus-visible .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-focus-visible=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-focus-visible=true] .checkbox__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control{border-color:var(--field-border-hover)}:is(.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control):before{background-color:var(--accent-hover)}.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control{color:var(--accent-foreground);border-color:#0000}:is(.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.checkbox[data-indeterminate=true] .checkbox__control{background-color:var(--accent);color:var(--accent-foreground)}.checkbox:active[data-indeterminate=true] .checkbox__control,.checkbox[data-pressed=true][data-indeterminate=true] .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-pressed=true])[data-indeterminate=true] .checkbox__control{background-color:var(--accent-hover)}.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-visible,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focused=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-visible=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-within,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground);border-color:#0000}:is(.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);background-color:var(--danger);opacity:1}.checkbox[data-indeterminate=true][aria-invalid=true] .checkbox__control,.checkbox[data-indeterminate=true][data-invalid=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground)}.checkbox__indicator{z-index:10;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);justify-content:center;align-items:center;display:flex;position:relative}.checkbox__indicator svg{width:100%;height:100%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.checkbox--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.checkbox--secondary .checkbox__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--checkbox-control-bg);--checkbox-control-bg:var(--default)}.checkbox:hover :is(.checkbox--secondary .checkbox__control),.checkbox:has([data-slot=checkbox-content][data-hovered=true]) :is(.checkbox--secondary .checkbox__control),.checkbox [data-slot=checkbox-content][data-hovered=true] :is(.checkbox--secondary .checkbox__control){border-color:var(--field-border-hover)}.checkbox__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.checkbox--secondary:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{background-color:var(--checkbox-control-bg)}:is(.checkbox--secondary[aria-checked=true] .checkbox__control,.checkbox--secondary[data-selected=true] .checkbox__control):before,.checkbox--secondary[data-indeterminate=true] .checkbox__control,.checkbox--secondary[data-indeterminate=true] .checkbox__control:before{background-color:var(--accent)}.fieldset{gap:calc(var(--spacing) * 6);flex-direction:column;flex:1 1 0;display:flex}.fieldset__legend{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.fieldset__field_group{width:100%}:where(.fieldset__field_group>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.fieldset__actions{align-items:center;gap:calc(var(--spacing) * 2);padding-top:var(--spacing);display:flex}.input-otp{align-items:center;gap:calc(var(--spacing) * 2);display:flex;position:relative}.input-otp[data-disabled=true]{cursor:not-allowed;opacity:.5}.input-otp__group{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.input-otp__slot{height:calc(var(--spacing) * 10);width:calc(var(--spacing) * 9.5);border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:var(--field-radius,calc(var(--radius) * 1.5));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;flex:1;justify-content:center;align-items:center;display:flex;position:relative}.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-otp__slot:hover,.input-otp__slot[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-otp__slot[data-active=true]{z-index:10;background-color:var(--field-focus);--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.input-otp__slot[data-filled=true]{background-color:var(--field-focus)}.input-otp__slot[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input-otp__slot[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-otp__slot[data-invalid=true]:focus,.input-otp__slot[data-invalid=true]:focus-visible,.input-otp__slot[data-invalid=true][data-focused=true],.input-otp__slot[data-invalid=true][data-focus-visible=true],.input-otp__slot[data-invalid=true]:focus-within,.input-otp__slot[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-otp__slot[data-invalid=true]{background-color:var(--field-focus)}.input-otp__slot-value{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-tracking:-.27px;letter-spacing:-.27px;animation:slot-value-in .25s var(--ease-smooth) both;transform-origin:bottom}.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.input-otp__caret{height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .5);background-color:var(--field-placeholder,var(--muted));width:2px;animation:1.2s ease-out infinite caret-blink;position:absolute}.input-otp__separator{border-radius:calc(var(--radius) * .5);background-color:var(--separator);flex-shrink:0;width:6px;height:2px}.input-otp--secondary .input-otp__slot{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-otp-slot-bg);--input-otp-slot-bg:var(--default);--input-otp-slot-bg-hover:var(--default-hover);--input-otp-slot-bg-focus:var(--default)}@media(hover:hover){.input-otp--secondary .input-otp__slot:hover,.input-otp--secondary .input-otp__slot[data-hovered=true]{background-color:var(--input-otp-slot-bg-hover)}}.input-otp--secondary .input-otp__slot[data-active=true],.input-otp--secondary .input-otp__slot[data-filled=true]{background-color:var(--input-otp-slot-bg-focus)}@keyframes slot-value-in{0%{opacity:0;transform:translateY(8px)scale(.8)}to{opacity:1;transform:translateY(0)scale(1)}}.input{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input{border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input:hover:not(:focus):not(:focus-visible),.input[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input:focus,.input[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input[data-invalid=true]:focus,.input[data-invalid=true]:focus-visible,.input[data-invalid=true][data-focused=true],.input[data-invalid=true][data-focus-visible=true],.input[data-invalid=true]:focus-within,.input[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input[data-invalid=true]{background-color:var(--field-focus)}.input:disabled,.input[data-disabled=true],.input[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-bg);--input-bg:var(--default);--input-bg-hover:var(--default-hover);--input-bg-focus:var(--default)}@media(hover:hover){.input--secondary:hover:not(:focus):not(:focus-visible),.input--secondary[data-hovered=true]:not([data-focus-visible=true]):not([data-focused=true]){background-color:var(--input-bg-hover)}}.input--secondary:focus,.input--secondary[data-focused=true]{background-color:var(--input-bg-focus)}.input--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input--secondary[data-invalid=true]:focus,.input--secondary[data-invalid=true]:focus-visible,.input--secondary[data-invalid=true][data-focused=true],.input--secondary[data-invalid=true][data-focus-visible=true],.input--secondary[data-invalid=true]:focus-within,.input--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input--secondary[data-invalid=true]{background-color:var(--input-bg-focus)}.input--full-width{width:100%}.input-group{min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);outline-style:none;align-items:center;display:inline-flex}.input-group:has([data-slot=input-group-textarea]){align-items:flex-start;height:auto}.input-group{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-group:hover:not(:focus-within),.input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-group:has([data-slot=input-group-input]:focus),.input-group:has([data-slot=input-group-textarea]:focus){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group[data-invalid=true]:focus,.input-group[data-invalid=true]:focus-visible,.input-group[data-invalid=true][data-focused=true],.input-group[data-invalid=true][data-focus-visible=true],.input-group[data-invalid=true]:focus-within,.input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.input-group[data-disabled=true],.input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.input-group:has([data-slot=input-group-input]:-webkit-autofill),.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.input-group__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}.input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input-group:has([data-slot=input-group-prefix]) .input-group__input{border-top-left-radius:0;border-bottom-left-radius:0;padding-left:0}.input-group:has([data-slot=input-group-suffix]) .input-group__input{border-top-right-radius:0;border-bottom-right-radius:0;padding-right:0}.input-group__input:focus,.input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.input-group__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input[data-slot=input-group-textarea]{resize:vertical;min-height:38px}.input-group__prefix{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-right-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-left:none;border-top-right-radius:0;border-bottom-right-radius:0;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__prefix{align-items:flex-start;padding-top:.5rem}.input-group__prefix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group__suffix{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-left-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-right:none;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__suffix{align-items:flex-start;padding-top:.5rem}.input-group__suffix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-group-bg);--input-group-bg:var(--default);--input-group-bg-hover:var(--default-hover);--input-group-bg-focus:var(--default)}@media(hover:hover){.input-group--secondary:hover:not(:focus-within),.input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--input-group-bg-hover)}}.input-group--secondary:has([data-slot=input-group-input]:focus),.input-group--secondary:has([data-slot=input-group-textarea]:focus){background-color:var(--input-group-bg-focus)}.input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group--secondary[data-invalid=true]:focus,.input-group--secondary[data-invalid=true]:focus-visible,.input-group--secondary[data-invalid=true][data-focused=true],.input-group--secondary[data-invalid=true][data-focus-visible=true],.input-group--secondary[data-invalid=true]:focus-within,.input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--input-group-bg-focus)}.input-group--secondary [data-slot=input-group-input],.input-group--secondary [data-slot=input-group-textarea]{background-color:#0000}.input-group--full-width{width:100%}.number-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.number-field[data-invalid=true],.number-field[aria-invalid=true]) [data-slot=description]{display:none}.number-field [data-slot=label]{width:fit-content}.number-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;grid-template-columns:40px 1fr 40px;align-items:center;display:grid;overflow:hidden}.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.number-field__group:hover:not(:focus-within),.number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.number-field__group[data-focus-within=true],.number-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field__group[data-invalid=true]:focus,.number-field__group[data-invalid=true]:focus-visible,.number-field__group[data-invalid=true][data-focused=true],.number-field__group[data-invalid=true][data-focus-visible=true],.number-field__group[data-invalid=true]:focus-within,.number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.number-field__group[data-disabled=true],.number-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.number-field__group:has([data-slot=number-field-input]:-webkit-autofill),.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.number-field__input{border-style:var(--tw-border-style);min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none}@media(min-width:40rem){.number-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.number-field__group:has([slot=decrement]) .number-field__input{border-top-left-radius:0;border-bottom-left-radius:0}.number-field__group:has([slot=increment]) .number-field__input{border-top-right-radius:0;border-bottom-right-radius:0}.number-field__input:focus,.number-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.number-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__increment-button,.number-field__decrement-button{height:100%;width:calc(var(--spacing) * 10);color:var(--field-foreground,var(--foreground));--tw-outline-style:none;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth);background-color:#0000;border-style:solid;border-radius:0;outline-style:none;justify-content:center;align-items:center;display:flex}:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.number-field__increment-button,.number-field__decrement-button{cursor:var(--cursor-interactive)}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:var(--field-foreground,var(--foreground))}@supports (color:color-mix(in lab,red,red)){:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:color-mix(in oklab,var(--field-foreground,var(--foreground)) 10%,transparent)}}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{transform:scale(.97)}:is(.number-field__increment-button,.number-field__decrement-button):disabled,:is(.number-field__increment-button,.number-field__decrement-button)[data-disabled=true],:is(.number-field__increment-button,.number-field__decrement-button)[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-increment-button-icon],:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-decrement-button-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.number-field__increment-button{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--field-placeholder,var(--muted))}@supports (color:color-mix(in lab,red,red)){.number-field__increment-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field__decrement-button{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--field-placeholder,var(--muted));border-top-right-radius:0;border-bottom-right-radius:0}@supports (color:color-mix(in lab,red,red)){.number-field__decrement-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field--secondary .number-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--number-field-group-bg);--number-field-group-bg:var(--default);--number-field-group-bg-hover:var(--default-hover);--number-field-group-bg-focus:var(--default)}@media(hover:hover){.number-field--secondary .number-field__group:hover:not(:focus-within),.number-field--secondary .number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--number-field-group-bg-hover)}}.number-field--secondary .number-field__group:focus-within,.number-field--secondary .number-field__group[data-focus-within=true]{background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field--secondary .number-field__group[data-invalid=true]:focus,.number-field--secondary .number-field__group[data-invalid=true]:focus-visible,.number-field--secondary .number-field__group[data-invalid=true][data-focused=true],.number-field--secondary .number-field__group[data-invalid=true][data-focus-visible=true],.number-field--secondary .number-field__group[data-invalid=true]:focus-within,.number-field--secondary .number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field--secondary .number-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group [data-slot=number-field-input]{background-color:#0000}.number-field--full-width,.number-field__group--full-width{width:100%}.radio-group{flex-direction:column;display:flex}.radio-group[data-orientation=vertical] [data-slot=radio]{margin-top:calc(var(--spacing) * 4)}.radio-group[data-orientation=horizontal]{gap:calc(var(--spacing) * 4);flex-flow:wrap}.radio-group--secondary .radio__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--radio-control-bg);--radio-control-bg:var(--default);--radio-control-bg-hover:var(--default-hover)}.radio:has([data-slot=radio-content][data-hovered=true]) :is(.radio-group--secondary .radio__control),.radio [data-slot=radio-content][data-hovered=true] :is(.radio-group--secondary .radio__control){border-color:var(--field-border-hover)}.radio:not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg-hover)}.radio{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.radio [data-slot=label]{-webkit-user-select:none;user-select:none}.radio .radio__content [data-slot=label]{cursor:var(--cursor-interactive)}.radio>[data-slot=description],.radio>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=description],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.radio__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.radio__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.radio__control{cursor:var(--cursor-interactive)}.radio:has([data-slot=radio-content][data-focus-visible=true]) .radio__control,.radio [data-slot=radio-content][data-focus-visible=true] .radio__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.radio:has([data-slot=radio-content][data-hovered=true]) .radio__control,.radio [data-slot=radio-content][data-hovered=true] .radio__control{border-color:var(--field-border-hover)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) .radio__control .radio__indicator:empty:before{background-color:var(--field-hover)}.radio:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio [data-slot=radio-content][data-pressed=true] .radio__control{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.radio[data-selected] .radio__control,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__control,.radio:has(input:checked) .radio__control{background-color:var(--accent);border-color:#0000}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__control,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__control{background-color:var(--accent-hover)}.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-visible,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focused=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-within,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-visible,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focused=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-within,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio__indicator{pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.radio__indicator:empty:before{content:"";border-radius:calc(var(--radius) * 1);background-color:var(--field-background,var(--default));width:100%;height:100%;transition:scale .2s var(--ease-out),background-color .2s var(--ease-out);scale:1}@media(prefers-reduced-motion:reduce){.radio__indicator:empty:before:not(:is()){transition-property:none}}.radio[data-selected] .radio__indicator:empty:before,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked) .radio__indicator:empty:before{background-color:var(--accent-foreground);scale:.4286}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before{scale:.5714}.radio--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textfield{gap:var(--spacing);flex-direction:column;display:flex}:is(.textfield[data-invalid=true],.textfield[aria-invalid=true]) [data-slot=description]{display:none}.textfield--full-width,.textfield--full-width [data-slot=input],.textfield--full-width [data-slot=textarea]{width:100%}.search-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.search-field[data-invalid=true],.search-field[aria-invalid=true]) [data-slot=description]{display:none}.search-field [data-slot=label]{width:fit-content}.search-field[data-empty=true] [data-slot=search-field-clear-button]{pointer-events:none;opacity:0}.search-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;position:relative;overflow:hidden}.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.search-field__group:hover:not(:focus-within),.search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.search-field__group[data-focus-within=true],.search-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field__group[data-invalid=true]:focus,.search-field__group[data-invalid=true]:focus-visible,.search-field__group[data-invalid=true][data-focused=true],.search-field__group[data-invalid=true][data-focus-visible=true],.search-field__group[data-invalid=true]:focus-within,.search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.search-field__group[data-disabled=true],.search-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.search-field__group:has([data-slot=search-field-input]:-webkit-autofill),.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.search-field__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}@media(min-width:40rem){.search-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.search-field__input::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__input::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__group:has([data-slot=search-field-search-icon]) .search-field__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.search-field__group:has([slot=clear]) .search-field__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.search-field__input:focus,.search-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.search-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__search-icon{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);flex-shrink:0}.search-field__clear-button{margin-right:calc(var(--spacing) * 2);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0}.search-field__clear-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.search-field--secondary .search-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--search-field-group-bg);--search-field-group-bg:var(--default);--search-field-group-bg-hover:var(--default-hover);--search-field-group-bg-focus:var(--default)}@media(hover:hover){.search-field--secondary .search-field__group:hover:not(:focus-within),.search-field--secondary .search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--search-field-group-bg-hover)}}.search-field--secondary .search-field__group:focus-within,.search-field--secondary .search-field__group[data-focus-within=true]{background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field--secondary .search-field__group[data-invalid=true]:focus,.search-field--secondary .search-field__group[data-invalid=true]:focus-visible,.search-field--secondary .search-field__group[data-invalid=true][data-focused=true],.search-field--secondary .search-field__group[data-invalid=true][data-focus-visible=true],.search-field--secondary .search-field__group[data-invalid=true]:focus-within,.search-field--secondary .search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field--secondary .search-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group [data-slot=search-field-input]{background-color:#0000}.search-field--full-width,.search-field__group--full-width{width:100%}.textarea{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.textarea::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.textarea{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.textarea{border-width:var(--border-width-field);border-color:var(--field-border);min-height:38px;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *),.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.textarea:hover:not(:focus):not(:focus-visible),.textarea[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.textarea:focus,.textarea[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.textarea[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea[data-invalid=true]:focus,.textarea[data-invalid=true]:focus-visible,.textarea[data-invalid=true][data-focused=true],.textarea[data-invalid=true][data-focus-visible=true],.textarea[data-invalid=true]:focus-within,.textarea[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea[data-invalid=true]{background-color:var(--field-focus)}.textarea:disabled,.textarea[data-disabled=true],.textarea[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textarea--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--textarea-bg);--textarea-bg:var(--default);--textarea-bg-hover:var(--default-hover);--textarea-bg-focus:var(--default)}@media(hover:hover){.textarea--secondary:hover:not(:focus):not(:focus-visible),.textarea--secondary[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--textarea-bg-hover)}}.textarea--secondary:focus,.textarea--secondary[data-focused=true]{background-color:var(--textarea-bg-focus)}.textarea--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea--secondary[data-invalid=true]:focus,.textarea--secondary[data-invalid=true]:focus-visible,.textarea--secondary[data-invalid=true][data-focused=true],.textarea--secondary[data-invalid=true][data-focus-visible=true],.textarea--secondary[data-invalid=true]:focus-within,.textarea--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea--secondary[data-invalid=true]{background-color:var(--textarea-bg-focus)}.textarea--full-width{width:100%}.calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.calendar--week-view .calendar__cell,.calendar--day-view .calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.calendar--day-view .calendar__grid{flex-direction:column;display:flex}.calendar--day-view .calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-header>tr{display:contents}.calendar--day-view .calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-body>tr{display:contents}.calendar--day-view .calendar__grid-body>tr:first-child>td{margin-top:0}.calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .calendar__nav-button{pointer-events:none;opacity:0}.calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 2);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.calendar__nav-button:hover,.calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.calendar__nav-button:active,.calendar__nav-button[data-pressed=true]{transform:scale(.95)}.calendar__nav-button:focus-visible,.calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__nav-button:disabled,.calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar__grid[aria-readonly=true] .calendar__cell{pointer-events:none}.calendar__grid-header,.calendar__grid-header>tr,.calendar__grid-body,.calendar__grid-body>tr{display:contents}.calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.calendar__grid-row{display:contents}.calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.calendar__cell{aspect-ratio:1;border-radius:calc(var(--radius) * 3);text-align:center;width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;will-change:scale;transition:transform .25s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__cell{cursor:var(--cursor-interactive)}.calendar__cell:focus-visible:not(:focus),.calendar__cell[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__cell[data-today=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.calendar__cell[data-today=true]:hover:not([data-selected=true]),.calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true]){background-color:var(--accent-soft-hover)}}.calendar__cell[data-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}.calendar__cell:active,.calendar__cell[data-pressed=true]{background-color:var(--default);transform:scale(.95)}:is(.calendar__cell:active,.calendar__cell[data-pressed=true])[data-selected=true]{background-color:var(--accent-hover)}@media(hover:hover){.calendar__cell:hover:not([data-selected=true]),.calendar__cell[data-hovered=true]:not([data-selected=true]){background-color:var(--default)}}.calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.calendar__cell[data-selected=true][data-outside-month=true]{background-color:var(--default)}.calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__cell:disabled:not([data-outside-month=true]),.calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.calendar__cell-indicator{background-color:var(--accent-foreground)}.range-calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.range-calendar--week-view .range-calendar__cell,.range-calendar--day-view .range-calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.range-calendar--day-view .range-calendar__grid{flex-direction:column;display:flex}.range-calendar--day-view .range-calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-header>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-body>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body>tr:first-child>td{margin-top:0}.range-calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.range-calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .range-calendar__nav-button{pointer-events:none;opacity:0}.range-calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.range-calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.range-calendar__nav-button:hover,.range-calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.range-calendar__nav-button:active,.range-calendar__nav-button[data-pressed=true]{transform:scale(.95)}.range-calendar__nav-button:focus-visible,.range-calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__nav-button:disabled,.range-calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.range-calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar__grid[aria-readonly=true] .range-calendar__cell{pointer-events:none}.range-calendar__grid-header,.range-calendar__grid-header>tr,.range-calendar__grid-body,.range-calendar__grid-body>tr{display:contents}.range-calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.range-calendar__grid-row{display:contents}.range-calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.range-calendar__cell{z-index:1;border-radius:calc(var(--radius) * 3);--tw-outline-style:none;cursor:var(--cursor-interactive);will-change:background-color,border-color;transition:box-shadow .1s var(--ease-out),border-color .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;margin-block:2px;margin-inline:0;padding:0;position:relative}.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell .range-calendar__cell-button{aspect-ratio:1;border-radius:calc(var(--radius) * 3);width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);-webkit-tap-highlight-color:transparent;will-change:scale;transition:scale .2s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]{z-index:2}:is(.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]) .range-calendar__cell-button{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__cell[data-today=true] .range-calendar__cell-button{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){:is(.range-calendar__cell[data-today=true]:hover:not([data-selected=true]),.range-calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--accent-soft-hover)}}.range-calendar__cell[data-selected=true]:not([data-outside-month=true]){background-color:var(--accent-soft);border-radius:0}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*){border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*)[data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*){border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*)[data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){z-index:2}:is(.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true])) .range-calendar__cell-button{background-color:var(--accent);color:var(--accent-foreground)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]){border-top-left-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){border-top-right-radius:calc(var(--radius) * 3);border-bottom-right-radius:calc(var(--radius) * 3)}:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true]) .range-calendar__cell-button{scale:.9}:is(:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-start=true],:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-end=true]) .range-calendar__cell-button{background-color:var(--accent-hover)}@media(hover:hover){:is(.range-calendar__cell:hover:not([data-selected=true]),.range-calendar__cell[data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--default)}}.range-calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:color-mix(in oklab,var(--default) 20%,transparent)}}.range-calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__cell:disabled:not([data-outside-month=true]),.range-calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true]{border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true]{border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.range-calendar__cell-indicator{background-color:var(--accent-foreground)}.calendar:has(.calendar-year-picker__year-grid),.range-calendar:has(.calendar-year-picker__year-grid){position:relative}.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]{will-change:opacity;transition:opacity .15s var(--ease-out),visibility 0s linear}:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]{pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s var(--ease-out),visibility 0s linear .15s}:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger{justify-content:flex-start;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1);--tw-outline-style:none;cursor:var(--cursor-interactive);touch-action:manipulation;outline-style:none;flex:1;display:flex}.calendar-year-picker__trigger:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar-year-picker__trigger-heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition:color .15s var(--ease-out)}.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger-indicator{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--accent-soft-foreground);transition:transform .15s var(--ease-out)}.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-indicator{transform:rotate(90deg)}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-heading{color:var(--accent-soft-foreground)}.calendar-year-picker__year-grid{pointer-events:none;scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);align-content:flex-start;gap:var(--spacing);padding:var(--spacing);opacity:0;will-change:opacity;grid-template-columns:repeat(3,1fr);display:grid;position:absolute;left:0;right:0;overflow-y:auto}.calendar-year-picker__year-grid[data-open=true]{pointer-events:auto;opacity:1;transition:opacity .2s var(--ease-out) 50ms}.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);padding-inline:calc(var(--spacing) * 2.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{cursor:var(--cursor-interactive)}@media(hover:hover)and (pointer:fine){.calendar-year-picker__year-cell:is(:hover,[data-hovered=true]):not([data-selected=true]){background-color:var(--default);color:var(--default-foreground)}}.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}@media(hover:hover)and (pointer:fine){:is(.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-hover)}}.calendar-year-picker__year-cell:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.date-field[data-invalid=true],.date-field[aria-invalid=true]) [data-slot=description]{display:none}.date-field [data-slot=label]{width:fit-content}.date-field--full-width{width:100%}.time-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.time-field[data-invalid=true],.time-field[aria-invalid=true]) [data-slot=description]{display:none}.time-field [data-slot=label]{width:fit-content}.time-field--full-width{width:100%}.date-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.date-input-group:hover:not(:focus-within),.date-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.date-input-group[data-focus-within=true]:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])),.date-input-group:focus-within:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.date-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group[data-invalid=true]:focus,.date-input-group[data-invalid=true]:focus-visible,.date-input-group[data-invalid=true][data-focused=true],.date-input-group[data-invalid=true][data-focus-visible=true],.date-input-group[data-invalid=true]:focus-within,.date-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.date-input-group[data-disabled=true],.date-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-input-group__input{cursor:text;border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;gap:1px;display:flex}@media(min-width:40rem){.date-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.date-input-group:has([data-slot=date-input-group-prefix]) .date-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.date-input-group:has([data-slot=date-input-group-suffix]) .date-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=start]{flex:none;padding-right:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=end]{padding-left:0}.date-input-group__input:focus,.date-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.date-input-group__input-container{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;flex:1;align-items:center;width:fit-content;display:flex;overflow:auto clip}.date-input-group__segment{border-radius:calc(var(--radius) * .75);padding-inline:calc(var(--spacing) * .5);text-align:end;text-wrap:nowrap;--tw-outline-style:none;outline-style:none;display:inline-block}.date-input-group__segment[data-type=literal]{color:var(--muted);padding:0}.date-input-group__segment[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.date-input-group__segment:focus,.date-input-group__segment[data-focused=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.date-input-group__segment[data-disabled=true]{opacity:.5}.date-input-group__segment[data-invalid=true]{color:var(--danger)}.date-input-group__segment[data-invalid=true]:focus,.date-input-group__segment[data-invalid=true][data-focused=true]{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.date-input-group__prefix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group__suffix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--date-input-group-bg);--date-input-group-bg:var(--default);--date-input-group-bg-hover:var(--default-hover);--date-input-group-bg-focus:var(--default)}@media(hover:hover){.date-input-group--secondary:hover:not(:focus-within),.date-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--date-input-group-bg-hover)}}.date-input-group--secondary:focus-within,.date-input-group--secondary[data-focus-within=true]{background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group--secondary[data-invalid=true]:focus,.date-input-group--secondary[data-invalid=true]:focus-visible,.date-input-group--secondary[data-invalid=true][data-focused=true],.date-input-group--secondary[data-invalid=true][data-focus-visible=true],.date-input-group--secondary[data-invalid=true]:focus-within,.date-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary [data-slot=date-input-group-input]{background-color:#0000}.date-input-group--full-width{width:100%}.date-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-picker .date-input-group__suffix,.date-picker .date-input-group__prefix{pointer-events:auto}.date-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__trigger:focus-visible:not(:focus),.date-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-picker__trigger:disabled,.date-picker__trigger[data-disabled=true],.date-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-picker__popover:focus-visible:not(:focus),.date-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-picker__popover[data-exiting=true],.date-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.date-range-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-range-picker .date-input-group__suffix,.date-range-picker .date-input-group__prefix{pointer-events:auto}.date-range-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__trigger:focus-visible:not(:focus),.date-range-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-range-picker__trigger:disabled,.date-range-picker__trigger[data-disabled=true],.date-range-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-range-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-range-picker__range-separator{padding-inline:var(--spacing);color:var(--field-placeholder,var(--muted));-webkit-user-select:none;user-select:none}.date-range-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-range-picker__popover:focus-visible:not(:focus),.date-range-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-range-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-range-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-range-picker__popover[data-exiting=true],.date-range-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.card{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 4);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:column;display:flex;position:relative;overflow:visible}.card__header{flex-direction:column;display:flex}.card__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.card__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);color:var(--muted)}.card__content{gap:var(--spacing);flex-direction:column;flex:1;display:flex}.card__footer{flex-direction:row;align-items:center;display:flex}.card--transparent{--tw-border-style:none;--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000;border-style:none}.card--default{background-color:var(--surface)}.card--secondary{background-color:var(--surface-secondary)}.card--tertiary{background-color:var(--surface-tertiary)}.header{width:100%;padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 1.5);padding-bottom:var(--spacing);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted)}.separator{border-radius:calc(var(--radius) * .5);border-top-style:var(--tw-border-style);border-top-width:0;border-bottom-style:var(--tw-border-style);background-color:var(--separator);border-bottom-width:0;flex-shrink:0;width:100%;height:1px}.separator--horizontal{width:100%;height:1px}.separator--vertical{height:auto;min-height:calc(var(--spacing) * 2);align-self:stretch;width:1px}.separator--default{background-color:var(--separator)}.separator--secondary{background-color:var(--separator-secondary)}.separator--tertiary{background-color:var(--separator-tertiary)}.separator__container{align-items:center;gap:calc(var(--spacing) * 3);display:flex}.separator__container--horizontal{flex-direction:row;width:100%}.separator__container--vertical{flex-direction:column;justify-content:center;height:100%}.separator__line{flex-grow:1;flex-shrink:0}.separator__content{text-align:center;white-space:nowrap;color:var(--muted);justify-content:center;align-items:center;display:inline-flex}.separator__content--horizontal,.separator__content--vertical{text-align:center}.surface{color:var(--foreground);position:relative}.surface--transparent{background-color:#0000}.surface--default{background-color:var(--surface);color:var(--surface-foreground)}.surface--secondary{background-color:var(--surface-secondary);color:var(--surface-secondary-foreground)}.surface--tertiary{background-color:var(--surface-tertiary);color:var(--surface-tertiary-foreground)}.avatar{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);background-color:var(--default);flex-shrink:0;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}.avatar__fallback{background-color:var(--default);width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);justify-content:center;align-items:center;display:flex}.avatar__image{aspect-ratio:1;width:100%;height:100%;transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s;position:absolute;top:0;right:0;bottom:0;left:0}.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *),.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.avatar--sm{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2)}.avatar--lg{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12);border-radius:calc(var(--radius) * 3)}.avatar--lg .avatar__fallback{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.avatar__fallback--accent{color:var(--accent-soft-foreground)}.avatar__fallback--default{color:var(--default-soft-foreground)}.avatar__fallback--success{color:var(--success-soft-foreground)}.avatar__fallback--warning{color:var(--warning-soft-foreground)}.avatar__fallback--danger{color:var(--danger-soft-foreground)}.avatar--soft{background-color:#0000}.avatar--soft .avatar__fallback--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.avatar--soft .avatar__fallback--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.avatar--soft .avatar__fallback--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.avatar--soft .avatar__fallback--default{background-color:var(--default-soft);color:var(--default-soft-foreground)}.avatar--soft .avatar__fallback--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.alert-dialog__trigger:focus-visible:not(:focus),.alert-dialog__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.alert-dialog__trigger:disabled,.alert-dialog__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.alert-dialog__trigger:active,.alert-dialog__trigger[data-pressed=true]{transform:scale(.97)}.alert-dialog__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.alert-dialog__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.alert-dialog__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]{will-change:opacity}:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__backdrop--transparent{background-color:#0000}.alert-dialog__backdrop--opaque{background-color:var(--backdrop)}.alert-dialog__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.alert-dialog__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.alert-dialog__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.alert-dialog__container{pointer-events:none}.alert-dialog__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.alert-dialog__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.alert-dialog__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.alert-dialog__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.alert-dialog__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]{will-change:opacity,transform}:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;min-height:0;max-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative;overflow:clip}.alert-dialog__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.alert-dialog__dialog[data-placement=auto]{margin-block:auto}}.alert-dialog__dialog[data-placement=center]{margin-block:auto}.alert-dialog__dialog[data-placement=bottom]{margin-top:auto}.alert-dialog__dialog[data-placement=top]{margin-top:0}.alert-dialog__dialog--xs{max-width:var(--container-xs)}.alert-dialog__dialog--sm{max-width:var(--container-sm)}.alert-dialog__dialog--md{max-width:var(--container-md)}.alert-dialog__dialog--lg{max-width:var(--container-lg)}.alert-dialog__dialog--cover{width:100%;height:100%;min-height:100%}.alert-dialog__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.alert-dialog__header>.modal__icon{margin-bottom:0}.alert-dialog__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.alert-dialog__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.alert-dialog__icon [data-slot=alert-dialog-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.alert-dialog__icon--default{background-color:var(--default);color:var(--foreground)}.alert-dialog__icon--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.alert-dialog__icon--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.alert-dialog__icon--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.alert-dialog__icon--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.alert-dialog__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.alert-dialog__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.alert-dialog__header+.alert-dialog__body{margin-top:calc(var(--spacing) * 2)}.alert-dialog__header+.alert-dialog__footer,.alert-dialog__body+.alert-dialog__footer{margin-top:calc(var(--spacing) * 5)}.drawer__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.drawer__trigger:focus-visible:not(:focus),.drawer__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.drawer__trigger:disabled,.drawer__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.drawer__trigger:active,.drawer__trigger[data-pressed=true]{transform:scale(.97)}.drawer__backdrop{z-index:50;height:var(--visual-viewport-height);opacity:1;width:100%;transition:opacity .25s cubic-bezier(.32,.72,0,1);position:fixed;top:0;right:0;bottom:0;left:0}.drawer__backdrop[data-entering=true]{opacity:0}.drawer__backdrop[data-exiting=true]{opacity:0;transition-duration:.2s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.drawer__backdrop[data-exiting=true],.drawer__backdrop[data-entering=true]{will-change:opacity}@media(prefers-reduced-motion:reduce){.drawer__backdrop{transition:none}}.drawer__backdrop--transparent{background-color:#0000}.drawer__backdrop--opaque{background-color:var(--backdrop)}.drawer__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.drawer__content{pointer-events:none;z-index:50;height:var(--visual-viewport-height);width:100%;min-width:0;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.drawer__content--bottom{align-items:flex-end}.drawer__content--top{align-items:flex-start}.drawer__content--left{justify-content:flex-start}.drawer__content--right{justify-content:flex-end}.drawer__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;padding:calc(var(--spacing) * 6);pointer-events:auto;--drawer-enter-duration:.25s;--drawer-exit-duration:.2s;--drawer-enter-ease:cubic-bezier(.32, .72, 0, 1);--drawer-exit-ease:cubic-bezier(.32, .72, 0, 1);will-change:translate;transition:translate var(--drawer-enter-duration) var(--drawer-enter-ease);outline-style:none;flex-direction:column;display:flex;position:relative}@media(prefers-reduced-motion:reduce){.drawer__dialog{transition:none}}.drawer__dialog[data-placement=bottom]{border-top-left-radius:min(32px,var(--radius-2xl));border-top-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=top]{border-bottom-left-radius:min(32px,var(--radius-2xl));border-bottom-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=left]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=left]{width:calc(var(--spacing) * 96)}}.drawer__dialog[data-placement=right]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=right]{width:calc(var(--spacing) * 96)}}[data-exiting=true] .drawer__dialog{transition-duration:var(--drawer-exit-duration);transition-timing-function:var(--drawer-exit-ease)}.drawer__content--left .drawer__dialog,.drawer__content--right .drawer__dialog,.drawer__content--top .drawer__dialog,.drawer__content--bottom .drawer__dialog{translate:0}.drawer__content--left[data-entering=true] .drawer__dialog,.drawer__content--left[data-exiting=true] .drawer__dialog{translate:-100%}.drawer__content--right[data-entering=true] .drawer__dialog,.drawer__content--right[data-exiting=true] .drawer__dialog{translate:100%}.drawer__content--top[data-entering=true] .drawer__dialog,.drawer__content--top[data-exiting=true] .drawer__dialog{translate:0 -100%}.drawer__content--bottom[data-entering=true] .drawer__dialog,.drawer__content--bottom[data-exiting=true] .drawer__dialog{translate:0 100%}.drawer__dialog--top{padding-bottom:calc(var(--spacing) * 2)}.drawer__dialog--top .drawer__handle{padding-bottom:0}.drawer__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.drawer__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.drawer__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.drawer__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.drawer__handle{padding-bottom:calc(var(--spacing) * 2);justify-content:center;align-items:center;display:flex}.drawer__handle>[data-slot=drawer-handle-bar]{height:var(--spacing);width:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * .25);background-color:var(--separator)}.drawer__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.drawer__header+.drawer__body{margin-top:calc(var(--spacing) * 2)}.drawer__header+.drawer__footer,.drawer__body+.drawer__footer{margin-top:calc(var(--spacing) * 5)}.drawer__handle+.drawer__header,.drawer__handle+.drawer__body{margin-top:0}.modal__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.modal__trigger:focus-visible:not(:focus),.modal__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.modal__trigger:disabled,.modal__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.modal__trigger:active,.modal__trigger[data-pressed=true]{transform:scale(.97)}.modal__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.modal__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.modal__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]{will-change:opacity}:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__backdrop--transparent{background-color:#0000}.modal__backdrop--opaque{background-color:var(--backdrop)}.modal__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.modal__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.modal__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.modal__container{pointer-events:none}.modal__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.modal__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.modal__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.modal__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.modal__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-exiting=true],.modal__container[data-entering=true]{will-change:opacity,transform}:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__container--scroll-outside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);pointer-events:auto;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__container--full{padding:0}@media(min-width:40rem){.modal__container--full{padding:0}}.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% ;--tw-enter-scale:1}@media(min-width:40rem){.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% }}.modal__container--full[data-exiting=true]{--tw-exit-scale:1}.modal__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative}.modal__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.modal__dialog[data-placement=auto]{margin-block:auto}}.modal__dialog[data-placement=center]{margin-block:auto}.modal__dialog[data-placement=bottom]{margin-top:auto}.modal__dialog[data-placement=top]{margin-top:0}.modal__dialog--scroll-inside{min-height:0;max-height:100%;overflow:clip}.modal__dialog--scroll-outside{flex-shrink:0;height:auto;min-height:0}.modal__dialog--xs{max-width:var(--container-xs)}.modal__dialog--sm{max-width:var(--container-sm)}.modal__dialog--md{max-width:var(--container-md)}.modal__dialog--lg{max-width:var(--container-lg)}.modal__dialog--cover{width:100%;height:100%;min-height:100%}.modal__dialog--full{--tw-shadow:0 0 #0000;width:100%;height:100%;min-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:0}.modal__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.modal__header>.modal__icon{margin-bottom:0}.modal__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.modal__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.modal__body{min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow:visible}.modal__body--scroll-inside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__body--scroll-outside{overflow-y:visible}.modal__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.modal__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.modal__header+.modal__body{margin-top:calc(var(--spacing) * 2)}.modal__header+.modal__footer,.modal__body+.modal__footer{margin-top:calc(var(--spacing) * 5)}.popover{transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0}.popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.popover[data-exiting=true],.popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.popover__dialog{padding:calc(var(--spacing) * 4);--tw-outline-style:none;outline-style:none}.popover__heading{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.popover__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.popover__trigger{cursor:var(--cursor-interactive)}.popover__trigger:focus-visible:not(:focus),.popover__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.popover__trigger:disabled,.popover__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tooltip{max-width:var(--container-xs);transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);padding:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));word-break:break-all;border-radius:min(32px,var(--radius-xl));box-shadow:var(--shadow-overlay)}.tooltip[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.tooltip[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.tooltip[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.tooltip[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.tooltip[data-exiting=true],.tooltip[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.tooltip [data-slot=overlay-arrow]{stroke:var(--border)}@supports (color:color-mix(in lab,red,red)){.tooltip [data-slot=overlay-arrow]{stroke:color-mix(in oklab,var(--border) 40%,transparent)}}.tooltip [data-slot=overlay-arrow]{fill:var(--overlay)}.tooltip[data-placement=bottom] [data-slot=overlay-arrow]{rotate:180deg}.tooltip[data-placement=left] [data-slot=overlay-arrow]{rotate:-90deg}.tooltip[data-placement=right] [data-slot=overlay-arrow]{rotate:90deg}.tooltip__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tooltip__trigger:focus-visible:not(:focus),.tooltip__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.combo-box{gap:var(--spacing);flex-direction:column;display:flex}:is(.combo-box[data-invalid=true],.combo-box[aria-invalid=true]) [data-slot=description]{display:none}.combo-box [data-slot=label]{width:fit-content}.combo-box [data-slot=input]{flex:1;min-width:0}.combo-box [data-slot=input]:has(+.combo-box__trigger){padding-inline-end:calc(var(--spacing) * 7)}.combo-box [data-slot=input]:focus,.combo-box [data-slot=input][data-focus]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.combo-box [data-slot=input]:disabled,.combo-box [data-slot=input][data-disabled],.combo-box [data-slot=input][aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.combo-box__input-group{isolation:isolate;align-items:center;display:inline-flex;position:relative}.combo-box__trigger{--tw-translate-y: -50% ;height:100%;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:pointer;color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;-webkit-tap-highlight-color:transparent;--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-color:#0000;border-style:none;outline-style:none;flex-shrink:0;justify-content:center;align-items:center;padding-inline-end:calc(var(--spacing) * 2);transition-duration:.15s;display:flex;position:absolute;top:50%}@media(hover:hover){.combo-box__trigger:hover,.combo-box__trigger[data-hovered=true]{color:var(--field-foreground,var(--foreground))}}.combo-box__trigger:focus-visible:not(:focus),.combo-box__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-radius:.25rem;outline-style:none}.combo-box__trigger[data-pressed=true]{opacity:.7}.combo-box__trigger:disabled,.combo-box__trigger[data-disabled],.combo-box__trigger[aria-disabled=true]{cursor:not-allowed;opacity:.5}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;transition-duration:.15s}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.combo-box__trigger[data-open=true] [data-slot=combo-box-trigger-default-icon]{rotate:180deg}.combo-box__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.combo-box__popover:focus-visible:not(:focus),.combo-box__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.combo-box__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.combo-box__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.combo-box__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.combo-box__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.combo-box__popover[data-exiting=true],.combo-box__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.combo-box__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.combo-box__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.combo-box__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.combo-box__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.combo-box__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.combo-box__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.combo-box__popover [data-slot=list-box-item] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.combo-box--full-width,.combo-box__input-group--full-width{width:100%}.select{gap:var(--spacing);flex-direction:column;display:flex}:is(.select[data-invalid=true],.select[aria-invalid=true]) [data-slot=description]{display:none}.select [data-slot=label]{width:fit-content}.select__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.select__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.select__trigger:has(.select__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.select__trigger:hover,.select__trigger[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.select__trigger:focus-visible:not(:focus),.select__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-visible,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focused=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-visible=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-within,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{background-color:var(--field-focus)}.select__trigger:disabled,.select__trigger[data-disabled=true],.select__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.select--secondary .select__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--select-trigger-bg);--select-trigger-bg:var(--default);--select-trigger-bg-hover:var(--default-hover);--select-trigger-bg-focus:var(--default)}@media(hover:hover){.select--secondary .select__trigger:hover,.select--secondary .select__trigger[data-hovered=true]{background-color:var(--select-trigger-bg-hover)}}.select--secondary .select__trigger:focus-visible:not(:focus),.select--secondary .select__trigger[data-focus-visible=true],.select[data-invalid=true] :is(.select--secondary .select__trigger),.select[aria-invalid=true] :is(.select--secondary .select__trigger){background-color:var(--select-trigger-bg-focus)}.select__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.select__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.select__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.select__value [data-slot=list-box-item-indicator]{display:none}.select__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.select__indicator[data-open=true]{rotate:180deg}.select__indicator[data-slot=select-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.select__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.select__popover:focus-visible:not(:focus),.select__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.select__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.select__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.select__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.select__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.select__popover[data-exiting=true],.select__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.select__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.select__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.select__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.select__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.select__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.select__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.select--full-width,.select__trigger--full-width{width:100%}.autocomplete{gap:var(--spacing);flex-direction:column;display:flex}.autocomplete__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.autocomplete__trigger:has(.autocomplete__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.autocomplete__trigger:focus-visible:not(:focus),.autocomplete__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-visible,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focused=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-visible=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-within,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{background-color:var(--field-focus)}.autocomplete__trigger:disabled,.autocomplete__trigger[data-disabled=true],.autocomplete__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.autocomplete--secondary .autocomplete__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--autocomplete-trigger-bg);--autocomplete-trigger-bg:var(--default);--autocomplete-trigger-bg-hover:var(--default-hover);--autocomplete-trigger-bg-focus:var(--default)}@media(hover:hover){.autocomplete--secondary .autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete--secondary .autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--autocomplete-trigger-bg-hover)}}.autocomplete--secondary .autocomplete__trigger:focus-visible:not(:focus),.autocomplete--secondary .autocomplete__trigger[data-focus-visible=true],.autocomplete[data-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger),.autocomplete[aria-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger){background-color:var(--autocomplete-trigger-bg-focus)}.autocomplete__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.autocomplete__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.autocomplete__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.autocomplete__value [data-slot=list-box-item-indicator]{display:none}.autocomplete__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;cursor:var(--cursor-interactive);flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.autocomplete__indicator[data-open=true]{rotate:180deg}.autocomplete__indicator[data-slot=autocomplete-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.autocomplete__popover{width:var(--trigger-width);max-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);overscroll-behavior:contain;background-color:var(--overlay);padding:0;padding-top:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);overflow:hidden}.autocomplete__popover:focus-visible:not(:focus),.autocomplete__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.32, .72, 0, 1);--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.25s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.autocomplete__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.autocomplete__popover[data-exiting=true],.autocomplete__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.autocomplete__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.autocomplete__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.autocomplete__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.autocomplete__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.autocomplete__popover [data-slot=list-box]{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);max-height:320px;padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none;overflow-y:auto}.autocomplete__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.autocomplete__popover [data-slot=search-field]{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);--tw-outline-style:none;outline-style:none}.autocomplete__popover [data-slot=empty-state]{text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--overlay-foreground)}@supports (color:color-mix(in lab,red,red)){.autocomplete__popover [data-slot=empty-state]{color:color-mix(in oklab,var(--overlay-foreground) 60%,transparent)}}.autocomplete__popover-dialog,.autocomplete__popover-dialog:focus,.autocomplete__popover-dialog:focus-visible,.autocomplete__popover-dialog[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete--full-width,.autocomplete__trigger--full-width{width:100%}.autocomplete__clear-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);color:var(--muted);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);cursor:var(--cursor-interactive);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);background-color:#0000;flex-shrink:0;justify-content:center;align-self:center;align-items:center;margin-inline-end:0;display:inline-flex;position:relative}.autocomplete__clear-button:not([data-empty=true]){transition:opacity .15s var(--ease-smooth)}.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__clear-button[data-empty=true]{pointer-events:none;opacity:0}.autocomplete__clear-button [data-slot=autocomplete-clear-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(hover:hover){.autocomplete__clear-button:hover,.autocomplete__clear-button[data-hovered=true]{background-color:var(--default-hover)}}.autocomplete__clear-button:active,.autocomplete__clear-button[data-pressed=true]{transform:scale(.93)}.kbd{height:calc(var(--spacing) * 6);align-items:center;display:inline-flex}:where(.kbd>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * .5) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-x-reverse)))}.kbd{border-radius:calc(var(--radius) * 1);background-color:var(--default);padding-inline:calc(var(--spacing) * 2);text-align:center;font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;color:var(--muted)}:where(.kbd:where(:dir(rtl),[dir=rtl],[dir=rtl] *)>:not(:last-child)){--tw-space-x-reverse:1}.kbd{word-spacing:-.25rem}.kbd__abbr{justify-content:center;align-items:center;width:100%;height:100%;text-decoration:none;display:flex}.kbd__content{justify-content:center;align-items:center;display:flex}.kbd--light{background-color:#0000}.typography,.typography-prose{color:var(--foreground)}.typography-prose h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose p{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography-prose a{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--link);text-underline-offset:4px;text-decoration-line:underline}.typography-prose blockquote{margin-top:calc(var(--spacing) * 4);border-left-style:var(--tw-border-style);border-left-width:4px;border-color:var(--border);padding-left:calc(var(--spacing) * 4);color:var(--muted);font-style:italic}.typography-prose ul{margin-block:calc(var(--spacing) * 4);list-style-type:disc}:where(.typography-prose ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ul{padding-left:calc(var(--spacing) * 6)}.typography-prose ol{margin-block:calc(var(--spacing) * 4);list-style-type:decimal}:where(.typography-prose ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ol{padding-left:calc(var(--spacing) * 6)}.typography-prose li{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose hr{margin-block:calc(var(--spacing) * 8);border-color:var(--separator)}.typography-prose pre{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);background-color:var(--default);padding:calc(var(--spacing) * 4);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);overflow-x:auto}.typography-prose strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--foreground)}.typography-prose em{font-style:italic}.typography-prose img{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5)}.typography--h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--body{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography--body-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.typography--body-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.typography--code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography--align-start{text-align:left}.typography--align-start:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:right}.typography--align-center{text-align:center}.typography--align-end{text-align:right}.typography--align-end:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:left}.typography--align-justify{text-align:justify}.typography--color-default{color:var(--foreground)}.typography--color-muted{color:var(--muted)}.typography--truncate{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.typography--weight-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.typography--weight-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.typography--weight-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.typography--weight-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.scroll-shadow{--scroll-shadow-size:40px;--scroll-shadow-scrollbar-size:10px;position:relative}.scroll-shadow--vertical{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-y:auto}.scroll-shadow--horizontal{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-x:auto}.scroll-shadow--fade.scroll-shadow--vertical:where([data-top-scroll=true],[data-bottom-scroll=true],[data-top-bottom-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,100% 0;mask-repeat:no-repeat;mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%;-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,100% 0;-webkit-mask-repeat:no-repeat;-webkit-mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%}.scroll-shadow--fade.scroll-shadow--vertical[data-top-scroll=true]{--scroll-linear-gradient:0deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-bottom-scroll=true]{--scroll-linear-gradient:180deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-top-bottom-scroll=true]{--scroll-linear-gradient:#000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal:where([data-left-scroll=true],[data-right-scroll=true],[data-left-right-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,0 100%;mask-repeat:no-repeat;mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,0 100%;-webkit-mask-repeat:no-repeat;-webkit-mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size)}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-scroll=true]{--scroll-linear-gradient:270deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-right-scroll=true]{--scroll-linear-gradient:90deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-right-scroll=true]{--scroll-linear-gradient:to right, #000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--hide-scrollbar{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;--scroll-shadow-scrollbar-size:0px}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{inset-inline:0}.inset-y-0{inset-block:0}.top-0{top:0}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.-right-3{right:calc(var(--spacing) * -3)}.right-0{right:0}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-0{left:0}.left-1\/2{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing) * -1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:var(--spacing)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-12{height:calc(var(--spacing) * 12)}.h-64{height:calc(var(--spacing) * 64)}.h-\[90px\]{height:90px}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:0}.min-h-full{min-height:100%}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-20{width:calc(var(--spacing) * 20)}.w-28{width:calc(var(--spacing) * 28)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-\[17rem\]{width:17rem}.w-\[calc\(100\%-2rem\)\]{width:calc(100% - 2rem)}.w-\[n\%\]{width:n%}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-44{max-width:calc(var(--spacing) * 44)}.max-w-\[1800px\]{max-width:1800px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-\[140px\]{min-width:140px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing) * 5);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-crosshair{cursor:crosshair}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y:pan-y;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.scrollbar{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter)}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--otari-line\)\]>:not(:last-child)){border-color:var(--otari-line)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:calc(var(--radius) * 1)}.rounded-md{border-radius:calc(var(--radius) * .75)}.rounded-sm{border-radius:calc(var(--radius) * .5)}.rounded-xl{border-radius:calc(var(--radius) * 1.5)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-\[\#c2843a\]{border-color:#c2843a}.border-\[var\(--otari-brand\)\]{border-color:var(--otari-brand)}.border-\[var\(--otari-line\)\]{border-color:var(--otari-line)}.border-amber-200{border-color:var(--color-amber-200)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-red-500{border-left-color:var(--color-red-500)}.bg-\[var\(--otari-bg\)\]{background-color:var(--otari-bg)}.bg-\[var\(--otari-brand\)\],.bg-\[var\(--otari-brand\)\]\/40{background-color:var(--otari-brand)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--otari-brand\)\]\/40{background-color:color-mix(in oklab,var(--otari-brand) 40%,transparent)}}.bg-\[var\(--otari-brand-tint\)\]{background-color:var(--otari-brand-tint)}.bg-\[var\(--otari-line\)\]{background-color:var(--otari-line)}.bg-\[var\(--otari-surface\)\]{background-color:var(--otari-surface)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-500{background-color:var(--color-green-500)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1{padding-bottom:var(--spacing)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#b45309\]{color:#b45309}.text-\[var\(--otari-brand-dark\)\]{color:var(--otari-brand-dark)}.text-\[var\(--otari-ink\)\]{color:var(--otari-ink)}.text-\[var\(--otari-muted\)\]{color:var(--otari-muted)}.text-amber-400{color:var(--color-amber-400)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-emerald-700{color:var(--color-emerald-700)}.text-green-700{color:var(--color-green-700)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.accent-\[var\(--otari-brand\)\]{accent-color:var(--otari-brand)}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.running{animation-play-state:running}.zoom-out{--tw-exit-scale:0}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-data-\[focus-visible\]\:outline-2:is(:where(.group)[data-focus-visible] *){outline-style:var(--tw-outline-style);outline-width:2px}.group-data-\[focus-visible\]\:outline-\[var\(--otari-brand\)\]:is(:where(.group)[data-focus-visible] *){outline-color:var(--otari-brand)}@media(hover:hover){.hover\:border-\[var\(--otari-brand\)\]:hover{border-color:var(--otari-brand)}.hover\:bg-\[var\(--otari-bg\)\]:hover{background-color:var(--otari-bg)}.hover\:bg-\[var\(--otari-brand\)\]:hover,.hover\:bg-\[var\(--otari-brand\)\]\/60:hover{background-color:var(--otari-brand)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--otari-brand\)\]\/60:hover{background-color:color-mix(in oklab,var(--otari-brand) 60%,transparent)}}.hover\:bg-\[var\(--otari-line\)\]:hover{background-color:var(--otari-line)}.hover\:text-\[var\(--otari-brand\)\]:hover{color:var(--otari-brand)}.hover\:text-\[var\(--otari-brand-dark\)\]:hover{color:var(--otari-brand-dark)}.hover\:text-\[var\(--otari-ink\)\]:hover{color:var(--otari-ink)}.hover\:text-amber-950:hover{color:var(--color-amber-950)}.hover\:text-red-700:hover{color:var(--color-red-700)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:not-sr-only:focus{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.focus\:absolute:focus{position:absolute}.focus\:top-3:focus{top:calc(var(--spacing) * 3)}.focus\:left-3:focus{left:calc(var(--spacing) * 3)}.focus\:z-50:focus{z-index:50}.focus\:rounded-lg:focus{border-radius:calc(var(--radius) * 1)}.focus\:border:focus{border-style:var(--tw-border-style);border-width:1px}.focus\:border-\[var\(--otari-brand\)\]:focus{border-color:var(--otari-brand)}.focus\:bg-\[var\(--otari-surface\)\]:focus{background-color:var(--otari-surface)}.focus\:px-4:focus{padding-inline:calc(var(--spacing) * 4)}.focus\:py-2:focus{padding-block:calc(var(--spacing) * 2)}.focus\:text-sm:focus{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.focus\:font-medium:focus{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.focus\:text-\[var\(--otari-brand-dark\)\]:focus{color:var(--otari-brand-dark)}.focus\:shadow-md:focus{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:bg-\[var\(--otari-brand\)\]:focus-visible{background-color:var(--otari-brand)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[var\(--otari-brand\)\]:focus-visible{--tw-ring-color:var(--otari-brand)}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-start-1{grid-column-start:1}.sm\:col-start-2{grid-column-start:2}.sm\:col-start-3{grid-column-start:3}.sm\:inline{display:inline}.sm\:w-28{width:calc(var(--spacing) * 28)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[minmax\(0\,1fr\)_16rem_10rem\]{grid-template-columns:minmax(0,1fr) 16rem 10rem}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-self-end{justify-self:flex-end}.sm\:justify-self-start{justify-self:flex-start}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}@media(min-width:48rem){.md\:flex{display:flex}.md\:hidden{display:none}.md\:px-6{padding-inline:calc(var(--spacing) * 6)}.md\:py-6{padding-block:calc(var(--spacing) * 6)}}@media(min-width:64rem){.lg\:sticky{position:sticky}.lg\:top-4{top:calc(var(--spacing) * 4)}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_360px\]{grid-template-columns:minmax(0,1fr) 360px}.lg\:items-start{align-items:flex-start}}@media(min-width:80rem){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--otari-brand:#4e8295;--otari-brand-dark:#3c6678;--otari-brand-soft:#8fb2bf;--otari-brand-tint:#eaf1f3;--otari-ink:#14242c;--otari-muted:#5b6b73;--otari-line:#dbe5e8;--otari-surface:#fff;--otari-bg:#f6f9fa;--otari-cat-1:#08899f;--otari-cat-2:#b76522;--otari-cat-3:#8560ac;--otari-cat-4:#47a34e;--otari-cat-5:#9d486c;--otari-cat-6:#0871c1;--otari-cat-7:#a9912b;--otari-cat-8:#a64450;--otari-cat-other:#8b969b;--otari-danger:#dc2626;--otari-code-ink:#e8eef0}.otari-table.table-root{background-color:var(--otari-surface);border:1px solid var(--otari-line);border-radius:.75rem;padding:0;overflow:hidden}.otari-table .table__header{background-color:var(--otari-brand-tint);border-bottom:1px solid var(--otari-line)}.otari-table .table__column,.otari-table [role=row]>[role=presentation]:first-of-type>.table__column,.otari-table [role=row]>[role=presentation]:last-of-type>.table__column{color:var(--otari-ink);background-color:#0000;border-radius:0;font-weight:600}.otari-table .table__column:after{content:none}.otari-table .table__row .table__cell{border-color:var(--otari-line)}.otari-table .table__row:hover .table__cell{background-color:var(--otari-bg)}.otari-table .otari-detail-row>td{border-bottom:1px solid var(--otari-line);background-color:var(--otari-bg);padding:0}.otari-table .otari-detail-opening .table__cell{background-color:var(--otari-brand-tint)}.otari-detail-reveal{grid-template-rows:0fr;animation:.18s ease-out forwards otari-detail-open;display:grid}.otari-detail-reveal>div{overflow:hidden}@keyframes otari-detail-open{0%{opacity:.5;grid-template-rows:0fr}to{opacity:1;grid-template-rows:1fr}}.otari-bulk-bar{animation:.16s ease-out otari-bulk-bar-in}@keyframes otari-bulk-bar-in{0%{opacity:0;transform:translate(-50%,.5rem)}to{opacity:1;transform:translate(-50%)}}@media(prefers-reduced-motion:reduce){.otari-detail-reveal{grid-template-rows:1fr;animation:none}.otari-bulk-bar{animation:none}}.otari-markdown{color:var(--otari-ink);font-size:.875rem;line-height:1.65}.otari-markdown>:first-child{margin-top:0}.otari-markdown h1,.otari-markdown h2,.otari-markdown h3,.otari-markdown h4{color:var(--otari-ink);font-weight:600;line-height:1.3}.otari-markdown h1{margin:2rem 0 .75rem;font-size:1.5rem}.otari-markdown h2{border-bottom:1px solid var(--otari-line);margin:2rem 0 .5rem;padding-bottom:.3rem;font-size:1.25rem}.otari-markdown h3{margin:1.5rem 0 .5rem;font-size:1.05rem}.otari-markdown h4{margin:1.25rem 0 .25rem;font-size:.95rem}.otari-markdown p{margin:.75rem 0}.otari-markdown a{color:var(--otari-brand-dark);text-underline-offset:2px;text-decoration:underline}.otari-markdown a:hover{text-decoration-thickness:2px}.otari-markdown ul,.otari-markdown ol{margin:.75rem 0;padding-left:1.5rem}.otari-markdown ul{list-style:outside}.otari-markdown ol{list-style:decimal}.otari-markdown li,.otari-markdown li>ul,.otari-markdown li>ol{margin:.25rem 0}.otari-markdown code{background-color:var(--otari-brand-tint);color:var(--otari-brand-dark);border-radius:.35rem;padding:.1rem .35rem;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,monospace;font-size:.85em}.otari-markdown pre{background-color:var(--otari-ink);border-radius:.6rem;margin:1rem 0;padding:.85rem 1rem;overflow-x:auto}.otari-markdown pre code{color:var(--otari-code-ink);background-color:#0000;border-radius:0;padding:0;font-size:.82rem;line-height:1.55}.otari-markdown blockquote{border-left:3px solid var(--otari-brand);color:var(--otari-muted);margin:1rem 0;padding:.25rem 0 .25rem 1rem}.otari-markdown hr{border:0;border-top:1px solid var(--otari-line);margin:1.5rem 0}.otari-markdown-scroll{max-width:100%;margin:1rem 0;overflow-x:auto}.otari-markdown table{border-collapse:collapse;font-size:.85rem}.otari-markdown th,.otari-markdown td{border:1px solid var(--otari-line);text-align:left;vertical-align:top;padding:.4rem .7rem}.otari-markdown th{background-color:var(--otari-brand-tint);color:var(--otari-ink);font-weight:600}.otari-markdown tbody tr:hover td,.otari-markdown tr:hover td{background-color:var(--otari-bg)}html,body,#root{height:100%}body{background-color:var(--otari-bg);color:var(--otari-ink);margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}@keyframes caret-blink{0%,70%,to{opacity:1}20%,50%{opacity:0}}@keyframes skeleton{to{transform:translate(200%)}} +/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--tw-content:"";--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-space-y-reverse:0;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-space-x-reverse:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-500:oklch(63.7% .237 25.331);--color-red-700:oklch(50.5% .213 27.518);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-amber-950:oklch(27.9% .077 45.635);--color-green-50:oklch(98.2% .018 155.826);--color-green-200:oklch(92.5% .084 155.995);--color-green-500:oklch(72.3% .219 149.579);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-700:oklch(50.8% .118 165.612);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5 / 2.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-xl:calc(var(--radius) * 1.5);--radius-2xl:calc(var(--radius) * 2);--radius-3xl:calc(var(--radius) * 3);--ease-out:cubic-bezier(0, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--shadow-surface:var(--surface-shadow);--shadow-overlay:var(--overlay-shadow);--border-width-field:var(--field-border-width,var(--border-width));--ease-smooth:ease;--ease-out-quad:cubic-bezier(.25, .46, .45, .94);--ease-out-quart:cubic-bezier(.165, .84, .44, 1);--ease-out-fluid:cubic-bezier(.32, .72, 0, 1);--ease-linear:linear}@layer theme.base{:root,.light,.default,[data-theme=light],[data-theme=default]{color-scheme:light;--white:oklch(100% 0 0);--black:oklch(0% 0 0);--snow:oklch(99.11% 0 0);--eclipse:oklch(21.03% .0059 285.89);--spacing:.25rem;--border-width:1px;--field-border-width:0px;--disabled-opacity:.5;--ring-offset-width:2px;--cursor-interactive:pointer;--cursor-disabled:not-allowed;--radius:.5rem;--field-radius:calc(var(--radius) * 1.5);--background:oklch(97.02% 0 0);--foreground:var(--eclipse);--surface:var(--white);--surface-foreground:var(--foreground);--surface-secondary:oklch(95.24% .0013 286.37);--surface-secondary-foreground:var(--foreground);--surface-tertiary:oklch(93.73% .0013 286.37);--surface-tertiary-foreground:var(--foreground);--overlay:var(--white);--overlay-foreground:var(--foreground);--muted:oklch(55.17% .0138 285.94);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(94% .001 286.375);--default-foreground:var(--eclipse);--accent:oklch(62.04% .195 253.83);--accent-foreground:var(--snow);--field-background:var(--white);--field-foreground:oklch(21.03% .0059 285.89);--field-placeholder:var(--muted);--field-border:transparent;--success:oklch(73.29% .1935 150.81);--success-foreground:var(--eclipse);--warning:oklch(78.19% .1585 72.33);--warning-foreground:var(--eclipse);--danger:oklch(65.32% .2328 25.74);--danger-foreground:var(--snow);--segment:var(--white);--segment-foreground:var(--eclipse);--border:oklch(90% .004 286.32);--separator:oklch(92% .004 286.32);--focus:var(--accent);--link:var(--foreground);--backdrop:#00000080;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft:color-mix(in oklab, var(--accent) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 70%, var(--foreground) 30%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--accent-soft-hover:color-mix(in oklab, var(--accent) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 70%, var(--foreground) 40%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft:color-mix(in oklab, var(--warning) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 70%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--warning-soft-hover:color-mix(in oklab, var(--warning) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft:color-mix(in oklab, var(--success) 15%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 60%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--success-soft-hover:color-mix(in oklab, var(--success) 20%, transparent)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){:root,.light,.default,[data-theme=light],[data-theme=default]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}:root,.light,.default,[data-theme=light],[data-theme=default]{--surface-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--overlay-shadow:0 2px 8px 0 #0000000f, 0 -6px 12px 0 #00000008, 0 14px 28px 0 #00000014;--field-shadow:0 2px 4px 0 #0000000a, 0 1px 2px 0 #0000000f, 0 0 1px 0 #0000000f;--skeleton-animation:shimmer;--tooltip-delay:1.5s;--tooltip-close-delay:.5s}.dark,[data-theme=dark]{color-scheme:dark;--background:oklch(12% .005 285.823);--foreground:var(--snow);--surface:oklch(21.03% .0059 285.89);--surface-foreground:var(--foreground);--surface-secondary:oklch(25.7% .0037 286.14);--surface-tertiary:oklch(27.21% .0024 247.91);--overlay:oklch(21.03% .0059 285.89);--overlay-foreground:var(--foreground);--muted:oklch(70.5% .015 286.067);--scrollbar:var(--scrollbar-thumb);--scrollbar-thumb:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--scrollbar-thumb:color-mix(in oklch, var(--foreground) 15%, transparent)}}.dark,[data-theme=dark]{--scrollbar-track:transparent;--scrollbar-gutter:auto;--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--default:oklch(27.4% .006 286.033);--default-foreground:var(--snow);--field-background:oklch(21.03% .0059 285.89);--field-foreground:var(--foreground);--warning:oklch(82.03% .1388 76.34);--warning-foreground:var(--eclipse);--danger:oklch(59.4% .1967 24.63);--danger-foreground:var(--snow);--segment:oklch(39.64% .01 285.93);--segment-foreground:var(--foreground);--border:oklch(28% .006 286.033);--separator:oklch(25% .006 286.033);--focus:var(--accent);--link:var(--foreground);--backdrop:#0009;--surface-shadow:0 0 0 0 transparent inset;--overlay-shadow:0 0 1px 0 #ffffff4d inset;--field-shadow:0 0 0 0 transparent inset;--surface-hover:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--surface-hover:color-mix(in oklab, var(--surface) 92%, var(--surface-foreground) 8%)}}.dark,[data-theme=dark]{--background-secondary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-secondary:color-mix(in oklab, var(--background) 96%, var(--foreground) 4%)}}.dark,[data-theme=dark]{--background-tertiary:var(--background)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--background-tertiary:color-mix(in oklab, var(--background) 92%, var(--foreground) 8%)}}.dark,[data-theme=dark]{--background-inverse:var(--foreground);--default-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-hover:color-mix(in oklab, var(--default) 96%, var(--default-foreground) 4%)}}.dark,[data-theme=dark]{--accent-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-hover:color-mix(in oklab, var(--accent) 90%, var(--accent-foreground) 10%)}}.dark,[data-theme=dark]{--success-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-hover:color-mix(in oklab, var(--success) 90%, var(--success-foreground) 10%)}}.dark,[data-theme=dark]{--warning-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-hover:color-mix(in oklab, var(--warning) 90%, var(--warning-foreground) 10%)}}.dark,[data-theme=dark]{--danger-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-hover:color-mix(in oklab, var(--danger) 90%, var(--danger-foreground) 10%)}}.dark,[data-theme=dark]{--field-hover:var(--field-background,var(--default))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-hover:color-mix(in oklab, var(--field-background,var(--default)) 90%, var(--field-foreground,var(--foreground)) 2%)}}.dark,[data-theme=dark]{--field-focus:var(--field-background,var(--default));--field-border-hover:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-hover:color-mix(in oklab, var(--field-border,var(--border)) 88%, var(--field-foreground,var(--foreground)) 10%)}}.dark,[data-theme=dark]{--field-border-focus:var(--field-border,var(--border))}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--field-border-focus:color-mix(in oklab, var(--field-border,var(--border)) 74%, var(--field-foreground,var(--foreground)) 22%)}}.dark,[data-theme=dark]{--default-soft:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft:color-mix(in oklab, var(--default) 50%, transparent)}}.dark,[data-theme=dark]{--default-soft-foreground:var(--default-foreground);--default-soft-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--default-soft-hover:color-mix(in oklab, var(--default) 60%, transparent)}}.dark,[data-theme=dark]{--accent-soft:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft:color-mix(in oklab, var(--accent) 12%, transparent)}}.dark,[data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--accent-soft-hover:var(--accent)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--accent-soft-hover:color-mix(in oklab, var(--accent) 16%, transparent)}}.dark,[data-theme=dark]{--danger-soft:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft:color-mix(in oklab, var(--danger) 15%, transparent)}}.dark,[data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--danger-soft-hover:var(--danger)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--danger-soft-hover:color-mix(in oklab, var(--danger) 20%, transparent)}}.dark,[data-theme=dark]{--warning-soft:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft:color-mix(in oklab, var(--warning) 12%, transparent)}}.dark,[data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--warning-soft-hover:var(--warning)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--warning-soft-hover:color-mix(in oklab, var(--warning) 16%, transparent)}}.dark,[data-theme=dark]{--success-soft:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft:color-mix(in oklab, var(--success) 12%, transparent)}}.dark,[data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 80%, var(--foreground) 30%)}}.dark,[data-theme=dark]{--success-soft-hover:var(--success)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--success-soft-hover:color-mix(in oklab, var(--success) 16%, transparent)}}.dark,[data-theme=dark]{--separator-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-secondary:color-mix(in oklab, var(--surface) 85%, var(--surface-foreground) 15%)}}.dark,[data-theme=dark]{--separator-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--separator-tertiary:color-mix(in oklab, var(--surface) 81%, var(--surface-foreground) 19%)}}.dark,[data-theme=dark]{--border-secondary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-secondary:color-mix(in oklab, var(--surface) 78%, var(--surface-foreground) 22%)}}.dark,[data-theme=dark]{--border-tertiary:var(--surface)}@supports (color:color-mix(in lab,red,red)){.dark,[data-theme=dark]{--border-tertiary:color-mix(in oklab, var(--surface) 66%, var(--surface-foreground) 34%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true]:not(.dark):not([data-theme=dark]){--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:var(--accent)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--accent-soft-foreground:color-mix(in oklab, var(--accent) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:var(--danger)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--danger-soft-foreground:color-mix(in oklab, var(--danger) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:var(--warning)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--warning-soft-foreground:color-mix(in oklab, var(--warning) 92%, var(--foreground) 8%)}}[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:var(--success)}@supports (color:color-mix(in lab,red,red)){[data-vibrant-palette=true].dark,[data-vibrant-palette=true][data-theme=dark]{--success-soft-foreground:color-mix(in oklab, var(--success) 92%, var(--foreground) 8%)}}}@layer components;}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*,:after,:before,::backdrop{border-color:var(--border,currentColor)}::file-selector-button{border-color:var(--border,currentColor)}:root{view-transition-name:none}::view-transition{pointer-events:none}[data-scrollbar=thin]{--scrollbar-width:thin;--scrollbar-color:var(--scrollbar-thumb) var(--scrollbar-track);--scrollbar-gutter:auto}[data-scrollbar=default]{--scrollbar-width:auto;--scrollbar-color:auto;--scrollbar-gutter:auto}[data-scrollbar=none]{--scrollbar-width:none;--scrollbar-color:auto;--scrollbar-gutter:auto}}@layer components{.close-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),color .15s var(--ease-out),background-color .1s var(--ease-out),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.close-button:focus-visible:not(:focus),.close-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.close-button:disabled,.close-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.close-button[data-pending=true]{pointer-events:none}.close-button svg{pointer-events:none;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);flex-shrink:0;align-self:center}.close-button--default{background-color:var(--default);color:var(--muted)}@media(hover:hover){.close-button--default:hover,.close-button--default[data-hovered=true]{background-color:var(--default-hover)}}.close-button--default:active,.close-button--default[data-pressed=true]{transform:scale(.93)}.description{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted)}.error-message{height:auto;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *),.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.error-message:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.error-message:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.field-error{height:0;padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));overflow-wrap:break-word;color:var(--danger);opacity:0}.field-error[data-visible]{opacity:1;height:auto}.field-error{transition:opacity .15s var(--ease-out),height .35s var(--ease-smooth)}.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *),.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.field-error:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.field-error:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox>.field-error,.checkbox>[data-slot=field-error],.switch>.field-error,.switch>[data-slot=field-error],.radio>.field-error,.radio>[data-slot=field-error]{height:auto;min-height:0;color:var(--muted);opacity:1;margin:0;padding:0;transition:none}.label{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}:is(.label--required,[data-required=true]:not([role=group]):not([role=radiogroup]):not([role=checkboxgroup])>.label,[data-required=true]:not([data-slot=radio]):not([data-slot=checkbox])>.label):after{margin-left:calc(var(--spacing) * .5);color:var(--danger);--tw-content:"*";content:var(--tw-content)}.label--disabled,[data-disabled=true] .label{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.label--invalid,[data-invalid=true] .label,[aria-invalid=true] .label{color:var(--danger)}.accordion{contain:layout style;width:100%}.accordion__body{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.accordion__body-inner{padding-inline:calc(var(--spacing) * 4);padding-top:0;padding-bottom:calc(var(--spacing) * 4);color:var(--muted)}.accordion__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__indicator[data-expanded=true]{rotate:-180deg}.accordion__item{--tw-border-style:none;border-style:none;position:relative}.accordion__item:after{content:"";border-radius:calc(var(--radius) * .25);background-color:var(--separator);width:100%;height:1px;position:absolute;bottom:0;left:0}.accordion__item:last-child:after{content:none}.accordion__item[data-hide-separator=true]:after{display:none}.accordion__trigger{cursor:var(--cursor-interactive);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 4);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-tap-highlight-color:transparent;transition:opacity .15s var(--ease-out),box-shadow .15s var(--ease-out);flex:1;justify-content:space-between;align-items:center;display:flex}.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--foreground)}@supports (color:color-mix(in lab,red,red)){.accordion__trigger:hover:not([aria-expanded=true]),.accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:color-mix(in oklab,var(--foreground) 3%,transparent 90%)}}}.accordion__trigger:focus-visible:not(:focus),.accordion__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.accordion__trigger:disabled,.accordion__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.accordion__panel{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *),.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.accordion__panel:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.accordion__panel:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.accordion__panel[data-expanded=true]{will-change:height,opacity;opacity:1}.accordion--surface{background-color:var(--surface);border-radius:min(32px,var(--radius-3xl))}@media(hover:hover){.accordion--surface .accordion__trigger:hover:not([aria-expanded=true]),.accordion--surface .accordion__trigger[data-hovered=true]:not([aria-expanded=true]){background-color:var(--default)}}.accordion--surface .accordion__item:after{background-color:var(--surface-foreground)}@supports (color:color-mix(in lab,red,red)){.accordion--surface .accordion__item:after{background-color:color-mix(in oklab,var(--surface-foreground) 6%,transparent)}}.accordion--surface .accordion__item:after{width:94%;left:3%}.accordion--surface .accordion__item:first-child [data-slot=accordion-trigger]{border-top-left-radius:min(32px,var(--radius-3xl));border-top-right-radius:min(32px,var(--radius-3xl))}.accordion--surface .accordion__item:last-child:not(:has([data-slot=accordion-trigger][aria-expanded=true])) [data-slot=accordion-trigger]{border-bottom-left-radius:min(32px,var(--radius-3xl));border-bottom-right-radius:min(32px,var(--radius-3xl))}.breadcrumbs{align-items:center;display:flex}.breadcrumbs .breadcrumbs__link{padding-inline:calc(var(--spacing) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);opacity:1;text-decoration-line:none;position:relative}.breadcrumbs .breadcrumbs__link:hover,.breadcrumbs .breadcrumbs__link[data-hovered=true]{text-decoration-line:underline}.breadcrumbs .breadcrumbs__link[data-current=true]{color:var(--link);opacity:1}.breadcrumbs .breadcrumbs__item{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);padding-inline:calc(var(--spacing) * .5);flex-shrink:0;display:flex}.breadcrumbs .breadcrumbs__separator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:var(--muted)}.breadcrumbs .breadcrumbs__separator:where(:dir(rtl),[dir=rtl],[dir=rtl] *){rotate:180deg}.disclosure-group{contain:layout style;width:100%}.disclosure{position:relative}.accordion__heading{display:flex}.disclosure__trigger{cursor:var(--cursor-interactive);-webkit-tap-highlight-color:transparent;display:inline-block}.disclosure__trigger:focus-visible:not(:focus),.disclosure__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.disclosure__trigger:disabled,.disclosure__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.disclosure__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:inherit;transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;flex-shrink:0;margin-left:auto;transition-duration:.25s}.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__indicator[data-expanded=true]{rotate:-180deg}.disclosure__content{opacity:0;height:var(--disclosure-panel-height);transition:height .2s var(--ease-out-quad),opacity .2s var(--ease-out);overflow:clip}.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *),.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.disclosure__content:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.disclosure__content:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.disclosure__content[data-expanded=true]{will-change:height,opacity;opacity:1}.disclosure__body{padding:calc(var(--spacing) * 2)}.link{border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);width:fit-content;height:fit-content;font-weight:var(--font-weight-medium);color:var(--link);text-decoration-line:none;-webkit-text-decoration-color:var(--separator-tertiary);text-decoration-color:var(--separator-tertiary);text-underline-offset:4px;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .1s var(--ease-out);align-items:center;text-decoration-thickness:1.5px;display:inline-flex;position:relative}.link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link{cursor:var(--cursor-interactive)}@media(hover:hover){.link:hover,.link[data-hovered=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.link:hover,.link[data-hovered=true]{-webkit-text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent);text-decoration-color:color-mix(in oklab,var(--muted) 50%,transparent)}}:is(.link:hover,.link[data-hovered=true]) .link__icon{opacity:1}}.link:active,.link[data-pressed=true]{text-decoration-line:underline;-webkit-text-decoration-color:var(--muted);text-decoration-color:var(--muted)}:is(.link:active,.link[data-pressed=true]) .link__icon{opacity:1}.link:focus-visible:not(:focus),.link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}:is(.link:focus-visible:not(:focus),.link[data-focus-visible=true]) .link__icon{opacity:1}.link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.link .link__icon{pointer-events:none;color:currentColor;opacity:.6;width:.75em;height:.75em;transition:opacity .15s var(--ease-out);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *),.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.link .link__icon:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.link .link__icon:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.link .link__icon svg{transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.link .link__icon[data-default-icon=true]{margin-left:var(--spacing);padding-bottom:calc(var(--spacing) * 1.5)}.link.button{gap:0;text-decoration-line:none}.pagination{justify-content:space-between;align-items:center;gap:calc(var(--spacing) * 4);flex-direction:column;width:100%;display:flex}@media(min-width:40rem){.pagination{flex-direction:row}}.pagination__summary{align-items:center;gap:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__summary{align-self:center}}.pagination__content{align-items:center;gap:var(--spacing);align-self:flex-start;display:flex}@media(min-width:40rem){.pagination__content{align-self:center}}.pagination__item{display:inline-flex}.pagination__link{isolation:isolate;width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);transform-origin:50%;border-radius:calc(var(--radius) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}@media(min-width:48rem){.pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *),.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.pagination__link:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.pagination__link:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.pagination__link{--pagination-link-bg:transparent;--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover);--pagination-link-fg:var(--default-foreground);background-color:var(--pagination-link-bg);color:var(--pagination-link-fg)}.pagination__link:focus-visible,.pagination__link[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.pagination__link:disabled,.pagination__link[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.pagination__link:hover,.pagination__link[data-hovered=true]{background-color:var(--pagination-link-bg-hover)}}.pagination__link:active,.pagination__link[data-pressed=true]{background-color:var(--pagination-link-bg-pressed);transform:scale(.97)}.pagination__link[data-active=true]{--pagination-link-bg:var(--default);--pagination-link-bg-hover:var(--default-hover);--pagination-link-bg-pressed:var(--default-hover)}.pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:inline-flex}@media(min-width:48rem){.pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}}.pagination__link--nav{gap:calc(var(--spacing) * 1.5);width:auto;padding-inline:calc(var(--spacing) * 2.5)}.pagination--sm .pagination__link{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__link{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__link:active,.pagination--sm .pagination__link[data-pressed=true]{transform:scale(.98)}.pagination--sm .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 2)}.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}@media(min-width:48rem){.pagination--sm .pagination__ellipsis{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}}.pagination--sm .pagination__summary{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.pagination--lg .pagination__link{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__link{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__link:active,.pagination--lg .pagination__link[data-pressed=true]{transform:scale(.96)}.pagination--lg .pagination__link--nav{width:auto;padding-inline:calc(var(--spacing) * 3)}.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.pagination--lg .pagination__ellipsis{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}}.pagination--lg .pagination__summary{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.tabs{gap:calc(var(--spacing) * 2);display:flex}.tabs[data-orientation=horizontal]{flex-direction:column}.tabs[data-orientation=vertical]{flex-direction:row}.tabs__list-container{position:relative}.tabs__list{background-color:var(--default);padding:var(--spacing);border-radius:calc(var(--radius) * 2.5);display:inline-flex}.tabs__list[data-orientation=horizontal]{flex-direction:row;width:100%}.tabs__list[data-orientation=vertical]{gap:var(--spacing);flex-direction:column}.tabs__list[data-orientation=vertical] .tabs__tab{min-width:calc(var(--spacing) * 20)}.tabs__tab{z-index:1;cursor:var(--cursor-interactive);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);width:100%;padding-inline:calc(var(--spacing) * 4);text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out),opacity .15s var(--ease-smooth);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__tab:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__tab:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__tab[data-selected=true]{color:var(--segment-foreground)}.tabs__tab[data-selected=true] .tabs__separator,.tabs__tab[data-selected=true]+.tabs__tab .tabs__separator{opacity:0}.tabs__tab:disabled,.tabs__tab[data-disabled=true],.tabs__tab[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.tabs__tab:not([data-selected=true]):not([data-disabled=true]):hover,.tabs__tab[data-hovered=true]:not([data-selected=true]):not([data-disabled=true]){opacity:.7}}.tabs__tab:focus-visible:not(:focus),.tabs__tab[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tabs__separator{border-radius:calc(var(--radius) * .5);background-color:var(--muted)}@supports (color:color-mix(in lab,red,red)){.tabs__separator{background-color:color-mix(in oklab,var(--muted) 25%,transparent)}}.tabs__separator{pointer-events:none;transition:opacity .15s var(--ease-smooth);position:absolute}.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs__list[data-orientation=horizontal] .tabs__separator{width:1px;height:50%;top:25%;left:0}.tabs__list[data-orientation=vertical] .tabs__separator{width:90%;height:1px;top:0;left:5%}.tabs__panel{width:100%;padding:calc(var(--spacing) * 2);--tw-outline-style:none;outline-style:none}.tabs__panel[data-exiting=true]{width:100%;position:absolute;top:0;left:0}.tabs__panel[data-orientation=horizontal]{margin-top:calc(var(--spacing) * 4)}.tabs__panel[data-orientation=vertical]{margin-left:calc(var(--spacing) * 4)}.tabs__indicator{box-shadow:var(--shadow-surface);z-index:-1;border-radius:var(--radius-3xl);background-color:var(--segment);width:100%;height:100%;transition-property:translate,width,height;transition-duration:.25s;transition-timing-function:var(--ease-out-fluid);position:absolute;top:0;left:0}.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tabs__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tabs__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tabs--secondary>.tabs__list-container>.tabs__list{background-color:#0000;border-radius:0;padding:0}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=horizontal]{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--border);max-width:100%;overflow:auto clip}.tabs--secondary>.tabs__list-container>.tabs__list[data-orientation=vertical]{border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--border)}.tabs--secondary>.tabs__list-container .tabs__tab{border-radius:0}.tabs--secondary>.tabs__list-container .tabs__tab[data-selected=true]{color:var(--foreground)}.tabs--secondary>.tabs__list-container .tabs__separator{display:none}.tabs--secondary>.tabs__list-container .tabs__indicator{background-color:var(--accent);box-shadow:none;border-radius:0}.tabs--secondary[data-orientation=horizontal]>.tabs__list-container .tabs__indicator{height:2px;top:auto;bottom:0}.tabs--secondary[data-orientation=vertical]>.tabs__list-container .tabs__indicator{width:2px;height:100%;top:0;left:0}.button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.button{height:calc(var(--spacing) * 9)}}.button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button{cursor:var(--cursor-interactive);--button-bg:transparent;--button-bg-hover:var(--button-bg);--button-bg-pressed:var(--button-bg-hover);--button-fg:currentColor;background-color:var(--button-bg);color:var(--button-fg)}.button:focus-visible:not(:focus),.button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.button:disabled,.button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.button[data-pending=true]{pointer-events:none}.button:active,.button[data-pressed=true]{background-color:var(--button-bg-pressed);transform:scale(.97)}@media(hover:hover){.button:hover,.button[data-hovered=true]{background-color:var(--button-bg-hover)}}.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.button svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.button--sm{height:calc(var(--spacing) * 8)}}.button--sm svg:not([data-slot=spinner] svg,[data-slot=link-icon] svg){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.button--sm:active,.button--sm[data-pressed=true]{transform:scale(.98)}.button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.button--lg{height:calc(var(--spacing) * 10)}}.button--lg:active,.button--lg[data-pressed=true]{transform:scale(.96)}.button--primary{--button-bg:var(--accent);--button-bg-hover:var(--accent-hover);--button-bg-pressed:var(--accent-hover);--button-fg:var(--accent-foreground)}.button--secondary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover);--button-fg:var(--accent-soft-foreground)}.button--tertiary{--button-bg:var(--default);--button-bg-hover:var(--default-hover);--button-bg-pressed:var(--default-hover)}.button--ghost,.button--outline{--button-bg:transparent;--button-bg-hover:var(--default);--button-bg-pressed:var(--default);--button-fg:var(--default-foreground)}.button--outline{border-style:var(--tw-border-style);border-width:1px;border-color:var(--border);--button-bg-hover:var(--default)}@supports (color:color-mix(in lab,red,red)){.button--outline{--button-bg-hover:color-mix(in srgb, var(--default) 60%, transparent)}}.button--danger{--button-bg:var(--danger);--button-bg-hover:var(--danger-hover);--button-bg-pressed:var(--danger-hover);--button-fg:var(--danger-foreground)}.button--danger-soft{--button-bg:var(--danger-soft);--button-bg-hover:var(--danger-soft-hover);--button-bg-pressed:var(--danger-soft-hover);--button-fg:var(--danger-soft-foreground)}.button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.button--icon-only{width:calc(var(--spacing) * 9)}}.button--icon-only.button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.button--icon-only.button--sm{width:calc(var(--spacing) * 8)}}.button--icon-only.button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.button--icon-only.button--lg{width:calc(var(--spacing) * 10)}}.button--full-width{width:100%}.button-group{justify-content:center;align-items:center;gap:0;height:auto;display:inline-flex}.button-group--horizontal{flex-direction:row}.button-group--vertical{flex-direction:column}.button-group .button{border-radius:0}.button-group--horizontal .button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.button-group--horizontal .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.button-group--vertical .button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.button-group--vertical .button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.button-group .button:active,.button-group .button[data-pressed=true]{transform:none}.button-group .button:focus-visible:not(:focus),.button-group .button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.button-group--horizontal .button-group__separator{width:1px;height:50%;top:25%;left:-1px}.button-group--vertical .button-group__separator{width:50%;height:1px;top:-1px;left:25%}.button-group--horizontal .button--outline:first-child{border-inline-end-style:var(--tw-border-style);border-inline-end-width:0}.button-group--horizontal .button--outline:last-child{border-inline-start-style:var(--tw-border-style);border-inline-start-width:0}.button-group--horizontal .button--outline:not(:first-child):not(:last-child){border-inline-style:var(--tw-border-style);border-inline-width:0}.button-group--vertical .button--outline:first-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.button-group--vertical .button--outline:last-child{border-top-style:var(--tw-border-style);border-top-width:0}.button-group--vertical .button--outline:not(:first-child):not(:last-child){border-block-style:var(--tw-border-style);border-block-width:0}.button-group--full-width{width:100%}.toggle-button{isolation:isolate;height:calc(var(--spacing) * 10);transform-origin:50%;justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);border-radius:calc(var(--radius) * 3);width:fit-content;padding-inline:calc(var(--spacing) * 4);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex;position:relative}@media(min-width:48rem){.toggle-button{height:calc(var(--spacing) * 9)}}.toggle-button{transition:transform .25s var(--ease-smooth),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button{cursor:var(--cursor-interactive);--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover);--toggle-button-fg:currentColor;--toggle-button-bg-selected:var(--accent-soft);--toggle-button-bg-selected-hover:var(--accent-soft-hover);--toggle-button-bg-selected-pressed:var(--accent-soft-hover);--toggle-button-fg-selected:var(--accent-soft-foreground);background-color:var(--toggle-button-bg);color:var(--toggle-button-fg)}.toggle-button:focus-visible:not(:focus),.toggle-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.toggle-button:disabled,.toggle-button[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@media(hover:hover){.toggle-button:hover,.toggle-button[data-hovered=true]{background-color:var(--toggle-button-bg-hover)}}.toggle-button:active,.toggle-button[data-pressed=true]{background-color:var(--toggle-button-bg-pressed);transform:scale(.97)}.toggle-button[data-selected=true]{background-color:var(--toggle-button-bg-selected);color:var(--toggle-button-fg-selected)}@media(hover:hover){.toggle-button[data-selected=true]:hover,.toggle-button[data-selected=true][data-hovered=true]{background-color:var(--toggle-button-bg-selected-hover)}}.toggle-button[data-selected=true]:active,.toggle-button[data-selected=true][data-pressed=true]{background-color:var(--toggle-button-bg-selected-pressed)}.toggle-button svg{pointer-events:none;margin-inline:calc(var(--spacing) * -.5);margin-block:calc(var(--spacing) * .5);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0;align-self:center}@media(min-width:40rem){.toggle-button svg{margin-block:var(--spacing);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}}.toggle-button--sm{height:calc(var(--spacing) * 9);padding-inline:calc(var(--spacing) * 3)}@media(min-width:48rem){.toggle-button--sm{height:calc(var(--spacing) * 8)}}.toggle-button--sm svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toggle-button--sm:active,.toggle-button--sm[data-pressed=true]{transform:scale(.98)}.toggle-button--lg{height:calc(var(--spacing) * 11);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}@media(min-width:48rem){.toggle-button--lg{height:calc(var(--spacing) * 10)}}.toggle-button--lg:active,.toggle-button--lg[data-pressed=true]{transform:scale(.96)}.toggle-button--default{--toggle-button-bg:var(--default);--toggle-button-bg-hover:var(--default-hover);--toggle-button-bg-pressed:var(--default-hover)}.toggle-button--ghost{--toggle-button-bg:transparent;--toggle-button-bg-hover:var(--default);--toggle-button-bg-pressed:var(--default);--toggle-button-fg:var(--default-foreground)}.toggle-button--icon-only{width:calc(var(--spacing) * 10);padding:0}@media(min-width:48rem){.toggle-button--icon-only{width:calc(var(--spacing) * 9)}}.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 9)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--sm{width:calc(var(--spacing) * 8)}}.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 11)}@media(min-width:48rem){.toggle-button--icon-only.toggle-button--lg{width:calc(var(--spacing) * 10)}}.toggle-button-group{justify-content:center;align-items:center;gap:0;width:fit-content;height:auto;display:inline-flex}.toggle-button-group--horizontal{flex-direction:row}.toggle-button-group--vertical{flex-direction:column}.toggle-button-group--full-width{width:100%}.toggle-button-group .toggle-button{border-radius:0}.toggle-button-group--horizontal .toggle-button:first-child{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:last-child{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.toggle-button-group--horizontal .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child{border-top-left-radius:calc(var(--radius) * 3);border-top-right-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:last-child{border-bottom-right-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.toggle-button-group--vertical .toggle-button:first-child:last-child{border-radius:calc(var(--radius) * 3)}.toggle-button-group .toggle-button:active,.toggle-button-group .toggle-button[data-pressed=true]{transform:none}.toggle-button-group .toggle-button:focus-visible:not(:focus),.toggle-button-group .toggle-button[data-focus-visible=true]{--tw-ring-offset-width:0px;--tw-ring-inset:inset}.toggle-button-group--full-width .toggle-button{flex:1}.toggle-button-group__separator{border-radius:calc(var(--radius) * .5);opacity:.15;pointer-events:none;transition:opacity .15s var(--ease-smooth);background-color:currentColor;position:absolute}.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toggle-button-group__separator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toggle-button-group__separator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toggle-button-group--horizontal .toggle-button-group__separator{width:1px;height:50%;top:25%;left:-1px}.toggle-button-group--vertical .toggle-button-group__separator{width:50%;height:1px;top:-1px;left:25%}.toggle-button-group--detached{gap:var(--spacing)}.toggle-button-group--detached .toggle-button{border-radius:calc(var(--radius) * 3)}.toggle-button-group--detached .toggle-button-group__separator{display:none}.toolbar{align-items:center;gap:calc(var(--spacing) * 2);grid-auto-flow:column;width:fit-content;display:grid}.toolbar .separator--vertical{align-self:center;height:50%}.toolbar .separator--horizontal{justify-content:center;justify-self:center;width:50%}.toolbar--vertical{grid-auto-flow:row;justify-content:flex-start;align-items:flex-start}.toolbar--vertical .button-group{justify-content:flex-start}.toolbar--attached{border-radius:calc(var(--radius) * 3);background-color:var(--surface);padding:var(--spacing);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.dropdown{gap:var(--spacing);flex-direction:column;display:flex}.dropdown__trigger{--tw-outline-style:none;transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;display:inline-block}.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.dropdown__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.dropdown__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.dropdown__trigger{cursor:var(--cursor-interactive)}.dropdown__trigger:focus-visible:not(:focus),.dropdown__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.dropdown__trigger:disabled,.dropdown__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.dropdown__trigger[data-pending=true]{pointer-events:none}.dropdown__trigger:active,.dropdown__trigger[data-pressed=true]{transform:scale(.97)}.dropdown__popover{max-width:48svw;transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));padding:0;overflow-y:auto}@media(min-width:48rem){.dropdown__popover{min-width:calc(var(--spacing) * 55)}}.dropdown__popover{border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay)}.dropdown__popover:focus-visible:not(:focus),.dropdown__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.dropdown__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.dropdown__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.dropdown__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.dropdown__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.dropdown__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.dropdown__popover[data-exiting=true],.dropdown__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.dropdown__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.dropdown__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.dropdown__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.dropdown__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.dropdown__popover [data-slot=dropdown-menu]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.dropdown__popover [data-slot=menu-item]{padding-inline:calc(var(--spacing) * 2.5)}.dropdown__menu{gap:calc(var(--spacing) * .5);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.dropdown__menu [data-slot=separator]{width:94%;margin-left:3%}.list-box-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item{cursor:var(--cursor-interactive)}.list-box-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.list-box-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.list-box-item:has(.list-box-item__indicator){padding-inline-end:calc(var(--spacing) * 7)}.list-box-item:focus-visible:not(:focus),.list-box-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.list-box-item:active,.list-box-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.list-box-item:hover,.list-box-item[data-hovered=true]{background-color:var(--default)}}.list-box-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.list-box-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--default-foreground);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-end:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.list-box-item__indicator [data-slot=list-box-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]{transition:stroke-dashoffset .25s linear}:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.list-box-item__indicator .list-box-item[aria-selected=true] [data-slot=list-box-item-indicator--checkmark],.list-box-item__indicator .list-box-item[data-selected=true] [data-slot=list-box-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.list-box-item--danger .list-box-item__indicator,.list-box-item--danger [data-slot=label]{color:var(--danger)}.list-box-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.list-box{width:100%;padding:var(--spacing);position:relative;overflow:clip}.list-box>*+*{margin-top:var(--spacing)}.list-box [data-slot=separator][data-orientation=horizontal]{width:94%;margin-left:3%}.menu-item{min-height:calc(var(--spacing) * 9);justify-content:flex-start;align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * 2);width:100%;padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 1.5);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:transform .25s var(--ease-out-quart),box-shadow .15s var(--ease-out);outline-style:none;display:flex;position:relative}.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item{cursor:var(--cursor-interactive)}.menu-item [data-slot=label]{pointer-events:none;-webkit-user-select:none;user-select:none;width:fit-content}.menu-item [data-slot=description]{pointer-events:none;text-wrap:wrap;-webkit-user-select:none;user-select:none}.menu-item [data-slot=submenu-indicator] svg{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.menu-item:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 7)}.menu-item[data-has-submenu=true]:has(.menu-item__indicator){padding-inline-start:calc(var(--spacing) * 2);padding-inline-end:calc(var(--spacing) * 7)}.menu-item:focus-visible:not(:focus),.menu-item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.menu-item:active,.menu-item[data-pressed=true]{transform:scale(.98)}@media(hover:hover){.menu-item:hover,.menu-item[data-hovered=true]{background-color:var(--default)}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]{transition:stroke-dashoffset .1s linear}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}:is(.menu-item[aria-checked=true],.menu-item[aria-selected=true],.menu-item[data-selected=true]) [data-slot=menu-item-indicator--dot]{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.menu-item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.menu-item__indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);color:var(--muted);transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;inset-inline-start:calc(var(--spacing) * 2);flex-shrink:0;justify-content:center;align-items:center;transition-duration:.25s;display:flex;position:absolute;top:50%}.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item__indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item__indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item[data-has-submenu=true] .menu-item__indicator{inset-inline-start:auto;inset-inline-end:calc(var(--spacing) * 2)}.menu-item__indicator [data-slot=menu-item-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.3s;transition-duration:.3s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--checkmark]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]){transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s}.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.menu-item[data-selection-mode=multiple] :is(.menu-item__indicator [data-slot=menu-item-indicator--dot]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.menu-item__indicator [data-slot=menu-item-indicator--dot]{--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:0}.menu-item__indicator--submenu{color:var(--muted)}.menu-item__indicator--submenu svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.menu-item--danger .menu-item__indicator,.menu-item--danger [data-slot=label]{color:var(--danger)}.menu-section{flex-direction:column;align-items:flex-start;gap:0;display:flex}.menu{gap:var(--spacing);width:100%;padding:var(--spacing);flex-direction:column;display:flex;position:relative;overflow:clip}.menu [data-slot=separator]{width:94%;margin-left:3%}.tag-group{gap:var(--spacing);flex-direction:column;display:flex;position:relative}.tag-group__list{gap:calc(var(--spacing) * 1.5);flex-wrap:wrap;display:flex;position:relative}.tag-group [slot=description],.tag-group [data-slot=description],.tag-group [slot=errorMessage],.tag-group [data-slot=error-message]{padding:var(--spacing)}.tag{--optical-offset:.031em;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1.5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:inline-flex;position:relative}.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tag:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tag:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tag{cursor:var(--cursor-interactive)}.tag svg{pointer-events:none;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:currentColor;flex-shrink:0;align-self:center}.tag:is([data-disabled=true],[aria-disabled=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tag:is(:focus-visible,[data-focus-visible]){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.tag:is([data-selected=true],[aria-selected=true]){background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.tag:is([data-selected=true],[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-soft-hover)}}.tag--sm{padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--md{padding-inline:calc(var(--spacing) * 2);padding-block:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.tag--lg{border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2.5);padding-block:calc(var(--spacing) * 1.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.tag--default{background-color:var(--default);color:var(--default-foreground)}@media(hover:hover){.tag--default:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--default-hover)}}.tag--surface{background-color:var(--surface);color:var(--surface-foreground)}@media(hover:hover){.tag--surface:is(:hover,[data-hovered=true]):not([data-selected=true]):not([data-disabled=true]){background-color:var(--surface-hover)}}.tag__remove-button{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);color:inherit}.tag__remove-button svg{width:inherit;height:inherit;color:currentColor;flex-shrink:0;align-self:center}.color-area{width:100%;max-width:calc(var(--spacing) * 56);border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;aspect-ratio:1;background:var(--color-area-background);flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-area[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-area--show-dots:after{content:"";pointer-events:none;border-radius:inherit;background-image:radial-gradient(circle,#fff3 1px,#0000 1px);background-size:8px 8px;position:absolute;top:0;right:0;bottom:0;left:0}.color-area__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);will-change:width,height;background-color:var(--color-area-thumb-color);transition:width .15s var(--ease-out),height .15s var(--ease-out);border:3px solid #fff;box-shadow:0 0 0 1px #0000001a,inset 0 0 0 1px #0000001a}.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-area__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-area__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-area__thumb[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-area__thumb[data-dragging=true]{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.color-area__thumb[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker{display:inline-flex}.color-picker__trigger{align-items:center;gap:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-flex}.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-picker__trigger [data-slot=label]{cursor:var(--cursor-interactive)}.color-picker__trigger:focus-visible:not(:focus),.color-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-picker__trigger:disabled,.color-picker__trigger[data-disabled=true],.color-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-picker__popover{min-width:calc(var(--spacing) * 62);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 2);padding-bottom:calc(var(--spacing) * 3);box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5));gap:calc(var(--spacing) * 3);flex-direction:column;display:flex;overflow:hidden auto}.color-picker__popover:focus-visible:not(:focus),.color-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.color-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.color-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.color-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.color-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.color-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.color-picker__popover[data-exiting=true],.color-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.color-slider{gap:var(--spacing);grid-template:"label output""track track"/1fr auto;width:100%;display:grid}.color-slider:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template:"track"/1fr;gap:0}.color-slider:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-columns:1fr;grid-template-areas:"label""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output){grid-template-columns:1fr;grid-template-areas:"output""track"}.color-slider:not(:has([data-slot=label])):has(.color-slider__output) .color-slider__output{justify-self:end}.color-slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.color-slider .color-slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.color-slider .color-slider__track{border-radius:calc(var(--radius) * 2);grid-area:track;position:relative}.color-slider .color-slider__track:before,.color-slider .color-slider__track:after{content:"";z-index:0;pointer-events:none;position:absolute}.color-slider .color-slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 2);-webkit-tap-highlight-color:transparent;border-style:var(--tw-border-style);border-width:3px;border-color:var(--color-white);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);z-index:1;transition:transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-slider .color-slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-slider .color-slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-slider .color-slider__thumb[data-dragging=true]{cursor:grabbing}.color-slider .color-slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-slider .color-slider__thumb[data-disabled=true]{cursor:default;background-color:var(--default)}.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.color-slider:disabled,.color-slider[data-disabled=true],.color-slider[aria-disabled=true]) [data-slot=label]{opacity:1}.color-slider[data-orientation=horizontal]{flex-direction:column}.color-slider[data-orientation=horizontal] .color-slider__track{height:calc(var(--spacing) * 5);border-radius:0;justify-self:center;width:calc(100% - 1.25rem);box-shadow:inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:before,.color-slider[data-orientation=horizontal] .color-slider__track:after{width:.625rem;height:100%;top:0}.color-slider[data-orientation=horizontal] .color-slider__track:before{border-top-left-radius:calc(var(--radius) * 2);border-bottom-left-radius:calc(var(--radius) * 2);background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;left:-.625rem;box-shadow:inset 1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__track:after{border-top-right-radius:calc(var(--radius) * 2);border-bottom-right-radius:calc(var(--radius) * 2);background-color:var(--track-end-color,transparent);right:-.625rem;box-shadow:inset -1px 0 #0000001a,inset 0 1px #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=horizontal] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);top:50%}.color-slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;place-items:center;height:100%}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):not(:has(.color-slider__output)){grid-template-rows:1fr;grid-template-areas:"track";gap:0}.color-slider[data-orientation=vertical]:has([data-slot=label]):not(:has(.color-slider__output)){grid-template-rows:1fr auto;grid-template-areas:"track""label"}.color-slider[data-orientation=vertical]:not(:has([data-slot=label])):has(.color-slider__output){grid-template-rows:auto 1fr;grid-template-areas:"output""track"}.color-slider[data-orientation=vertical] .color-slider__output,.color-slider[data-orientation=vertical] [data-slot=label]{text-align:center}.color-slider[data-orientation=vertical] .color-slider__track{width:calc(var(--spacing) * 5);border-radius:0;justify-self:center;height:calc(100% - 1.25rem);box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:before,.color-slider[data-orientation=vertical] .color-slider__track:after{width:100%;height:.625rem;left:0}.color-slider[data-orientation=vertical] .color-slider__track:before{background:linear-gradient(var(--track-start-color,transparent)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;border-bottom-right-radius:999px;border-bottom-left-radius:999px;bottom:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 -1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__track:after{background-color:var(--track-end-color,transparent);border-top-left-radius:999px;border-top-right-radius:999px;top:-.625rem;box-shadow:inset 1px 0 #0000001a,inset -1px 0 #0000001a,inset 0 1px #0000001a}.color-slider[data-orientation=vertical] .color-slider__thumb{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);left:50%}.color-swatch{box-sizing:border-box;width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);background:linear-gradient(var(--color-swatch-current),var(--color-swatch-current)),repeating-conic-gradient(#efefef,#efefef 25%,#f7f7f7 0%,#f7f7f7 50%) 50% / 16px 16px;flex-shrink:0;position:relative;box-shadow:inset 0 0 0 1px #0000001a}.color-swatch--circle{border-radius:calc(var(--radius) * 2)}.color-swatch--square{border-radius:calc(var(--radius) * .75)}.color-swatch--xs{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.color-swatch--xs.color-swatch--circle{border-radius:calc(var(--radius) * 1)}.color-swatch--sm{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.color-swatch--sm.color-swatch--circle{border-radius:calc(var(--radius) * 1.5)}.color-swatch--lg{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.color-swatch--lg.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.color-swatch--xl.color-swatch--circle{border-radius:calc(var(--radius) * 3)}.color-swatch-picker{align-items:center;gap:calc(var(--spacing) * 2);flex-wrap:wrap;display:flex}.color-swatch-picker__item{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);border-style:var(--tw-border-style);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:border-color .1s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);border-width:2px;border-color:#0000;outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__item:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__item:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__item:focus-visible,.color-swatch-picker__item[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.color-swatch-picker__item[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-swatch-picker__item[data-selected=true]{border-color:var(--color-swatch-current);box-shadow:var(--field-shadow)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{transform:scale(.77)}.color-swatch-picker__swatch{border-radius:inherit;width:100%;height:100%;transition:transform .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);display:block}.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__swatch:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__swatch:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-swatch-picker__swatch:hover{transform:scale(1.1)}}.color-swatch-picker__indicator{pointer-events:none;z-index:10;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.color-swatch-picker__indicator>*{width:33.3333%;height:33.3333%;color:var(--color-white);transition:transform .15s var(--ease-out);transform:scale(0)translateZ(0)}.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-swatch-picker__indicator>:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-swatch-picker__indicator>:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.color-swatch-picker__indicator[data-light-color=true] .color-swatch-picker__indicator>*{color:var(--color-black)}.color-swatch-picker__item[data-selected=true] .color-swatch-picker__indicator>*{transform:scale(1)translateZ(0)}.color-swatch-picker--stack{flex-direction:column}.color-swatch-picker--xs .color-swatch-picker__item{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px}.color-swatch-picker--sm .color-swatch-picker__item{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);border-style:var(--tw-border-style);border-width:2px}.color-swatch-picker--lg .color-swatch-picker__item{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--xl .color-swatch-picker__item{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);border-style:var(--tw-border-style);border-width:3px}.color-swatch-picker--square .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xs .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item,.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--sm .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * .75)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--lg .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item{border-radius:calc(var(--radius) * 1.5)}.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item .color-swatch-picker__swatch,.color-swatch-picker--square.color-swatch-picker--xl .color-swatch-picker__item[data-selected=true] .color-swatch-picker__swatch{border-radius:calc(var(--radius) * 1)}.color-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.color-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.color-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.color-input-group:hover:not(:focus-within),.color-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.color-input-group[data-focus-within=true],.color-input-group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.color-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group[data-invalid=true]:focus,.color-input-group[data-invalid=true]:focus-visible,.color-input-group[data-invalid=true][data-focused=true],.color-input-group[data-invalid=true][data-focus-visible=true],.color-input-group[data-invalid=true]:focus-within,.color-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.color-input-group[data-disabled=true],.color-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.color-input-group__input{cursor:text;border-style:var(--tw-border-style);height:100%;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;display:flex}@media(min-width:40rem){.color-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.color-input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}.color-input-group:has([data-slot=color-input-group-prefix]) .color-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.color-input-group:has([data-slot=color-input-group-suffix]) .color-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.color-input-group__input:focus,.color-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.color-input-group__prefix{color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group__suffix{color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.color-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--color-input-group-bg);--color-input-group-bg:var(--default);--color-input-group-bg-hover:var(--default-hover);--color-input-group-bg-focus:var(--default)}@media(hover:hover){.color-input-group--secondary:hover:not(:focus-within),.color-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--color-input-group-bg-hover)}}.color-input-group--secondary:focus-within,.color-input-group--secondary[data-focus-within=true]{background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.color-input-group--secondary[data-invalid=true]:focus,.color-input-group--secondary[data-invalid=true]:focus-visible,.color-input-group--secondary[data-invalid=true][data-focused=true],.color-input-group--secondary[data-invalid=true][data-focus-visible=true],.color-input-group--secondary[data-invalid=true]:focus-within,.color-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.color-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--color-input-group-bg-focus)}.color-input-group--secondary [data-slot=color-input-group-input]{background-color:#0000}.color-input-group--full-width{width:100%}.color-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.color-field[data-invalid=true],.color-field[aria-invalid=true]) [data-slot=description]{display:none}.color-field [data-slot=label]{width:fit-content}.color-field--full-width{width:100%}.slider{gap:var(--spacing);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.slider [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.slider .slider__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.slider .slider__track{border-radius:calc(var(--radius) * 1.5);background-color:var(--default);grid-area:track;position:relative}.slider .slider__fill{pointer-events:none;background-color:var(--accent);position:absolute}.slider .slider__thumb{cursor:grab;border-radius:calc(var(--radius) * 1.5);background-color:var(--accent);-webkit-tap-highlight-color:transparent;transition:background-color .25s var(--ease-smooth),transform .25s var(--ease-out),box-shadow .15s var(--ease-out);justify-content:center;align-items:center;display:flex;position:absolute}.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.slider .slider__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.slider .slider__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.slider .slider__thumb:after{z-index:10;border-radius:calc(var(--radius) * 1);background-color:var(--accent-foreground);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);content:"";transform-origin:50%;transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));position:relative}@media(prefers-reduced-motion:reduce){.slider .slider__thumb:after:not(:is()){transition-property:none}}.slider .slider__thumb[data-dragging=true]{cursor:grabbing}.slider .slider__thumb[data-dragging=true]:after{scale:.9}@media(prefers-reduced-motion:reduce){.slider .slider__thumb[data-dragging=true]:after:not(:is()){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}}.slider .slider__thumb[data-focus-visible=true]{z-index:10;--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.slider .slider__thumb[data-disabled=true]{cursor:default}.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.slider:disabled,.slider[data-disabled=true],.slider[aria-disabled=true]) [data-slot=label]{opacity:1}.slider[data-orientation=horizontal]{flex-direction:column}.slider[data-orientation=horizontal] .slider__track{height:calc(var(--spacing) * 5);border-inline-style:var(--tw-border-style);border-inline-width:.75rem;border-inline-color:#0000;width:100%}.slider[data-orientation=horizontal] .slider__track[data-fill-start=true]{border-inline-start-color:var(--accent)}.slider[data-orientation=horizontal] .slider__track[data-fill-end=true]{border-inline-end-color:var(--accent)}.slider[data-orientation=horizontal] .slider__fill,.slider[data-orientation=horizontal] .slider__thumb{height:100%}.slider[data-orientation=horizontal] .slider__thumb{width:1.75rem;top:50%}.slider[data-orientation=horizontal] .slider__thumb:after{width:1.5rem;height:1rem}.slider[data-orientation=vertical]{gap:calc(var(--spacing) * 2);flex-direction:row;grid-template:"output""track"1fr"label"/1fr;height:100%}.slider[data-orientation=vertical] .slider__output,.slider[data-orientation=vertical] [data-slot=label]{text-align:center}.slider[data-orientation=vertical] .slider__track{height:100%;width:calc(var(--spacing) * 5);border-block-style:var(--tw-border-style);border-block-width:.75rem;border-block-color:#0000;justify-self:center}.slider[data-orientation=vertical] .slider__track[data-fill-start=true]{border-bottom-color:var(--accent)}.slider[data-orientation=vertical] .slider__track[data-fill-end=true]{border-top-color:var(--accent)}.slider[data-orientation=vertical] .slider__fill,.slider[data-orientation=vertical] .slider__thumb{width:100%}.slider[data-orientation=vertical] .slider__thumb{height:1.75rem;left:50%}.slider[data-orientation=vertical] .slider__thumb:after{width:1rem;height:1.5rem}.switch{align-items:flex-start;gap:var(--spacing);-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);--switch-control-bg:var(--default);--switch-control-bg-hover:var(--switch-control-bg);flex-direction:column;display:flex}@supports (color:color-mix(in lab,red,red)){.switch{--switch-control-bg-hover:color-mix(in oklab, var(--switch-control-bg), transparent 20%)}}.switch{--switch-control-bg-pressed:var(--switch-control-bg-hover);--switch-control-bg-checked:var(--accent);--switch-control-bg-checked-hover:var(--accent-hover)}.switch[data-disabled=true],.switch[data-disabled=true] [data-slot=description],.switch[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.switch[data-disabled=true] .switch__thumb{background-color:var(--default-foreground)}@supports (color:color-mix(in lab,red,red)){.switch[data-disabled=true] .switch__thumb{background-color:color-mix(in oklab,var(--default-foreground) 20%,transparent)}}.switch>[data-slot=description]{width:100%;min-width:0;padding-inline-start:3.25rem}.switch>[data-slot=field-error]{width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--muted);padding-inline-start:3.25rem}.switch.switch--sm>[data-slot=description],.switch.switch--sm>[data-slot=field-error]{padding-inline-start:2.75rem}.switch.switch--lg>[data-slot=description],.switch.switch--lg>[data-slot=field-error]{padding-inline-start:3.75rem}:is(.switch:disabled[aria-checked=true],.switch:disabled[data-selected=true],.switch[data-disabled=true][aria-checked=true],.switch[data-disabled=true][data-selected=true],.switch[aria-disabled=true][aria-checked=true],.switch[aria-disabled=true][data-selected=true]) .switch__thumb{opacity:.4}.switch__control{border-radius:calc(var(--radius) * 1.5);background-color:var(--switch-control-bg);width:2.5rem;height:1.25rem;transition:background-color .25s var(--ease-smooth),box-shadow .15s var(--ease-out);flex-shrink:0;align-items:center;display:flex;position:relative;overflow:hidden}.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch:focus-visible .switch__control,.switch:has([data-slot=switch-content][data-focus-visible=true]) .switch__control,.switch [data-slot=switch-content][data-focus-visible=true] .switch__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.switch:hover .switch__control,.switch:has([data-slot=switch-content][data-hovered=true]) .switch__control,.switch [data-slot=switch-content][data-hovered=true] .switch__control{background-color:var(--switch-control-bg-hover)}.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control{background-color:var(--switch-control-bg-pressed)}:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transform:none}@media(prefers-reduced-motion:reduce){:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.switch:active .switch__control,.switch:has([data-slot=switch-content][data-pressed=true]) .switch__control,.switch [data-slot=switch-content][data-pressed=true] .switch__control):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transform:none}}.switch[aria-checked=true] .switch__control,.switch[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked)}.switch[aria-checked=true]:hover .switch__control,.switch[data-selected=true]:hover .switch__control,.switch[aria-checked=true][data-hovered=true] .switch__control,.switch[data-selected=true][data-hovered=true] .switch__control,.switch:has([data-slot=switch-content][data-hovered=true])[data-selected=true] .switch__control,.switch[aria-checked=true]:active .switch__control,.switch[data-selected=true]:active .switch__control,.switch[aria-checked=true][data-pressed=true] .switch__control,.switch[data-selected=true][data-pressed=true] .switch__control,.switch:has([data-slot=switch-content][data-pressed=true])[data-selected=true] .switch__control{background-color:var(--switch-control-bg-checked-hover)}.switch__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.switch--sm .switch__control{border-radius:calc(var(--radius) * 1);width:2rem;height:1rem}.switch--lg .switch__control{width:3rem;height:1.5rem}.switch__thumb{transform-origin:50%;border-radius:calc(var(--radius) * 1);background-color:var(--color-white);color:var(--color-black);--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);width:1.375rem;height:1rem;transition:margin .3s var(--ease-out-fluid),background-color .2s var(--ease-out);margin-inline-start:calc(var(--spacing) * .5);display:flex}.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *),.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.switch__thumb:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.switch__thumb:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.switch[aria-checked=true] .switch__thumb,.switch[data-selected=true] .switch__thumb{background-color:var(--accent-foreground);color:var(--accent);margin-inline-start:calc(100% - 1.5rem);box-shadow:0 0 5px #00000005,0 2px 10px #0000000f,0 0 1px #0000004d}.switch--sm .switch__thumb{border-radius:calc(var(--radius) * .75);width:1.03125rem;height:.75rem}.switch[aria-checked=true] :is(.switch--sm .switch__thumb),.switch[data-selected=true] :is(.switch--sm .switch__thumb){margin-inline-start:calc(100% - 1.15625rem)}.switch--lg .switch__thumb{border-radius:calc(var(--radius) * 1.5);width:1.71875rem;height:1.25rem}.switch[aria-checked=true] :is(.switch--lg .switch__thumb),.switch[data-selected=true] :is(.switch--lg .switch__thumb){margin-inline-start:calc(100% - 1.84375rem)}.switch__thumb>*{justify-content:center;align-items:center;width:100%;height:100%;display:flex}.switch__label{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.switch [data-slot=label]{-webkit-user-select:none;user-select:none}.switch__content [data-slot=label]{cursor:var(--cursor-interactive)}.switch [data-slot=description]{cursor:default;-webkit-user-select:none;user-select:none}.switch-group{gap:calc(var(--spacing) * 6);flex-direction:column;display:flex}.switch-group__items{gap:calc(var(--spacing) * 4);display:flex}.switch-group--horizontal .switch-group__items{flex-direction:row}.switch-group--vertical .switch-group__items{flex-direction:column}.badge{justify-content:center;align-items:center;gap:calc(var(--spacing) * .5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);min-height:calc(var(--spacing) * 7);min-width:calc(var(--spacing) * 7);border-radius:calc(var(--radius) * 3);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:1.34;--badge-bg:var(--default);--badge-fg:var(--default-foreground);--badge-border:var(--background);background-color:var(--badge-bg);color:var(--badge-fg);border:1px solid var(--badge-border);flex-shrink:0;line-height:1.34;display:inline-flex}.badge__label{padding-inline:calc(var(--spacing) * .5)}.badge-anchor{flex-shrink:0;display:inline-flex;position:relative}.badge--lg{min-height:calc(var(--spacing) * 8);min-width:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;line-height:1.43}.badge--sm{min-height:calc(var(--spacing) * 4);min-width:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);--tw-leading:1.34;font-size:10px;line-height:1.34}.badge--accent{--badge-fg:var(--accent-soft-foreground)}.badge--default{--badge-fg:var(--default-foreground)}.badge--success{--badge-fg:var(--success-soft-foreground)}.badge--warning{--badge-fg:var(--warning-soft-foreground)}.badge--danger{--badge-fg:var(--danger-soft-foreground)}.badge--top-right{position:absolute;top:0;right:0;transform:translate(25%,-25%)}.badge--top-left{position:absolute;top:0;left:0;transform:translate(-25%,-25%)}.badge--bottom-right{position:absolute;bottom:0;right:0;transform:translate(25%,25%)}.badge--bottom-left{position:absolute;bottom:0;left:0;transform:translate(-25%,25%)}.badge--primary.badge--accent{--badge-bg:var(--accent);--badge-fg:var(--accent-foreground)}.badge--primary.badge--default{--badge-bg:var(--default);--badge-fg:var(--default-foreground)}.badge--primary.badge--success{--badge-bg:var(--success);--badge-fg:var(--success-foreground)}.badge--primary.badge--warning{--badge-bg:var(--warning);--badge-fg:var(--warning-foreground)}.badge--primary.badge--danger{--badge-bg:var(--danger);--badge-fg:var(--danger-foreground)}.badge--soft.badge--accent{--badge-bg:var(--accent-soft);--badge-fg:var(--accent-soft-foreground)}.badge--soft.badge--default{--badge-bg:var(--default-soft);--badge-fg:var(--default-soft-foreground)}.badge--soft.badge--success{--badge-bg:var(--success-soft);--badge-fg:var(--success-soft-foreground)}.badge--soft.badge--warning{--badge-bg:var(--warning-soft);--badge-fg:var(--warning-soft-foreground)}.badge--soft.badge--danger{--badge-bg:var(--danger-soft);--badge-fg:var(--danger-soft-foreground)}.chip{align-items:center;gap:calc(var(--spacing) * .5);border-radius:calc(var(--radius) * 2);padding-inline:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * .5);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--chip-bg:var(--default);--chip-fg:currentColor;background-color:var(--chip-bg);color:var(--chip-fg);flex-shrink:0;display:inline-flex}.chip__label{padding-inline:calc(var(--spacing) * .5)}.chip--accent{--chip-fg:var(--accent-soft-foreground)}.chip--danger{--chip-fg:var(--danger-soft-foreground)}.chip--default{--chip-fg:var(--default-foreground)}.chip--success{--chip-fg:var(--success-soft-foreground)}.chip--warning{--chip-fg:var(--warning-soft-foreground)}.chip--tertiary{--chip-bg:transparent}.chip--sm{padding-inline:var(--spacing);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));padding-block:0}.chip--md{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.chip--lg{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.chip--primary.chip--accent{--chip-bg:var(--accent);--chip-fg:var(--accent-foreground)}.chip--primary.chip--success{--chip-bg:var(--success);--chip-fg:var(--success-foreground)}.chip--primary.chip--warning{--chip-bg:var(--warning);--chip-fg:var(--warning-foreground)}.chip--primary.chip--danger{--chip-bg:var(--danger);--chip-fg:var(--danger-foreground)}.chip--accent.chip--soft{--chip-bg:var(--accent-soft);--chip-fg:var(--accent-soft-foreground)}.chip--success.chip--soft{--chip-bg:var(--success-soft);--chip-fg:var(--success-soft-foreground)}.chip--warning.chip--soft{--chip-bg:var(--warning-soft);--chip-fg:var(--warning-soft-foreground)}.chip--danger.chip--soft{--chip-bg:var(--danger-soft);--chip-fg:var(--danger-soft-foreground)}.chip--default.chip--soft{--chip-bg:var(--default-soft);--chip-fg:var(--default-soft-foreground)}.table-root{grid-template-columns:minmax(0,1fr);width:100%;display:grid;position:relative;overflow:clip}.table__scroll-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;overflow-x:auto}.table-root--primary{background-color:var(--surface-secondary);padding-inline:var(--spacing);padding-bottom:var(--spacing);border-radius:min(32px,calc(var(--radius) * 2.5))}.table-root--secondary .table__header{border-bottom-style:var(--tw-border-style);background-color:#0000;border-bottom-width:0}.table-root--secondary .table__column{background-color:var(--surface-secondary)}.table-root--secondary :is(th.table__column:first-child,[role=row]>[role=presentation]:first-of-type>.table__column){border-start-start-radius:min(32px,var(--radius-2xl));border-end-start-radius:min(32px,var(--radius-2xl))}.table-root--secondary :is(th.table__column:last-child,[role=row]>[role=presentation]:last-of-type>.table__column){border-start-end-radius:min(32px,var(--radius-2xl));border-end-end-radius:min(32px,var(--radius-2xl))}.table-root--secondary .table__body{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table-root--secondary .table__body tr:first-child td:first-child,.table-root--secondary .table__body tr:first-child td:last-child,.table-root--secondary .table__body tr:last-child td:first-child,.table-root--secondary .table__body tr:last-child td:last-child{border-radius:0}.table-root--secondary .table__body:not(tbody){border-radius:0;overflow:visible}.table-root--secondary .table__row .table__cell{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row .table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table-root--secondary .table__row .table__cell{background-color:#0000}@media(hover:hover){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.table-root--secondary .table__row:hover .table__cell,.table-root--secondary .table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--default) 50%,transparent)}}}.table__content{border-collapse:separate;--tw-border-spacing-x:0;--tw-border-spacing-y:0;width:100%;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.table-root--primary .table__content{overflow:clip}.table__header{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator)}@supports (color:color-mix(in lab,red,red)){.table__header{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__header{background-color:var(--surface-secondary)}.table__column{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);position:relative}.table__column:after{content:"";pointer-events:none;height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .5);background-color:var(--separator);inset-inline-end:calc(var(--spacing) * 0);position:absolute;top:50%}.table__column:last-child:not(:only-child):after{content:none}.table__column[data-allows-sorting=true]{cursor:var(--cursor-interactive)}@media(hover:hover){.table__column[data-allows-sorting=true]:hover,.table__column[data-allows-sorting=true][data-hovered=true]{color:var(--foreground)}}.table__column:focus-visible,.table__column[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}[role=row]>[role=presentation]:last-of-type:not(:only-of-type)>.table__column:after{content:none}.table__sortable-column-header{justify-content:space-between;align-items:center;display:flex}.table__sortable-column-indicator{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out)}.table__sortable-column-indicator[data-direction=descending]{rotate:180deg}.table__body tr:first-child td:first-child{border-start-start-radius:min(32px,var(--radius-2xl))}.table__body tr:first-child td:last-child{border-start-end-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:first-child{border-end-start-radius:min(32px,var(--radius-2xl))}.table__body tr:last-child td:last-child{border-end-end-radius:min(32px,var(--radius-2xl))}.table__body:not(tbody){border-radius:min(32px,var(--radius-2xl));height:100%;position:relative;overflow:clip}.table__row{border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator);height:100%;position:relative}@supports (color:color-mix(in lab,red,red)){.table__row{border-color:color-mix(in oklab,var(--separator) 50%,transparent)}}.table__row:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row:hover .table__cell,.table__row[data-hovered=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 40%,transparent)}}}.table__row[data-selected=true] .table__cell{background-color:var(--surface)}@supports (color:color-mix(in lab,red,red)){.table__row[data-selected=true] .table__cell{background-color:color-mix(in oklab,var(--surface) 10%,transparent)}}.table__row[aria-disabled=true],.table__row[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.table__row:focus-visible,.table__row[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.table__row[data-dragging=true]{opacity:.5}.table__row[data-drop-target=true] .table__cell{background-color:var(--accent-soft)}.table__cell{background-color:var(--surface);height:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);vertical-align:middle;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground);border-bottom-style:var(--tw-border-style);border-bottom-width:1px;border-color:var(--separator-tertiary)}@supports (color:color-mix(in lab,red,red)){.table__cell{border-color:color-mix(in oklab,var(--separator-tertiary) 50%,transparent)}}.table__cell:focus-visible,.table__cell[data-focus-visible=true]{border-radius:calc(var(--radius) * 1);--tw-outline-style:none;box-shadow:inset 0 0 0 2px var(--focus);outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true]) :is(.table__cell,.table__column){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):only-child,.table__row:is(:focus-visible,[data-focus-visible=true])>:only-child :is(.table__cell,.table__column){border-radius:calc(var(--radius) * 1);--tw-shadow:inset 0 0 0 2px var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):first-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:first-child:not(:only-child) :is(.table__cell,.table__column){border-top-left-radius:calc(var(--radius) * 1);border-bottom-left-radius:calc(var(--radius) * 1);--tw-shadow:inset 2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):last-child:not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:last-child:not(:only-child) :is(.table__cell,.table__column){border-top-right-radius:calc(var(--radius) * 1);border-bottom-right-radius:calc(var(--radius) * 1);--tw-shadow:inset -2px 0 0 0 var(--tw-shadow-color,var(--focus)), inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__row:is(:focus-visible,[data-focus-visible=true])>:is(.table__cell,.table__column):not(:first-child):not(:last-child):not(:only-child),.table__row:is(:focus-visible,[data-focus-visible=true])>:not(:first-child):not(:last-child):not(:only-child) :is(.table__cell,.table__column){--tw-shadow:inset 0 2px 0 0 var(--tw-shadow-color,var(--focus)), inset 0 -2px 0 0 var(--tw-shadow-color,var(--focus));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;outline-style:none}.table__cell[data-tree-column]{padding-inline-start:calc(1rem * var(--table-row-level,1))}.table__footer{padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 2.5);align-items:center;display:flex}.table__resizable-container{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);scrollbar-gutter:auto;position:relative;overflow:auto}.table__column-resizer{height:calc(var(--spacing) * 4);--tw-translate-y: -50% ;border-radius:calc(var(--radius) * .5);background-color:var(--separator);box-sizing:content-box;--tw-translate-x: 50% ;width:1px;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:col-resize;touch-action:none;padding-inline:calc(var(--spacing) * 2);--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-clip:content-box;border-style:none;outline-style:none;position:absolute;top:50%}.table__column-resizer[data-hovered=true],.table__column-resizer:hover,.table__column-resizer[data-resizing=true]{height:100%;width:calc(var(--spacing) * .5);background-color:var(--accent)}.table__column-resizer[data-focus-visible=true],.table__column-resizer:focus-visible{height:100%;width:calc(var(--spacing) * .5);background-color:var(--focus)}.table__column:has(.table__column-resizer):after{content:none}.table__load-more td,.table__load-more [role=rowheader]{padding-block:calc(var(--spacing) * 3);text-align:center}:is(.table__load-more td,.table__load-more [role=rowheader])>*{margin-inline:auto}.table__load-more-content{justify-content:center;align-items:center;gap:calc(var(--spacing) * 2);padding-block:calc(var(--spacing) * 2);display:flex}.alert{justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 4);background-color:var(--surface);width:100%;padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex}.alert__content{flex-direction:column;flex-grow:1;align-items:flex-start;height:100%;display:flex}.alert__indicator{padding:var(--spacing);-webkit-user-select:none;user-select:none;justify-content:center;align-items:center;display:flex}.alert__indicator [data-slot=alert-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.alert__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.alert__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.alert--default .alert__indicator,.alert--default .alert__title{color:var(--foreground)}.alert--accent .alert__indicator,.alert--accent .alert__title{color:var(--accent-soft-foreground)}.alert--success .alert__indicator,.alert--success .alert__title{color:var(--success-soft-foreground)}.alert--warning .alert__indicator,.alert--warning .alert__title{color:var(--warning-soft-foreground)}.alert--danger .alert__indicator,.alert--danger .alert__title{color:var(--danger-soft-foreground)}.empty-state{padding:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.skeleton{pointer-events:none;border-radius:calc(var(--radius) * .5);background-color:var(--surface-tertiary);position:relative;overflow:hidden}@supports (color:color-mix(in lab,red,red)){.skeleton{background-color:color-mix(in oklab,var(--surface-tertiary) 70%,transparent)}}.skeleton--shimmer:after{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-gradient-position:to right;animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}@supports (background-image:linear-gradient(in lab,red,red)){.skeleton--shimmer:after{--tw-gradient-position:to right in oklab}}.skeleton--shimmer:after{background-image:linear-gradient(var(--tw-gradient-stops));--tw-gradient-from:transparent;--tw-gradient-via:var(--surface-tertiary);--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));--tw-gradient-to:transparent;--tw-content:"";content:var(--tw-content)}.skeleton--shimmer:has(.skeleton):after{content:none}.skeleton--shimmer:has(.skeleton):before{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y);--tw-content:"";content:var(--tw-content);z-index:10;pointer-events:none;mix-blend-mode:overlay;background:linear-gradient(90deg,#0000,#ffffff80,#0000);animation:2s linear infinite skeleton;position:absolute;top:0;right:0;bottom:0;left:0}.skeleton--shimmer:has(.skeleton) .skeleton:after{content:none}.skeleton--pulse{animation:var(--animate-pulse)}.meter{gap:var(--spacing);--meter-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.meter [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.meter .meter__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.meter .meter__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.meter .meter__fill{border-radius:calc(var(--radius) * .5);background-color:var(--meter-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.meter .meter__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.meter .meter__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.meter:disabled,.meter[data-disabled=true],.meter[aria-disabled=true]) [data-slot=label]{opacity:1}.meter--sm .meter__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.meter--sm .meter__fill{border-radius:calc(var(--radius) * .25)}.meter--lg .meter__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.meter--lg .meter__fill{border-radius:calc(var(--radius) * .75)}.meter--default{--meter-fill:var(--default-foreground)}.meter--accent{--meter-fill:var(--accent)}.meter--success{--meter-fill:var(--success)}.meter--warning{--meter-fill:var(--warning)}.meter--danger{--meter-fill:var(--danger)}.progress-bar{gap:var(--spacing);--progress-bar-fill:var(--accent);grid-template-columns:1fr auto;grid-template-areas:"label output""track track";width:100%;display:grid}.progress-bar [data-slot=label]{width:fit-content;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);grid-area:label}.progress-bar .progress-bar__output{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);grid-area:output}.progress-bar .progress-bar__track{border-radius:calc(var(--radius) * .5);background-color:var(--default);height:calc(var(--spacing) * 2);grid-area:track;position:relative;overflow:hidden}.progress-bar .progress-bar__fill{border-radius:calc(var(--radius) * .5);background-color:var(--progress-bar-fill);height:100%;transition:width .3s var(--ease-out);position:absolute;top:0;left:0}.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-bar:not([aria-valuenow]) .progress-bar__fill{width:40%;animation:1.5s cubic-bezier(.65,0,.35,1) infinite progress-bar-indeterminate}.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-bar:not([aria-valuenow]) .progress-bar__fill:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.progress-bar:disabled,.progress-bar[data-disabled=true],.progress-bar[aria-disabled=true]) [data-slot=label]{opacity:1}@keyframes progress-bar-indeterminate{0%{transform:translate(-100%)}to{transform:translate(350%)}}.progress-bar--sm .progress-bar__track{height:var(--spacing);border-radius:calc(var(--radius) * .25)}.progress-bar--sm .progress-bar__fill{border-radius:calc(var(--radius) * .25)}.progress-bar--lg .progress-bar__track{height:calc(var(--spacing) * 3);border-radius:calc(var(--radius) * .75)}.progress-bar--lg .progress-bar__fill{border-radius:calc(var(--radius) * .75)}.progress-bar--default{--progress-bar-fill:var(--default-foreground)}.progress-bar--accent{--progress-bar-fill:var(--accent)}.progress-bar--success{--progress-bar-fill:var(--success)}.progress-bar--warning{--progress-bar-fill:var(--warning)}.progress-bar--danger{--progress-bar-fill:var(--danger)}.progress-circle{--progress-circle-stroke:var(--accent);--progress-circle-track-stroke:var(--default);justify-content:center;align-items:center;display:inline-flex}.progress-circle .progress-circle__track{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.progress-circle .progress-circle__track-circle{stroke:var(--progress-circle-track-stroke)}.progress-circle .progress-circle__fill-circle{stroke:var(--progress-circle-stroke);transition:stroke-dashoffset .3s var(--ease-out)}.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle .progress-circle__fill-circle:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle .progress-circle__fill-circle:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.progress-circle:not([aria-valuenow]) .progress-circle__track{animation:1s linear infinite progress-circle-spin}.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *),.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.progress-circle:not([aria-valuenow]) .progress-circle__track:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.progress-circle:disabled,.progress-circle[data-disabled=true],.progress-circle[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}@keyframes progress-circle-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.progress-circle--sm .progress-circle__track{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.progress-circle--lg .progress-circle__track{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.progress-circle--default{--progress-circle-stroke:var(--default-foreground)}.progress-circle--accent{--progress-circle-stroke:var(--accent)}.progress-circle--success{--progress-circle-stroke:var(--success)}.progress-circle--warning{--progress-circle-stroke:var(--warning)}.progress-circle--danger{--progress-circle-stroke:var(--danger)}.spinner{pointer-events:none;width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);flex-shrink:0;animation:.75s linear infinite spin;display:inline-flex}.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *),.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.spinner:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.spinner:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.spinner--sm{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.spinner--lg{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.spinner--xl{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.spinner--current{color:inherit}.spinner--accent{color:var(--accent)}.spinner--danger{color:var(--danger)}.spinner--success{color:var(--success)}.spinner--warning{color:var(--warning)}.toast-region{pointer-events:none;z-index:50;--tw-outline-style:none;outline-style:none;width:calc(100vw - 2rem);position:fixed}@media(min-width:40rem){.toast-region{width:auto;min-width:var(--toast-width)}}.toast-region{display:block}.toast-region--bottom{bottom:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--bottom-start{bottom:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--bottom-end{right:calc(var(--spacing) * 4);bottom:calc(var(--spacing) * 4)}.toast-region--top{top:calc(var(--spacing) * 4);--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y);left:50%}.toast-region--top-start{top:calc(var(--spacing) * 4);left:calc(var(--spacing) * 4)}.toast-region--top-end{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4)}.toast-region:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast{pointer-events:auto;justify-content:flex-start;align-items:flex-start;gap:calc(var(--spacing) * 1.5);background-color:var(--surface);padding-inline:calc(var(--spacing) * 4);padding-block:calc(var(--spacing) * 3);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:row;display:flex;position:absolute;left:0;right:0}.toast--bottom,.toast--bottom-start,.toast--bottom-end{bottom:0}.toast--top,.toast--top-start,.toast--top-end{top:0}.toast:not([data-frontmost=true]){pointer-events:none;height:var(--front-height);overflow:hidden}.toast:not([data-frontmost=true]) .toast__close-button{pointer-events:none;opacity:0;outline:none}.toast[data-hidden=true]{pointer-events:none;opacity:0;display:flex}.toast:focus-visible{outline-style:var(--tw-outline-style);outline-offset:2px;outline-width:2px;outline-color:var(--focus)}.toast--bottom,.toast--bottom-start,.toast--bottom-end{view-transition-class:toast-bottom}.toast--top,.toast--top-start,.toast--top-end{view-transition-class:toast-top}.toast__content{flex-direction:column;flex-grow:1;align-self:center;align-items:flex-start;height:100%;display:flex}.toast__indicator{padding:var(--spacing);color:var(--overlay-foreground);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.toast__indicator [data-slot=toast-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__indicator [data-slot=spinner],.toast__indicator [data-slot=spinner-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.toast__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--overlay-foreground)}.toast__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--muted)}.toast__close-button{pointer-events:none;top:calc(var(--spacing) * -1);right:calc(var(--spacing) * -1);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);border-color:var(--border);background-color:var(--default);opacity:0;position:absolute}@media(min-width:40rem){.toast__close-button{border-style:var(--tw-border-style);background-color:var(--overlay);border-width:1px}}.toast__close-button{transition:opacity .15s var(--ease-smooth)}.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.toast__close-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.toast__close-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(min-width:40rem){.toast__close-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}}@media(hover:hover){.toast__close-button:hover,.toast__close-button[data-hovered=true]{background-color:var(--default)}}.toast[data-frontmost=true]:hover .toast__close-button{pointer-events:auto;opacity:1}.toast__action{margin-top:calc(var(--spacing) * 2)}@media(min-width:40rem){.toast__action{margin-top:0}}.toast--accent .toast__title{color:var(--accent-soft-foreground)}.toast--success .toast__title,.toast--success .toast__indicator{color:var(--success-soft-foreground)}.toast--warning .toast__title,.toast--warning .toast__indicator{color:var(--warning-soft-foreground)}.toast--danger .toast__title,.toast--danger .toast__indicator{color:var(--danger-soft-foreground)}::view-transition-old(*){will-change:translate,opacity}::view-transition-new(*){will-change:translate,opacity}::view-transition-new(.toast-bottom):only-child{animation:.35s toast-slide-bottom-in}::view-transition-old(.toast-bottom):only-child{animation:.35s forwards toast-slide-bottom-out}::view-transition-new(.toast-top):only-child{animation:.35s toast-slide-top-in}::view-transition-old(.toast-top):only-child{animation:.35s forwards toast-slide-top-out}@keyframes toast-slide-bottom-in{0%{opacity:0;translate:0 100%}}@keyframes toast-slide-bottom-out{to{opacity:0;translate:0 100%}}@keyframes toast-slide-top-in{0%{opacity:0;translate:0 -100%}}@keyframes toast-slide-top-out{to{opacity:0;translate:0 -100%}}.checkbox-group{flex-direction:column;display:flex}.checkbox-group [data-slot=checkbox]{margin-top:calc(var(--spacing) * 4)}.checkbox{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.checkbox>[data-slot=description],.checkbox>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.checkbox [data-slot=label]{-webkit-user-select:none;user-select:none}.checkbox .checkbox__content [data-slot=label]{cursor:var(--cursor-interactive)}.checkbox[data-disabled=true],.checkbox[data-disabled=true] [data-slot=description],.checkbox[data-disabled=true] [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.checkbox[data-selected=true],.checkbox[data-indeterminate=true]) .checkbox__indicator{border-color:var(--accent-foreground)}.checkbox [data-slot=checkbox-default-indicator--checkmark]{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5);stroke-width:2.5px;color:var(--accent-foreground);transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.2s;transition-duration:.2s}.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox [data-slot=checkbox-default-indicator--checkmark]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox[data-selected=true] [data-slot=checkbox-default-indicator--checkmark]{transition:stroke-dashoffset .15s linear 15ms}.checkbox[data-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[data-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][data-selected=true] [data-slot=checkbox-default-indicator--checkmark],.checkbox[aria-invalid=true][aria-checked=true] [data-slot=checkbox-default-indicator--checkmark]{color:var(--danger-foreground)}.checkbox[data-indeterminate=true] [data-slot=checkbox-default-indicator--indeterminate]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.checkbox[data-indeterminate=true][data-invalid=true] [data-slot=checkbox-default-indicator--indeterminate],.checkbox[data-indeterminate=true][aria-invalid=true] [data-slot=checkbox-default-indicator--indeterminate]{color:var(--danger-foreground)}.checkbox__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .75);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative;overflow:hidden}.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.checkbox__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.checkbox__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.checkbox__control{cursor:var(--cursor-interactive)}.checkbox__control:before{pointer-events:none;z-index:0;transform-origin:50%;--tw-scale-x:70%;--tw-scale-y:70%;--tw-scale-z:70%;scale:var(--tw-scale-x) var(--tw-scale-y);border-radius:calc(var(--radius) * .75);background-color:var(--accent);opacity:0;--tw-content:"";content:var(--tw-content);transition:scale .1s var(--ease-linear),opacity .2s var(--ease-linear),background-color .2s var(--ease-out);position:absolute;top:0;right:0;bottom:0;left:0}@media(prefers-reduced-motion:reduce){.checkbox__control:before:not(:is()){transition-property:none}}.checkbox:focus-visible .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-focus-visible=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-focus-visible=true] .checkbox__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control{border-color:var(--field-border-hover)}:is(.checkbox:hover .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-hovered=true]) .checkbox__control,.checkbox [data-slot=checkbox-content][data-hovered=true] .checkbox__control):before{background-color:var(--accent-hover)}.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control{color:var(--accent-foreground);border-color:#0000}:is(.checkbox[aria-checked=true] .checkbox__control,.checkbox[data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);opacity:1}.checkbox[data-indeterminate=true] .checkbox__control{background-color:var(--accent);color:var(--accent-foreground)}.checkbox:active[data-indeterminate=true] .checkbox__control,.checkbox[data-pressed=true][data-indeterminate=true] .checkbox__control,.checkbox:has([data-slot=checkbox-content][data-pressed=true])[data-indeterminate=true] .checkbox__control{background-color:var(--accent-hover)}.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-visible,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focused=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-visible=true],:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control):focus-within,:is(.checkbox[data-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control,.checkbox[aria-invalid=true]:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground);border-color:#0000}:is(.checkbox[data-invalid=true][aria-checked=true] .checkbox__control,.checkbox[data-invalid=true][data-selected=true] .checkbox__control,.checkbox[aria-invalid=true][aria-checked=true] .checkbox__control,.checkbox[aria-invalid=true][data-selected=true] .checkbox__control):before{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y);background-color:var(--danger);opacity:1}.checkbox[data-indeterminate=true][aria-invalid=true] .checkbox__control,.checkbox[data-indeterminate=true][data-invalid=true] .checkbox__control{background-color:var(--danger);color:var(--danger-foreground)}.checkbox__indicator{z-index:10;width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3);justify-content:center;align-items:center;display:flex;position:relative}.checkbox__indicator svg{width:100%;height:100%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.checkbox--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.checkbox--secondary .checkbox__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--checkbox-control-bg);--checkbox-control-bg:var(--default)}.checkbox:hover :is(.checkbox--secondary .checkbox__control),.checkbox:has([data-slot=checkbox-content][data-hovered=true]) :is(.checkbox--secondary .checkbox__control),.checkbox [data-slot=checkbox-content][data-hovered=true] :is(.checkbox--secondary .checkbox__control){border-color:var(--field-border-hover)}.checkbox__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.checkbox--secondary:not([aria-checked=true]):not([data-selected=true]):not([data-indeterminate=true]) .checkbox__control{background-color:var(--checkbox-control-bg)}:is(.checkbox--secondary[aria-checked=true] .checkbox__control,.checkbox--secondary[data-selected=true] .checkbox__control):before,.checkbox--secondary[data-indeterminate=true] .checkbox__control,.checkbox--secondary[data-indeterminate=true] .checkbox__control:before{background-color:var(--accent)}.fieldset{gap:calc(var(--spacing) * 6);flex-direction:column;flex:1 1 0;display:flex}.fieldset__legend{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.fieldset__field_group{width:100%}:where(.fieldset__field_group>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.fieldset__actions{align-items:center;gap:calc(var(--spacing) * 2);padding-top:var(--spacing);display:flex}.input-otp{align-items:center;gap:calc(var(--spacing) * 2);display:flex;position:relative}.input-otp[data-disabled=true]{cursor:not-allowed;opacity:.5}.input-otp__group{align-items:center;gap:calc(var(--spacing) * 2);display:flex}.input-otp__slot{height:calc(var(--spacing) * 10);width:calc(var(--spacing) * 9.5);border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:var(--field-radius,calc(var(--radius) * 1.5));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;flex:1;justify-content:center;align-items:center;display:flex;position:relative}.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-otp__slot:hover,.input-otp__slot[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-otp__slot[data-active=true]{z-index:10;background-color:var(--field-focus);--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.input-otp__slot[data-filled=true]{background-color:var(--field-focus)}.input-otp__slot[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input-otp__slot[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-otp__slot[data-invalid=true]:focus,.input-otp__slot[data-invalid=true]:focus-visible,.input-otp__slot[data-invalid=true][data-focused=true],.input-otp__slot[data-invalid=true][data-focus-visible=true],.input-otp__slot[data-invalid=true]:focus-within,.input-otp__slot[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-otp__slot[data-invalid=true]{background-color:var(--field-focus)}.input-otp__slot-value{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-tracking:-.27px;letter-spacing:-.27px;animation:slot-value-in .25s var(--ease-smooth) both;transform-origin:bottom}.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-otp__slot-value:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-otp__slot-value:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.input-otp__caret{height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * .5);background-color:var(--field-placeholder,var(--muted));width:2px;animation:1.2s ease-out infinite caret-blink;position:absolute}.input-otp__separator{border-radius:calc(var(--radius) * .5);background-color:var(--separator);flex-shrink:0;width:6px;height:2px}.input-otp--secondary .input-otp__slot{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-otp-slot-bg);--input-otp-slot-bg:var(--default);--input-otp-slot-bg-hover:var(--default-hover);--input-otp-slot-bg-focus:var(--default)}@media(hover:hover){.input-otp--secondary .input-otp__slot:hover,.input-otp--secondary .input-otp__slot[data-hovered=true]{background-color:var(--input-otp-slot-bg-hover)}}.input-otp--secondary .input-otp__slot[data-active=true],.input-otp--secondary .input-otp__slot[data-filled=true]{background-color:var(--input-otp-slot-bg-focus)}@keyframes slot-value-in{0%{opacity:0;transform:translateY(8px)scale(.8)}to{opacity:1;transform:translateY(0)scale(1)}}.input{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input{border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input:hover:not(:focus):not(:focus-visible),.input[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input:focus,.input[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input[data-invalid=true]:focus,.input[data-invalid=true]:focus-visible,.input[data-invalid=true][data-focused=true],.input[data-invalid=true][data-focus-visible=true],.input[data-invalid=true]:focus-within,.input[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input[data-invalid=true]{background-color:var(--field-focus)}.input:disabled,.input[data-disabled=true],.input[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.input--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-bg);--input-bg:var(--default);--input-bg-hover:var(--default-hover);--input-bg-focus:var(--default)}@media(hover:hover){.input--secondary:hover:not(:focus):not(:focus-visible),.input--secondary[data-hovered=true]:not([data-focus-visible=true]):not([data-focused=true]){background-color:var(--input-bg-hover)}}.input--secondary:focus,.input--secondary[data-focused=true]{background-color:var(--input-bg-focus)}.input--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input--secondary[data-invalid=true]:focus,.input--secondary[data-invalid=true]:focus-visible,.input--secondary[data-invalid=true][data-focused=true],.input--secondary[data-invalid=true][data-focus-visible=true],.input--secondary[data-invalid=true]:focus-within,.input--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input--secondary[data-invalid=true]{background-color:var(--input-bg-focus)}.input--full-width{width:100%}.input-group{min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);outline-style:none;align-items:center;display:inline-flex}.input-group:has([data-slot=input-group-textarea]){align-items:flex-start;height:auto}.input-group{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.input-group:hover:not(:focus-within),.input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.input-group:has([data-slot=input-group-input]:focus),.input-group:has([data-slot=input-group-textarea]:focus){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group[data-invalid=true]:focus,.input-group[data-invalid=true]:focus-visible,.input-group[data-invalid=true][data-focused=true],.input-group[data-invalid=true][data-focus-visible=true],.input-group[data-invalid=true]:focus-within,.input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.input-group[data-disabled=true],.input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.input-group:has([data-slot=input-group-input]:-webkit-autofill),.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.input-group:has([data-slot=input-group-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.input-group__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}.input-group__input::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.input-group:has([data-slot=input-group-prefix]) .input-group__input{border-top-left-radius:0;border-bottom-left-radius:0;padding-left:0}.input-group:has([data-slot=input-group-suffix]) .input-group__input{border-top-right-radius:0;border-bottom-right-radius:0;padding-right:0}.input-group__input:focus,.input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.input-group__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.input-group__input[data-slot=input-group-textarea]{resize:vertical;min-height:38px}.input-group__prefix{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-right-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-left:none;border-top-right-radius:0;border-bottom-right-radius:0;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__prefix{align-items:flex-start;padding-top:.5rem}.input-group__prefix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__prefix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__prefix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group__suffix{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));height:100%;padding-inline:calc(var(--spacing) * 3);color:var(--field-placeholder,var(--muted));border-width:var(--border-width-field);border-color:var(--field-border);border-style:solid;border-left-color:var(--field-border);background-color:#0000;border-top:none;border-bottom:none;border-right:none;justify-content:center;align-items:center;display:flex}.input-group:has([data-slot=input-group-textarea]) .input-group__suffix{align-items:flex-start;padding-top:.5rem}.input-group__suffix{transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth)}.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *),.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.input-group__suffix:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.input-group__suffix:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--input-group-bg);--input-group-bg:var(--default);--input-group-bg-hover:var(--default-hover);--input-group-bg-focus:var(--default)}@media(hover:hover){.input-group--secondary:hover:not(:focus-within),.input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--input-group-bg-hover)}}.input-group--secondary:has([data-slot=input-group-input]:focus),.input-group--secondary:has([data-slot=input-group-textarea]:focus){background-color:var(--input-group-bg-focus)}.input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.input-group--secondary[data-invalid=true]:focus,.input-group--secondary[data-invalid=true]:focus-visible,.input-group--secondary[data-invalid=true][data-focused=true],.input-group--secondary[data-invalid=true][data-focus-visible=true],.input-group--secondary[data-invalid=true]:focus-within,.input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--input-group-bg-focus)}.input-group--secondary [data-slot=input-group-input],.input-group--secondary [data-slot=input-group-textarea]{background-color:#0000}.input-group--full-width{width:100%}.number-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.number-field[data-invalid=true],.number-field[aria-invalid=true]) [data-slot=description]{display:none}.number-field [data-slot=label]{width:fit-content}.number-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;grid-template-columns:40px 1fr 40px;align-items:center;display:grid;overflow:hidden}.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.number-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.number-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.number-field__group:hover:not(:focus-within),.number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.number-field__group[data-focus-within=true],.number-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field__group[data-invalid=true]:focus,.number-field__group[data-invalid=true]:focus-visible,.number-field__group[data-invalid=true][data-focused=true],.number-field__group[data-invalid=true][data-focus-visible=true],.number-field__group[data-invalid=true]:focus-within,.number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.number-field__group[data-disabled=true],.number-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.number-field__group:has([data-slot=number-field-input]:-webkit-autofill),.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.number-field__group:has([data-slot=number-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.number-field__input{border-style:var(--tw-border-style);min-width:0;padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,);--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none}@media(min-width:40rem){.number-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.number-field__group:has([slot=decrement]) .number-field__input{border-top-left-radius:0;border-bottom-left-radius:0}.number-field__group:has([slot=increment]) .number-field__input{border-top-right-radius:0;border-bottom-right-radius:0}.number-field__input:focus,.number-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.number-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.number-field__increment-button,.number-field__decrement-button{height:100%;width:calc(var(--spacing) * 10);color:var(--field-foreground,var(--foreground));--tw-outline-style:none;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth);background-color:#0000;border-style:solid;border-radius:0;outline-style:none;justify-content:center;align-items:center;display:flex}:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.number-field__increment-button,.number-field__decrement-button):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.number-field__increment-button,.number-field__decrement-button):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.number-field__increment-button,.number-field__decrement-button{cursor:var(--cursor-interactive)}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:var(--field-foreground,var(--foreground))}@supports (color:color-mix(in lab,red,red)){:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{background-color:color-mix(in oklab,var(--field-foreground,var(--foreground)) 10%,transparent)}}:is(.number-field__increment-button,.number-field__decrement-button):active,:is(.number-field__increment-button,.number-field__decrement-button)[data-pressed=true]{transform:scale(.97)}:is(.number-field__increment-button,.number-field__decrement-button):disabled,:is(.number-field__increment-button,.number-field__decrement-button)[data-disabled=true],:is(.number-field__increment-button,.number-field__decrement-button)[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-increment-button-icon],:is(.number-field__increment-button,.number-field__decrement-button) [data-slot=number-field-decrement-button-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.number-field__increment-button{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-right-radius:var(--field-radius,calc(var(--radius) * 1.5));border-left-style:var(--tw-border-style);border-left-width:1px;border-color:var(--field-placeholder,var(--muted))}@supports (color:color-mix(in lab,red,red)){.number-field__increment-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field__decrement-button{border-top-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-bottom-left-radius:var(--field-radius,calc(var(--radius) * 1.5));border-right-style:var(--tw-border-style);border-right-width:1px;border-color:var(--field-placeholder,var(--muted));border-top-right-radius:0;border-bottom-right-radius:0}@supports (color:color-mix(in lab,red,red)){.number-field__decrement-button{border-color:color-mix(in oklab,var(--field-placeholder,var(--muted)) 15%,transparent)}}.number-field--secondary .number-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--number-field-group-bg);--number-field-group-bg:var(--default);--number-field-group-bg-hover:var(--default-hover);--number-field-group-bg-focus:var(--default)}@media(hover:hover){.number-field--secondary .number-field__group:hover:not(:focus-within),.number-field--secondary .number-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--number-field-group-bg-hover)}}.number-field--secondary .number-field__group:focus-within,.number-field--secondary .number-field__group[data-focus-within=true]{background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.number-field--secondary .number-field__group[data-invalid=true]:focus,.number-field--secondary .number-field__group[data-invalid=true]:focus-visible,.number-field--secondary .number-field__group[data-invalid=true][data-focused=true],.number-field--secondary .number-field__group[data-invalid=true][data-focus-visible=true],.number-field--secondary .number-field__group[data-invalid=true]:focus-within,.number-field--secondary .number-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.number-field--secondary .number-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--number-field-group-bg-focus)}.number-field--secondary .number-field__group [data-slot=number-field-input]{background-color:#0000}.number-field--full-width,.number-field__group--full-width{width:100%}.radio-group{flex-direction:column;display:flex}.radio-group[data-orientation=vertical] [data-slot=radio]{margin-top:calc(var(--spacing) * 4)}.radio-group[data-orientation=horizontal]{gap:calc(var(--spacing) * 4);flex-flow:wrap}.radio-group--secondary .radio__control{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--radio-control-bg);--radio-control-bg:var(--default);--radio-control-bg-hover:var(--default-hover)}.radio:has([data-slot=radio-content][data-hovered=true]) :is(.radio-group--secondary .radio__control),.radio [data-slot=radio-content][data-hovered=true] :is(.radio-group--secondary .radio__control){border-color:var(--field-border-hover)}.radio:not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) :is(.radio-group--secondary .radio__control) .radio__indicator:empty:before{background-color:var(--radio-control-bg-hover)}.radio{align-items:flex-start;gap:var(--spacing);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);outline-style:none;flex-direction:column;display:flex}.radio [data-slot=label]{-webkit-user-select:none;user-select:none}.radio .radio__content [data-slot=label]{cursor:var(--cursor-interactive)}.radio>[data-slot=description],.radio>[data-slot=field-error]{cursor:default;width:100%;min-width:0;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));text-wrap:wrap;overflow-wrap:break-word;color:var(--muted);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--spacing) * 7)}.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=description],:is(.radio:disabled,.radio[data-disabled=true],.radio[aria-disabled=true]) [data-slot=field-error]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.radio__content{cursor:inherit;align-items:center;gap:calc(var(--spacing) * 3);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;outline-style:none;display:inline-flex}.radio__control{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1);border-style:var(--tw-border-style);border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border,var(--border));background-color:var(--field-background,var(--default));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;transition:background-color .2s var(--ease-out),border-color .2s var(--ease-out),transform .1s var(--ease-out);outline-style:none;flex-shrink:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *),.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.radio__control:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.radio__control:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.radio__control{cursor:var(--cursor-interactive)}.radio:has([data-slot=radio-content][data-focus-visible=true]) .radio__control,.radio [data-slot=radio-content][data-focus-visible=true] .radio__control{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.radio:has([data-slot=radio-content][data-hovered=true]) .radio__control,.radio [data-slot=radio-content][data-hovered=true] .radio__control{border-color:var(--field-border-hover)}.radio:has([data-slot=radio-content][data-hovered=true]):not([data-selected]):not(:has(input:checked)) .radio__control .radio__indicator:empty:before{background-color:var(--field-hover)}.radio:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio [data-slot=radio-content][data-pressed=true] .radio__control{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.radio[data-selected] .radio__control,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__control,.radio:has(input:checked) .radio__control{background-color:var(--accent);border-color:#0000}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__control,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__control,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__control{background-color:var(--accent-hover)}.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-visible,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focused=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control):focus-within,:is(.radio[data-invalid=true] .radio__control,.radio[aria-invalid=true] .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-visible,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focused=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-visible=true],:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control):focus-within,:is(.radio[data-invalid=true][data-selected] .radio__control,.radio[aria-invalid=true][data-selected] .radio__control,.radio[data-invalid=true]:has(input:checked) .radio__control,.radio[aria-invalid=true]:has(input:checked) .radio__control)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.radio__indicator{pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;top:0;right:0;bottom:0;left:0}.radio__indicator:empty:before{content:"";border-radius:calc(var(--radius) * 1);background-color:var(--field-background,var(--default));width:100%;height:100%;transition:scale .2s var(--ease-out),background-color .2s var(--ease-out);scale:1}@media(prefers-reduced-motion:reduce){.radio__indicator:empty:before:not(:is()){transition-property:none}}.radio[data-selected] .radio__indicator:empty:before,.radio:has([data-slot=radio-content][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked) .radio__indicator:empty:before{background-color:var(--accent-foreground);scale:.4286}.radio[data-selected]:has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before,.radio:has([data-slot=radio-content][data-pressed=true][aria-checked=true]) .radio__indicator:empty:before,.radio:has(input:checked):has([data-slot=radio-content][data-pressed=true]) .radio__indicator:empty:before{scale:.5714}.radio--disabled{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textfield{gap:var(--spacing);flex-direction:column;display:flex}:is(.textfield[data-invalid=true],.textfield[aria-invalid=true]) [data-slot=description]{display:none}.textfield--full-width,.textfield--full-width [data-slot=input],.textfield--full-width [data-slot=textarea]{width:100%}.search-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.search-field[data-invalid=true],.search-field[aria-invalid=true]) [data-slot=description]{display:none}.search-field [data-slot=label]{width:fit-content}.search-field[data-empty=true] [data-slot=search-field-clear-button]{pointer-events:none;opacity:0}.search-field__group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;position:relative;overflow:hidden}.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.search-field__group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.search-field__group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.search-field__group:hover:not(:focus-within),.search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.search-field__group[data-focus-within=true],.search-field__group:focus-within{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field__group[data-invalid=true]:focus,.search-field__group[data-invalid=true]:focus-visible,.search-field__group[data-invalid=true][data-focused=true],.search-field__group[data-invalid=true][data-focus-visible=true],.search-field__group[data-invalid=true]:focus-within,.search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field__group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.search-field__group[data-disabled=true],.search-field__group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}:-webkit-any(.search-field__group:has([data-slot=search-field-input]:-webkit-autofill),.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}:is(.search-field__group:has([data-slot=search-field-input]:autofill)){background-color:var(--field-focus);border-color:var(--field-border-focus)}.search-field__input{border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1}@media(min-width:40rem){.search-field__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.search-field__input::-webkit-search-cancel-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__input::-webkit-search-decoration{-webkit-appearance:none;-moz-appearance:none;appearance:none}.search-field__group:has([data-slot=search-field-search-icon]) .search-field__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.search-field__group:has([slot=clear]) .search-field__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.search-field__input:focus,.search-field__input:focus-visible{--tw-outline-style:none;outline-style:none}.search-field__input:-webkit-autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:hover{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:focus{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:-webkit-autofill:active{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__input:autofill{-webkit-text-fill-color:var(--field-foreground);caret-color:var(--field-foreground);transition:background-color 9999s ease-in-out;box-shadow:inset 0 0 0 1000px #0000}.search-field__search-icon{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);flex-shrink:0}.search-field__clear-button{margin-right:calc(var(--spacing) * 2);width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);flex-shrink:0}.search-field__clear-button [data-slot=close-button-icon]{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.search-field--secondary .search-field__group{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--search-field-group-bg);--search-field-group-bg:var(--default);--search-field-group-bg-hover:var(--default-hover);--search-field-group-bg-focus:var(--default)}@media(hover:hover){.search-field--secondary .search-field__group:hover:not(:focus-within),.search-field--secondary .search-field__group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--search-field-group-bg-hover)}}.search-field--secondary .search-field__group:focus-within,.search-field--secondary .search-field__group[data-focus-within=true]{background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.search-field--secondary .search-field__group[data-invalid=true]:focus,.search-field--secondary .search-field__group[data-invalid=true]:focus-visible,.search-field--secondary .search-field__group[data-invalid=true][data-focused=true],.search-field--secondary .search-field__group[data-invalid=true][data-focus-visible=true],.search-field--secondary .search-field__group[data-invalid=true]:focus-within,.search-field--secondary .search-field__group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.search-field--secondary .search-field__group[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--search-field-group-bg-focus)}.search-field--secondary .search-field__group [data-slot=search-field-input]{background-color:#0000}.search-field--full-width,.search-field__group--full-width{width:100%}.textarea{border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;outline-style:none}.textarea::placeholder{color:var(--field-placeholder,var(--muted))}@media(min-width:40rem){.textarea{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.textarea{border-width:var(--border-width-field);border-color:var(--field-border);min-height:38px;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out)}.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *),.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.textarea:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.textarea:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.textarea:hover:not(:focus):not(:focus-visible),.textarea[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.textarea:focus,.textarea[data-focused=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.textarea[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea[data-invalid=true]:focus,.textarea[data-invalid=true]:focus-visible,.textarea[data-invalid=true][data-focused=true],.textarea[data-invalid=true][data-focus-visible=true],.textarea[data-invalid=true]:focus-within,.textarea[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea[data-invalid=true]{background-color:var(--field-focus)}.textarea:disabled,.textarea[data-disabled=true],.textarea[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.textarea--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--textarea-bg);--textarea-bg:var(--default);--textarea-bg-hover:var(--default-hover);--textarea-bg-focus:var(--default)}@media(hover:hover){.textarea--secondary:hover:not(:focus):not(:focus-visible),.textarea--secondary[data-hovered=true]:not([data-focused=true]):not([data-focus-visible=true]){background-color:var(--textarea-bg-hover)}}.textarea--secondary:focus,.textarea--secondary[data-focused=true]{background-color:var(--textarea-bg-focus)}.textarea--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.textarea--secondary[data-invalid=true]:focus,.textarea--secondary[data-invalid=true]:focus-visible,.textarea--secondary[data-invalid=true][data-focused=true],.textarea--secondary[data-invalid=true][data-focus-visible=true],.textarea--secondary[data-invalid=true]:focus-within,.textarea--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.textarea--secondary[data-invalid=true]{background-color:var(--textarea-bg-focus)}.textarea--full-width{width:100%}.calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.calendar--week-view .calendar__cell,.calendar--day-view .calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.calendar--day-view .calendar__grid{flex-direction:column;display:flex}.calendar--day-view .calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-header>tr{display:contents}.calendar--day-view .calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar--day-view .calendar__grid-body>tr{display:contents}.calendar--day-view .calendar__grid-body>tr:first-child>td{margin-top:0}.calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .calendar__nav-button{pointer-events:none;opacity:0}.calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 2);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.calendar__nav-button:hover,.calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.calendar__nav-button:active,.calendar__nav-button[data-pressed=true]{transform:scale(.95)}.calendar__nav-button:focus-visible,.calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__nav-button:disabled,.calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.calendar__grid[aria-readonly=true] .calendar__cell{pointer-events:none}.calendar__grid-header,.calendar__grid-header>tr,.calendar__grid-body,.calendar__grid-body>tr{display:contents}.calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.calendar__grid-row{display:contents}.calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.calendar__cell{aspect-ratio:1;border-radius:calc(var(--radius) * 3);text-align:center;width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-tap-highlight-color:transparent;will-change:scale;transition:transform .25s var(--ease-out),box-shadow .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:flex;position:relative}.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar__cell{cursor:var(--cursor-interactive)}.calendar__cell:focus-visible:not(:focus),.calendar__cell[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar__cell[data-today=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){.calendar__cell[data-today=true]:hover:not([data-selected=true]),.calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true]){background-color:var(--accent-soft-hover)}}.calendar__cell[data-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}.calendar__cell:active,.calendar__cell[data-pressed=true]{background-color:var(--default);transform:scale(.95)}:is(.calendar__cell:active,.calendar__cell[data-pressed=true])[data-selected=true]{background-color:var(--accent-hover)}@media(hover:hover){.calendar__cell:hover:not([data-selected=true]),.calendar__cell[data-hovered=true]:not([data-selected=true]){background-color:var(--default)}}.calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.calendar__cell[data-selected=true][data-outside-month=true]{background-color:var(--default)}.calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.calendar__cell:disabled:not([data-outside-month=true]),.calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.calendar__cell-indicator{background-color:var(--accent-foreground)}.range-calendar{width:calc(var(--spacing) * 63);max-width:calc(var(--spacing) * 63);container-type:inline-size}.range-calendar--week-view .range-calendar__cell,.range-calendar--day-view .range-calendar__cell{aspect-ratio:1;place-self:center;width:100%;height:auto}.range-calendar--day-view .range-calendar__grid{flex-direction:column;display:flex}.range-calendar--day-view .range-calendar__grid-header{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-header>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body{margin-top:var(--spacing);grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar--day-view .range-calendar__grid-body>tr{display:contents}.range-calendar--day-view .range-calendar__grid-body>tr:first-child>td{margin-top:0}.range-calendar__header{padding-inline:calc(var(--spacing) * .5);padding-bottom:calc(var(--spacing) * 4);justify-content:space-between;align-items:center;display:flex}.range-calendar__header:has(.calendar-year-picker__trigger[data-open=true]) .range-calendar__nav-button{pointer-events:none;opacity:0}.range-calendar__heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);flex:1}.range-calendar__nav-button{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6);border-radius:calc(var(--radius) * 1.5);color:var(--accent-soft-foreground);will-change:scale;transition:transform .25s var(--ease-out),background-color .1s var(--ease-out),box-shadow .1s var(--ease-out),opacity .15s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__nav-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__nav-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__nav-button{cursor:var(--cursor-interactive)}@media(hover:hover){.range-calendar__nav-button:hover,.range-calendar__nav-button[data-hovered=true]{background-color:var(--default);color:var(--accent-soft-foreground)}}.range-calendar__nav-button:active,.range-calendar__nav-button[data-pressed=true]{transform:scale(.95)}.range-calendar__nav-button:focus-visible,.range-calendar__nav-button[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__nav-button:disabled,.range-calendar__nav-button[data-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__nav-button-icon{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.range-calendar__grid{grid-template-columns:repeat(7,1fr);width:100%;display:grid}.range-calendar__grid[aria-readonly=true] .range-calendar__cell{pointer-events:none}.range-calendar__grid-header,.range-calendar__grid-header>tr,.range-calendar__grid-body,.range-calendar__grid-body>tr{display:contents}.range-calendar__grid-body>tr:first-child>td{margin-top:var(--spacing)}.range-calendar__grid-row{display:contents}.range-calendar__header-cell{padding-bottom:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted);justify-content:center;align-items:center;display:flex}.range-calendar__cell{z-index:1;border-radius:calc(var(--radius) * 3);--tw-outline-style:none;cursor:var(--cursor-interactive);will-change:background-color,border-color;transition:box-shadow .1s var(--ease-out),border-color .1s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;margin-block:2px;margin-inline:0;padding:0;position:relative}.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell .range-calendar__cell-button{aspect-ratio:1;border-radius:calc(var(--radius) * 3);width:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground);-webkit-tap-highlight-color:transparent;will-change:scale;transition:scale .2s var(--ease-out);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);justify-content:center;align-items:center;display:flex}.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *),.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.range-calendar__cell .range-calendar__cell-button:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.range-calendar__cell .range-calendar__cell-button:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]{z-index:2}:is(.range-calendar__cell:focus-visible:not(:focus),.range-calendar__cell[data-focus-visible=true]) .range-calendar__cell-button{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.range-calendar__cell[data-today=true] .range-calendar__cell-button{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}@media(hover:hover){:is(.range-calendar__cell[data-today=true]:hover:not([data-selected=true]),.range-calendar__cell[data-today=true][data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--accent-soft-hover)}}.range-calendar__cell[data-selected=true]:not([data-outside-month=true]){background-color:var(--accent-soft);border-radius:0}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*){border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:first-child>*,[aria-disabled]+td>*)[data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*){border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__cell[data-selected=true]:is(td:last-child>*,td:has(+[aria-disabled])>*)[data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){z-index:2}:is(.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]),.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true])) .range-calendar__cell-button{background-color:var(--accent);color:var(--accent-foreground)}.range-calendar__cell[data-selection-start=true]:not([data-outside-month=true]){border-top-left-radius:calc(var(--radius) * 3);border-bottom-left-radius:calc(var(--radius) * 3)}.range-calendar__cell[data-selection-end=true]:not([data-outside-month=true]){border-top-right-radius:calc(var(--radius) * 3);border-bottom-right-radius:calc(var(--radius) * 3)}:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true]) .range-calendar__cell-button{scale:.9}:is(:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-start=true],:is(.range-calendar__cell:active,.range-calendar__cell[data-pressed=true])[data-selection-end=true]) .range-calendar__cell-button{background-color:var(--accent-hover)}@media(hover:hover){:is(.range-calendar__cell:hover:not([data-selected=true]),.range-calendar__cell[data-hovered=true]:not([data-selected=true])) .range-calendar__cell-button{background-color:var(--default)}}.range-calendar__cell[data-outside-month=true]{color:var(--muted);opacity:.5}.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:var(--default)}@supports (color:color-mix(in lab,red,red)){.range-calendar__cell[data-selected=true][data-outside-month=true]:not([data-selection-start=true],[data-selection-end=true]){background-color:color-mix(in oklab,var(--default) 20%,transparent)}}.range-calendar__cell[data-unavailable=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.range-calendar__cell:disabled:not([data-outside-month=true]),.range-calendar__cell[data-disabled=true]:not([data-outside-month=true]){opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none;text-decoration:line-through}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true]{border-start-start-radius:calc(var(--radius) * 1);border-end-start-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-outside-month=true])+td>.range-calendar__cell[data-selected=true][data-selection-start=true]{border-start-start-radius:calc(var(--radius) * 3);border-end-start-radius:calc(var(--radius) * 3)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true]{border-start-end-radius:calc(var(--radius) * 1);border-end-end-radius:calc(var(--radius) * 1)}.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-outside-month=true],.range-calendar__grid-body td:has(>.range-calendar__cell[data-selected=true]):has(+td>.range-calendar__cell[data-outside-month=true])>.range-calendar__cell[data-selected=true][data-selection-end=true]{border-start-end-radius:calc(var(--radius) * 3);border-end-end-radius:calc(var(--radius) * 3)}.range-calendar__cell-indicator{bottom:var(--spacing);--tw-translate-x: -50% ;width:3px;height:3px;translate:var(--tw-translate-x) var(--tw-translate-y);border-radius:calc(var(--radius) * .25);background-color:var(--muted);position:absolute;left:50%}[data-selected=true]>.range-calendar__cell-indicator{background-color:var(--accent-foreground)}.calendar:has(.calendar-year-picker__year-grid),.range-calendar:has(.calendar-year-picker__year-grid){position:relative}.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]{will-change:opacity;transition:opacity .15s var(--ease-out),visibility 0s linear}:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid)>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid)>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]{pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s var(--ease-out),visibility 0s linear .15s}:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=calendar-grid],.range-calendar:has(.calendar-year-picker__year-grid[data-open=true])>[data-slot=range-calendar-grid]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger{justify-content:flex-start;align-items:center;gap:var(--spacing);border-radius:calc(var(--radius) * 1);--tw-outline-style:none;cursor:var(--cursor-interactive);touch-action:manipulation;outline-style:none;flex:1;display:flex}.calendar-year-picker__trigger:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.calendar-year-picker__trigger-heading{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);transition:color .15s var(--ease-out)}.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-heading:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-heading:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger-indicator{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));color:var(--accent-soft-foreground);transition:transform .15s var(--ease-out)}.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__trigger-indicator:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__trigger-indicator:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-indicator{transform:rotate(90deg)}.calendar-year-picker__trigger[data-open=true] .calendar-year-picker__trigger-heading{color:var(--accent-soft-foreground)}.calendar-year-picker__year-grid{pointer-events:none;scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);align-content:flex-start;gap:var(--spacing);padding:var(--spacing);opacity:0;will-change:opacity;grid-template-columns:repeat(3,1fr);display:grid;position:absolute;left:0;right:0;overflow-y:auto}.calendar-year-picker__year-grid[data-open=true]{pointer-events:auto;opacity:1;transition:opacity .2s var(--ease-out) 50ms}.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-grid[data-open=true]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-grid[data-open=true]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 3);padding-inline:calc(var(--spacing) * 2.5);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:color .1s var(--ease-smooth),scale .1s var(--ease-smooth),opacity .1s var(--ease-smooth),background-color .1s var(--ease-smooth),box-shadow .1s var(--ease-out);transform-origin:50%;transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);outline-style:none;justify-content:center;align-items:center;display:inline-flex;position:relative}.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *),.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.calendar-year-picker__year-cell:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.calendar-year-picker__year-cell:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.calendar-year-picker__year-cell{cursor:var(--cursor-interactive)}@media(hover:hover)and (pointer:fine){.calendar-year-picker__year-cell:is(:hover,[data-hovered=true]):not([data-selected=true]){background-color:var(--default);color:var(--default-foreground)}}.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]{background-color:var(--accent);color:var(--accent-foreground)}@media(hover:hover)and (pointer:fine){:is(.calendar-year-picker__year-cell[data-selected=true],.calendar-year-picker__year-cell[aria-selected=true]):is(:hover,[data-hovered=true]){background-color:var(--accent-hover)}}.calendar-year-picker__year-cell:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.date-field[data-invalid=true],.date-field[aria-invalid=true]) [data-slot=description]{display:none}.date-field [data-slot=label]{width:fit-content}.date-field--full-width{width:100%}.time-field{gap:var(--spacing);flex-direction:column;display:flex}:is(.time-field[data-invalid=true],.time-field[aria-invalid=true]) [data-slot=description]{display:none}.time-field [data-slot=label]{width:fit-content}.time-field--full-width{width:100%}.date-input-group{height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-width:1px;border-width:var(--border-width-field);border-color:var(--field-border);transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);outline-style:none;align-items:center;display:inline-flex;overflow:hidden}.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-input-group:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-input-group:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}@media(hover:hover){.date-input-group:hover:not(:focus-within),.date-input-group[data-hovered=true]:not([data-focus-within=true]){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.date-input-group[data-focus-within=true]:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])),.date-input-group:focus-within:not(:has([data-slot=date-picker-trigger]:focus,[data-slot=date-picker-trigger][data-focused=true],[data-slot=date-range-picker-trigger]:focus,[data-slot=date-range-picker-trigger][data-focused=true])){--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;outline-style:none}.date-input-group[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group[data-invalid=true]:focus,.date-input-group[data-invalid=true]:focus-visible,.date-input-group[data-invalid=true][data-focused=true],.date-input-group[data-invalid=true][data-focus-visible=true],.date-input-group[data-invalid=true]:focus-within,.date-input-group[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group[data-invalid=true]{background-color:var(--field-focus);border-color:var(--color-field-border-invalid)}.date-input-group[data-disabled=true],.date-input-group[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-input-group__input{cursor:text;border-style:var(--tw-border-style);padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;background-color:#0000;border-width:0;border-radius:0;outline-style:none;flex:1;align-items:center;gap:1px;display:flex}@media(min-width:40rem){.date-input-group__input{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.date-input-group:has([data-slot=date-input-group-prefix]) .date-input-group__input{padding-left:calc(var(--spacing) * 2);border-top-left-radius:0;border-bottom-left-radius:0}.date-input-group:has([data-slot=date-input-group-suffix]) .date-input-group__input{padding-right:calc(var(--spacing) * 2);border-top-right-radius:0;border-bottom-right-radius:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=start]{flex:none;padding-right:0}.date-input-group:has(.date-range-picker__range-separator) .date-input-group__input[slot=end]{padding-left:0}.date-input-group__input:focus,.date-input-group__input:focus-visible{--tw-outline-style:none;outline-style:none}.date-input-group__input-container{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;flex:1;align-items:center;width:fit-content;display:flex;overflow:auto clip}.date-input-group__segment{border-radius:calc(var(--radius) * .75);padding-inline:calc(var(--spacing) * .5);text-align:end;text-wrap:nowrap;--tw-outline-style:none;outline-style:none;display:inline-block}.date-input-group__segment[data-type=literal]{color:var(--muted);padding:0}.date-input-group__segment[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.date-input-group__segment:focus,.date-input-group__segment[data-focused=true]{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.date-input-group__segment[data-disabled=true]{opacity:.5}.date-input-group__segment[data-invalid=true]{color:var(--danger)}.date-input-group__segment[data-invalid=true]:focus,.date-input-group__segment[data-invalid=true][data-focused=true]{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.date-input-group__prefix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:0;margin-left:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group__suffix{pointer-events:none;color:var(--field-placeholder,var(--muted));margin-right:calc(var(--spacing) * 3);flex-shrink:0;align-items:center;display:flex}.date-input-group--secondary{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--date-input-group-bg);--date-input-group-bg:var(--default);--date-input-group-bg-hover:var(--default-hover);--date-input-group-bg-focus:var(--default)}@media(hover:hover){.date-input-group--secondary:hover:not(:focus-within),.date-input-group--secondary[data-hovered=true]:not([data-focus-within=true]){background-color:var(--date-input-group-bg-hover)}}.date-input-group--secondary:focus-within,.date-input-group--secondary[data-focus-within=true]{background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary[data-invalid=true]{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}.date-input-group--secondary[data-invalid=true]:focus,.date-input-group--secondary[data-invalid=true]:focus-visible,.date-input-group--secondary[data-invalid=true][data-focused=true],.date-input-group--secondary[data-invalid=true][data-focus-visible=true],.date-input-group--secondary[data-invalid=true]:focus-within,.date-input-group--secondary[data-invalid=true][data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.date-input-group--secondary[data-invalid=true]{border-color:var(--color-field-border-invalid);background-color:var(--date-input-group-bg-focus)}.date-input-group--secondary [data-slot=date-input-group-input]{background-color:#0000}.date-input-group--full-width{width:100%}.date-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-picker .date-input-group__suffix,.date-picker .date-input-group__prefix{pointer-events:auto}.date-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__trigger:focus-visible:not(:focus),.date-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-picker__trigger:disabled,.date-picker__trigger[data-disabled=true],.date-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-picker__popover:focus-visible:not(:focus),.date-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-picker__popover[data-exiting=true],.date-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.date-range-picker{gap:var(--spacing);flex-direction:column;display:inline-flex}.date-range-picker .date-input-group__suffix,.date-range-picker .date-input-group__prefix{pointer-events:auto}.date-range-picker__trigger{border-radius:var(--field-radius,calc(var(--radius) * 1.5));width:100%;padding:var(--spacing);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));-webkit-tap-highlight-color:transparent;cursor:var(--cursor-interactive);transition:box-shadow .15s var(--ease-out);align-items:center;display:inline-flex}.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__trigger:focus-visible:not(:focus),.date-range-picker__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.date-range-picker__trigger:disabled,.date-range-picker__trigger[data-disabled=true],.date-range-picker__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.date-range-picker__trigger-indicator{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);color:var(--field-placeholder,var(--muted));justify-content:center;align-items:center;display:inline-flex}.date-range-picker__range-separator{padding-inline:var(--spacing);color:var(--field-placeholder,var(--muted));-webkit-user-select:none;user-select:none}.date-range-picker__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;overscroll-behavior:contain;background-color:var(--overlay);padding:calc(var(--spacing) * 3);overflow-y:auto}.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *),.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.date-range-picker__popover:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.date-range-picker__popover:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.date-range-picker__popover{box-shadow:var(--shadow-overlay);border-radius:min(32px,calc(var(--radius) * 2.5))}.date-range-picker__popover:focus-visible:not(:focus),.date-range-picker__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.date-range-picker__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.date-range-picker__popover[data-entering=true][data-placement^=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-entering=true][data-placement^=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.date-range-picker__popover[data-entering=true][data-placement^=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.date-range-picker__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.date-range-picker__popover[data-exiting=true],.date-range-picker__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.card{gap:calc(var(--spacing) * 3);padding:calc(var(--spacing) * 4);--tw-shadow:var(--surface-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:min(32px,var(--radius-3xl));flex-direction:column;display:flex;position:relative;overflow:visible}.card__header{flex-direction:column;display:flex}.card__title{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6);--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.card__description{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5);color:var(--muted)}.card__content{gap:var(--spacing);flex-direction:column;flex:1;display:flex}.card__footer{flex-direction:row;align-items:center;display:flex}.card--transparent{--tw-border-style:none;--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:#0000;border-style:none}.card--default{background-color:var(--surface)}.card--secondary{background-color:var(--surface-secondary)}.card--tertiary{background-color:var(--surface-tertiary)}.header{width:100%;padding-inline:calc(var(--spacing) * 2);padding-top:calc(var(--spacing) * 1.5);padding-bottom:var(--spacing);text-align:left;font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--muted)}.separator{border-radius:calc(var(--radius) * .5);border-top-style:var(--tw-border-style);border-top-width:0;border-bottom-style:var(--tw-border-style);background-color:var(--separator);border-bottom-width:0;flex-shrink:0;width:100%;height:1px}.separator--horizontal{width:100%;height:1px}.separator--vertical{height:auto;min-height:calc(var(--spacing) * 2);align-self:stretch;width:1px}.separator--default{background-color:var(--separator)}.separator--secondary{background-color:var(--separator-secondary)}.separator--tertiary{background-color:var(--separator-tertiary)}.separator__container{align-items:center;gap:calc(var(--spacing) * 3);display:flex}.separator__container--horizontal{flex-direction:row;width:100%}.separator__container--vertical{flex-direction:column;justify-content:center;height:100%}.separator__line{flex-grow:1;flex-shrink:0}.separator__content{text-align:center;white-space:nowrap;color:var(--muted);justify-content:center;align-items:center;display:inline-flex}.separator__content--horizontal,.separator__content--vertical{text-align:center}.surface{color:var(--foreground);position:relative}.surface--transparent{background-color:#0000}.surface--default{background-color:var(--surface);color:var(--surface-foreground)}.surface--secondary{background-color:var(--surface-secondary);color:var(--surface-secondary-foreground)}.surface--tertiary{background-color:var(--surface-tertiary);color:var(--surface-tertiary-foreground)}.avatar{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);background-color:var(--default);flex-shrink:0;justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}.avatar__fallback{background-color:var(--default);width:100%;height:100%;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);justify-content:center;align-items:center;display:flex}.avatar__image{aspect-ratio:1;width:100%;height:100%;transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.25s;transition-duration:.25s;position:absolute;top:0;right:0;bottom:0;left:0}.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *),.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.avatar__image:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.avatar__image:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.avatar--sm{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8);border-radius:calc(var(--radius) * 2)}.avatar--lg{width:calc(var(--spacing) * 12);height:calc(var(--spacing) * 12);border-radius:calc(var(--radius) * 3)}.avatar--lg .avatar__fallback{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.avatar__fallback--accent{color:var(--accent-soft-foreground)}.avatar__fallback--default{color:var(--default-soft-foreground)}.avatar__fallback--success{color:var(--success-soft-foreground)}.avatar__fallback--warning{color:var(--warning-soft-foreground)}.avatar__fallback--danger{color:var(--danger-soft-foreground)}.avatar--soft{background-color:#0000}.avatar--soft .avatar__fallback--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.avatar--soft .avatar__fallback--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.avatar--soft .avatar__fallback--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.avatar--soft .avatar__fallback--default{background-color:var(--default-soft);color:var(--default-soft-foreground)}.avatar--soft .avatar__fallback--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.alert-dialog__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.alert-dialog__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.alert-dialog__trigger:focus-visible:not(:focus),.alert-dialog__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.alert-dialog__trigger:disabled,.alert-dialog__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.alert-dialog__trigger:active,.alert-dialog__trigger[data-pressed=true]{transform:scale(.97)}.alert-dialog__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.alert-dialog__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.alert-dialog__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]{will-change:opacity}:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__backdrop[data-exiting=true],.alert-dialog__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__backdrop--transparent{background-color:#0000}.alert-dialog__backdrop--opaque{background-color:var(--backdrop)}.alert-dialog__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.alert-dialog__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.alert-dialog__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.alert-dialog__container{pointer-events:none}.alert-dialog__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.alert-dialog__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.alert-dialog__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.alert-dialog__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.alert-dialog__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.alert-dialog__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]{will-change:opacity,transform}:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.alert-dialog__container[data-exiting=true],.alert-dialog__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.alert-dialog__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;min-height:0;max-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative;overflow:clip}.alert-dialog__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.alert-dialog__dialog[data-placement=auto]{margin-block:auto}}.alert-dialog__dialog[data-placement=center]{margin-block:auto}.alert-dialog__dialog[data-placement=bottom]{margin-top:auto}.alert-dialog__dialog[data-placement=top]{margin-top:0}.alert-dialog__dialog--xs{max-width:var(--container-xs)}.alert-dialog__dialog--sm{max-width:var(--container-sm)}.alert-dialog__dialog--md{max-width:var(--container-md)}.alert-dialog__dialog--lg{max-width:var(--container-lg)}.alert-dialog__dialog--cover{width:100%;height:100%;min-height:100%}.alert-dialog__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.alert-dialog__header>.modal__icon{margin-bottom:0}.alert-dialog__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.alert-dialog__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.alert-dialog__icon [data-slot=alert-dialog-default-icon]{box-sizing:content-box;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.alert-dialog__icon--default{background-color:var(--default);color:var(--foreground)}.alert-dialog__icon--accent{background-color:var(--accent-soft);color:var(--accent-soft-foreground)}.alert-dialog__icon--success{background-color:var(--success-soft);color:var(--success-soft-foreground)}.alert-dialog__icon--warning{background-color:var(--warning-soft);color:var(--warning-soft-foreground)}.alert-dialog__icon--danger{background-color:var(--danger-soft);color:var(--danger-soft-foreground)}.alert-dialog__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.alert-dialog__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.alert-dialog__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.alert-dialog__header+.alert-dialog__body{margin-top:calc(var(--spacing) * 2)}.alert-dialog__header+.alert-dialog__footer,.alert-dialog__body+.alert-dialog__footer{margin-top:calc(var(--spacing) * 5)}.drawer__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.drawer__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.drawer__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.drawer__trigger:focus-visible:not(:focus),.drawer__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.drawer__trigger:disabled,.drawer__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.drawer__trigger:active,.drawer__trigger[data-pressed=true]{transform:scale(.97)}.drawer__backdrop{z-index:50;height:var(--visual-viewport-height);opacity:1;width:100%;transition:opacity .25s cubic-bezier(.32,.72,0,1);position:fixed;top:0;right:0;bottom:0;left:0}.drawer__backdrop[data-entering=true]{opacity:0}.drawer__backdrop[data-exiting=true]{opacity:0;transition-duration:.2s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.drawer__backdrop[data-exiting=true],.drawer__backdrop[data-entering=true]{will-change:opacity}@media(prefers-reduced-motion:reduce){.drawer__backdrop{transition:none}}.drawer__backdrop--transparent{background-color:#0000}.drawer__backdrop--opaque{background-color:var(--backdrop)}.drawer__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.drawer__content{pointer-events:none;z-index:50;height:var(--visual-viewport-height);width:100%;min-width:0;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.drawer__content--bottom{align-items:flex-end}.drawer__content--top{align-items:flex-start}.drawer__content--left{justify-content:flex-start}.drawer__content--right{justify-content:flex-end}.drawer__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;padding:calc(var(--spacing) * 6);pointer-events:auto;--drawer-enter-duration:.25s;--drawer-exit-duration:.2s;--drawer-enter-ease:cubic-bezier(.32, .72, 0, 1);--drawer-exit-ease:cubic-bezier(.32, .72, 0, 1);will-change:translate;transition:translate var(--drawer-enter-duration) var(--drawer-enter-ease);outline-style:none;flex-direction:column;display:flex;position:relative}@media(prefers-reduced-motion:reduce){.drawer__dialog{transition:none}}.drawer__dialog[data-placement=bottom]{border-top-left-radius:min(32px,var(--radius-2xl));border-top-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=top]{border-bottom-left-radius:min(32px,var(--radius-2xl));border-bottom-right-radius:min(32px,var(--radius-2xl));width:100%;max-height:85vh}.drawer__dialog[data-placement=left]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=left]{width:calc(var(--spacing) * 96)}}.drawer__dialog[data-placement=right]{height:100%;width:calc(var(--spacing) * 80);border-radius:0;max-width:85vw}@media(min-width:40rem){.drawer__dialog[data-placement=right]{width:calc(var(--spacing) * 96)}}[data-exiting=true] .drawer__dialog{transition-duration:var(--drawer-exit-duration);transition-timing-function:var(--drawer-exit-ease)}.drawer__content--left .drawer__dialog,.drawer__content--right .drawer__dialog,.drawer__content--top .drawer__dialog,.drawer__content--bottom .drawer__dialog{translate:0}.drawer__content--left[data-entering=true] .drawer__dialog,.drawer__content--left[data-exiting=true] .drawer__dialog{translate:-100%}.drawer__content--right[data-entering=true] .drawer__dialog,.drawer__content--right[data-exiting=true] .drawer__dialog{translate:100%}.drawer__content--top[data-entering=true] .drawer__dialog,.drawer__content--top[data-exiting=true] .drawer__dialog{translate:0 -100%}.drawer__content--bottom[data-entering=true] .drawer__dialog,.drawer__content--bottom[data-exiting=true] .drawer__dialog{translate:0 100%}.drawer__dialog--top{padding-bottom:calc(var(--spacing) * 2)}.drawer__dialog--top .drawer__handle{padding-bottom:0}.drawer__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.drawer__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.drawer__body{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow-y:auto}.drawer__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.drawer__handle{padding-bottom:calc(var(--spacing) * 2);justify-content:center;align-items:center;display:flex}.drawer__handle>[data-slot=drawer-handle-bar]{height:var(--spacing);width:calc(var(--spacing) * 9);border-radius:calc(var(--radius) * .25);background-color:var(--separator)}.drawer__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.drawer__header+.drawer__body{margin-top:calc(var(--spacing) * 2)}.drawer__header+.drawer__footer,.drawer__body+.drawer__footer{margin-top:calc(var(--spacing) * 5)}.drawer__handle+.drawer__header,.drawer__handle+.drawer__body{margin-top:0}.modal__trigger{cursor:var(--cursor-interactive);transition:transform .25s var(--ease-out-quart),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.modal__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.modal__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.modal__trigger:focus-visible:not(:focus),.modal__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.modal__trigger:disabled,.modal__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.modal__trigger:active,.modal__trigger[data-pressed=true]{transform:scale(.97)}.modal__backdrop{z-index:50;height:var(--visual-viewport-height);flex-direction:row;justify-content:center;align-items:center;width:100%;display:flex;position:fixed;top:0;right:0;bottom:0;left:0}.modal__backdrop[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:var(--ease-out);transition-duration:.15s;transition-timing-function:var(--ease-out);--tw-enter-opacity:0}.modal__backdrop[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:var(--ease-out);transition-duration:.1s;transition-timing-function:var(--ease-out);--tw-exit-opacity:0}.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]{will-change:opacity}:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__backdrop[data-exiting=true],.modal__backdrop[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__backdrop--transparent{background-color:#0000}.modal__backdrop--opaque{background-color:var(--backdrop)}.modal__backdrop--blur{background-color:var(--backdrop);--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.modal__container{height:var(--visual-viewport-height);width:100%;min-width:0;padding:calc(var(--spacing) * 4);flex-direction:column;flex:1;align-items:center;display:flex}@media(min-width:40rem){.modal__container{width:fit-content;padding:calc(var(--spacing) * 10)}}.modal__container{pointer-events:none}.modal__container[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-enter-opacity:0;--tw-enter-scale: 105% ;transition-duration:.25s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y:calc(1*var(--spacing))}@media(min-width:40rem){.modal__container[data-entering=true][data-placement=auto]{--tw-enter-translate-y: 0% }}.modal__container[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.modal__container[data-entering=true][data-placement=center]{--tw-enter-translate-y: -0% }.modal__container[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing))}.modal__container[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-opacity:0;--tw-exit-scale:.95;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.modal__container[data-exiting=true],.modal__container[data-entering=true]{will-change:opacity,transform}:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{animation:none}@media(prefers-reduced-motion:reduce){:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,:is(.modal__container[data-exiting=true],.modal__container[data-entering=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{animation:none}}.modal__container--scroll-outside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);pointer-events:auto;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__container--full{padding:0}@media(min-width:40rem){.modal__container--full{padding:0}}.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% ;--tw-enter-scale:1}@media(min-width:40rem){.modal__container--full[data-entering=true]{--tw-enter-translate-y: 0% }}.modal__container--full[data-exiting=true]{--tw-exit-scale:1}.modal__dialog{background-color:var(--overlay);--tw-shadow:var(--overlay-shadow);width:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;border-radius:min(32px,var(--radius-3xl));padding:calc(var(--spacing) * 6);pointer-events:auto;outline-style:none;flex-direction:column;display:flex;position:relative}.modal__dialog[data-placement=auto]{margin-top:auto}@media(min-width:40rem){.modal__dialog[data-placement=auto]{margin-block:auto}}.modal__dialog[data-placement=center]{margin-block:auto}.modal__dialog[data-placement=bottom]{margin-top:auto}.modal__dialog[data-placement=top]{margin-top:0}.modal__dialog--scroll-inside{min-height:0;max-height:100%;overflow:clip}.modal__dialog--scroll-outside{flex-shrink:0;height:auto;min-height:0}.modal__dialog--xs{max-width:var(--container-xs)}.modal__dialog--sm{max-width:var(--container-sm)}.modal__dialog--md{max-width:var(--container-md)}.modal__dialog--lg{max-width:var(--container-lg)}.modal__dialog--cover{width:100%;height:100%;min-height:100%}.modal__dialog--full{--tw-shadow:0 0 #0000;width:100%;height:100%;min-height:100%;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-radius:0}.modal__header{gap:calc(var(--spacing) * 3);flex-direction:column;margin-bottom:0;display:flex}.modal__header>.modal__icon{margin-bottom:0}.modal__heading{vertical-align:middle;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--foreground)}.modal__icon{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10);border-radius:calc(var(--radius) * 3);-webkit-user-select:none;user-select:none;flex-shrink:0;justify-content:center;align-items:center;display:flex}.modal__body{min-height:0;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:1.43;color:var(--muted);margin:-3px;flex:1;margin-block:0;padding:3px;line-height:1.43;overflow:visible}.modal__body--scroll-inside{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;overflow-y:auto}.modal__body--scroll-outside{overflow-y:visible}.modal__footer{justify-content:flex-end;align-items:center;gap:calc(var(--spacing) * 2);flex-direction:row;margin-top:0;display:flex}.modal__close-trigger{top:calc(var(--spacing) * 4);right:calc(var(--spacing) * 4);position:absolute}.modal__header+.modal__body{margin-top:calc(var(--spacing) * 2)}.modal__header+.modal__footer,.modal__body+.modal__footer{margin-top:calc(var(--spacing) * 5)}.popover{transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0}.popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.popover[data-exiting=true],.popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.popover__dialog{padding:calc(var(--spacing) * 4);--tw-outline-style:none;outline-style:none}.popover__heading{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.popover__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.popover__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.popover__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.popover__trigger{cursor:var(--cursor-interactive)}.popover__trigger:focus-visible:not(:focus),.popover__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.popover__trigger:disabled,.popover__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.tooltip{max-width:var(--container-xs);transform-origin:var(--trigger-anchor-point);background-color:var(--overlay);padding:calc(var(--spacing) * 2);font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));word-break:break-all;border-radius:min(32px,var(--radius-xl));box-shadow:var(--shadow-overlay)}.tooltip[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.9;transition-duration:.15s;transition-timing-function:ease}.tooltip[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.tooltip[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.tooltip[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.tooltip[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.tooltip[data-exiting=true],.tooltip[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.tooltip [data-slot=overlay-arrow]{stroke:var(--border)}@supports (color:color-mix(in lab,red,red)){.tooltip [data-slot=overlay-arrow]{stroke:color-mix(in oklab,var(--border) 40%,transparent)}}.tooltip [data-slot=overlay-arrow]{fill:var(--overlay)}.tooltip[data-placement=bottom] [data-slot=overlay-arrow]{rotate:180deg}.tooltip[data-placement=left] [data-slot=overlay-arrow]{rotate:-90deg}.tooltip[data-placement=right] [data-slot=overlay-arrow]{rotate:90deg}.tooltip__trigger{transition:color .15s var(--ease-smooth),background-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);display:inline-block}.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.tooltip__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.tooltip__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.tooltip__trigger:focus-visible:not(:focus),.tooltip__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;outline-style:none}.combo-box{gap:var(--spacing);flex-direction:column;display:flex}:is(.combo-box[data-invalid=true],.combo-box[aria-invalid=true]) [data-slot=description]{display:none}.combo-box [data-slot=label]{width:fit-content}.combo-box [data-slot=input]{flex:1;min-width:0}.combo-box [data-slot=input]:has(+.combo-box__trigger){padding-inline-end:calc(var(--spacing) * 7)}.combo-box [data-slot=input]:focus,.combo-box [data-slot=input][data-focus]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-outline-style:none;--tw-ring-offset-width:0px;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.combo-box [data-slot=input]:disabled,.combo-box [data-slot=input][data-disabled],.combo-box [data-slot=input][aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.combo-box__input-group{isolation:isolate;align-items:center;display:inline-flex;position:relative}.combo-box__trigger{--tw-translate-y: -50% ;height:100%;translate:var(--tw-translate-x) var(--tw-translate-y);cursor:pointer;color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;-webkit-tap-highlight-color:transparent;--tw-border-style:none;--tw-outline-style:none;inset-inline-end:calc(var(--spacing) * 0);background-color:#0000;border-style:none;outline-style:none;flex-shrink:0;justify-content:center;align-items:center;padding-inline-end:calc(var(--spacing) * 2);transition-duration:.15s;display:flex;position:absolute;top:50%}@media(hover:hover){.combo-box__trigger:hover,.combo-box__trigger[data-hovered=true]{color:var(--field-foreground,var(--foreground))}}.combo-box__trigger:focus-visible:not(:focus),.combo-box__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-radius:.25rem;outline-style:none}.combo-box__trigger[data-pressed=true]{opacity:.7}.combo-box__trigger:disabled,.combo-box__trigger[data-disabled],.combo-box__trigger[aria-disabled=true]{cursor:not-allowed;opacity:.5}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;transition-duration:.15s}.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.combo-box__trigger [data-slot=combo-box-trigger-default-icon]:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.combo-box__trigger[data-open=true] [data-slot=combo-box-trigger-default-icon]{rotate:180deg}.combo-box__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.combo-box__popover:focus-visible:not(:focus),.combo-box__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.combo-box__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.combo-box__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.combo-box__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.combo-box__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.combo-box__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.combo-box__popover[data-exiting=true],.combo-box__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.combo-box__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.combo-box__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.combo-box__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.combo-box__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.combo-box__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.combo-box__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.combo-box__popover [data-slot=list-box-item] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.combo-box--full-width,.combo-box__input-group--full-width{width:100%}.select{gap:var(--spacing);flex-direction:column;display:flex}:is(.select[data-invalid=true],.select[aria-invalid=true]) [data-slot=description]{display:none}.select [data-slot=label]{width:fit-content}.select__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.select__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.select__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.select__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.select__trigger:has(.select__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.select__trigger:hover,.select__trigger[data-hovered=true]{background-color:var(--field-hover);border-color:var(--field-border-hover)}}.select__trigger:focus-visible:not(:focus),.select__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-visible,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focused=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-visible=true],:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger):focus-within,:is(.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.select[data-invalid=true] .select__trigger,.select[aria-invalid=true] .select__trigger{background-color:var(--field-focus)}.select__trigger:disabled,.select__trigger[data-disabled=true],.select__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.select--secondary .select__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--select-trigger-bg);--select-trigger-bg:var(--default);--select-trigger-bg-hover:var(--default-hover);--select-trigger-bg-focus:var(--default)}@media(hover:hover){.select--secondary .select__trigger:hover,.select--secondary .select__trigger[data-hovered=true]{background-color:var(--select-trigger-bg-hover)}}.select--secondary .select__trigger:focus-visible:not(:focus),.select--secondary .select__trigger[data-focus-visible=true],.select[data-invalid=true] :is(.select--secondary .select__trigger),.select[aria-invalid=true] :is(.select--secondary .select__trigger){background-color:var(--select-trigger-bg-focus)}.select__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.select__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.select__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.select__value [data-slot=list-box-item-indicator]{display:none}.select__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.select__indicator[data-open=true]{rotate:180deg}.select__indicator[data-slot=select-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.select__popover{min-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overscroll-behavior:contain;background-color:var(--overlay);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);padding:0;overflow-y:auto}.select__popover:focus-visible:not(:focus),.select__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.select__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.15s;--tw-ease:ease;--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.15s;transition-timing-function:ease}.select__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.select__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.select__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.select__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:ease;--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:ease}.select__popover[data-exiting=true],.select__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.select__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.select__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.select__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.select__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.select__popover [data-slot=list-box]{padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none}.select__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.select__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.select--full-width,.select__trigger--full-width{width:100%}.autocomplete{gap:var(--spacing);flex-direction:column;display:flex}.autocomplete__trigger{isolation:isolate;min-height:calc(var(--spacing) * 9);border-radius:var(--field-radius,calc(var(--radius) * 1.5));border-style:var(--tw-border-style);background-color:var(--field-background,var(--default));padding-inline:calc(var(--spacing) * 3);padding-block:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--field-foreground,var(--foreground));--tw-shadow:var(--field-shadow);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-outline-style:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;transition:background-color .15s var(--ease-smooth),border-color .15s var(--ease-smooth),box-shadow .15s var(--ease-out);border-width:1px;outline-style:none;display:inline-flex;position:relative}.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__trigger:is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__trigger:not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__trigger{cursor:var(--cursor-interactive);border-width:var(--border-width-field);border-color:var(--field-border)}.autocomplete__trigger:has(.autocomplete__indicator){padding-inline-end:calc(var(--spacing) * 7)}@media(hover:hover){.autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--field-hover);border-color:var(--field-border-hover)}}.autocomplete__trigger:focus-visible:not(:focus),.autocomplete__trigger[data-focus-visible=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--focus);--tw-ring-offset-width:var(--ring-offset-width);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-color:var(--background);--tw-outline-style:none;border-color:var(--field-border-focus);background-color:var(--field-focus);outline-style:none}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{outline-style:var(--tw-outline-style);outline-width:1px;outline-color:var(--danger);--tw-outline-style:solid;--tw-ring-offset-width:3px;outline-style:solid}:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-visible,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focused=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-visible=true],:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger):focus-within,:is(.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger)[data-focus-within=true]{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);--tw-ring-color:var(--danger);--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-offset-width:0px}.autocomplete[data-invalid=true] .autocomplete__trigger,.autocomplete[aria-invalid=true] .autocomplete__trigger{background-color:var(--field-focus)}.autocomplete__trigger:disabled,.autocomplete__trigger[data-disabled=true],.autocomplete__trigger[aria-disabled=true]{opacity:var(--disabled-opacity);cursor:var(--cursor-disabled);pointer-events:none}.autocomplete--secondary .autocomplete__trigger{--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);background-color:var(--autocomplete-trigger-bg);--autocomplete-trigger-bg:var(--default);--autocomplete-trigger-bg-hover:var(--default-hover);--autocomplete-trigger-bg-focus:var(--default)}@media(hover:hover){.autocomplete--secondary .autocomplete__trigger:hover:not(:has(.autocomplete__clear-button:hover)),.autocomplete--secondary .autocomplete__trigger[data-hovered=true]:not(:has(.autocomplete__clear-button:hover)){background-color:var(--autocomplete-trigger-bg-hover)}}.autocomplete--secondary .autocomplete__trigger:focus-visible:not(:focus),.autocomplete--secondary .autocomplete__trigger[data-focus-visible=true],.autocomplete[data-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger),.autocomplete[aria-invalid=true] :is(.autocomplete--secondary .autocomplete__trigger){background-color:var(--autocomplete-trigger-bg-focus)}.autocomplete__value{text-align:start;font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));overflow-wrap:break-word;color:currentColor;flex:1}@media(min-width:40rem){.autocomplete__value{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}.autocomplete__value[data-placeholder=true]{color:var(--field-placeholder,var(--muted))}.autocomplete__value [data-slot=list-box-item-indicator]{display:none}.autocomplete__indicator{color:var(--field-placeholder,var(--muted));transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));--tw-duration:.15s;cursor:var(--cursor-interactive);flex-shrink:0;justify-content:center;align-items:center;margin-block:auto;transition-duration:.15s;display:flex;position:absolute;inset-block:0;inset-inline-end:calc(var(--spacing) * 2)}.autocomplete__indicator[data-open=true]{rotate:180deg}.autocomplete__indicator[data-slot=autocomplete-default-indicator]{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.autocomplete__popover{width:var(--trigger-width);max-width:var(--trigger-width);transform-origin:var(--trigger-anchor-point);scroll-padding-block:var(--spacing);overscroll-behavior:contain;background-color:var(--overlay);padding:0;padding-top:calc(var(--spacing) * 2);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));border-radius:min(32px,var(--radius-3xl));box-shadow:var(--shadow-overlay);overflow:hidden}.autocomplete__popover:focus-visible:not(:focus),.autocomplete__popover[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete__popover[data-entering=true]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.25s;--tw-ease:cubic-bezier(.32, .72, 0, 1);--tw-enter-opacity:0;--tw-enter-scale:.95;transition-duration:.25s;transition-timing-function:cubic-bezier(.32,.72,0,1)}.autocomplete__popover[data-entering=true][data-placement=top]{--tw-enter-translate-y:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=bottom]{--tw-enter-translate-y:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-entering=true][data-placement=left]{--tw-enter-translate-x:calc(1*var(--spacing))}.autocomplete__popover[data-entering=true][data-placement=right]{--tw-enter-translate-x:calc(1*var(--spacing)*-1)}.autocomplete__popover[data-exiting=true]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);--tw-duration:.1s;--tw-ease:cubic-bezier(.25, .46, .45, .94);--tw-exit-scale:.95;--tw-exit-opacity:0;transition-duration:.1s;transition-timing-function:cubic-bezier(.25,.46,.45,.94)}.autocomplete__popover[data-exiting=true],.autocomplete__popover[data-entering=true]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration));will-change:opacity,transform}.autocomplete__popover [data-slot=popover-overlay-arrow]{fill:var(--overlay)}.autocomplete__popover[data-placement=bottom] [data-slot=popover-overlay-arrow]{rotate:180deg}.autocomplete__popover[data-placement=left] [data-slot=popover-overlay-arrow]{rotate:-90deg}.autocomplete__popover[data-placement=right] [data-slot=popover-overlay-arrow]{rotate:90deg}.autocomplete__popover [data-slot=list-box]{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);max-height:320px;padding:calc(var(--spacing) * 1.5);--tw-outline-style:none;outline-style:none;overflow-y:auto}.autocomplete__popover [data-slot=list-box-item]{padding-inline:calc(var(--spacing) * 2.5)}.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator],.autocomplete__popover [data-slot=list-box]:not([aria-multiselectable=true]) [data-slot=list-box-item-indicator] [data-slot=list-box-item-indicator--checkmark]{transition-property:none}.autocomplete__popover [data-slot=search-field]{padding-inline:calc(var(--spacing) * 3);padding-block:var(--spacing);--tw-outline-style:none;outline-style:none}.autocomplete__popover [data-slot=empty-state]{text-align:center;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--overlay-foreground)}@supports (color:color-mix(in lab,red,red)){.autocomplete__popover [data-slot=empty-state]{color:color-mix(in oklab,var(--overlay-foreground) 60%,transparent)}}.autocomplete__popover-dialog,.autocomplete__popover-dialog:focus,.autocomplete__popover-dialog:focus-visible,.autocomplete__popover-dialog[data-focus-visible=true]{--tw-outline-style:none;outline-style:none}.autocomplete--full-width,.autocomplete__trigger--full-width{width:100%}.autocomplete__clear-button{isolation:isolate;height:calc(var(--spacing) * 6);width:calc(var(--spacing) * 6);transform-origin:50%;border-radius:calc(var(--radius) * 1.5);padding:var(--spacing);color:var(--muted);-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5);cursor:var(--cursor-interactive);transform:translateZ(0) var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);background-color:#0000;flex-shrink:0;justify-content:center;align-self:center;align-items:center;margin-inline-end:0;display:inline-flex;position:relative}.autocomplete__clear-button:not([data-empty=true]){transition:opacity .15s var(--ease-smooth)}.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *),.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):before,.autocomplete__clear-button:not([data-empty=true]):is([data-reduce-motion=true],[data-reduce-motion=true] *):after{transition-property:none}@media(prefers-reduced-motion:reduce){.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)),.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):before,.autocomplete__clear-button:not([data-empty=true]):not(:is([data-reduce-motion=true],[data-reduce-motion=true] *)):after{transition-property:none}}.autocomplete__clear-button[data-empty=true]{pointer-events:none;opacity:0}.autocomplete__clear-button [data-slot=autocomplete-clear-button-icon]{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}@media(hover:hover){.autocomplete__clear-button:hover,.autocomplete__clear-button[data-hovered=true]{background-color:var(--default-hover)}}.autocomplete__clear-button:active,.autocomplete__clear-button[data-pressed=true]{transform:scale(.93)}.kbd{height:calc(var(--spacing) * 6);align-items:center;display:inline-flex}:where(.kbd>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * .5) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-x-reverse)))}.kbd{border-radius:calc(var(--radius) * 1);background-color:var(--default);padding-inline:calc(var(--spacing) * 2);text-align:center;font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);white-space:nowrap;color:var(--muted)}:where(.kbd:where(:dir(rtl),[dir=rtl],[dir=rtl] *)>:not(:last-child)){--tw-space-x-reverse:1}.kbd{word-spacing:-.25rem}.kbd__abbr{justify-content:center;align-items:center;width:100%;height:100%;text-decoration:none;display:flex}.kbd__content{justify-content:center;align-items:center;display:flex}.kbd--light{background-color:#0000}.typography,.typography-prose{color:var(--foreground)}.typography-prose h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography-prose p{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography-prose a{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium);color:var(--link);text-underline-offset:4px;text-decoration-line:underline}.typography-prose blockquote{margin-top:calc(var(--spacing) * 4);border-left-style:var(--tw-border-style);border-left-width:4px;border-color:var(--border);padding-left:calc(var(--spacing) * 4);color:var(--muted);font-style:italic}.typography-prose ul{margin-block:calc(var(--spacing) * 4);list-style-type:disc}:where(.typography-prose ul>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ul{padding-left:calc(var(--spacing) * 6)}.typography-prose ol{margin-block:calc(var(--spacing) * 4);list-style-type:decimal}:where(.typography-prose ol>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}.typography-prose ol{padding-left:calc(var(--spacing) * 6)}.typography-prose li{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography-prose hr{margin-block:calc(var(--spacing) * 8);border-color:var(--separator)}.typography-prose pre{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5);background-color:var(--default);padding:calc(var(--spacing) * 4);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed);overflow-x:auto}.typography-prose strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--foreground)}.typography-prose em{font-style:italic}.typography-prose img{margin-block:calc(var(--spacing) * 4);border-radius:calc(var(--radius) * 1.5)}.typography--h1{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h2{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h3{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h4{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h5{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.typography--body{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.typography--body-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));--tw-leading:calc(var(--spacing) * 6);line-height:calc(var(--spacing) * 6)}.typography--body-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height));--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.typography--code{border-radius:calc(var(--radius) * .75);background-color:var(--default);padding-inline:calc(var(--spacing) * 1.5);padding-block:calc(var(--spacing) * .5);font-family:var(--font-mono);font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height));color:var(--foreground)}.typography--align-start{text-align:left}.typography--align-start:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:right}.typography--align-center{text-align:center}.typography--align-end{text-align:right}.typography--align-end:where(:dir(rtl),[dir=rtl],[dir=rtl] *){text-align:left}.typography--align-justify{text-align:justify}.typography--color-default{color:var(--foreground)}.typography--color-muted{color:var(--muted)}.typography--truncate{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.typography--weight-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.typography--weight-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.typography--weight-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.typography--weight-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.scroll-shadow{--scroll-shadow-size:40px;--scroll-shadow-scrollbar-size:10px;position:relative}.scroll-shadow--vertical{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-y:auto}.scroll-shadow--horizontal{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter);overflow-x:auto}.scroll-shadow--fade.scroll-shadow--vertical:where([data-top-scroll=true],[data-bottom-scroll=true],[data-top-bottom-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,100% 0;mask-repeat:no-repeat;mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%;-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,100% 0;-webkit-mask-repeat:no-repeat;-webkit-mask-size:calc(100% - var(--scroll-shadow-scrollbar-size)) 100%,var(--scroll-shadow-scrollbar-size) 100%}.scroll-shadow--fade.scroll-shadow--vertical[data-top-scroll=true]{--scroll-linear-gradient:0deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-bottom-scroll=true]{--scroll-linear-gradient:180deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--vertical[data-top-bottom-scroll=true]{--scroll-linear-gradient:#000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal:where([data-left-scroll=true],[data-right-scroll=true],[data-left-right-scroll=true]){mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);mask-position:0 0,0 100%;mask-repeat:no-repeat;mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size);-webkit-mask-image:linear-gradient(var(--scroll-linear-gradient)),linear-gradient(#000,#000);-webkit-mask-position:0 0,0 100%;-webkit-mask-repeat:no-repeat;-webkit-mask-size:100% calc(100% - var(--scroll-shadow-scrollbar-size)),100% var(--scroll-shadow-scrollbar-size)}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-scroll=true]{--scroll-linear-gradient:270deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-right-scroll=true]{--scroll-linear-gradient:90deg, #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--fade.scroll-shadow--horizontal[data-left-right-scroll=true]{--scroll-linear-gradient:to right, #000, #000, transparent 0, #000 var(--scroll-shadow-size), #000 calc(100% - var(--scroll-shadow-size)), transparent}.scroll-shadow--hide-scrollbar{scrollbar-color:auto;scrollbar-gutter:auto;-ms-overflow-style:none;scrollbar-width:none;--scroll-shadow-scrollbar-size:0px}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{inset-inline:0}.inset-y-0{inset-block:0}.top-0{top:0}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.-right-3{right:calc(var(--spacing) * -3)}.right-0{right:0}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-0{left:0}.left-1\/2{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.-mr-1{margin-right:calc(var(--spacing) * -1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.-ml-1{margin-left:calc(var(--spacing) * -1)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:var(--spacing)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-12{height:calc(var(--spacing) * 12)}.h-64{height:calc(var(--spacing) * 64)}.h-\[90px\]{height:90px}.h-full{height:100%}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-\[90vh\]{max-height:90vh}.min-h-0{min-height:0}.min-h-full{min-height:100%}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-20{width:calc(var(--spacing) * 20)}.w-28{width:calc(var(--spacing) * 28)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-\[17rem\]{width:17rem}.w-\[calc\(100\%-2rem\)\]{width:calc(100% - 2rem)}.w-\[n\%\]{width:n%}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-40{max-width:calc(var(--spacing) * 40)}.max-w-44{max-width:calc(var(--spacing) * 44)}.max-w-\[1800px\]{max-width:1800px}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-\[140px\]{min-width:140px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing) * 5);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-col-resize{cursor:col-resize}.cursor-crosshair{cursor:crosshair}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y:pan-y;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.scrollbar{scrollbar-width:var(--scrollbar-width);scrollbar-color:var(--scrollbar-color);scrollbar-gutter:var(--scrollbar-gutter)}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-\[var\(--otari-line\)\]>:not(:last-child)){border-color:var(--otari-line)}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:calc(var(--radius) * 1)}.rounded-md{border-radius:calc(var(--radius) * .75)}.rounded-xl{border-radius:calc(var(--radius) * 1.5)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-\[\#c2843a\]{border-color:#c2843a}.border-\[var\(--otari-brand\)\]{border-color:var(--otari-brand)}.border-\[var\(--otari-line\)\]{border-color:var(--otari-line)}.border-amber-200{border-color:var(--color-amber-200)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-emerald-500{border-left-color:var(--color-emerald-500)}.border-l-red-500{border-left-color:var(--color-red-500)}.bg-\[var\(--otari-bg\)\]{background-color:var(--otari-bg)}.bg-\[var\(--otari-brand\)\],.bg-\[var\(--otari-brand\)\]\/40{background-color:var(--otari-brand)}@supports (color:color-mix(in lab,red,red)){.bg-\[var\(--otari-brand\)\]\/40{background-color:color-mix(in oklab,var(--otari-brand) 40%,transparent)}}.bg-\[var\(--otari-brand-tint\)\]{background-color:var(--otari-brand-tint)}.bg-\[var\(--otari-line\)\]{background-color:var(--otari-line)}.bg-\[var\(--otari-surface\)\]{background-color:var(--otari-surface)}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-500{background-color:var(--color-green-500)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-0{padding:0}.p-1{padding:var(--spacing)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-7{padding:calc(var(--spacing) * 7)}.px-0{padding-inline:0}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-1{padding-right:var(--spacing)}.pr-1\.5{padding-right:calc(var(--spacing) * 1.5)}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-1{padding-bottom:var(--spacing)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#b45309\]{color:#b45309}.text-\[var\(--otari-brand-dark\)\]{color:var(--otari-brand-dark)}.text-\[var\(--otari-ink\)\]{color:var(--otari-ink)}.text-\[var\(--otari-muted\)\]{color:var(--otari-muted)}.text-amber-400{color:var(--color-amber-400)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-emerald-700{color:var(--color-emerald-700)}.text-green-700{color:var(--color-green-700)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.underline-offset-2{text-underline-offset:2px}.accent-\[var\(--otari-brand\)\]{accent-color:var(--otari-brand)}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.running{animation-play-state:running}.zoom-out{--tw-exit-scale:0}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-data-\[focus-visible\]\:outline-2:is(:where(.group)[data-focus-visible] *){outline-style:var(--tw-outline-style);outline-width:2px}.group-data-\[focus-visible\]\:outline-\[var\(--otari-brand\)\]:is(:where(.group)[data-focus-visible] *){outline-color:var(--otari-brand)}@media(hover:hover){.hover\:border-\[var\(--otari-brand\)\]:hover{border-color:var(--otari-brand)}.hover\:bg-\[var\(--otari-bg\)\]:hover{background-color:var(--otari-bg)}.hover\:bg-\[var\(--otari-brand\)\]:hover,.hover\:bg-\[var\(--otari-brand\)\]\/60:hover{background-color:var(--otari-brand)}@supports (color:color-mix(in lab,red,red)){.hover\:bg-\[var\(--otari-brand\)\]\/60:hover{background-color:color-mix(in oklab,var(--otari-brand) 60%,transparent)}}.hover\:bg-\[var\(--otari-line\)\]:hover{background-color:var(--otari-line)}.hover\:text-\[var\(--otari-brand\)\]:hover{color:var(--otari-brand)}.hover\:text-\[var\(--otari-brand-dark\)\]:hover{color:var(--otari-brand-dark)}.hover\:text-\[var\(--otari-ink\)\]:hover{color:var(--otari-ink)}.hover\:text-amber-950:hover{color:var(--color-amber-950)}.hover\:text-red-700:hover{color:var(--color-red-700)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:not-sr-only:focus{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.focus\:absolute:focus{position:absolute}.focus\:top-3:focus{top:calc(var(--spacing) * 3)}.focus\:left-3:focus{left:calc(var(--spacing) * 3)}.focus\:z-50:focus{z-index:50}.focus\:rounded-lg:focus{border-radius:calc(var(--radius) * 1)}.focus\:border:focus{border-style:var(--tw-border-style);border-width:1px}.focus\:border-\[var\(--otari-brand\)\]:focus{border-color:var(--otari-brand)}.focus\:bg-\[var\(--otari-surface\)\]:focus{background-color:var(--otari-surface)}.focus\:px-4:focus{padding-inline:calc(var(--spacing) * 4)}.focus\:py-2:focus{padding-block:calc(var(--spacing) * 2)}.focus\:text-sm:focus{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.focus\:font-medium:focus{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.focus\:text-\[var\(--otari-brand-dark\)\]:focus{color:var(--otari-brand-dark)}.focus\:shadow-md:focus{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:bg-\[var\(--otari-brand\)\]:focus-visible{background-color:var(--otari-brand)}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[var\(--otari-brand\)\]:focus-visible{--tw-ring-color:var(--otari-brand)}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:col-span-2{grid-column:span 2/span 2}.sm\:col-start-1{grid-column-start:1}.sm\:col-start-2{grid-column-start:2}.sm\:col-start-3{grid-column-start:3}.sm\:inline{display:inline}.sm\:w-28{width:calc(var(--spacing) * 28)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[minmax\(0\,1fr\)_16rem_10rem\]{grid-template-columns:minmax(0,1fr) 16rem 10rem}.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-self-end{justify-self:flex-end}.sm\:justify-self-start{justify-self:flex-start}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}@media(min-width:48rem){.md\:flex{display:flex}.md\:hidden{display:none}.md\:px-6{padding-inline:calc(var(--spacing) * 6)}.md\:py-6{padding-block:calc(var(--spacing) * 6)}}@media(min-width:64rem){.lg\:sticky{position:sticky}.lg\:top-4{top:calc(var(--spacing) * 4)}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(0\,1fr\)_360px\]{grid-template-columns:minmax(0,1fr) 360px}.lg\:items-start{align-items:flex-start}}@media(min-width:80rem){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root{--otari-brand:#4e8295;--otari-brand-dark:#3c6678;--otari-brand-soft:#8fb2bf;--otari-brand-tint:#eaf1f3;--otari-ink:#14242c;--otari-muted:#5b6b73;--otari-line:#dbe5e8;--otari-surface:#fff;--otari-bg:#f6f9fa;--otari-cat-1:#08899f;--otari-cat-2:#b76522;--otari-cat-3:#8560ac;--otari-cat-4:#47a34e;--otari-cat-5:#9d486c;--otari-cat-6:#0871c1;--otari-cat-7:#a9912b;--otari-cat-8:#a64450;--otari-cat-other:#8b969b;--otari-danger:#dc2626;--otari-code-ink:#e8eef0}.otari-table.table-root{background-color:var(--otari-surface);border:1px solid var(--otari-line);border-radius:.75rem;padding:0;overflow:hidden}.otari-table .table__header{background-color:var(--otari-brand-tint);border-bottom:1px solid var(--otari-line)}.otari-table .table__column,.otari-table [role=row]>[role=presentation]:first-of-type>.table__column,.otari-table [role=row]>[role=presentation]:last-of-type>.table__column{color:var(--otari-ink);background-color:#0000;border-radius:0;font-weight:600}.otari-table .table__column:after{content:none}.otari-table .table__row .table__cell{border-color:var(--otari-line)}.otari-table .table__row:hover .table__cell{background-color:var(--otari-bg)}.otari-table .otari-detail-row>td{border-bottom:1px solid var(--otari-line);background-color:var(--otari-bg);padding:0}.otari-table .otari-detail-opening .table__cell{background-color:var(--otari-brand-tint)}.otari-detail-reveal{grid-template-rows:0fr;animation:.18s ease-out forwards otari-detail-open;display:grid}.otari-detail-reveal>div{overflow:hidden}@keyframes otari-detail-open{0%{opacity:.5;grid-template-rows:0fr}to{opacity:1;grid-template-rows:1fr}}.otari-bulk-bar{animation:.16s ease-out otari-bulk-bar-in}@keyframes otari-bulk-bar-in{0%{opacity:0;transform:translate(-50%,.5rem)}to{opacity:1;transform:translate(-50%)}}@media(prefers-reduced-motion:reduce){.otari-detail-reveal{grid-template-rows:1fr;animation:none}.otari-bulk-bar{animation:none}}.otari-markdown{color:var(--otari-ink);font-size:.875rem;line-height:1.65}.otari-markdown>:first-child{margin-top:0}.otari-markdown h1,.otari-markdown h2,.otari-markdown h3,.otari-markdown h4{color:var(--otari-ink);font-weight:600;line-height:1.3}.otari-markdown h1{margin:2rem 0 .75rem;font-size:1.5rem}.otari-markdown h2{border-bottom:1px solid var(--otari-line);margin:2rem 0 .5rem;padding-bottom:.3rem;font-size:1.25rem}.otari-markdown h3{margin:1.5rem 0 .5rem;font-size:1.05rem}.otari-markdown h4{margin:1.25rem 0 .25rem;font-size:.95rem}.otari-markdown p{margin:.75rem 0}.otari-markdown a{color:var(--otari-brand-dark);text-underline-offset:2px;text-decoration:underline}.otari-markdown a:hover{text-decoration-thickness:2px}.otari-markdown ul,.otari-markdown ol{margin:.75rem 0;padding-left:1.5rem}.otari-markdown ul{list-style:outside}.otari-markdown ol{list-style:decimal}.otari-markdown li,.otari-markdown li>ul,.otari-markdown li>ol{margin:.25rem 0}.otari-markdown code{background-color:var(--otari-brand-tint);color:var(--otari-brand-dark);border-radius:.35rem;padding:.1rem .35rem;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,monospace;font-size:.85em}.otari-markdown pre{background-color:var(--otari-ink);border-radius:.6rem;margin:1rem 0;padding:.85rem 1rem;overflow-x:auto}.otari-markdown pre code{color:var(--otari-code-ink);background-color:#0000;border-radius:0;padding:0;font-size:.82rem;line-height:1.55}.otari-markdown blockquote{border-left:3px solid var(--otari-brand);color:var(--otari-muted);margin:1rem 0;padding:.25rem 0 .25rem 1rem}.otari-markdown hr{border:0;border-top:1px solid var(--otari-line);margin:1.5rem 0}.otari-markdown-scroll{max-width:100%;margin:1rem 0;overflow-x:auto}.otari-markdown table{border-collapse:collapse;font-size:.85rem}.otari-markdown th,.otari-markdown td{border:1px solid var(--otari-line);text-align:left;vertical-align:top;padding:.4rem .7rem}.otari-markdown th{background-color:var(--otari-brand-tint);color:var(--otari-ink);font-weight:600}.otari-markdown tbody tr:hover td,.otari-markdown tr:hover td{background-color:var(--otari-bg)}html,body,#root{height:100%}body{background-color:var(--otari-bg);color:var(--otari-ink);margin:0;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-border-spacing-x{syntax:"";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}@keyframes caret-blink{0%,70%,to{opacity:1}20%,50%{opacity:0}}@keyframes skeleton{to{transform:translate(200%)}} diff --git a/src/gateway/static/dashboard/index.html b/src/gateway/static/dashboard/index.html index ba040d749..b36add768 100644 --- a/src/gateway/static/dashboard/index.html +++ b/src/gateway/static/dashboard/index.html @@ -19,11 +19,11 @@ insets to sit out of the way. --> Otari Dashboard - + - +
diff --git a/web/src/components/charts.tsx b/web/src/components/charts.tsx index 8c2987c97..3ccaa2a80 100644 --- a/web/src/components/charts.tsx +++ b/web/src/components/charts.tsx @@ -30,6 +30,17 @@ export interface ChartPoint { value: number; } +// A series identity swatch. An SVG fill (which accepts var(--otari-*) tokens) +// rather than an inline background-color style, per the dashboard's no-inline- +// styles convention. +function SeriesMarker({ color }: { color: string }) { + return ( + + + + ); +} + // Tooltip body. recharts clones this element and injects `active`, `payload`, // and `label` at render time, so only the format props are passed by the // caller. For a single series it shows one value row; for a stack it shows one @@ -67,9 +78,7 @@ export function ChartTooltip({ {visible.map((entry, index) => (
- {rows.length > 1 ? ( - - ) : null} + {rows.length > 1 && entry.color ? : null} {entry.name} @@ -97,7 +106,7 @@ export function ChartLegend({ series }: { series: SeriesDef[] }) {
{series.map((s) => ( - + {s.label} ))}